pkgsrc-WIP-changes archive

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

gnunet: attempt to setup gnunet service according to gnunet docs.



Module Name:	pkgsrc-wip
Committed By:	ng0 <ng0%n0.is@localhost>
Pushed By:	ng0
Date:		Sun Mar 10 23:44:07 2019 +0000
Changeset:	b5700846ec109e9095e79fcaf41e1ff3e41eb3d0

Modified Files:
	gnunet/Makefile
	gnunet/files/gnunet.conf
	gnunet/files/gnunet.in

Log Message:
gnunet: attempt to setup gnunet service according to gnunet docs.

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

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

diffstat:
 gnunet/Makefile          | 33 ++++++++++++++++++++-------------
 gnunet/files/gnunet.conf |  3 +++
 gnunet/files/gnunet.in   |  6 +++---
 3 files changed, 26 insertions(+), 16 deletions(-)

diffs:
diff --git a/gnunet/Makefile b/gnunet/Makefile
index be14677ccb..94ba02058d 100644
--- a/gnunet/Makefile
+++ b/gnunet/Makefile
@@ -29,38 +29,45 @@ CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
 CONFIGURE_ARGS+=	--with-extractor=${BUILDLINK_PREFIX.libextractor}
 CONFIGURE_ARGS+=	--with-gnunetdns=gnunetdns
 
+BUILD_DEFS+=			VARBASE
+
+GNUNET_DIR?=			${VARBASE}/chroot/gnunet
+GNUNET_LOG_DIR?=		${VARBASE}/log/gnunet
 GNUNET_USER=			gnunet
 GNUNET_GROUP=			gnunet
 GNUNETDNS_GROUP=		gnunetdns
-PKG_GECOS.${GNUNET_USER}=	Gnunet
-PKG_HOME.${GNUNET_USER}=	${VARBASE}/chroot/gnunet
-BUILD_DEFS+=			VARBASE
 PKG_SYSCONFSUBDIR=		gnunet
 
-PKG_GROUPS_VARS+=		GNUNET_GROUP
-PKG_GROUPS_VARS+=		GNUNETDNS_GROUP
-PKG_USERS_VARS=			GNUNET_USER
+PKG_GROUPS+=			${GNUNET_GROUP}
+PKG_GROUPS+=			${GNUNETDNS_GROUP}
+PKG_USERS+=			${GNUNET_USER}:${GNUNET_GROUP}
+PKG_GECOS.gnunet=		GNUnet System user
+PKG_HOME.gnunet=		${GNUNET_DIR}
 
 RCD_SCRIPTS=			gnunet
 RCD_SCRIPT_SRC.gnunet=		${FILESDIR}/gnunet.in
-PKG_GROUPS=			${GNUNET_GROUP} ${GNUNETDNS_GROUP}
-PKG_USERS=			${GNUNET_USER}:${GNUNET_GROUP}
-USER_GROUP=			${GNUNET_USER} ${GNUNET_GROUP}
 
-OWN_DIRS_PERMS+=		${PKG_HOME.${GNUNET_USER}} ${USER_GROUP} 0700
+OWN_DIRS_PERMS+=		${GNUNET_DIR} ${GNUNET_USER} ${GNUNET_GROUP} 0700
+OWN_DIRS_PERMS+=		${GNUNET_LOG_DIR} ${GNUNET_USER} ${GNUNET_GROUP} 0755
+OWN_DIRS_PERMS+=		${GNUNET_DIR}/data ${GNUNET_USER} ${GNUNET_GROUP} 0700
 
 MAKE_DIRS+=			${PKG_SYSCONFDIR}
+MAKE_DIRS+=			${GNUNET_LOG_DIR}
+MAKE_DIRS+=			${GNUNET_DIR}/data
 AUTO_MKDIRS=			YES
 CONF_FILES+=			${FILESDIR}/gnunet.conf \
 				${PKG_SYSCONFDIR}/gnunet.conf
 
-FILES_SUBST+=			PKG_HOME=${PKG_HOME.${GNUNET_USER}}
+FILES_SUBST+=			PKG_HOME=${GNUNET_DIR}
 
 SUBST_CLASSES+=			sysconfdir
 SUBST_STAGE.sysconfdir=		post-build
-SUBST_MESSAGE.sysconfdir=	Fixing sysconfdir in gnunet.conf
+SUBST_MESSAGE.sysconfdir=	Fixing paths in gnunet.conf
 SUBST_FILES.sysconfdir=		${FILESDIR}/gnunet.conf
-SUBST_SED.sysconfdir=		-e 's,^DEFAULTCONFIG.*,DEFAULTCONFIG = ${PKG_SYSCONFDIR}/gnunet.conf,g'
+SUBST_SED.sysconfdir+=		-e 's,^DEFAULTCONFIG.*,DEFAULTCONFIG = ${PKG_SYSCONFDIR}/gnunet.conf,g'
+SUBST_SED.sysconfdir+=		-e 's,^GNUNET_DATA_HOME.*,GNUNET_DATA_HOME = ${GNUNET_DIR}/data,g'
+SUBST_SED.sysconfdir+=		-e 's,^GNUNET_RUNTIME_DIR.*,GNUNET_RUNTIME_DIR = ${GNUNET_DIR},g'
+SUBST_SED.sysconfdir+=		-e 's,^GNUNET_HOME.*,GNUNET_HOME = ${GNUNET_DIR},g'
 
 # All helpers have to be suid. fs helper must not be suid.
 # Not all of these files may be available.
diff --git a/gnunet/files/gnunet.conf b/gnunet/files/gnunet.conf
index 5d19777459..3ded6eb4b3 100644
--- a/gnunet/files/gnunet.conf
+++ b/gnunet/files/gnunet.conf
@@ -1,5 +1,8 @@
 [PATHS]
 DEFAULTCONFIG = /usr/pkg/etc/gnunet/gnunet.conf
+GNUNET_DATA_HOME = @GNUNET_DIR@/data/
+GNUNET_RUNTIME_DIR = @GNUNET_DIR@
+GNUNET_HOME = @GNUNET_DIR@
 
 # choose your database backend
 #[datastore]
diff --git a/gnunet/files/gnunet.in b/gnunet/files/gnunet.in
index 3668e6681b..d9e6ac52f3 100755
--- a/gnunet/files/gnunet.in
+++ b/gnunet/files/gnunet.in
@@ -34,9 +34,9 @@ gnunet_env="HOME=${gnunet_home} USER=${gnunet_user} TMP=/tmp"
 
 gnunet_precmd()
 {
-	if [ -f ${gnunet_home}/.local/share/gnunet/gnunet.conf ]; then
-		@CHMOD@ 0600 @PKG_HOME@/.local/share/gnunet/gnunet.conf
-		@CHOWN@ gnunet:gnunet @PKG_HOME@/.local/share/gnunet/gnunet.conf
+	if [ -f ${gnunet_home}/data/gnunet.conf ]; then
+		@CHMOD@ 0600 @PKG_HOME@/data/gnunet.conf
+		@CHOWN@ gnunet:gnunet @PKG_HOME@/data/gnunet.conf
 	fi
 	if [ ! -d ${gnunet_home}/.cache/gnunet ]; then
 		@MKDIR@ -p ${gnunet_home}/.cache/gnunet


Home | Main Index | Thread Index | Old Index