View | Details | Raw Unified | Return to bug 266415 | Differences between
and this patch

Collapse All | Expand All

(-)b/dns/ddclient/Makefile (-28 / +24 lines)
Lines 1-6 Link Here
1
PORTNAME=	ddclient
1
PORTNAME=	ddclient
2
DISTVERSIONPREFIX=	v
2
PORTVERSION=	3.10.0.p2
3
DISTVERSION=	3.9.1
4
CATEGORIES=	dns
3
CATEGORIES=	dns
5
4
6
MAINTAINER=	mjl@luckie.org.nz
5
MAINTAINER=	mjl@luckie.org.nz
Lines 10-52 WWW= https://github.com/ddclient/ddclient Link Here
10
LICENSE=	GPLv2+
9
LICENSE=	GPLv2+
11
LICENSE_FILE=	${WRKSRC}/COPYING
10
LICENSE_FILE=	${WRKSRC}/COPYING
12
11
13
RUN_DEPENDS=	p5-Data-Validate-IP>0:net-mgmt/p5-Data-Validate-IP
12
RUN_DEPENDS=	p5-JSON-PP>0:converters/p5-JSON-PP
14
13
15
USES=		perl5 tar:bzip2
14
USES=			autoreconf perl5 tar:bzip2
16
USE_GITHUB=	yes
15
USE_AUTOCONF_VER=	259
17
USE_PERL5=	run
16
USE_PERL5=		run
18
USE_RC_SUBR=	${PORTNAME}
17
USE_RC_SUBR=		${PORTNAME}
18
USE_GITHUB=		yes
19
GH_TAGNAME=		v3.10.0_2
20
21
GNU_CONFIGURE=	yes
19
22
20
NO_ARCH=	yes
23
NO_ARCH=	yes
21
NO_BUILD=	yes
24
SUB_FILES=	ddclient_force pkg-message
22
SUB_FILES=	pkg-message ddclient_force
23
25
24
PLIST_FILES=	"@sample(,,600) etc/ddclient.conf.sample" \
26
PORTDOCS=	CONTRIBUTING.md COPYRIGHT ChangeLog.md README.cisco README.md \
25
		etc/periodic/daily/ddclient_force \
27
		README.ssl sample-ddclient-wrapper.sh \
26
		sbin/ddclient
27
PORTDOCS=	COPYRIGHT ChangeLog README.cisco README.ssl README.md \
28
		sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \
28
		sample-etc_cron.d_ddclient sample-etc_dhclient-exit-hooks \
29
		sample-etc_dhcpc_dhcpcd-eth0.exe sample-etc_ppp_ip-up.local
29
		sample-etc_dhcpc_dhcpcd-eth0.exe sample-etc_ppp_ip-up.local \
30
30
		sample-etc_rc.d_ddclient.freebsd sample-get-ip-from-fritzbox
31
OPTIONS_DEFINE=	SSL DOCS
32
OPTIONS_DEFAULT=SSL
33
31
34
SSL_RUN_DEPENDS=ca_root_nss>0:security/ca_root_nss \
32
OPTIONS_DEFINE=		DOCS SSL
35
		p5-IO-Socket-SSL>0:security/p5-IO-Socket-SSL
33
OPTIONS_DEFAULT=	SSL
36
34
37
post-patch:
35
SSL_RUN_DEPENDS=	ca_root_nss>0:security/ca_root_nss \
38
	@${GREP} -lR '/usr' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
36
			p5-IO-Socket-SSL>0:security/p5-IO-Socket-SSL
39
		's|/usr|${PREFIX}|g'
40
	@${REINPLACE_CMD} -e 's|%%ETCDIR%%|${PREFIX}/etc| ; \
41
		 s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/ddclient
42
	@${REINPLACE_CMD} -e '/^\#\!\/usr\/local\/local/d' \
43
		${WRKSRC}/ddclient
44
37
45
do-install:
38
do-install:
46
	(cd ${WRKSRC} && ${INSTALL_DATA} sample-etc_ddclient.conf \
39
	(cd ${WRKSRC} && ${INSTALL_DATA} ddclient.conf \
47
		${STAGEDIR}${PREFIX}/etc/ddclient.conf.sample)
40
		${STAGEDIR}${PREFIX}/etc/ddclient.conf.sample)
48
	(cd ${WRKSRC} && ${INSTALL_SCRIPT} ddclient \
41
	(cd ${WRKSRC} && ${INSTALL_SCRIPT} ddclient \
49
		${STAGEDIR}${PREFIX}/sbin)
42
		${STAGEDIR}${PREFIX}/bin)
50
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily
43
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily
51
	(cd ${WRKDIR} && ${INSTALL_SCRIPT} ddclient_force \
44
	(cd ${WRKDIR} && ${INSTALL_SCRIPT} ddclient_force \
52
		${STAGEDIR}${PREFIX}/etc/periodic/daily/ddclient_force)
45
		${STAGEDIR}${PREFIX}/etc/periodic/daily/ddclient_force)
Lines 55-58 do-install: Link Here
55
	(cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${STAGEDIR}${DOCSDIR})
48
	(cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${STAGEDIR}${DOCSDIR})
56
.endfor
49
.endfor
57
50
51
post-install:
52
	${MKDIR} ${STAGEDIR}/var/cache/ddclient
53
58
.include <bsd.port.mk>
54
.include <bsd.port.mk>
(-)b/dns/ddclient/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1603527045
1
TIMESTAMP = 1662773732
2
SHA256 (ddclient-ddclient-v3.9.1_GH0.tar.gz) = e4969e15cc491fc52bdcd649d4c2b0e4b1bf0c9f9dba23471c634871acc52470
2
SHA256 (ddclient-ddclient-3.10.0.p2-v3.10.0_2_GH0.tar.gz) = 3463ef12d36b421091fd761ac34a62c40fedc9dc7425f77349a052eb49c7dff5
3
SIZE (ddclient-ddclient-v3.9.1_GH0.tar.gz) = 63469
3
SIZE (ddclient-ddclient-3.10.0.p2-v3.10.0_2_GH0.tar.gz) = 274330
(-)b/dns/ddclient/files/ddclient.in (-1 / +1 lines)
Lines 17-23 Link Here
17
name="ddclient"
17
name="ddclient"
18
rcvar=ddclient_enable
18
rcvar=ddclient_enable
19
19
20
command="%%PREFIX%%/sbin/${name}"
20
command="%%PREFIX%%/bin/${name}"
21
required_files="%%PREFIX%%/etc/${name}.conf"
21
required_files="%%PREFIX%%/etc/${name}.conf"
22
22
23
load_rc_config ${name}
23
load_rc_config ${name}
(-)b/dns/ddclient/files/ddclient_force.in (-1 / +2 lines)
Lines 22-28 case "$daily_ddclient_force_enable" in Link Here
22
			sleep `jot -r 1 0 900`
22
			sleep `jot -r 1 0 900`
23
		fi
23
		fi
24
24
25
		%%PREFIX%%/sbin/ddclient -force || rc=3
25
		%%PREFIX%%/bin/ddclient -force || rc=3
26
		;;
26
		;;
27
	*)
27
	*)
28
		rc=0
28
		rc=0
Lines 30-32 case "$daily_ddclient_force_enable" in Link Here
30
esac
30
esac
31
31
32
exit $rc
32
exit $rc
33
(-)b/dns/ddclient/files/patch-ddclient (-72 / +42 lines)
Lines 1-85 Link Here
1
--- ddclient.orig	2018-05-23 10:25:05 UTC
1
--- ddclient.in.orig	2022-05-15 20:12:34.000000000 -0400
2
+++ ddclient
2
+++ ddclient.in
3
@@ -25,6 +25,7 @@ use Getopt::Long;
3
@@ -29,6 +29,7 @@
4
 use IO::Socket::INET;
5
 use Socket qw(AF_INET AF_INET6 PF_INET PF_INET6);
4
 use Sys::Hostname;
6
 use Sys::Hostname;
5
 use IO::Socket;
6
 use Data::Validate::IP;
7
+use POSIX 'setsid';
7
+use POSIX 'setsid';
8
 
8
 
9
 my $version  = "3.8.3";
9
 use version 0.77; our $VERSION = version->declare('v3.10.0_2');
10
 my $programd  = $0; 
10
 (my $version = $VERSION->stringify()) =~ s/^v//;
11
@@ -33,9 +34,9 @@ my $program   = $programd;
11
@@ -1022,6 +1023,9 @@
12
 $program  =~ s/d$//;
12
         ;
13
 my $now       = time;
13
     } elsif (opt('daemon')) {
14
 my $hostname  = hostname();
14
         $SIG{'CHLD'} = 'IGNORE';
15
-my $etc       = ($program =~ /test/i) ? './'   : '/etc/ddclient/';
15
+        chdir '/';
16
-my $cachedir  = ($program =~ /test/i) ? './'   : '/var/cache/ddclient/';
16
+        open(STDIN,  "</dev/null");
17
-my $savedir   = ($program =~ /test/i) ? 'URL/' : '/tmp/';
17
+        open(STDOUT, ">/dev/null");
18
+my $etc       = ($program =~ /test/i) ? './'   : '%%ETCDIR%%/';
18
         my $pid = fork;
19
+my $cachedir  = ($program =~ /test/i) ? './'   : '/var/tmp/';
19
         if ($pid < 0) {
20
+my $savedir   = ($program =~ /test/i) ? 'URL/' : '/var/tmp/';
20
             print STDERR "${program}: can not fork ($!)\n";
21
 my $msgs      = '';
21
@@ -1029,10 +1033,9 @@
22
 my $last_msgs = '';
22
         } elsif ($pid) {
23
 
23
             exit 0;
24
@@ -43,7 +44,7 @@ use vars qw($file $lineno);
24
         }
25
 local $file   = '';
25
+        setsid;
26
 local $lineno = '';
26
         $SIG{'CHLD'} = 'DEFAULT';
27
 
27
-        open(STDOUT, ">/dev/null");
28
-$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:/usr/bin:/etc:/usr/lib:";
28
-        open(STDERR, ">/dev/null");
29
+$ENV{'PATH'} = (exists($ENV{PATH}) ? "$ENV{PATH}:" : "") . "/sbin:/usr/sbin:/bin:";
29
-        open(STDIN,  "</dev/null");
30
 
30
+        open(STDERR, "&STDOUT");
31
 sub T_ANY	{'any'};
31
         write_pid();
32
 sub T_STRING	{'string'};
33
@@ -792,6 +793,9 @@ if (opt('foreground') || opt('force')) {
34
     ;
35
 } elsif (opt('daemon')) {
36
     $SIG{'CHLD'}   = 'IGNORE';
37
+    chdir '/';
38
+    open(STDIN,  "</dev/null");
39
+    open(STDOUT, ">/dev/null");
40
     my $pid = fork;
41
     if ($pid < 0) {
42
 	print STDERR "${program}: can not fork ($!)\n";
43
@@ -799,10 +803,9 @@ if (opt('foreground') || opt('force')) {
44
     } elsif ($pid) {
45
 	exit 0;
46
     }
32
     }
47
+    setsid;
48
     $SIG{'CHLD'}   = 'DEFAULT';
49
-    open(STDOUT, ">/dev/null");
50
-    open(STDERR, ">/dev/null");
51
-    open(STDIN,  "</dev/null");
52
+    open(STDERR, "&STDOUT");
53
 }
54
 
33
 
55
 # write out the pid file if we're daemon'ized
34
@@ -2011,17 +2014,17 @@
56
@@ -1595,17 +1598,17 @@ sub pipecmd {
57
     ## execute the command.
35
     ## execute the command.
58
     local *FD;
36
     local *FD;
59
     if (! open(FD, $cmd)) {
37
     if (!open(FD, $cmd)) {
60
-	printf STDERR "$program: cannot execute command %s.\n", $cmd;
38
-        printf STDERR "%s: cannot execute command %s.\n", $program, $cmd;
61
+	warning("$program: cannot execute command %s.\n", $cmd);
39
+        warning("%s: cannot execute command %s.\n", $program, $cmd);
62
 
40
 
63
     } elsif ($stdin && (! print FD "$stdin\n")) {
41
     } elsif ($stdin && (!print FD "$stdin\n")) {
64
-	printf STDERR "$program: failed writting to %s.\n", $cmd;
42
-        printf STDERR "%s: failed writting to %s.\n", $program, $cmd;
65
+	warning("$program: failed writing to %s.\n", $cmd);
43
+        warning("%s: failed writting to %s.\n", $program, $cmd);
66
 	close(FD);
44
         close(FD);
67
 
45
 
68
     } elsif (! close(FD)) {
46
     } elsif (!close(FD)) {
69
-	printf STDERR "$program: failed closing %s.($@)\n", $cmd;
47
-        printf STDERR "%s: failed closing %s.(%s)\n", $program, $cmd, $@;
70
+	warning("$program: failed closing %s.($@)\n", $cmd);
48
+        warning("%s: failed closing %s.(%s)\n", $program, $cmd, $@);
71
 
49
 
72
     } elsif (opt('exec') && $?) {
50
     } elsif (opt('exec') && $?) {
73
-	printf STDERR "$program: failed %s. ($@)\n", $cmd;
51
-        printf STDERR "%s: failed %s. (%s)\n", $program, $cmd, $@;
74
+	warning("$program: failed %s. ($@)\n", $cmd);
52
+        warning("%s: failed %s. (%s)\n", $program, $cmd, $@);
75
 
53
 
76
     } else {
54
     } else {
77
 	$ok = 1;
55
         $ok = 1;
78
@@ -2034,6 +2037,7 @@ sub geturl {
79
 	    $sd = IO::Socket::SSL->new(
80
             PeerAddr => $peer,
81
             PeerPort => $port,
82
+            SSL_ca_file => '%%LOCALBASE%%/share/certs/ca-root-nss.crt',
83
             Proto => 'tcp',
84
             MultiHomed => 1,
85
             Timeout => opt('timeout'),
(-)b/dns/ddclient/files/pkg-message.in (+1 lines)
Lines 18-20 your /etc/periodic.conf Link Here
18
EOM
18
EOM
19
}
19
}
20
]
20
]
21
(-)b/dns/ddclient/pkg-plist (-1 / +3 lines)
Added Link Here
0
- 
1
bin/ddclient
2
@dir /var/cache/ddclient
3
@sample(,,600) etc/ddclient.conf.sample etc/ddclient.conf

Return to bug 266415