diff options
author | sem <sem@FreeBSD.org> | 2005-01-09 02:44:55 +0800 |
---|---|---|
committer | sem <sem@FreeBSD.org> | 2005-01-09 02:44:55 +0800 |
commit | 4edae36f8257acba7dcce28378231db3829c8c19 (patch) | |
tree | 176992fe7599ae010002536ad4b425af61e9f33a /net-p2p/gift | |
parent | 3e060ed90d65778d7dda0d1bee1497f3c2a781fb (diff) | |
download | freebsd-ports-gnome-4edae36f8257acba7dcce28378231db3829c8c19.tar.gz freebsd-ports-gnome-4edae36f8257acba7dcce28378231db3829c8c19.tar.zst freebsd-ports-gnome-4edae36f8257acba7dcce28378231db3829c8c19.zip |
- Add rcNG script
PR: ports/75905
Submitted by: Manuel Rabade Garcia <mig(at)mig-29.net>
Approved by: maintainer
Diffstat (limited to 'net-p2p/gift')
-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 |