diff options
author | Sergey Matveychuk <sem@FreeBSD.org> | 2005-01-08 18:44:55 +0000 |
---|---|---|
committer | Sergey Matveychuk <sem@FreeBSD.org> | 2005-01-08 18:44:55 +0000 |
commit | 4bb436e61c5a4b7634cb5b5e700ecec3ae4a9d74 (patch) | |
tree | e6463a36bbf6baafc4c3870e9baf81642dda508f /net-p2p | |
parent | b608f29439580896b8b628046981ef8636607a8b (diff) | |
download | ports-4bb436e61c5a4b7634cb5b5e700ecec3ae4a9d74.tar.gz ports-4bb436e61c5a4b7634cb5b5e700ecec3ae4a9d74.zip |
Notes
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/gift/Makefile | 13 | ||||
-rw-r--r-- | net-p2p/gift/files/giftd.sh | 49 | ||||
-rw-r--r-- | net-p2p/gift/pkg-message | 9 | ||||
-rw-r--r-- | net-p2p/gift/pkg-plist | 1 |
4 files changed, 71 insertions, 1 deletions
diff --git a/net-p2p/gift/Makefile b/net-p2p/gift/Makefile index 6b840977600b..9c3a1ccef895 100644 --- a/net-p2p/gift/Makefile +++ b/net-p2p/gift/Makefile @@ -7,6 +7,7 @@ PORTNAME= giFT PORTVERSION= 0.11.8.1 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME:L} @@ -27,18 +28,28 @@ LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" \ LDFLAGS="${LDFLAGS}" INSTALLS_SHLIB= yes +USE_RC_SUBR= yes MAN1= giftd.1 DOC_FILES= AUTHORS COPYING src/ChangeLog \ INSTALL NEWS QUICKSTART README TODO +.include <bsd.port.pre.mk> + +SED_SCRIPT+= -e 's,%%PREFIX%%,${PREFIX},g' \ + -e 's,%%RC_SUBR%%,${RC_SUBR},g' + post-patch: @${REINPLACE_CMD} -e \ 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|g' \ ${WRKSRC}/lib/Makefile.in +post-build: + @${SED} ${SED_SCRIPT} <${FILESDIR}/giftd.sh >${WRKDIR}/giftd.sh + post-install: + @${INSTALL_SCRIPT} ${WRKDIR}/giftd.sh ${PREFIX}/etc/rc.d/ .ifndef(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for doc in ${DOC_FILES} @@ -47,4 +58,4 @@ post-install: .endif @${CAT} ${PKGMESSAGE} -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/net-p2p/gift/files/giftd.sh b/net-p2p/gift/files/giftd.sh new file mode 100644 index 000000000000..1bbed2ce2970 --- /dev/null +++ b/net-p2p/gift/files/giftd.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: giftd +# REQUIRE: DAEMON +# KEYWORD: FreeBSD shutdown + +# Define these giftd_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/giftd +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE + +giftd_enable="NO" +giftd_flags="-d -q" +giftd_user="" +giftd_local_dir="" + +. "%%RC_SUBR%%" + +name="giftd" +rcvar=`set_rcvar` +command="%%PREFIX%%/bin/giftd" + +required_dirs=${giftd_local_dir} +start_precmd="giftd_check_vars" + +giftd_check_vars() +{ + if [ -z ${giftd_user} ]; then + giftd_user=$(whoami) + fi + + if [ $giftd_user = 'root' ]; then + warn "You should set giftd_user to a non-root user for security reasons" + fi + + if [ -z ${giftd_local_dir} ]; then + giftd_local_dir="$(pw usershow $giftd_user | awk -F : '{ print $9 }')/.giFT" + fi + + rc_flags="${giftd_flags} --local-dir=${giftd_local_dir}" +} + +load_rc_config $name +run_rc_command "$1" diff --git a/net-p2p/gift/pkg-message b/net-p2p/gift/pkg-message index 20ac33156ca6..3bcf938f0ee5 100644 --- a/net-p2p/gift/pkg-message +++ b/net-p2p/gift/pkg-message @@ -11,3 +11,12 @@ $ gift-setup Note that giFT and OpenFT will not work with the default setup, so make sure you read and understand all questions before answering or just pressing enter. To reconfigure giFT and OpenFT later, just run gift-setup again. + +If you want to run giFT from startup tweak and add the folowing variables to your +/etc/rc.conf: + +giftd_enable="YES" +# Run gift as (defaults to root, avoid this for security reasons) +giftd_user="" +# Path to giftd.conf (defaults to .giFT in the giftd_user home) +giftd_local_dir="" diff --git a/net-p2p/gift/pkg-plist b/net-p2p/gift/pkg-plist index 6ac6da4c68d1..d1f5f0a9e0a6 100644 --- a/net-p2p/gift/pkg-plist +++ b/net-p2p/gift/pkg-plist @@ -1,3 +1,4 @@ +etc/rc.d/giftd.sh bin/gift-setup bin/giftd include/libgift/array.h |