diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 6fa37d705e58..cc319992155a 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -7,6 +7,7 @@ PORTNAME= ddclient PORTVERSION= 3.8.0 +PORTREVISION= 1 CATEGORIES= dns MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} @@ -17,14 +18,15 @@ COMMENT= Update dynamic DNS entries RUN_DEPENDS= ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL .endif +LICENSE= GPLv2 + USE_BZIP2= yes USE_PERL5_RUN= yes NO_BUILD= yes USE_RC_SUBR= ${PORTNAME} -SUB_FILES= pkg-message +SUB_FILES= pkg-message ddclient_force PKGMESSAGE= ${WRKDIR}/pkg-message -PLIST_FILES= etc/ddclient.conf.sample sbin/ddclient PORTDOCS= COPYING COPYRIGHT Changelog README README.cisco README.ssl \ sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \ @@ -46,6 +48,10 @@ do-install: @${INSTALL} -d ${DOCSDIR} @${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}/ .endif + +post-install: + ${MKDIR} ${PREFIX}/etc/periodic/daily + ${INSTALL_SCRIPT} ${WRKDIR}/ddclient_force ${PREFIX}/etc/periodic/daily/ddclient_force @${CAT} ${PKGMESSAGE} .include diff --git a/dns/ddclient/files/ddclient_force.in b/dns/ddclient/files/ddclient_force.in new file mode 100644 index 000000000000..871e8643bb92 --- /dev/null +++ b/dns/ddclient/files/ddclient_force.in @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_ddclient_force_enable" in + [Yy][Ee][Ss]) + echo + echo 'Forcing ddclient update:' + + out=`%%PREFIX%%/sbin/ddclient -force` + echo "$out" + rc=0 + ;; + *) + rc=0 + ;; +esac + +exit $rc diff --git a/dns/ddclient/files/patch-ddclient b/dns/ddclient/files/patch-ddclient new file mode 100644 index 000000000000..5a1c51e7aa7b --- /dev/null +++ b/dns/ddclient/files/patch-ddclient @@ -0,0 +1,61 @@ +--- ./ddclient.orig 2009-01-27 20:14:02.000000000 +0100 ++++ ./ddclient 2010-08-17 20:13:00.000000000 +0200 +@@ -1,4 +1,3 @@ +-#!/usr/bin/perl -w + #!/usr/local/bin/perl -w + ###################################################################### + # $Id: ddclient 106 2008-12-04 18:05:23Z wimpunk $ +@@ -19,6 +18,7 @@ + use Getopt::Long; + use Sys::Hostname; + use IO::Socket; ++use POSIX 'setsid'; + + my $version = "3.8.0"; + my $programd = $0; +@@ -625,6 +625,9 @@ + $SIG{'KILL'} = sub { $caught_kill = 1; }; + if (opt('daemon') && !opt('force')) { + $SIG{'CHLD'} = 'IGNORE'; ++ chdir '/'; ++ open(STDIN, "/dev/null"); + my $pid = fork; + if ($pid < 0) { + print STDERR "${program}: can not fork ($!)\n"; +@@ -632,11 +635,10 @@ + } elsif ($pid) { + exit 0; + } ++ setsid; + $SIG{'CHLD'} = 'DEFAULT'; + $opt{'syslog'} = 1; +- open(STDOUT, ">/dev/null"); +- open(STDERR, ">/dev/null"); +- open(STDIN, "