]> git.pld-linux.org Git - packages/ddclient.git/blobdiff - ddclient.spec
Up to 3.9.1
[packages/ddclient.git] / ddclient.spec
index 446242f820c23e98e26f91581e560d8c926cc58a..127ede28c3aed2d1cc39185432be235ba1413809 100644 (file)
@@ -1,26 +1,43 @@
-%include       /usr/lib/rpm/macros.perl
 Summary:       A dynamic IP address utility
 Summary(pl.UTF-8):     Narzędzie do dynamicznych adresów IP
 Summary(pt_BR.UTF-8):  Cliente para atualizar entradas DNS dinâmicas no DynDNS.org
 Name:          ddclient
-Version:       3.8.0
-Release:       5
+Version:       3.9.1
+Release:       1
 Epoch:         1
 License:       GPL v2
 Group:         Networking
-Source0:       http://downloads.sourceforge.net/ddclient/%{name}-%{version}.tar.bz2
-# Source0-md5: 6cac7a5eb1da781bfd4d98cef0b21f8e
+Source0:       https://github.com/ddclient/ddclient/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 8497033052649ebe6f714338c7be4cda
 Source1:       %{name}.init
-Patch0:                branch.diff
-Source2:       %{name}.NetworkManager
-URL:           http://ddclient.sourceforge.net/
+Source2:       %{name}.sysconfig
+Source3:       %{name}.NetworkManager
+Source4:       %{name}-tmpfiles.conf
+Patch0:                config.patch
+URL:           https://github.com/ddclient/ddclient
 BuildRequires: rpm-perlprov
 BuildRequires: rpmbuild(macros) >= 1.268
+Provides:      group(ddclient)
+Provides:      user(ddclient)
 Requires(post,preun):  /sbin/chkconfig
+Requires(postun):      /usr/sbin/groupdel
+Requires(postun):      /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
 Requires:      rc-scripts
+# for freedns: Digest::SHA1, IO::Socket::SSL
+Suggests:      perl-Digest-SHA1
+Suggests:      perl-IO-Socket-SSL
+# for cloudflare JSON::Any
+Suggests:      perl-JSON-Any
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                cachedir        %{_localstatedir}/cache/ddclient
+%define                rundir          %{_localstatedir}/run/ddclient
+
 %description
 DDclient is a small full featured client with FULL DynDNS NIC2
 support, requiring only Perl and no additional modules. It runs under
@@ -61,19 +78,29 @@ gratuita.
 
 %prep
 %setup -q
-%patch0 -p0
+cp -p sample-etc_ddclient.conf %{name}.conf
+%patch0 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir}/ddclient,/etc/{rc.d/init.d,NetworkManager/dispatcher.d},%{_sbindir},%{_var}/cache/%{name}}
-cp -a sample-etc_ddclient.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,sysconfig,NetworkManager/dispatcher.d}} \
+       $RPM_BUILD_ROOT{%{_sbindir},%{systemdtmpfilesdir},%{cachedir},%{rundir}}
+
+cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}
 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
-install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/50-%{name}
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/50-%{name}
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
+touch $RPM_BUILD_ROOT%{cachedir}/%{name}.cache
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+%groupadd -g 325 ddclient
+%useradd -u 525 -d /var/run/%{name} -g ddclient -c "ddclient user" ddclient
+
 %post
 /sbin/chkconfig --add %{name}
 %service %{name} restart "%{name} daemon"
@@ -84,6 +111,12 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del %{name}
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+       %userremove ddclient
+       %groupremove ddclient
+fi
+
 %triggerpostun -- ddclient < 1:3.6.4
 if [ -f /etc/ddclient.conf.rpmsave ]; then
        echo "Moving config to new location /etc/ddclient"
@@ -94,10 +127,16 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc Changelog README*
+%doc ChangeLog Changelog.old README*
 %attr(755,root,root) %{_sbindir}/ddclient
 %dir %{_sysconfdir}/%{name}
-%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
+# switch to %attr(640,root,ddclient) when this gets resolution: https://sourceforge.net/p/ddclient/bugs/77/
+%attr(600,ddclient,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
+%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %attr(754,root,root) /etc/rc.d/init.d/%{name}
-%dir %{_var}/cache/%{name}
-/etc/NetworkManager/dispatcher.d/50-%{name}
+%attr(755,root,root) /etc/NetworkManager/dispatcher.d/50-%{name}
+%{systemdtmpfilesdir}/%{name}.conf
+
+%dir %attr(770,root,ddclient) %{cachedir}
+%ghost %attr(600,ddclient,ddclient) %ghost %{cachedir}/%{name}.cache
+%dir %attr(770,root,ddclient) %{rundir}
This page took 0.070635 seconds and 4 git commands to generate.