From ccaaf22f13d72cd29bf2699b07010a1a42a29bfb Mon Sep 17 00:00:00 2001 From: leeym Date: Sat, 16 Jul 2005 01:23:02 +0000 Subject: - utilize USE_RCORDER / USE_RC_SUBR to solve this problem when OSVERSION > 500037 PR: 80054 Patched by: leeym Submitted by: Thomas Schweikle Approved by: maintainer timeout --- dns/dnsmasq/Makefile | 27 +++++++++++++-------------- dns/dnsmasq/files/dnsmasq.sh | 29 ----------------------------- dns/dnsmasq/files/dnsmasq.sh.in | 27 +++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 43 deletions(-) delete mode 100644 dns/dnsmasq/files/dnsmasq.sh create mode 100644 dns/dnsmasq/files/dnsmasq.sh.in (limited to 'dns') diff --git a/dns/dnsmasq/Makefile b/dns/dnsmasq/Makefile index f3cf22ce5310..687af49afdc0 100644 --- a/dns/dnsmasq/Makefile +++ b/dns/dnsmasq/Makefile @@ -13,28 +13,27 @@ MASTER_SITES= http://www.thekelleys.org.uk/dnsmasq/ MAINTAINER= steven@honson.org COMMENT= Lightweight, easy to configure DNS forwarder and DHCP server -USE_REINPLACE= yes -USE_RC_SUBR= yes - MAN8= dnsmasq.8 -PLIST_FILES= sbin/dnsmasq etc/dnsmasq.conf.example etc/rc.d/dnsmasq.sh +PLIST_FILES= sbin/dnsmasq etc/dnsmasq.conf.example + +USE_GETOPT_LONG=yes +MAKE_ENV= LIBS="${LDFLAGS}" RPM_OPT_FLAGS="${CPPFLAGS}" -USE_GETOPT_LONG= yes -MAKE_ENV+= "LIBS=${LDFLAGS}" .if defined(WITHOUT_IPV6) -MAKE_ENV+= RPM_OPT_FLAGS="${CPPFLAGS} -DNO_IPV6" -.else -MAKE_ENV+= RPM_OPT_FLAGS="${CPPFLAGS}" +MAKE_ENV+= -DNO_IPV6 .endif -post-build: - @${SED} -e "s|%%RC_SUBR%%|${RC_SUBR}|g;s|%%PREFIX%%|${PREFIX}|g" \ - <${FILESDIR}/dnsmasq.sh >${WRKDIR}/dnsmasq.sh +.include + +.if ${OSVERSION} < 500037 +USE_RC_SUBR= dnsmasq.sh +.else +USE_RCORDER= dnsmasq.sh +.endif do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/dnsmasq ${PREFIX}/sbin ${INSTALL_DATA} ${WRKSRC}/dnsmasq.conf.example ${PREFIX}/etc - ${INSTALL_SCRIPT} ${WRKDIR}/dnsmasq.sh ${PREFIX}/etc/rc.d ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${PREFIX}/man/man8 -.include +.include diff --git a/dns/dnsmasq/files/dnsmasq.sh b/dns/dnsmasq/files/dnsmasq.sh deleted file mode 100644 index c723b1ec3361..000000000000 --- a/dns/dnsmasq/files/dnsmasq.sh +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/sh -# -# -# PROVIDE: dnsmasq -# REQUIRE: DAEMON NETWORKING SERVERS -# KEYWORD: FreeBSD -# -# Add the following line to /etc/rc.conf to enable dnsmasq: -# -# dnsmasq_enable="YES" -# - -# override these variables in /etc/rc.conf -dnsmasq_enable=NO - - -. %%RC_SUBR%% - -name=dnsmasq -rcvar=$(set_rcvar) - -command=%%PREFIX%%/sbin/${name} -pidfile=/var/run/${name}.pid -required_files=${dnsmasq_conf} -#start_precmd=${name}_precmd - -load_rc_config ${name} -run_rc_command "$1" - diff --git a/dns/dnsmasq/files/dnsmasq.sh.in b/dns/dnsmasq/files/dnsmasq.sh.in new file mode 100644 index 000000000000..2f661e4a132c --- /dev/null +++ b/dns/dnsmasq/files/dnsmasq.sh.in @@ -0,0 +1,27 @@ +#! /bin/sh +# +# PROVIDE: named dnsmasq +# REQUIRE: SERVERS cleanvar +# BEFORE: DAEMON +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf to enable dnsmasq: +# +# dnsmasq_enable="YES" +# + +# override these variables in /etc/rc.conf +dnsmasq_enable=NO + +. %%RC_SUBR%% + +name=dnsmasq +rcvar=$(set_rcvar) + +command=%%PREFIX%%/sbin/${name} +pidfile=/var/run/${name}.pid +required_files=${dnsmasq_conf} + +load_rc_config ${name} +run_rc_command "$1" + -- cgit