From bd758d5188aa0f470ad6b785809103441f5451cf Mon Sep 17 00:00:00 2001 From: gafton Date: Wed, 24 Nov 2004 03:10:04 +0000 Subject: [PATCH 1/8] Fix braindead import typo artifact in the default generated Makefile. Oh well, the fedora extras commits list needs a workout anyway... --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6ba9603..2cd21d0 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Makefile for source rpm: ddclient -# $Id$ +# $Id: Makefile,v 1.1 2004/11/08 04:12:30 cvsextras Exp $ NAME := ddclient SPECFILE = $(firstword $(wildcard *.spec)) @@ -12,7 +12,7 @@ MAKEFILE_COMMON := $(shell $(find-makefile-common)) ifeq ($(MAKEFILE_COMMON),) # attept a checkout define checkout-makefile-common -test -f CVS/Rootx && { 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 +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)) From 62e84490f2c8c1e515acd1ec0d4e28b75d271ea8 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Fri, 10 Dec 2004 22:03:02 +0000 Subject: [PATCH 2/8] Bump release, strip off fedora.us prefix and dist tag. --- ddclient.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddclient.spec b/ddclient.spec index 464ba10..a0dfe3e 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -1,6 +1,6 @@ Name: ddclient Version: 3.6.3 -Release: 0.fdr.4.2 +Release: 4 Epoch: 0 Summary: A client to update dynamic DNS host entries. From 9c5c4b74f056b9a6ba3e0229efa59e4c49dc4876 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 23 Jan 2008 18:41:32 +0000 Subject: [PATCH 3/8] Initialize branch EL-4 for ddclient --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..6ec5cef --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-4 From 6da84d469d5d48c5ab29e4e41829082eb9a422f2 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Wed, 23 Jan 2008 19:13:03 +0000 Subject: [PATCH 4/8] - Upgrade to 3.7.3 (#429438) - Updated the license tag according to the guidelines --- .cvsignore | 2 +- ddclient.cache.patch | 20 ------- ddclient.initscript | 20 +++---- ddclient.rwtab | 1 + ddclient.spec | 124 +++++++++++++++++++++++++++++++------------ ddclient.sysconfig | 4 +- sources | 2 +- 7 files changed, 106 insertions(+), 67 deletions(-) delete mode 100644 ddclient.cache.patch create mode 100644 ddclient.rwtab diff --git a/.cvsignore b/.cvsignore index 8d15306..b67ecec 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -ddclient-3.6.3.tar.gz +ddclient-3.7.3.tar.bz2 diff --git a/ddclient.cache.patch b/ddclient.cache.patch deleted file mode 100644 index d957c83..0000000 --- a/ddclient.cache.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Naur ddclient-3.6.3/ddclient ddclient-3.6.3.patched/ddclient ---- ddclient-3.6.3/ddclient 2003-06-14 19:39:16.000000000 +0200 -+++ ddclient-3.6.3.patched/ddclient 2003-09-04 12:25:55.000000000 +0200 -@@ -21,6 +21,7 @@ - my $now = time; - my $hostname = hostname(); - my $etc = ($program =~ /test/i) ? './' : '/etc/'; -+my $cache = ($program =~ /test/i) ? './' : '/var/cache/'; - my $savedir = ($program =~ /test/i) ? 'URL/' : '/tmp/'; - my $msgs = ''; - my $last_msgs = ''; -@@ -184,7 +185,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 index f25d09d..2a8176a 100755 --- a/ddclient.initscript +++ b/ddclient.initscript @@ -2,7 +2,7 @@ # # ddclient This shell script takes care of starting and stopping ddclient. # -# chkconfig: 345 65 35 +# chkconfig: - 65 35 # description: ddclient provides support for updating dynamic DNS services # processname: ddclient # config: /etc/sysconfig/ddclient @@ -21,10 +21,14 @@ exec="/usr/sbin/ddclient" prog=$(basename $exec) lockfile=/var/lock/subsys/$prog +cache=/var/cache/ddclient/ddclient.cache +pid=/var/run/ddclient/ddclient.pid start() { echo -n $"Starting $prog: " - daemon $exec $DDCLIENT_OPTIONS + [ -f $cache ] || touch $cache + chown ddclient:ddclient $cache && chmod 600 $cache || exit $? + daemon --user=ddclient --pidfile=$pid $exec $DDCLIENT_OPTIONS retval=$? echo [ $retval -eq 0 ] && touch $lockfile @@ -33,6 +37,8 @@ start() { stop() { echo -n $"Stopping $prog: " + # FIXME: call killproc with -p $pid; not done yet so that a 3.6.6->3.7.1 + # update will do the right thing with try-restart during the upgrade killproc $prog retval=$? echo @@ -53,10 +59,6 @@ force_reload() { restart } -fdrstatus() { - status $prog -} - # See how we were called. case "$1" in start|stop|restart|reload) @@ -66,12 +68,12 @@ case "$1" in force_reload ;; status) - fdrstatus + status -p $pid $prog ;; - condrestart) + try-restart|condrestart) [ ! -f $lockfile ] || restart ;; *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}" + echo $"Usage: $0 {start|stop|status|restart|try-restart|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.spec b/ddclient.spec index a0dfe3e..9cf26ea 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -1,36 +1,49 @@ Name: ddclient -Version: 3.6.3 -Release: 4 -Epoch: 0 -Summary: A client to update dynamic DNS host entries. +Version: 3.7.3 +Release: 1%{?dist} +Summary: Client to update dynamic DNS host entries Group: System Environment/Daemons -License: GPL -URL: http://burry.ca:4141/ddclient -Source: http://members.rogers.com/ddclient/pub/%{name}-%{version}.tar.gz +License: GPLv2+ +URL: http://ddclient.sourceforge.net/ +Source0: http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2 +Source1: ddclient.rwtab 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 +Requires(pre): /usr/sbin/useradd +Requires(pre): /usr/sbin/groupadd +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +Requires(hint): perl(IO::Socket::SSL) %description ddclient is a Perl client used to update dynamic DNS entries for accounts on many dynamic DNS services. -# ----------------------------------------------------------------------------- %prep %setup -q -%patch -p1 +rm sample-etc_rc.d_init.d_ddclient* + +# Move pid file location for running as non-root. +sed -i -e 's|/var/run/ddclient.pid|/var/run/ddclient/ddclient.pid|' \ + sample-etc_ddclient.conf + +# Send less mail by default, eg. not on every shutdown. +sed -i -e 's|^mail=|#mail=|' sample-etc_ddclient.conf + +# http://sourceforge.net/forum/forum.php?forum_id=706446 +sed -i -e 's|"3\.7\.1"|"3.7.2"|' ddclient + +# Backwards compatibility from pre-3.6.6-1 +sed -i -e 's|/etc/ddclient/|%{_sysconfdir}/|' ddclient -# ----------------------------------------------------------------------------- %build -# ----------------------------------------------------------------------------- %install rm -rf $RPM_BUILD_ROOT @@ -39,47 +52,90 @@ mkdir -p $RPM_BUILD_ROOT%{_sbindir} mkdir -p $RPM_BUILD_ROOT%{_initrddir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig install -p ddclient $RPM_BUILD_ROOT%{_sbindir} -install -p sample-etc_ddclient.conf $RPM_BUILD_ROOT%{_sysconfdir}/ddclient.conf +install -pm 600 sample-etc_ddclient.conf \ + $RPM_BUILD_ROOT%{_sysconfdir}/ddclient.conf +install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rwtab.d/ddclient install -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/ddclient -install -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ddclient -mkdir -p $RPM_BUILD_ROOT/var/cache -touch $RPM_BUILD_ROOT/var/cache/ddclient.cache +install -pm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ddclient +mkdir -p $RPM_BUILD_ROOT/var/cache/ddclient +touch $RPM_BUILD_ROOT/var/cache/ddclient/ddclient.cache +mkdir -p $RPM_BUILD_ROOT/var/run/ddclient -# ----------------------------------------------------------------------------- %clean rm -rf $RPM_BUILD_ROOT -# ----------------------------------------------------------------------------- + +%pre +/usr/sbin/groupadd -r ddclient >/dev/null 2>&1 || : +/usr/sbin/useradd -r -M -d /var/cache/ddclient -g ddclient \ + -s /sbin/nologin -c "Dynamic DNS Client" ddclient >/dev/null 2>&1 || : %post /sbin/chkconfig --add ddclient -touch /var/cache/ddclient.cache -chmod 0600 /var/cache/ddclient.cache - -%preun -if [ $1 = 0 ]; then - /sbin/service ddclient stop > /dev/null 2>&1 - /sbin/chkconfig --del ddclient +if [ $1 -gt 1 ]; then + # 3.6.6->3.7.1: config(noreplace), but we need the ownership change... + chown ddclient:ddclient %{_sysconfdir}/ddclient.conf + # ...and the pid file location change is nice to have too + if grep -qF /var/run/ddclient.pid %{_sysconfdir}/ddclient.conf ; then + sed -i -e 's|/var/run/ddclient.pid|/var/run/ddclient/ddclient.pid|' \ + %{_sysconfdir}/ddclient.conf || : + fi fi +%preun +if [ $1 -eq 0 ]; then + %{_initrddir}/ddclient stop > /dev/null 2>&1 + /sbin/chkconfig --del ddclient +fi + +%postun +if [ $1 -ge 1 ]; then + %{_initrddir}/ddclient try-restart >/dev/null +fi %files %defattr(-,root,root,-) -%doc README* COPYING COPYRIGHT -%doc %attr(0644, root, root) sample* -%{_sbindir}/ddclient -%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/ddclient.conf +%doc README* COPYING COPYRIGHT Changelog sample-* +%attr(600,ddclient,ddclient) %config(noreplace) %{_sysconfdir}/ddclient.conf +%config(noreplace) %{_sysconfdir}/rwtab.d/ddclient %config(noreplace) %{_sysconfdir}/sysconfig/ddclient -%ghost %attr(0600, root, root) /var/cache/ddclient.cache +%attr(0700,ddclient,ddclient) %dir /var/cache/ddclient/ +%attr(0600,ddclient,ddclient) %ghost /var/cache/ddclient/ddclient.cache %{_initrddir}/ddclient +%{_sbindir}/ddclient +%attr(0755,ddclient,ddclient) %dir /var/run/ddclient/ -# ----------------------------------------------------------------------------- %changelog +* 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). +- Don't set service to autostart on "chkconfig --add". +- Fix sysconfig/ddclient permissions. +- Drop non-useful samples. + +* Fri Apr 7 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 ea60e93..184dc0a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dfa5ff6967cb854de804d4e7b9633fdc ddclient-3.6.3.tar.gz +f6a55bc68cf73ffe7e80d2fa5cd44f85 ddclient-3.7.3.tar.bz2 From 639ce2d4351666893b9aa0fdaa62b42dfaab1df5 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:20:37 +0000 Subject: [PATCH 5/8] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2cd21d0..6877da1 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: ddclient -# $Id: Makefile,v 1.1 2004/11/08 04:12:30 cvsextras Exp $ +# $Id: Makefile,v 1.2 2004/11/24 03:10:04 gafton Exp $ 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 +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 63a5f2947253215785e5b5e007a9d23f65002f07 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sat, 1 May 2010 23:15:56 +0000 Subject: [PATCH 6/8] - 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) --- .cvsignore | 2 +- ddclient.NetworkManager | 15 +++++ ddclient.initscript | 121 ++++++++++++++++++---------------- ddclient.spec | 140 ++++++++++++++++++++-------------------- sources | 2 +- 5 files changed, 154 insertions(+), 126 deletions(-) create mode 100644 ddclient.NetworkManager diff --git a/.cvsignore b/.cvsignore index b67ecec..6d46518 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -ddclient-3.7.3.tar.bz2 +ddclient-3.8.0.tar.bz2 diff --git a/ddclient.NetworkManager b/ddclient.NetworkManager new file mode 100644 index 0000000..df7abf5 --- /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 /var/lock/subsys/ddclient ] && /sbin/service ddclient stop || : + } && { :; } +fi + +if [ "$2" = "up" ]; then + /sbin/ip -o route show dev "$1" | grep -q '^default' && { + /sbin/chkconfig ddclient && /sbin/service ddclient start || : + } || { :; } +fi diff --git a/ddclient.initscript b/ddclient.initscript index 2a8176a..1271d2c 100755 --- a/ddclient.initscript +++ b/ddclient.initscript @@ -1,79 +1,92 @@ -#!/bin/sh +#!/bin/bash # -# ddclient This shell script takes care of starting and stopping ddclient. +# ddclient Client to update dynamic DNS host entries # -# chkconfig: - 65 35 -# description: ddclient provides support for updating dynamic DNS services -# processname: ddclient -# config: /etc/sysconfig/ddclient +# chkconfig: - 65 35 +# description: ddclient is a Perl client used to update dynamic DNS \ +# entries for accounts on many dynamic DNS services. +# processname: /usr/sbin/ddclient +# config: /etc/ddclient.conf +# pidfile: /var/run/ddclient/ddclient.pid + +### BEGIN INIT INFO +# Provides: ddclient +# Required-Start: $local_fs $network $syslog +# Required-Stop: $local_fs $network $syslog +# Should-Start: $named +# Should-Stop: $named +# Short-Description: Client to update dynamic DNS host entries +# Description: ddclient is a Perl client used to update dynamic DNS +# entries for accounts on many dynamic DNS services. +### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions -# Source networking configuration. -. /etc/sysconfig/network +if [ -f /etc/sysconfig/ddclient ]; then + . /etc/sysconfig/ddclient +fi -# Check that networking is up. -[ "$NETWORKING" = "no" ] && exit 0 - -. /etc/sysconfig/ddclient - -exec="/usr/sbin/ddclient" -prog=$(basename $exec) +exec=/usr/sbin/ddclient +prog=`basename $exec` lockfile=/var/lock/subsys/$prog cache=/var/cache/ddclient/ddclient.cache pid=/var/run/ddclient/ddclient.pid +RETVAL=0 start() { - echo -n $"Starting $prog: " - [ -f $cache ] || touch $cache - chown ddclient:ddclient $cache && chmod 600 $cache || exit $? - daemon --user=ddclient --pidfile=$pid $exec $DDCLIENT_OPTIONS - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval + # Check that networking is up. + [ ! -f /var/lock/subsys/network -a ! -f /var/lock/subsys/NetworkManager ] && exit 0 + + echo -n $"Starting $prog: " + [ -f $cache ] || touch $cache + chown ddclient:ddclient $cache && chmod 600 $cache || exit $? + daemon --user=ddclient --pidfile=$pid $exec $DDCLIENT_OPTIONS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + + return $RETVAL } stop() { - echo -n $"Stopping $prog: " - # FIXME: call killproc with -p $pid; not done yet so that a 3.6.6->3.7.1 - # update will do the right thing with try-restart during the upgrade - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval + echo -n $"Stopping $prog: " + killproc -p $pid $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + + return $RETVAL } restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart + stop + start } # See how we were called. case "$1" in - start|stop|restart|reload) - $1 - ;; - force-reload) - force_reload - ;; + start) + start + ;; + stop) + stop + ;; status) - status -p $pid $prog - ;; - try-restart|condrestart) - [ ! -f $lockfile ] || restart - ;; + status -p $pid $prog + ;; + restart|force-reload|reload) + restart + ;; + condrestart|try-restart) + if [ -f $lockfile ]; then + restart + fi + ;; *) - echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}" - exit 2 + echo $"Usage: $0 {start|stop|status|reload|restart|condrestart|force-reload|try-restart}" + RETVAL=1 + ;; esac + +exit $RETVAL diff --git a/ddclient.spec b/ddclient.spec index 9cf26ea..1b23dfe 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -1,113 +1,113 @@ -Name: ddclient -Version: 3.7.3 -Release: 1%{?dist} -Summary: Client to update dynamic DNS host entries - -Group: System Environment/Daemons -License: GPLv2+ -URL: http://ddclient.sourceforge.net/ -Source0: http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2 -Source1: ddclient.rwtab -Source2: ddclient.initscript -Source3: ddclient.sysconfig -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildArch: noarch -Requires(pre): /usr/sbin/useradd -Requires(pre): /usr/sbin/groupadd -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(hint): perl(IO::Socket::SSL) +Summary: Client to update dynamic DNS host entries +Name: ddclient +Version: 3.8.0 +Release: 1%{?dist} +License: GPLv2+ +Group: System Environment/Daemons +URL: http://ddclient.sourceforge.net/ +Source0: http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2 +Source1: ddclient.rwtab +Source2: ddclient.initscript +Source3: ddclient.sysconfig +Source4: ddclient.NetworkManager +BuildArch: noarch +Requires(pre): shadow-utils +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service, /sbin/chkconfig +Requires(postun): /sbin/service +Requires(hint): perl(IO::Socket::SSL) +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description ddclient is a Perl client used to update dynamic DNS entries for accounts on many dynamic DNS services. - %prep %setup -q -rm sample-etc_rc.d_init.d_ddclient* - # Move pid file location for running as non-root. -sed -i -e 's|/var/run/ddclient.pid|/var/run/ddclient/ddclient.pid|' \ - sample-etc_ddclient.conf +sed -e 's|/var/run/ddclient.pid|%{_localstatedir}/run/%{name}/%{name}.pid|' -i sample-etc_ddclient.conf # Send less mail by default, eg. not on every shutdown. -sed -i -e 's|^mail=|#mail=|' sample-etc_ddclient.conf +sed -e 's|^mail=|#mail=|' -i sample-etc_ddclient.conf # http://sourceforge.net/forum/forum.php?forum_id=706446 -sed -i -e 's|"3\.7\.1"|"3.7.2"|' ddclient +sed -e 's|"3\.7\.1"|"3.7.2"|' -i %{name} # Backwards compatibility from pre-3.6.6-1 -sed -i -e 's|/etc/ddclient/|%{_sysconfdir}/|' ddclient - +sed -e 's|/etc/ddclient/|%{_sysconfdir}/|' -i %{name} %build - %install rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_sbindir} -mkdir -p $RPM_BUILD_ROOT%{_initrddir} -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig -install -p ddclient $RPM_BUILD_ROOT%{_sbindir} -install -pm 600 sample-etc_ddclient.conf \ - $RPM_BUILD_ROOT%{_sysconfdir}/ddclient.conf -install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rwtab.d/ddclient -install -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/ddclient -install -pm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ddclient -mkdir -p $RPM_BUILD_ROOT/var/cache/ddclient -touch $RPM_BUILD_ROOT/var/cache/ddclient/ddclient.cache -mkdir -p $RPM_BUILD_ROOT/var/run/ddclient +mkdir -p $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{rc.d/init.d,rwtab.d,sysconfig}} +install -p -m 755 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name} +install -p -m 600 sample-etc_ddclient.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf +install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rwtab.d/%{name} +install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name} +install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} +%if 0%{?fedora}%{?rhel} > 4 +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d +install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/50-%{name} +%endif +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{cache,run}/%{name} +touch $RPM_BUILD_ROOT%{_localstatedir}/cache/%{name}/%{name}.cache +# Correct permissions for later usage in %doc +chmod 644 sample-* %clean rm -rf $RPM_BUILD_ROOT - %pre -/usr/sbin/groupadd -r ddclient >/dev/null 2>&1 || : -/usr/sbin/useradd -r -M -d /var/cache/ddclient -g ddclient \ - -s /sbin/nologin -c "Dynamic DNS Client" ddclient >/dev/null 2>&1 || : +getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name} +getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/cache/%{name} -s /sbin/nologin -c "Dynamic DNS Client" %{name} +exit 0 %post -/sbin/chkconfig --add ddclient -if [ $1 -gt 1 ]; then - # 3.6.6->3.7.1: config(noreplace), but we need the ownership change... - chown ddclient:ddclient %{_sysconfdir}/ddclient.conf - # ...and the pid file location change is nice to have too - if grep -qF /var/run/ddclient.pid %{_sysconfdir}/ddclient.conf ; then - sed -i -e 's|/var/run/ddclient.pid|/var/run/ddclient/ddclient.pid|' \ - %{_sysconfdir}/ddclient.conf || : - fi -fi +/sbin/chkconfig --add %{name} %preun if [ $1 -eq 0 ]; then - %{_initrddir}/ddclient stop > /dev/null 2>&1 - /sbin/chkconfig --del ddclient + /sbin/service %{name} stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name} fi %postun -if [ $1 -ge 1 ]; then - %{_initrddir}/ddclient try-restart >/dev/null +if [ $1 -ne 0 ]; then + /sbin/service %{name} condrestart > /dev/null 2>&1 || : fi %files %defattr(-,root,root,-) -%doc README* COPYING COPYRIGHT Changelog sample-* -%attr(600,ddclient,ddclient) %config(noreplace) %{_sysconfdir}/ddclient.conf -%config(noreplace) %{_sysconfdir}/rwtab.d/ddclient -%config(noreplace) %{_sysconfdir}/sysconfig/ddclient -%attr(0700,ddclient,ddclient) %dir /var/cache/ddclient/ -%attr(0600,ddclient,ddclient) %ghost /var/cache/ddclient/ddclient.cache -%{_initrddir}/ddclient -%{_sbindir}/ddclient -%attr(0755,ddclient,ddclient) %dir /var/run/ddclient/ - +%doc README* COPYING COPYRIGHT Changelog 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 +%{_sysconfdir}/rc.d/init.d/%{name} +%if 0%{?fedora}%{?rhel} > 4 +%{_sysconfdir}/NetworkManager/dispatcher.d/50-%{name} +%endif +%attr(600,%{name},%{name}) %config(noreplace) %{_sysconfdir}/%{name}.conf +%config(noreplace) %{_sysconfdir}/rwtab.d/%{name} +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%{_sbindir}/%{name} +%attr(0700,%{name},%{name}) %dir %{_localstatedir}/cache/%{name}/ +%attr(0600,%{name},%{name}) %ghost %{_localstatedir}/cache/%{name}/%{name}.cache +%attr(0755,%{name},%{name}) %dir %{_localstatedir}/run/%{name}/ %changelog +* 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 diff --git a/sources b/sources index 184dc0a..008224d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f6a55bc68cf73ffe7e80d2fa5cd44f85 ddclient-3.7.3.tar.bz2 +6cac7a5eb1da781bfd4d98cef0b21f8e ddclient-3.8.0.tar.bz2 From 87ba49c6a1a18742d5c7fb29c71812cb496fd513 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sat, 29 May 2010 10:47:49 +0000 Subject: [PATCH 7/8] - Fixed wrong permissions at NetworkManager dispatcher (#506286) - Updated %description to be more verbose and detailed (#588053) --- ddclient.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ddclient.spec b/ddclient.spec index 1b23dfe..083ebd5 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -1,7 +1,7 @@ Summary: Client to update dynamic DNS host entries Name: ddclient Version: 3.8.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Daemons URL: http://ddclient.sourceforge.net/ @@ -20,7 +20,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n %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 @@ -49,7 +52,7 @@ install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name} install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} %if 0%{?fedora}%{?rhel} > 4 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d -install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/50-%{name} +install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/50-%{name} %endif mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{cache,run}/%{name} touch $RPM_BUILD_ROOT%{_localstatedir}/cache/%{name}/%{name}.cache @@ -97,6 +100,10 @@ fi %attr(0755,%{name},%{name}) %dir %{_localstatedir}/run/%{name}/ %changelog +* 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) From 786913f8e4c3efa70df6af95197a1e003c87378f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 12:45:02 +0000 Subject: [PATCH 8/8] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 6877da1..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: ddclient -# $Id: Makefile,v 1.2 2004/11/24 03:10:04 gafton Exp $ -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 $$d/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/branch b/branch deleted file mode 100644 index 6ec5cef..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-4