ddclient/ddclient.spec
Stefan Seyfried 4be12eb8ac Accepting request 209397 from home:seife:branches:network
- fix the breakage from last submission
  * service file was put into tmpfiles.d
  * tmpfiles config was put into systemd service dir
  * rcddclient link was broken (pointed to "service" file)
- fix rpmlint warnings, also introduced by last submission:
  * service files and tmpdir config are neither config files nor
    should be executable
- package is noarch, mark it as such
- documentation should not have executable bit set

OBS-URL: https://build.opensuse.org/request/show/209397
OBS-URL: https://build.opensuse.org/package/show/network/ddclient?expand=0&rev=29
2013-12-04 13:27:38 +00:00

130 lines
4.1 KiB
RPMSpec

#
# spec file for package ddclient
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: ddclient
Summary: A Perl Client to Update Dynamic DNS Entries
License: GPL-2.0+
Group: Productivity/Networking/DNS/Utilities
Version: 3.8.1
Release: 0
Url: http://ddclient.sourceforge.net/
Source0: http://switch.dl.sourceforge.net/sourceforge/ddclient/%{name}-%{version}.tar.bz2
Source1: %{name}.service
Source2: %{name}.sysconfig
Source3: %{name}-tmpfiles.conf
Source4: rc.%{name}
Patch0: %{name}-3.8.1-config.patch
Patch1: %{name}-3.8.1-update_nic.patch
BuildRequires: pkgconfig(systemd)
BuildArch: noarch
Requires(pre): %fillup_prereq
Requires: perl >= 5.004
%{?systemd_requires}
Recommends: perl-IO-Socket-SSL
%description
ddclient is a small full-featured client requiring only Perl. Supported
features include daemon operation, manual and automatic updates, static
and dynamic updates, optimized updates for multiple addresses, MX, wild
cards, abuse avoidance, retry for failed updates, and status updates to
syslog and through e-mail. ddclient can obtain the IP address from any
interface, through a Web-based IP detection service, and for multiple
routers using custom FW definitions. It also provides full support for
DynDNS.org's NIC2 protocol. Support is also included for other dynamic
DNS services. Comes with sample scripts for use with DHCP, PPP, and
cron.
%prep
%setup
%patch0
%patch1
rm -f sample-etc_ddclient.conf.orig
chmod a-x sample-*
mkdir examples
mv sample-ddclient-wrapper.sh examples
%build
#%%configure
#make
# If the package provides automatic testing
#make test
# nothing to do here (yet)
%install
#make DESTDIR=$RPM_BUILD_ROOT install
%{__mkdir_p} %{buildroot}%{_sbindir}
%{__mkdir_p} %{buildroot}%{_sysconfdir}
%if 0%{?suse_version} >=1230
%{__mkdir_p} %{buildroot}%{_unitdir}
%{__mkdir_p} %{buildroot}%{_libexecdir}/tmpfiles.d
%else
%{__mkdir_p} %{buildroot}%{_sysconfdir}/init.d
%endif
%{__install} -m 755 %{name} %{buildroot}%{_sbindir}/
%{__install} -m 644 sample-etc_ddclient.conf %{buildroot}%{_sysconfdir}/%{name}.conf
# init script and config file
%if 0%{?suse_version} >=1230
%{__install} -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}.service
%{__install} -m 644 %{SOURCE3} %{buildroot}%{_libexecdir}/tmpfiles.d/%{name}.conf
%{__ln_s} %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%else
%{__install} -m 755 %{SOURCE4} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__ln_s} %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%endif
%{__install} -d -m 755 %{buildroot}/var/adm/fillup-templates
%{__install} -m 644 %{SOURCE2} %{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
%{__install} -d -m 755 %{buildroot}/var/cache/%{name}
%post
%{fillup_only}
%if 0%{?suse_version} >=1230
%service_add_post %{name}.service
%endif
%preun
%if 0%{?suse_version} >=1230
%service_del_preun %{name}.service
%else
%stop_on_removal ddclient
%endif
%postun
%if 0%{?suse_version} >=1230
%service_del_postun %{name}.service
%else
%restart_on_update ddclient
%insserv_cleanup
%endif
%files
%defattr(-, root, root)
%doc COPY* README* sample* examples
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/%{name}.conf
%if 0%{?suse_version} >=1230
%{_unitdir}/%{name}.service
%{_libexecdir}/tmpfiles.d/ddclient.conf
%else
/etc/init.d/%{name}
%endif
%{_sbindir}/%{name}
%{_sbindir}/rc%{name}
/var/adm/fillup-templates/sysconfig.%{name}
%dir /var/cache/%{name}
%changelog