diff options
author | stefan <stefan@FreeBSD.org> | 2010-11-11 18:31:35 +0800 |
---|---|---|
committer | stefan <stefan@FreeBSD.org> | 2010-11-11 18:31:35 +0800 |
commit | 1d84e0ea2c2872b10370a6aec1a769b4bf5715fd (patch) | |
tree | 53b252f4f4b92bdf2070c04cfaca5a2c0ac0d3e9 /net-p2p/uhub | |
parent | 250fff78769c662973de6cfbdb12860847c77271 (diff) | |
download | freebsd-ports-gnome-1d84e0ea2c2872b10370a6aec1a769b4bf5715fd.tar.gz freebsd-ports-gnome-1d84e0ea2c2872b10370a6aec1a769b4bf5715fd.tar.zst freebsd-ports-gnome-1d84e0ea2c2872b10370a6aec1a769b4bf5715fd.zip |
* Sets up a uhub UID and GID for the daemon to run as.
* Modifies configuration file permissions to restrict them to root and the above
GID.
* Patches uhub source so that PREFIX/etc/uhub/uhub.conf is the compiled in
default configuration file.
* rc.d script changes - enable above uid/gid, enable syslog logging, simplify.
PR: 151819
Submitted by: Aragon Gouveia <aragon@phat.za.net>
Approved by: maintainer
Diffstat (limited to 'net-p2p/uhub')
-rw-r--r-- | net-p2p/uhub/Makefile | 23 | ||||
-rw-r--r-- | net-p2p/uhub/files/uhub.sh.in | 10 |
2 files changed, 19 insertions, 14 deletions
diff --git a/net-p2p/uhub/Makefile b/net-p2p/uhub/Makefile index a4e7c144315f..02bc02947cc2 100644 --- a/net-p2p/uhub/Makefile +++ b/net-p2p/uhub/Makefile @@ -7,7 +7,7 @@ PORTNAME= uhub PORTVERSION= 0.3.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net-p2p MASTER_SITES= http://www.extatic.org/downloads/uhub/ DISTNAME= ${PORTNAME}-${PORTVERSION}-src @@ -19,6 +19,10 @@ USE_PERL5_BUILD=yes USE_GMAKE= yes USE_RC_SUBR= uhub.sh +USERS= uhub +GROUPS= uhub +SHAREGRP= uhub +SHAREMODE= 640 WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} MAKEFILE= ${WRKSRC}/GNUmakefile @@ -36,15 +40,18 @@ LDFLAGS+= -L${OPENSSLLIB} post-patch: @${REINPLACE_CMD} -e 's|/etc/uhub/|${PREFIX}&|' ${WRKSRC}/doc/uhub.conf + @${REINPLACE_CMD} -e 's|/etc/uhub/|${PREFIX}&|' ${WRKSRC}/src/uhub.h -post-install: +do-install: + @${INSTALL_PROGRAM} ${WRKSRC}/uhub ${PREFIX}/bin/uhub + @${MKDIR} ${PREFIX}/etc/uhub @${INSTALL_DATA} ${WRKSRC}/doc/uhub.conf ${PREFIX}/etc/uhub/uhub.conf.sample @${INSTALL_DATA} ${WRKSRC}/doc/users.conf ${PREFIX}/etc/uhub/users.conf.sample - @if [ -f ${PREFIX}/etc/uhub/motd.txt ]; then \ - ${TOUCH} ${PREFIX}/etc/uhub/motd.txt.sample ; \ - fi - @if [ -f ${PREFIX}/etc/uhub/rules.txt ]; then \ - ${TOUCH} ${PREFIX}/etc/uhub/rules.txt.sample ; \ - fi + @${INSTALL_DATA} /dev/null ${PREFIX}/etc/uhub/motd.txt.sample + @${INSTALL_DATA} /dev/null ${PREFIX}/etc/uhub/rules.txt.sample +.for i in uhub.conf users.conf motd.txt rules.txt + @[ ! -f ${PREFIX}/etc/uhub/${i} ] \ + && cp -p ${PREFIX}/etc/uhub/${i}.sample ${PREFIX}/etc/uhub/${i} +.endfor .include <bsd.port.post.mk> diff --git a/net-p2p/uhub/files/uhub.sh.in b/net-p2p/uhub/files/uhub.sh.in index 7cfd522dde1c..7f8167b5b497 100644 --- a/net-p2p/uhub/files/uhub.sh.in +++ b/net-p2p/uhub/files/uhub.sh.in @@ -11,8 +11,6 @@ # # uhub_enable (bool): Set it to "YES" to enable uhub # Default is "NO". -# uhub_conf (path): Set full path to config file. -# Default is "%%PREFIX%%/etc/uhub/uhub.conf". # uhub_pidfile (path): Set full path to pid file. # Default is "/var/run/uhub.pid". # @@ -24,12 +22,12 @@ rcvar=`set_rcvar` load_rc_config $name -: ${uhub_enable="NO"} -: ${uhub_conf="%%PREFIX%%/etc/uhub/uhub.conf"} -: ${uhub_pidfile="/var/run/${name}.pid"} +: ${uhub_enable:="NO"} +: ${uhub_flags:="-L -u uhub -g uhub"} +: ${uhub_pidfile:="/var/run/${name}.pid"} command=%%PREFIX%%/bin/uhub -command_args="-fq -c ${uhub_conf} -p ${uhub_pidfile}" +command_args="-f -p ${uhub_pidfile}" pidfile=${uhub_pidfile} required_files=${uhub_conf} stop_postcmd=stop_postcmd |