diff -urN dnscrypt-proxy.old/Makefile dnscrypt-proxy/Makefile --- dnscrypt-proxy.old/Makefile 2015-02-20 16:55:50.000000000 +0000 +++ dnscrypt-proxy/Makefile 2015-04-06 22:38:21.000000000 +0000 @@ -3,6 +3,7 @@ PORTNAME= dnscrypt-proxy PORTVERSION= 1.4.3 +PORTREVISION= 1 CATEGORIES= dns MASTER_SITES= http://download.dnscrypt.org/dnscrypt-proxy/ \ http://www.dns-lab.com/downloads/dnscrypt-proxy/ @@ -18,9 +19,23 @@ GNU_CONFIGURE= yes USES= execinfo gmake -SUB_FILES= pkg-message - +OPTIONS_DEFINE= DOCS +OPTIONS_SINGLE= RCWHICH +OPTIONS_SINGLE_RCWHICH= RCSINGLE RCMULTI +RCWHICH_DESC= rc script to use: +RCSINGLE_DESC= use default rc script for single daemon +RCMULTI_DESC= use experimental rc script for multiple instances +OPTIONS_DEFAULT=RCSINGLE + +.include + +.if ${PORT_OPTIONS:MRCMULTI} +USE_RC_SUBR= ${PORTNAME}_multi +SUB_FILES= pkg-message_multi +.else USE_RC_SUBR= ${PORTNAME} +SUB_FILES= pkg-message +.endif USERS= _dnscrypt-proxy @@ -28,8 +43,6 @@ README-PLUGINS.markdown README-WINDOWS.markdown \ README.markdown TECHNOTES THANKS -OPTIONS_DEFINE= DOCS - post-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} diff -urN dnscrypt-proxy.old/files/dnscrypt-proxy_multi.in dnscrypt-proxy/files/dnscrypt-proxy_multi.in --- dnscrypt-proxy.old/files/dnscrypt-proxy_multi.in 1970-01-01 00:00:00.000000000 +0000 +++ dnscrypt-proxy/files/dnscrypt-proxy_multi.in 2015-04-06 02:26:06.000000000 +0000 @@ -0,0 +1,71 @@ +#!/bin/sh +# +# $FreeBSD: $ +# +# PROVIDE: dnscrypt_proxy +# REQUIRE: SERVERS cleanvar +# BEFORE: named local_unbound unbound +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable dnscrypt-proxy: +# +# dnscrypt_proxy_instances (str): Set to "dnscrypt_proxy" by default. +# List of dnscrypt_proxy instance id's, +# e.g. "dnscrypt_proxy_1 dnscrypt_proxy_2", etc. +# {instance_id}_enable (bool): Set to NO by default. +# Set to YES to enable dnscrypt-proxy. +# {instance_id}_uid (str): Set to "_dnscrypt-proxy" by default. +# User to switch to after starting. +# {instance_id}_resolver (str): Set to "opendns" by default. +# Choose a different upstream resolver. +# {instance_id}_pidfile (str): default: "/var/run/dnscrypt-proxy.pid" +# Location of pid file. +# {instance_id}_logfile (str): default: "/var/log/dnscrypt-proxy.log" +# Location of log file. +# +# To redirect a local resolver through dnscrypt-proxy, point it at 127.0.0.2 +# and add the following to rc.conf: +# ifconfig_lo0_alias0="inet 127.0.0.2 netmask 0xffffffff" +# dnscrypt_proxy_flags='-a 127.0.0.2' + +. /etc/rc.subr + +name=dnscrypt_proxy +rcvar=dnscrypt_proxy_enable + +load_rc_config ${name} + +: ${dnscrypt_proxy_instances="${name}"} +: ${dnscrypt_proxy_enable:=NO} + +dnscrypt_proxy_enable_tmp=${dnscrypt_proxy_enable} + +command=%%PREFIX%%/sbin/dnscrypt-proxy +procname=%%PREFIX%%/sbin/dnscrypt-proxy + +for i in $dnscrypt_proxy_instances; do + name=${i} + + eval ${name}_enable=${dnscrypt_proxy_enable_tmp} + rcvar=${name}_enable + + load_rc_config ${i} + + eval dnscrypt_proxy_uid_tmp=\${${i}_uid} + eval dnscrypt_proxy_resolver_tmp=\${${i}_resolver} + eval dnscrypt_proxy_pidfile_tmp=\${${i}_pidfile} + eval dnscrypt_proxy_logfile_tmp=\${${i}_logfile} + +: ${dnscrypt_proxy_uid_tmp:=_dnscrypt-proxy} # User to run daemon as +: ${dnscrypt_proxy_resolver_tmp:=opendns} # resolver to use +: ${dnscrypt_proxy_pidfile_tmp:=/var/run/${i}.pid} # Path to pid file +: ${dnscrypt_proxy_logfile_tmp:=/var/log/${i}.log} # Path to log file + + command_args="-d -p ${dnscrypt_proxy_pidfile_tmp} -l ${dnscrypt_proxy_logfile_tmp} -u ${dnscrypt_proxy_uid_tmp} -R ${dnscrypt_proxy_resolver_tmp}" + + pidfile=${dnscrypt_proxy_pidfile_tmp} + + _rc_restart_done=false # workaround for: service dnscrypt-proxy restart + + run_rc_command "$1" +done diff -urN dnscrypt-proxy.old/files/pkg-message.in dnscrypt-proxy/files/pkg-message.in --- dnscrypt-proxy.old/files/pkg-message.in 2014-01-22 15:52:06.000000000 +0000 +++ dnscrypt-proxy/files/pkg-message.in 2015-04-06 19:06:04.000000000 +0000 @@ -1,18 +1,13 @@ This port/software comes all 'working out of the box'. -By default this port is using OpenDNS' resolvers, -but other nameservers are also possible. - -To view available options, run: -%%PREFIX%%/sbin/dnscrypt-proxy --help -or read the manual: `man dnscrypt-proxy` - -You might like to adjust -%%ETCDIR%%/rc.d/dnscrypt-proxy -accordingly with your needs and/or preferences. +By default this port is using OpenDNS' resolvers, other services are possible. To enable dnscrypt-proxy at boot: echo dnscrypt_proxy_enable=\"YES\" >> /etc/rc.conf +echo dnscrypt_proxy_flags=\"-a 127.0.0.2\" >> /etc/rc.conf +To view available options, run: +%%PREFIX%%/sbin/dnscrypt-proxy --help +or read the manual: `man dnscrypt-proxy` diff -urN dnscrypt-proxy.old/files/pkg-message_multi.in dnscrypt-proxy/files/pkg-message_multi.in --- dnscrypt-proxy.old/files/pkg-message_multi.in 1970-01-01 00:00:00.000000000 +0000 +++ dnscrypt-proxy/files/pkg-message_multi.in 2015-04-06 19:05:51.000000000 +0000 @@ -0,0 +1,19 @@ + +This port/software comes all 'working out of the box'. + +By default this port is using OpenDNS' resolvers, other services are possible. + +To enable dnscrypt-proxy at boot: +echo dnscrypt_proxy_enable=\"YES\" >> /etc/rc.conf +echo dnscrypt_proxy_instances=\"dnscrypt_proxy_1 dnscrypt_proxy_2 dnscrypt_proxy_3\" >> /etc/rc.conf +echo dnscrypt_proxy_1_resolver=\"soltysiak\" >> /etc/rc.conf +echo dnscrypt_proxy_1_flags=\"-a 127.0.0.2\" >> /etc/rc.conf +echo dnscrypt_proxy_2_resolver=\"okturtles\" >> /etc/rc.conf +echo dnscrypt_proxy_2_flags=\"-a 127.0.0.3\" >> /etc/rc.conf +echo dnscrypt_proxy_3_resolver=\"cypherpunk\" >> /etc/rc.conf +echo dnscrypt_proxy_3_flags=\"-a 127.0.0.4\" >> /etc/rc.conf + +To view available options, run: +%%PREFIX%%/sbin/dnscrypt-proxy --help +or read the manual: `man dnscrypt-proxy` +