Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2007 20:53:31 GMT
From:      olli hauer <ohauer@gmx.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/118089: [patch] add rc script to port dns/dnsproxy
Message-ID:  <200711162053.lAGKrVnH038599@www.freebsd.org>
Resent-Message-ID: <200711162100.lAGL03x8035559@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         118089
>Category:       ports
>Synopsis:       [patch] add rc script to port dns/dnsproxy
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 16 21:00:03 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     olli hauer
>Release:        FreeBSD 6.2-RELEASE-p4
>Organization:
>Environment:
>Description:
There is no rc script for the port dns/dnsproxy so i wrote one.

Also copy a sample config file to $PREFIX/etc/


>How-To-Repeat:
install the old port without patch
>Fix:
diff -Nru --exclude=RCS dnsproxy/Makefile dnsproxy.1/Makefile
--- dnsproxy/Makefile
+++ dnsproxy/Makefile
@@ -16,8 +16,16 @@
 GNU_CONFIGURE= yes
 CONFIGURE_TARGET=      --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}

+USE_RC_SUBR?=  dnsproxy
+
 MAN1=          dnsproxy.1
-PLIST_FILES=   sbin/dnsproxy
+PLIST_FILES=   sbin/dnsproxy \
+               etc/dnsproxy.conf.sample
+
+CONFIG_DIR=    ${PREFIX}/etc
+SAMPLE_DNSPROXY_CONF= ${CONFIG_DIR}/dnsproxy.conf.sample
+
+SUB_FILES=     pkg-message

 .include <bsd.port.pre.mk>

@@ -26,8 +34,16 @@
        ${RM} ${WRKSRC}/libevent/compat/sys/queue.h
 .endif

+post-install:
+       @${CAT} ${PKGMESSAGE}
+
 do-install:
        @${INSTALL_PROGRAM} ${WRKSRC}/dnsproxy ${PREFIX}/sbin
        @${INSTALL_MAN} ${WRKSRC}/dnsproxy.1 ${MAN1PREFIX}/man/man1
+       @if [ ! -f ${SAMPLE_DNSPROXY_CONF} ]; then \
+               ${ECHO_MSG} "Installing ${SAMPLE_DNSPROXY_CONF} file."; \
+               ${ECHO_MSG} "${INSTALL_DATA} -v -p ${WRKSRC}/dnsproxy.conf ${SAMPLE_DNSPROXY_CONF}"; \
+               ${INSTALL_DATA} -v -p ${WRKSRC}/dnsproxy.conf ${SAMPLE_DNSPROXY_CONF}; \
+       fi

 .include <bsd.port.post.mk>
diff -Nru --exclude=RCS dnsproxy/files/dnsproxy.in dnsproxy.1/files/dnsproxy.in
+++ dnsproxy/files/dnsproxy.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: dnsproxy
+# REQUIRE: NETWORKING SERVERS
+# BEFORE:  DAEMON
+# KEYWORD: shutdown
+
+#
+# Define these spamd_* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#
+# dnsproxy_enable="YES"        # Run the dnsproxy(1) daemon (YES/NO).
+# dnsproxy_flags=""    # Extra flags for dnsproxy(1) (if enabled).
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+dnsproxy_enable=${dnsproxy_enable:-"NO"}
+command_args=${dnsproxy_flags:-"-c %%PREFIX%%/etc/dnsproxy.conf -d"}
+
+. %%RC_SUBR%%
+
+name="dnsproxy"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/dnsproxy"
+
+load_rc_config $name
+run_rc_command "$1"
diff -Nru --exclude=RCS dnsproxy/files/pkg-message.in dnsproxy.1/files/pkg-message.in
+++ dnsproxy/files/pkg-message.in
@@ -0,0 +1,12 @@
+**********************************************************************
+To enable dnsproxy you need:
+
+1) Enable dnsproxy in /etc/rc.conf with the following line:
+   dnsproxy_enable="YES"
+
+2) Configuration template is available in %%PREFIX%%/etc/dnsproxy as
+   dnsproxy.conf.sample file.
+
+For more information see man dnsproxy(1)
+
+**********************************************************************


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711162053.lAGKrVnH038599>