3fd0121195
pkgsrc changes: - Add support for the test suite (this needs gmake as a test tool dependency) - Fix the shebang of test shell script with REPLACE_BASH and also add a SUBST to fix a shebang in the middle of scripts (needed in shell script part of the test suite). REPLACE_INTERPRETER only adjust the shebang in the first line of the file. - Add patches/patch-tests_test-lib.sh to just use `date -r' in non-GNU and non-macOS lands. By default the current date is used and then the test will definitely fails. While there are no guarantees that the date(1) available on the system supports `-r' option it is probably better to try using it (indeed this make all the date tests happy on NetBSD and probably also on FreeBSD and OpenBSD according a quick skim of their date(1) man pages). - Also install USAGE.md document (it is referenced by README.md). Changes: ## [2.11.0] - 2018-03-26 ### Added - Added support for `$XDG_CONFIG_HOME` config file/actions location - Created [CODE_OF_CONDUCT.md](/CODE_OF_CONDUCT.md) ([#217]) - Created [CHANGELOG.md](/CHANGELOG.md) ([#218]) ### Changed - Updated `add` command to accept lowercase priority ([#230]) - Clean tests and version file in Makefile. Don't ignore errors in tests. - Updated [README.md](/README.md) ([#219]) - Update Downloads links to point at the Releases page ([#228]) - Set the executable bit when preparing releases ([#156]) ### Fixes - Update links to use https - Suppress todo.sh error messages when invoked during completion ([#8])
63 lines
2 KiB
Makefile
63 lines
2 KiB
Makefile
# $NetBSD: Makefile,v 1.2 2018/04/25 15:23:55 leot Exp $
|
|
|
|
DISTNAME= todotxt-2.11.0
|
|
CATEGORIES= time
|
|
MASTER_SITES= ${MASTER_SITE_GITHUB:=todotxt/}
|
|
GITHUB_PROJECT= todo.txt-cli
|
|
GITHUB_TAG= v${PKGVERSION_NOREV}
|
|
|
|
MAINTAINER= leot@NetBSD.org
|
|
HOMEPAGE= http://todotxt.org/
|
|
COMMENT= Simple and extensible shell script for managing your todo.txt file
|
|
LICENSE= gnu-gpl-v3
|
|
|
|
USE_TOOLS+= bash:run gmake:test gsed:run
|
|
|
|
SUBST_CLASSES+= todosh
|
|
SUBST_STAGE.todosh= pre-configure
|
|
SUBST_MESSAGE.todosh= Adjusting hard-coded paths, version and use GNU sed
|
|
SUBST_FILES.todosh+= todo.sh
|
|
SUBST_SED.todosh+= -e '/TODOTXT_GLOBAL_CFG_FILE=/ s,/etc/todo/config,${PKG_SYSCONFDIR}/todo.cfg,'
|
|
SUBST_SED.todosh+= -E -e 's,([(| ])sed ,\1${TOOLS_PATH.gsed} ,g'
|
|
SUBST_SED.todosh+= -e 's,@DEV_VERSION@,${PKGVERSION_NOREV},g'
|
|
|
|
SUBST_CLASSES+= todocfg
|
|
SUBST_STAGE.todocfg= pre-configure
|
|
SUBST_MESSAGE.todocfg= Adjusting TOOL_DIR path to user's HOME
|
|
SUBST_FILES.todocfg+= todo.cfg
|
|
SUBST_SED.todocfg+= -e '/^export TODO_DIR/ s,=.*,=$$HOME/.todo,'
|
|
|
|
# XXX: REPLACE_BASH only affect the `#!' on the first line, so we need to
|
|
# XXX: manually adjust the other in the middle of the shell script.
|
|
SUBST_CLASSES+= shebang
|
|
SUBST_STAGE.shebang= pre-configure
|
|
SUBST_MESSAGE.shebang= Replace hardcoded /bin/bash in the middle of scripts
|
|
SUBST_FILES.shebang+= tests/actions-test-lib.sh
|
|
SUBST_SED.shebang+= -e '2,$$s;!/bin/bash;!${BASH};'
|
|
|
|
REPLACE_BASH+= todo.sh
|
|
REPLACE_BASH+= tests/*.sh
|
|
|
|
USE_LANGUAGES= # none
|
|
|
|
NO_BUILD= yes
|
|
|
|
EGDIR= ${PREFIX}/share/examples/todotxt
|
|
DOCDIR= ${PREFIX}/share/doc/todotxt
|
|
|
|
PKG_SYSCONFSUBDIR= todotxt
|
|
CONF_FILES= ${EGDIR}/todo.cfg \
|
|
${PKG_SYSCONFDIR}/todo.cfg
|
|
|
|
TEST_TARGET= test
|
|
|
|
INSTALLATION_DIRS= bin ${DOCDIR} ${EGDIR}
|
|
|
|
do-install:
|
|
${INSTALL_SCRIPT} ${WRKSRC}/todo.sh ${DESTDIR}${PREFIX}/bin
|
|
${INSTALL_DATA} ${WRKSRC}/todo.cfg ${DESTDIR}${EGDIR}
|
|
${INSTALL_DATA} ${WRKSRC}/todo_completion ${DESTDIR}${EGDIR}
|
|
${INSTALL_DATA} ${WRKSRC}/README.md ${DESTDIR}${DOCDIR}
|
|
${INSTALL_DATA} ${WRKSRC}/USAGE.md ${DESTDIR}${DOCDIR}
|
|
|
|
.include "../../mk/bsd.pkg.mk"
|