summaryrefslogtreecommitdiff
path: root/security/isakmpd
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2003-07-31 10:38:32 +0000
committerjmmv <jmmv@pkgsrc.org>2003-07-31 10:38:32 +0000
commit4ab51057d8801e73df4ec712ea9c9fd36471737e (patch)
treebe517d4c5b66f025bdc93c584a90d7fef46d1f4c /security/isakmpd
parent38dd4422e2bcae03d27570dd3e689e2b1ac80ecf (diff)
downloadpkgsrc-4ab51057d8801e73df4ec712ea9c9fd36471737e.tar.gz
Convert to the bsd.pkg.install.mk framework by honouring PKG_SYSCONFDIR and
using RCD_SCRIPTS to handle generation and installation of the rc.d script. Convert the rc.d script to the rc.subr framework too. Bump PKGREVISION to 1.
Diffstat (limited to 'security/isakmpd')
-rw-r--r--security/isakmpd/Makefile25
-rw-r--r--security/isakmpd/files/isakmpd.sh42
2 files changed, 38 insertions, 29 deletions
diff --git a/security/isakmpd/Makefile b/security/isakmpd/Makefile
index 0071fc242ce..06c1b588c4c 100644
--- a/security/isakmpd/Makefile
+++ b/security/isakmpd/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.27 2003/07/17 22:52:56 grant Exp $
+# $NetBSD: Makefile,v 1.28 2003/07/31 10:38:32 jmmv Exp $
#
DISTNAME= isakmpd-20021118
+PKGREVISION= 1
WRKSRC= ${WRKDIR}/isakmpd
CATEGORIES= security net
MASTER_SITES= ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/
@@ -20,25 +21,31 @@ USE_PKGINSTALL= YES
MAKE_ENV+= BINDIR=${PREFIX}/sbin MANDIR=${PREFIX}/man
-post-patch:
+PKG_SYSCONFSUBDIR= isakmpd
+
+RCD_SCRIPTS= isakmpd
+RCD_SCRIPT_WRK.isakmpd= ${WRKDIR}/isakmpd.sh
+
+pre-configure:
@${ECHO_MSG} "Fixing references to buildlink directories"
@for i in ${WRKSRC}/sysdep/netbsd/Makefile.sysdep; do \
${MV} $${i} $${i}.orig; \
${SED} "s+@BUILDLINK_PREFIX.openssl@+${BUILDLINK_PREFIX.openssl}+g" \
< $${i}.orig > $${i}; \
done
+ @${ECHO_MSG} "Fixing references to configuration directory"
+ @for i in conf.h policy.h ike_auth.h; do \
+ ${MV} ${WRKSRC}/$${i} ${WRKSRC}/$${i}.orig; \
+ ${SED} "s+/etc/isakmpd+${PKG_SYSCONFDIR}+g" \
+ < ${WRKSRC}/$${i}.orig > ${WRKSRC}/$${i}; \
+ done
@${ECHO_MSG} "Fixing manual page references"
@for i in isakmpd.8 isakmpd.conf.5 isakmpd.policy.5; do \
${MV} ${WRKSRC}/$${i} ${WRKSRC}/$${i}.orig; \
- ${SED} "s+/usr/share/ipsec+${PREFIX}/share/examples+g" \
+ ${SED} -e "s+/usr/share/ipsec+${PREFIX}/share/examples+g" \
+ -e "s+/etc/isakmpd+${PKG_SYSCONFDIR}+g" \
< ${WRKSRC}/$${i}.orig > ${WRKSRC}/$${i}; \
done
-pre-install:
- @${SED} ${FILES_SUBST_SED} ${FILESDIR}/isakmpd.sh > ${WRKDIR}/isakmpd.sh
-
-post-install:
- ${INSTALL_SCRIPT} ${WRKDIR}/isakmpd.sh ${PREFIX}/etc/rc.d/isakmpd
-
.include "../../security/openssl/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/security/isakmpd/files/isakmpd.sh b/security/isakmpd/files/isakmpd.sh
index e8f5c820f36..bfbccfe26bb 100644
--- a/security/isakmpd/files/isakmpd.sh
+++ b/security/isakmpd/files/isakmpd.sh
@@ -1,23 +1,25 @@
-#!/bin/sh
+#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: isakmpd.sh,v 1.1 2002/04/04 09:42:30 martti Exp $
+# $NetBSD: isakmpd.sh,v 1.2 2003/07/31 10:38:33 jmmv Exp $
#
+# PROVIDE: isakmpd
+# REQUIRE: DAEMON NETWORK
+#
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="isakmpd"
+rcvar="${name}"
+command="@PREFIX@/sbin/isakmpd"
+pidfile="/var/run/isakmpd.pid"
+required_files="@PKG_SYSCONFDIR@/isakmpd.conf"
-case "$1" in
- start)
- if [ -r /etc/isakmpd/isakmpd.conf ]; then
- echo 'Starting isakmpd'
- @PREFIX@/sbin/isakmpd
- fi
- ;;
- stop)
- if [ -f /var/run/isakmpd.pid ]; then
- echo 'Stopping isakmpd'
- kill `cat /var/run/isakmpd.pid`
- rm -f /var/run/isakmpd.pid
- fi
- ;;
- *)
- echo "$0 start | stop"
- ;;
-esac
+if [ -f /etc/rc.subr ]; then
+ load_rc_config "${name}"
+ run_rc_command "$1"
+else
+ printf " ${name}"
+ eval ${command} ${isakmpd_flags} ${command_args}
+fi