pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

star: Defaults file handling fixed.



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <michael.baeuerle%stz-e.de@localhost>
Pushed By:	micha
Date:		Mon Oct 1 18:49:01 2018 +0200
Changeset:	0249a0ffc8d37c72aeed3e32e961ade0883afa81

Modified Files:
	star/Makefile
	star/TODO
Added Files:
	star/MESSAGE.star

Log Message:
star: Defaults file handling fixed.

File MESSAGE.star added to explain reason for different location.
This is necessary according to the license and note in defaults.c.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=0249a0ffc8d37c72aeed3e32e961ade0883afa81

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 star/MESSAGE.star | 14 ++++++++++++++
 star/Makefile     | 23 ++++++++++++++++++++---
 star/TODO         |  2 +-
 3 files changed, 35 insertions(+), 4 deletions(-)

diffs:
diff --git a/star/MESSAGE.star b/star/MESSAGE.star
new file mode 100644
index 0000000000..5cfe37db41
--- /dev/null
+++ b/star/MESSAGE.star
@@ -0,0 +1,14 @@
+===========================================================================
+$NetBSD$
+
+Note: The location of the ${PKGNAME_NOREV} `defaults' file has been set to
+
+	${STAR_CONF}
+
+This is the pkgsrc standard config file location, NOT the ${PKGNAME_NOREV}
+standard location, which is /etc/default/star.
+
+The reason for this is that pkgsrc packages should not use configuration
+files outside ${LOCALBASE} unless they are explicitly set by the user.
+
+===========================================================================
diff --git a/star/Makefile b/star/Makefile
index 5ea1242caf..699200612b 100644
--- a/star/Makefile
+++ b/star/Makefile
@@ -18,11 +18,28 @@ TOOL_DEPENDS+=	smake-[0-9]*:../../wip/smake
 SMAKE=		MAKEFLAGS= smake
 MAKE_FLAGS+=	DESTDIR=${DESTDIR} INS_BASE=${PREFIX} DEFMANBASE=. MANDIR=${PKGMANDIR}
 
-# This creates strange "shift: can't shift that many" errors
-#MAKE_DIRS_PERMS+=	${PKG_SYSCONFDIR}/default/star 0755
-CONF_FILES=	${PREFIX}/share/examples/star/star ${PKG_SYSCONFDIR}/default/star
+# The default location is /etc/default/star
+# We patch the documentation appropriately. Additionally, we also provide a
+# MESSAGE stating the reasons we do this, as required by the license.
+STAR_CONF?=	${PKG_SYSCONFDIR}/star
+
+.if ${STAR_CONF} != "/etc/default/star"
+MESSAGE_SRC+=	MESSAGE.star
+MESSAGE_SUBST+=	PKGNAME_NOREV=${PKGNAME_NOREV:Q}
+MESSAGE_SUBST+=	STAR_CONF=${STAR_CONF:Q}
+.endif
+
+CONF_FILES=	${PREFIX}/share/examples/star/star ${STAR_CONF}
 AUTO_MKDIRS=	yes
 
+SUBST_CLASSES+=		fix
+SUBST_STAGE.fix=	post-patch
+SUBST_FILES.fix+=	star/star.1
+SUBST_FILES.fix+=	star/star.dfl
+SUBST_FILES.fix+=	star/defaults.c
+SUBST_SED.fix=		-e "s,/etc/default/star,${STAR_CONF},g"
+SUBST_MESSAGE.fix=	Replace defaults file paths.
+
 .include "../../mk/bsd.prefs.mk"
 
 # Shared platform specific code for schilytools (provided by smake package)
diff --git a/star/TODO b/star/TODO
index 947706fb1e..919d8355aa 100644
--- a/star/TODO
+++ b/star/TODO
@@ -1,3 +1,3 @@
 [X] Compilation works
 [X] Installation rule and PLIST
-[ ] MAKE_DIRS_PERMS doesn't work
+[X] Use defaults file from ${PKG_SYSCONFDIR} and modify documentation


Home | Main Index | Thread Index | Old Index