aboutsummaryrefslogtreecommitdiffstats
path: root/dns
diff options
context:
space:
mode:
authorohauer <ohauer@FreeBSD.org>2010-08-18 03:22:56 +0800
committerohauer <ohauer@FreeBSD.org>2010-08-18 03:22:56 +0800
commitf2dd952c97375dc9c33892db88f448507701e1fc (patch)
treed496cc1f2cce982e198bc2ad189dc1c216208748 /dns
parent05bdd4d16adc9452784dc6eff62299b0634db8fa (diff)
downloadfreebsd-ports-gnome-f2dd952c97375dc9c33892db88f448507701e1fc.tar.gz
freebsd-ports-gnome-f2dd952c97375dc9c33892db88f448507701e1fc.tar.zst
freebsd-ports-gnome-f2dd952c97375dc9c33892db88f448507701e1fc.zip
- add periodic daily script to force update
- connect to license framework - add special patch from glarkin to ensure daemon detach from tty, change some printf to use the warning function instead. PR: 148586 Submitted by: Chris Howey <howeyc _at_ gmail.com> Approved by: maintainer, glarkin (mentor)
Diffstat (limited to 'dns')
-rw-r--r--dns/ddclient/Makefile10
-rw-r--r--dns/ddclient/files/ddclient_force.in28
-rw-r--r--dns/ddclient/files/patch-ddclient61
-rw-r--r--dns/ddclient/files/pkg-message.in6
-rw-r--r--dns/ddclient/pkg-plist6
5 files changed, 109 insertions, 2 deletions
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 <bsd.port.mk>
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");
++ open(STDOUT, ">/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, "</dev/null");
++ open(STDERR, "&STDOUT");
+
+ write_pid();
+ }
+@@ -1404,17 +1406,17 @@
+ ## execute the command.
+ local *FD;
+ if (! open(FD, $cmd)) {
+- printf STDERR "$program: cannot execute command %s.\n", $cmd;
++ warning("$program: cannot execute command %s.\n", $cmd);
+
+ } elsif ($stdin && (! print FD "$stdin\n")) {
+- printf STDERR "$program: failed writting to %s.\n", $cmd;
++ warning("$program: failed writing to %s.\n", $cmd);
+ close(FD);
+
+ } elsif (! close(FD)) {
+- printf STDERR "$program: failed closing %s.($@)\n", $cmd;
++ warning("$program: failed closing %s.($@)\n", $cmd);
+
+ } elsif (opt('exec') && $?) {
+- printf STDERR "$program: failed %s. ($@)\n", $cmd;
++ warning("$program: failed %s. ($@)\n", $cmd);
+
+ } else {
+ $ok = 1;
diff --git a/dns/ddclient/files/pkg-message.in b/dns/ddclient/files/pkg-message.in
index bfcaeda65273..8420c75d3ed9 100644
--- a/dns/ddclient/files/pkg-message.in
+++ b/dns/ddclient/files/pkg-message.in
@@ -12,4 +12,10 @@ following line to /etc/rc.conf
ddclient_enable="YES"
+If you would like to force ddclient to update your account
+daily regardless of IP changes add the following line to
+your /etc/periodic.conf
+
+ daily_ddclient_force_enable="YES"
+
***********************************************************
diff --git a/dns/ddclient/pkg-plist b/dns/ddclient/pkg-plist
new file mode 100644
index 000000000000..e827e6414423
--- /dev/null
+++ b/dns/ddclient/pkg-plist
@@ -0,0 +1,6 @@
+@comment $FreeBSD$
+etc/ddclient.conf.sample
+etc/periodic/daily/ddclient_force
+sbin/ddclient
+@dirrmtry etc/periodic/daily
+@dirrmtry etc/periodic