diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index a801f8d..0000000 --- a/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -ddclient-3.6.6.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cae593d --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +ddclient-3.8.0.tar.bz2 +/ddclient-3.8.1.tar.bz2 +/ddclient-3.8.2.tar.bz2 +/ddclient-3.8.3.tar.bz2 +/ddclient-3.9.0.tar.gz +/ddclient-3.9.1.tar.gz +/ddclient-3.10.0.tar.gz +/ddclient-3.11.1.tar.gz +/ddclient-3.11.2.tar.gz +/ddclient-4.0.0.tar.gz diff --git a/Makefile b/Makefile deleted file mode 100644 index 17b07ef..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: ddclient -# $Id$ -NAME := ddclient -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/ddclient-tmpfiles.conf b/ddclient-tmpfiles.conf new file mode 100644 index 0000000..6eed278 --- /dev/null +++ b/ddclient-tmpfiles.conf @@ -0,0 +1 @@ +d /run/ddclient 0755 ddclient ddclient - diff --git a/ddclient.NetworkManager b/ddclient.NetworkManager new file mode 100644 index 0000000..fe7c614 --- /dev/null +++ b/ddclient.NetworkManager @@ -0,0 +1,15 @@ +#!/bin/sh + +export LC_ALL=C + +if [ "$2" = "down" ]; then + /sbin/ip route ls | grep -q '^default' || { + [ -f /run/ddclient/ddclient.pid ] && /usr/bin/systemctl stop ddclient.service || : + } && { :; } +fi + +if [ "$2" = "up" ]; then + /sbin/ip -o route show dev "$1" | grep -q '^default' && { + /usr/bin/systemctl is-enabled ddclient >/dev/null && /usr/bin/systemctl start ddclient.service || : + } || { :; } +fi diff --git a/ddclient.cache.patch b/ddclient.cache.patch deleted file mode 100644 index ab03b50..0000000 --- a/ddclient.cache.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ddclient-3.6.6/ddclient.cache 2005-03-20 13:01:23.000000000 +0200 -+++ ddclient-3.6.6/ddclient 2005-07-30 23:27:07.000000000 +0300 -@@ -23,6 +23,7 @@ - my $now = time; - my $hostname = hostname(); - my $etc = ($program =~ /test/i) ? './' : '/etc/ddclient/'; -+my $cache = ($program =~ /test/i) ? './' : '/var/cache/'; - my $savedir = ($program =~ /test/i) ? 'URL/' : '/tmp/'; - my $msgs = ''; - my $last_msgs = ''; -@@ -217,7 +218,7 @@ - 'global-defaults' => { - 'daemon' => setv(T_DELAY, 0, 0, 1, 0, interval('60s')), - 'file' => setv(T_FILE, 0, 0, 1, "$etc$program.conf", undef), -- 'cache' => setv(T_FILE, 0, 0, 1, "$etc$program.cache", undef), -+ 'cache' => setv(T_FILE, 0, 0, 1, "$cache$program.cache", undef), - 'pid' => setv(T_FILE, 0, 0, 1, "", undef), - 'proxy' => setv(T_FQDNP, 0, 0, 1, '', undef), - 'protocol' => setv(T_PROTO, 0, 0, 1, 'dyndns2', undef), diff --git a/ddclient.initscript b/ddclient.initscript deleted file mode 100755 index 6094348..0000000 --- a/ddclient.initscript +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# -# ddclient This shell script takes care of starting and stopping ddclient. -# -# chkconfig: - 65 35 -# description: ddclient provides support for updating dynamic DNS services -# processname: ddclient -# config: /etc/sysconfig/ddclient - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ "$NETWORKING" = "no" ] && exit 0 - -. /etc/sysconfig/ddclient - -exec="/usr/sbin/ddclient" -prog=$(basename $exec) -lockfile=/var/lock/subsys/$prog - -start() { - echo -n $"Starting $prog: " - daemon $exec $DDCLIENT_OPTIONS - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -fdrstatus() { - status $prog -} - -# See how we were called. -case "$1" in - start|stop|restart|reload) - $1 - ;; - force-reload) - force_reload - ;; - status) - fdrstatus - ;; - condrestart) - [ ! -f $lockfile ] || restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}" - exit 2 -esac diff --git a/ddclient.rwtab b/ddclient.rwtab new file mode 100644 index 0000000..927514c --- /dev/null +++ b/ddclient.rwtab @@ -0,0 +1 @@ +files /var/cache/ddclient/ddclient.cache diff --git a/ddclient.service b/ddclient.service new file mode 100644 index 0000000..0ccec5a --- /dev/null +++ b/ddclient.service @@ -0,0 +1,14 @@ +[Unit] +Description=Dynamic DNS Update Client +After=syslog.target network-online.target nss-lookup.target + +[Service] +User=ddclient +Group=ddclient +Type=exec +EnvironmentFile=-/etc/sysconfig/ddclient +ExecStartPre=/bin/touch /var/cache/ddclient/ddclient.cache +ExecStart=/usr/sbin/ddclient $DDCLIENT_OPTIONS --foreground + +[Install] +WantedBy=multi-user.target diff --git a/ddclient.spec b/ddclient.spec index 513bfa6..e64e7d9 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -1,81 +1,337 @@ -Name: ddclient -Version: 3.6.6 -Release: 2%{?dist} -Summary: Client to update dynamic DNS host entries +%global cachedir %{_localstatedir}/cache/ddclient +%global rundir %{_rundir}/ddclient -Group: System Environment/Daemons -License: GPL -URL: http://ddclient.sourceforge.net/ -Source0: http://download.sf.net/ddclient/%{name}-%{version}.tar.bz2 -Source2: ddclient.initscript -Source3: ddclient.sysconfig -# Patch hardcodes cache location to /var/cache. -# This is reflected in install section below. -Patch: ddclient.cache.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch +Summary: Client to update dynamic DNS host entries +Name: ddclient +Version: 4.0.0 +Release: 5%{?dist} +# Automatically converted from old format: GPLv2+ - review is highly recommended. +License: GPL-2.0-or-later +URL: https://ddclient.net/ +Source0: https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: ddclient.rwtab +Source2: ddclient.service +Source3: ddclient.sysconfig +Source4: ddclient.NetworkManager +Source5: ddclient-tmpfiles.conf + +BuildArch: noarch + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl(Sys::Hostname) +BuildRequires: perl(version) +BuildRequires: systemd +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +# For tests +BuildRequires: iproute +BuildRequires: perl(HTTP::Daemon) +BuildRequires: perl(HTTP::Daemon::SSL) +BuildRequires: perl(HTTP::Message::PSGI) +BuildRequires: perl(HTTP::Request) +BuildRequires: perl(HTTP::Response) +BuildRequires: perl(IO::Socket::INET6) +BuildRequires: perl(Test::MockModule) +BuildRequires: perl(Test::TCP) +BuildRequires: perl(Test::Warnings) +BuildRequires: perl(Time::HiRes) + +Requires: perl(Data::Validate::IP) +Requires: perl(Digest::SHA1) +Requires: perl(IO::Socket::INET6) +Requires: perl(IO::Socket::SSL) +Requires: perl(JSON::PP) + +# Old NetworkManager expects the dispatcher scripts in a different place +Conflicts: NetworkManager < 1.20 %description ddclient is a Perl client used to update dynamic DNS entries for accounts -on many dynamic DNS services. - +on many different dynamic DNS services. Features include: Operating as a +daemon, manual and automatic updates, static and dynamic updates, optimized +updates for multiple addresses, MX, wildcards, abuse avoidance, retrying +the failed updates and sending update status to syslog and through e-mail. %prep -%setup -q -%patch -p1 -rm sample-etc_rc.d_init.d_ddclient* -# Backwards compatibility from pre-3.6.6-1 -sed -i -e 's|/etc/ddclient/|%{_sysconfdir}/|' ddclient +%autosetup -p 1 +# Send less mail by default, eg. not on every shutdown. +sed -e 's|^mail=|#mail=|' -i ddclient.conf.in +./autogen + +# Create a sysusers.d config file +cat >ddclient.sysusers.conf < /dev/null 2>&1 - /sbin/chkconfig --del ddclient -fi +%systemd_preun %{name}.service %postun -if [ $1 -ge 1 ]; then - /sbin/service ddclient condrestart >/dev/null -fi +%systemd_postun_with_restart %{name}.service + %files -%defattr(-,root,root,-) -%doc README* COPYING COPYRIGHT Changelog sample-* -%{_sbindir}/ddclient -%config(noreplace) %{_sysconfdir}/ddclient.conf -%config(noreplace) %{_sysconfdir}/sysconfig/ddclient -%ghost %attr(0600, root, root) /var/cache/ddclient.cache -%{_initrddir}/ddclient +%license COPYING COPYRIGHT +%doc README* ChangeLog.md sample-etc_ppp_ip-up.local +%doc sample-etc_dhclient-exit-hooks sample-etc_cron.d_ddclient +%doc sample-ddclient-wrapper.sh sample-etc_dhcpc_dhcpcd-eth0.exe + +%{_sbindir}/%{name} +%{_tmpfilesdir}/%{name}.conf +%{_unitdir}/%{name}.service + +# sysconfdir +%config(noreplace) %{_sysconfdir}/rwtab.d/%{name} +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%attr(600,%{name},%{name}) %config(noreplace) %{_sysconfdir}/%{name}.conf +%{_prefix}/lib/NetworkManager/dispatcher.d/50-%{name} + +# localstatedir +%attr(0700,%{name},%{name}) %dir %{cachedir} +%attr(0600,%{name},%{name}) %ghost %{cachedir}/%{name}.cache +%ghost %attr(0755,%{name},%{name}) %dir %{rundir} +%{_sysusersdir}/ddclient.conf %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 4.0.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Tue Apr 01 2025 Scott Talbert - 4.0.0-4 +- Switch systemd service to use exec and remove pid file (#2355909) + +* Tue Mar 25 2025 Scott Talbert - 4.0.0-3 +- Restore expected ddclient.conf dir to pre-4.0 location (#2354194) + +* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 4.0.0-2 +- Add sysusers.d config file to allow rpm to create users/groups automatically + +* Wed Jan 22 2025 Scott Talbert - 4.0.0-1 +- Update to new upstream release 4.0.0 (#2334061) + +* Wed Jan 22 2025 Scott Talbert - 3.11.2-7 +- Fix FTBFS with newer autoconf + +* Thu Jan 16 2025 Fedora Release Engineering - 3.11.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jul 25 2024 Miroslav Suchý - 3.11.2-5 +- convert license to SPDX + +* Wed Jul 17 2024 Fedora Release Engineering - 3.11.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed Jan 24 2024 Fedora Release Engineering - 3.11.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 3.11.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Nov 29 2023 Scott Talbert - 3.11.2-1 +- Update to new upstream release 3.11.2 (#2251294) + +* Sat Nov 18 2023 Scott Talbert - 3.11.1-1 +- Update to new upstream release 3.11.1 (#2244514) + +* Thu Sep 14 2023 kenneth topp - 3.10.0-1 +- Update to new upstream release 3.10.0 + +* Thu Jan 19 2023 Fedora Release Engineering - 3.9.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 3.9.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 3.9.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Jul 21 2021 Fedora Release Engineering - 3.9.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 3.9.1-5 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Tue Jan 26 2021 Fedora Release Engineering - 3.9.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Sep 12 2020 Scott Talbert - 3.9.1-3 +- Move pidfile from /var/run to /run (#1876265) + +* Mon Jul 27 2020 Fedora Release Engineering - 3.9.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jan 31 2020 Scott Talbert - 3.9.1-1 +- Update to new upstream release 3.9.1 (#1796923) + +* Tue Jan 28 2020 Fedora Release Engineering - 3.9.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Aug 22 2019 Lubomir Rintel - 3.9.0-4 +- Move the NetworkManager dispatcher script out of /etc + +* Wed Jul 24 2019 Fedora Release Engineering - 3.9.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 3.9.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Aug 10 2018 Scott Talbert - 3.9.0-1 +- New upstream release 3.9.0 + +* Thu Jul 12 2018 Fedora Release Engineering - 3.8.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 3.8.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Sep 09 2017 Scott Talbert - 3.8.3-5 +- Start after network-online.target rather than network.target (#1476999) + +* Wed Jul 26 2017 Fedora Release Engineering - 3.8.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 3.8.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Dec 30 2016 Scott Talbert - 3.8.3-2 +- Prevent NetworkManager from starting ddclient if it is disabled (#1409178) + +* Mon Mar 28 2016 Scott Talbert - 3.8.3-1 +- New upstream release 3.8.3 (#1226537) +- Change NetworkManager dispatcher to look for PID file (#1316149) + +* Sat Jun 07 2014 Fedora Release Engineering - 3.8.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Apr 21 2014 Jamie Nguyen - 3.8.2-1 +- update to upstream release 3.8.2 +- remove old EPEL 6 related macros +- remove all logic for older versions of Fedora/EPEL +- make spec more readable + +* Wed Dec 25 2013 Robert Scheck 3.8.1-9 +- Use the new systemd macros (#850084, thanks to Lukáš Nykrýn) +- Adapted the spec file to handle systemd and SysV initscripts + +* Sat Aug 10 2013 Paul Howarth - 3.8.1-8 +- BR: systemd-units for %%{_unitdir} macro definition (fixes FTBFS #992118) +- Put tmpfiles config in %%{_tmpfilesdir}, not under /etc +- Package installation creates %%{_localstatedir}/run/%%{name} (#909272, #957355) +- Service files are not executable +- Require perl(Digest::SHA1) (#909258) +- Wait for name resolution to be available before starting (#905553) + +* Sat Aug 03 2013 Fedora Release Engineering - 3.8.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 17 2013 Petr Pisar - 3.8.1-6 +- Perl 5.18 rebuild + +* Wed Feb 13 2013 Fedora Release Engineering - 3.8.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Jul 18 2012 Fedora Release Engineering - 3.8.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue May 15 2012 Jon Ciesla - 3.8.1-3 +- Add ghost to /var/run/ddclient + +* Mon May 14 2012 Jon Ciesla - 3.8.1-2 +- Add tmpfiles.d. + +* Thu Mar 29 2012 Jon Ciesla - 3.8.1-1 +- Latest upstream. +- Migrate to systemd, 718756. + +* Fri Jan 13 2012 Fedora Release Engineering - 3.8.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Feb 10 2011 Robert Scheck 3.8.0-4 +- Replaced Requires(hint) by Requires as RPM 4.9 dropped support + +* Tue Feb 08 2011 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat May 29 2010 Robert Scheck 3.8.0-2 +- Fixed wrong permissions at NetworkManager dispatcher (#506286) +- Updated %%description to be more verbose and detailed (#588053) + +* Sat May 01 2010 Robert Scheck 3.8.0-1 +- Upgrade to 3.8.0 and several spec file cleanups (#551906) +- Rewrote initscript to match LSB standards and headers (#246903) +- Added dispatcher to NetworkManager to avoid failures (#506286) + +* Fri Jul 24 2009 Fedora Release Engineering - 3.7.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Feb 24 2009 Fedora Release Engineering - 3.7.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Jan 23 2008 Robert Scheck 3.7.3-1 +- Upgrade to 3.7.3 (#429438) +- Updated the license tag according to the guidelines + +* Thu Jun 14 2007 Ville Skyttä - 3.7.2-1 +- 3.7.2. +- Tweak default config to send less mail (eg. not on every shutdown). + +* Fri Mar 2 2007 Ville Skyttä - 3.7.1-1 +- 3.7.1, cache file moved to /var/cache/ddclient. +- Run as a dedicated ddclient user (#220539). +- Add read only root/temporary state config (#220540). +- Create/chmod cache in init script instead of %%post. +- Add scriptlet dependencies, try-restart action and other minor tweaks. + * Sat Jul 30 2005 Ville Skyttä - 3.6.6-1 - 3.6.6, update URLs (#165272). - Restart service on future package upgrades (still manually needed this time). @@ -83,12 +339,12 @@ fi - Fix sysconfig/ddclient permissions. - Drop non-useful samples. -* Fri Apr 7 2005 Michael Schwendt - 3.6.3-5 +* Wed Apr 6 2005 Michael Schwendt - 3.6.3-5 - rebuilt * Mon Apr 05 2004 Toshio Kuratomi - 0:3.6.3-0.fdr.4.fc1 - Fix %%doc %%attr ownership -- Touch the cache file in %post +- Touch the cache file in %%post * Mon Sep 08 2003 Michael Schwendt - 0:3.6.3-0.fdr.3 - Add own Fedora-style initscript and /etc/sysconfig/ddclient file. diff --git a/ddclient.sysconfig b/ddclient.sysconfig index f046b08..97de4c1 100644 --- a/ddclient.sysconfig +++ b/ddclient.sysconfig @@ -1,4 +1,4 @@ -# -# ddclient service options +# -*- sh -*- +# ddclient service options, see ddclient --help for what's available. # DDCLIENT_OPTIONS="-daemon 300" diff --git a/sources b/sources index be68acc..76f2cf8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5fd0f82446fbed857c841a4deb83cdb9 ddclient-3.6.6.tar.bz2 +SHA512 (ddclient-4.0.0.tar.gz) = 095723aa43c4f08d7e3aa46c0bc47e753fdcbcb2cd0ac5f77cd687f98694985ad70e2f6509c05aaa232d0412fcb0aef8bb07a6d9e4302130ab1db047c14e1e86