aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorlioux <lioux@FreeBSD.org>2005-10-11 00:38:19 +0800
committerlioux <lioux@FreeBSD.org>2005-10-11 00:38:19 +0800
commit47049ad4130970b6227f949b333abd0697425670 (patch)
tree33c066fa7007c6c017f6037ff8ec61f97cb89f28 /net
parent782608f667c2b335391c576aa0c4f04b02f531d2 (diff)
downloadfreebsd-ports-gnome-47049ad4130970b6227f949b333abd0697425670.tar.gz
freebsd-ports-gnome-47049ad4130970b6227f949b333abd0697425670.tar.zst
freebsd-ports-gnome-47049ad4130970b6227f949b333abd0697425670.zip
o Add a rc.d startup script
o Bump PORTREVISION
Diffstat (limited to 'net')
-rw-r--r--net/mldonkey-devel/Makefile8
-rw-r--r--net/mldonkey-devel/files/mlnet.sh59
-rw-r--r--net/mldonkey-devel/pkg-plist1
3 files changed, 68 insertions, 0 deletions
diff --git a/net/mldonkey-devel/Makefile b/net/mldonkey-devel/Makefile
index ea7abb1ed87a..141026cf3465 100644
--- a/net/mldonkey-devel/Makefile
+++ b/net/mldonkey-devel/Makefile
@@ -7,6 +7,7 @@
PORTNAME= mldonkey
PORTVERSION= 2.6.4
+PORTREVISION= 1
CATEGORIES+= net
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -22,6 +23,7 @@ CONFLICTS= mldonkey-[0-9]*
USE_BZIP2= yes
USE_ICONV= yes
+USE_RC_SUBR= yes
WANT_AUTOCONF_VER= 259
USE_REINPLACE= yes
GNU_CONFIGURE= yes
@@ -113,6 +115,9 @@ post-patch:
@${REINPLACE_CMD} -E \
-e 's|%%AUTOCONF%%|${AUTOCONF}|' \
${BUILD_WRKSRC}/config/Makefile.in
+# rc.d
+ @${SED} -e "s|%%PREFIX%%|${PREFIX}|" \
+ ${FILESDIR}/mlnet.sh > ${WRKDIR}/mlnet.sh
pre-configure:
cd ${WRKSRC}/config && ${AUTOCONF}
@@ -154,6 +159,9 @@ do-install:
@${INSTALL_DATA} ${WRKSRC}/distrib/${file} ${DOCSDIR}
.endfor
.endif
+# rc.d
+ @${INSTALL_SCRIPT} ${WRKDIR}/mlnet.sh \
+ ${PREFIX}/etc/rc.d
post-install:
@${CAT} ${PKGMESSAGE}
diff --git a/net/mldonkey-devel/files/mlnet.sh b/net/mldonkey-devel/files/mlnet.sh
new file mode 100644
index 000000000000..82edeb6d8272
--- /dev/null
+++ b/net/mldonkey-devel/files/mlnet.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Under a BSDL license. Copyright 2005. Mario S F Ferreira <lioux@FreeBSD.org>
+
+# PROVIDE: mlnet
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable mlnet:
+#
+#mlnet_enable="YES"
+#mlnet_user=""
+#mlnet_logfile=""
+#
+
+. /etc/rc.subr
+
+name="mlnet"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/mlnet"
+procname="%%PREFIX%%/bin/mlnet-real"
+
+## hardcoded, cannot override
+mlnet_pidfile="${HOME}/.mldonkey/mlnet.pid"
+
+mlnet_check_vars()
+{
+ if [ -z "${mlnet_user}" ]; then
+ mlnet_user=$(whoami)
+ fi
+
+ if [ "x${mlnet_user}" = "xroot" ]; then
+ err 1 "You have to set mlnet_user to a non-root user for security reasons"
+ fi
+}
+
+start_cmd="start_cmd"
+start_cmd()
+{
+ mlnet_check_vars
+ if [ -n "${mlnet_logfile}" ]; then
+ mlnet_logcommand="-log_file ${mlnet_logfile}"
+ fi
+
+ su -l ${mlnet_user} -c "${command} \
+ ${mlnet_logcommand} \
+ ${mlnet_flags} \
+ >/dev/null &"
+}
+
+load_rc_config "${name}"
+: ${mlnet_enable="NO"}
+: ${mlnet_user=""}
+: ${mlnet_logfile=""}
+
+run_rc_command "$1"
diff --git a/net/mldonkey-devel/pkg-plist b/net/mldonkey-devel/pkg-plist
index a2ce1f94ec95..f2445bae30a7 100644
--- a/net/mldonkey-devel/pkg-plist
+++ b/net/mldonkey-devel/pkg-plist
@@ -1,3 +1,4 @@
+etc/rc.d/mlnet.sh
%%CORE%%bin/kill_mldonkey
%%CORE%%bin/mlnet
%%CORE%%bin/mlnet-real