lkundrak / rpms / ddclient

Forked from rpms/ddclient 4 years ago
Clone
cvsextras dd98616
Name:           ddclient
2e950d7
Version:        3.7.3
50154aa
Release:        1%{?dist}
e32b02f
Summary:        Client to update dynamic DNS host entries
cvsextras dd98616
cvsextras dd98616
Group:          System Environment/Daemons
2e950d7
License:        GPLv2+
09d2f80
URL:            http://ddclient.sourceforge.net/
2e950d7
Source0:        http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2
50154aa
Source1:        ddclient.rwtab
cvsextras dd98616
Source2:        ddclient.initscript
cvsextras dd98616
Source3:        ddclient.sysconfig
cvsextras dd98616
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
50154aa
cvsextras dd98616
BuildArch:      noarch
50154aa
Requires(pre):  /usr/sbin/useradd
50154aa
Requires(pre):  /usr/sbin/groupadd
50154aa
Requires(post): /sbin/chkconfig
50154aa
Requires(preun): /sbin/chkconfig
50154aa
Requires(hint): perl(IO::Socket::SSL)
cvsextras dd98616
cvsextras dd98616
%description
cvsextras dd98616
ddclient is a Perl client used to update dynamic DNS entries for accounts
cvsextras dd98616
on many dynamic DNS services.
cvsextras dd98616
cvsextras dd98616
cvsextras dd98616
%prep
cvsextras dd98616
%setup -q
09d2f80
rm sample-etc_rc.d_init.d_ddclient*
2e950d7
2e950d7
# Move pid file location for running as non-root.
50154aa
sed -i -e 's|/var/run/ddclient.pid|/var/run/ddclient/ddclient.pid|' \
50154aa
    sample-etc_ddclient.conf
2e950d7
2e950d7
# Send less mail by default, eg. not on every shutdown.
2e950d7
sed -i -e 's|^mail=|#mail=|' sample-etc_ddclient.conf
2e950d7
2e950d7
# http://sourceforge.net/forum/forum.php?forum_id=706446
2e950d7
sed -i -e 's|"3\.7\.1"|"3.7.2"|' ddclient
2e950d7
09d2f80
# Backwards compatibility from pre-3.6.6-1
09d2f80
sed -i -e 's|/etc/ddclient/|%{_sysconfdir}/|' ddclient
cvsextras dd98616
2e950d7
cvsextras dd98616
%build
cvsextras dd98616
cvsextras dd98616
cvsextras dd98616
%install
cvsextras dd98616
rm -rf $RPM_BUILD_ROOT
cvsextras dd98616
cvsextras dd98616
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
cvsextras dd98616
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
cvsextras dd98616
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
cvsextras dd98616
install -p ddclient $RPM_BUILD_ROOT%{_sbindir}
09d2f80
install -pm 600 sample-etc_ddclient.conf \
50154aa
    $RPM_BUILD_ROOT%{_sysconfdir}/ddclient.conf
50154aa
install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rwtab.d/ddclient
cvsextras dd98616
install -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/ddclient
09d2f80
install -pm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ddclient
50154aa
mkdir -p $RPM_BUILD_ROOT/var/cache/ddclient
50154aa
touch $RPM_BUILD_ROOT/var/cache/ddclient/ddclient.cache
50154aa
mkdir -p $RPM_BUILD_ROOT/var/run/ddclient
cvsextras dd98616
cvsextras dd98616
cvsextras dd98616
%clean
cvsextras dd98616
rm -rf $RPM_BUILD_ROOT
cvsextras dd98616
cvsextras dd98616
50154aa
%pre
50154aa
/usr/sbin/groupadd -r ddclient >/dev/null 2>&1 || :
50154aa
/usr/sbin/useradd -r -M -d /var/cache/ddclient -g ddclient \
50154aa
    -s /sbin/nologin -c "Dynamic DNS Client" ddclient >/dev/null 2>&1 || :
50154aa
cvsextras dd98616
%post
cvsextras dd98616
/sbin/chkconfig --add ddclient
50154aa
if [ $1 -gt 1 ]; then
50154aa
    # 3.6.6->3.7.1: config(noreplace), but we need the ownership change...
50154aa
    chown ddclient:ddclient %{_sysconfdir}/ddclient.conf
50154aa
    # ...and the pid file location change is nice to have too
50154aa
    if grep -qF /var/run/ddclient.pid %{_sysconfdir}/ddclient.conf ; then
50154aa
        sed -i -e 's|/var/run/ddclient.pid|/var/run/ddclient/ddclient.pid|' \
50154aa
            %{_sysconfdir}/ddclient.conf || :
50154aa
    fi
50154aa
fi
cvsextras dd98616
cvsextras dd98616
%preun
e32b02f
if [ $1 -eq 0 ]; then
50154aa
    %{_initrddir}/ddclient stop > /dev/null 2>&1
50154aa
    /sbin/chkconfig --del ddclient
cvsextras dd98616
fi
cvsextras dd98616
09d2f80
%postun
09d2f80
if [ $1 -ge 1 ]; then
50154aa
    %{_initrddir}/ddclient try-restart >/dev/null
09d2f80
fi
cvsextras dd98616
cvsextras dd98616
%files
cvsextras dd98616
%defattr(-,root,root,-)
09d2f80
%doc README* COPYING COPYRIGHT Changelog sample-*
50154aa
%attr(600,ddclient,ddclient) %config(noreplace) %{_sysconfdir}/ddclient.conf
50154aa
%config(noreplace) %{_sysconfdir}/rwtab.d/ddclient
cvsextras dd98616
%config(noreplace) %{_sysconfdir}/sysconfig/ddclient
50154aa
%attr(0700,ddclient,ddclient) %dir /var/cache/ddclient/
50154aa
%attr(0600,ddclient,ddclient) %ghost /var/cache/ddclient/ddclient.cache
cvsextras dd98616
%{_initrddir}/ddclient
50154aa
%{_sbindir}/ddclient
50154aa
%attr(0755,ddclient,ddclient) %dir /var/run/ddclient/
cvsextras dd98616
cvsextras dd98616
cvsextras dd98616
%changelog
2e950d7
* Wed Jan 23 2008 Robert Scheck <robert@fedoraproject.org> 3.7.3-1
2e950d7
- Upgrade to 3.7.3 (#429438)
2e950d7
- Updated the license tag according to the guidelines
2e950d7
2e950d7
* Thu Jun 14 2007 Ville Skyttä <ville.skytta at iki.fi> - 3.7.2-1
2e950d7
- 3.7.2.
2e950d7
- Tweak default config to send less mail (eg. not on every shutdown).
2e950d7
50154aa
* Fri Mar  2 2007 Ville Skyttä <ville.skytta at iki.fi> - 3.7.1-1
50154aa
- 3.7.1, cache file moved to /var/cache/ddclient.
50154aa
- Run as a dedicated ddclient user (#220539).
50154aa
- Add read only root/temporary state config (#220540).
50154aa
- Create/chmod cache in init script instead of %%post.
50154aa
- Add scriptlet dependencies, try-restart action and other minor tweaks.
50154aa
09d2f80
* Sat Jul 30 2005 Ville Skyttä <ville.skytta at iki.fi> - 3.6.6-1
09d2f80
- 3.6.6, update URLs (#165272).
09d2f80
- Restart service on future package upgrades (still manually needed this time).
09d2f80
- Don't set service to autostart on "chkconfig --add".
09d2f80
- Fix sysconfig/ddclient permissions.
09d2f80
- Drop non-useful samples.
09d2f80
09d2f80
* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 3.6.3-5
730fa8c
- rebuilt
730fa8c
cvsextras dd98616
* Mon Apr 05 2004 Toshio Kuratomi <toshio[+]tiki-lounge.com> - 0:3.6.3-0.fdr.4.fc1
cvsextras dd98616
- Fix %%doc %%attr ownership
50154aa
- Touch the cache file in %%post
cvsextras dd98616
cvsextras dd98616
* Mon Sep 08 2003 Michael Schwendt <mschwendt[AT]users.sf.net> - 0:3.6.3-0.fdr.3
cvsextras dd98616
- Add own Fedora-style initscript and /etc/sysconfig/ddclient file.
cvsextras dd98616
- Fix file permissions of config file and example files.
cvsextras dd98616
- Since ddclient.cache.patch uses hardcoded /var, don't use
cvsextras dd98616
  %%_localstatedir in spec file either.
cvsextras dd98616
cvsextras dd98616
* Sun Sep 07 2003 Thomas Vander Stichele <thomas at apestaart dot org>
cvsextras dd98616
- 0:3.6.3-0.fdr.2: fixed ghostness of cache file