aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/nylon/Makefile10
-rw-r--r--net/nylon/files/nylon.sh.in36
-rw-r--r--net/nylon/pkg-plist2
3 files changed, 46 insertions, 2 deletions
diff --git a/net/nylon/Makefile b/net/nylon/Makefile
index c189e4482053..4bb76b057dba 100644
--- a/net/nylon/Makefile
+++ b/net/nylon/Makefile
@@ -16,6 +16,9 @@ COMMENT= A Unix SOCKS 4 and 5 proxy server
BUILD_DEPENDS= ${LOCALBASE}/lib/libevent.a:${PORTSDIR}/devel/libevent
+USE_RC_SUBR= yes
+RC_SCRIPTS_SUB=PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
GNU_CONFIGURE= yes
# Necessary for $PREFIX to work:
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@@ -23,7 +26,14 @@ CONFIGURE_ARGS= --with-libevent=${LOCALBASE}
MAN1= nylon.1
+PLIST_FILES= bin/nylon etc/nylon.conf etc/rc.d/nylon.sh
+
+post-extract:
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/nylon.sh.in > ${WRKSRC}/nylon.sh
+
post-install:
${INSTALL_DATA} ${FILESDIR}/nylon.conf ${PREFIX}/etc
+ ${INSTALL_SCRIPT} ${WRKSRC}/nylon.sh ${PREFIX}/etc/rc.d
.include <bsd.port.mk>
diff --git a/net/nylon/files/nylon.sh.in b/net/nylon/files/nylon.sh.in
new file mode 100644
index 000000000000..251f9c90c280
--- /dev/null
+++ b/net/nylon/files/nylon.sh.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+
+# PROVIDE: nylon
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable nylon:
+#
+#nylon_enable="YES"
+#
+# See nylon(1) for flags
+#
+
+. %%RC_SUBR%%
+
+name=nylon
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/bin/nylon
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+ rm -f $pidfile
+}
+
+# set defaults
+
+nylon_enable=${nylon_enable:-"NO"}
+nylon_flags=${nylon_flags:-"-s"}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/nylon/pkg-plist b/net/nylon/pkg-plist
deleted file mode 100644
index e8c0a6ed57d3..000000000000
--- a/net/nylon/pkg-plist
+++ /dev/null
@@ -1,2 +0,0 @@
-bin/nylon
-etc/nylon.conf