]> git.pld-linux.org Git - packages/ddclient.git/blob - ddclient.spec
try-restart service after perl-base upgrade; rel 2
[packages/ddclient.git] / ddclient.spec
1 #
2 # Conditional build:
3 %bcond_without  systemd         # systemd units
4
5 Summary:        A dynamic IP address utility
6 Summary(pl.UTF-8):      Narzędzie do dynamicznych adresów IP
7 Summary(pt_BR.UTF-8):   Cliente para atualizar entradas DNS dinâmicas no DynDNS.org
8 Name:           ddclient
9 Version:        3.9.1
10 Release:        2
11 Epoch:          1
12 License:        GPL v2
13 Group:          Networking
14 Source0:        https://github.com/ddclient/ddclient/archive/v%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5:  8497033052649ebe6f714338c7be4cda
16 Source1:        %{name}.init
17 Source2:        %{name}.sysconfig
18 Source3:        %{name}.NetworkManager
19 Source4:        %{name}-tmpfiles.conf
20 Source5:        %{name}.service
21 Patch0:         config.patch
22 URL:            https://github.com/ddclient/ddclient
23 BuildRequires:  rpm-perlprov
24 BuildRequires:  rpmbuild(macros) >= 1.268
25 Provides:       group(ddclient)
26 Provides:       user(ddclient)
27 Requires(post,preun):   /sbin/chkconfig
28 Requires(postun):       /usr/sbin/groupdel
29 Requires(postun):       /usr/sbin/userdel
30 Requires(pre):  /bin/id
31 Requires(pre):  /usr/bin/getgid
32 Requires(pre):  /usr/sbin/groupadd
33 Requires(pre):  /usr/sbin/useradd
34 Requires:       rc-scripts
35 %{?with_systemd:Requires:       systemd-units >= 1:250.1}
36 # for freedns: Digest::SHA1, IO::Socket::SSL
37 Suggests:       perl-Digest-SHA1
38 Suggests:       perl-IO-Socket-SSL
39 # for cloudflare JSON::Any
40 Suggests:       perl-JSON-Any
41 BuildArch:      noarch
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %define         cachedir        %{_localstatedir}/cache/ddclient
45 %define         rundir          %{_localstatedir}/run/ddclient
46
47 %description
48 DDclient is a small full featured client with FULL DynDNS NIC2
49 support, requiring only Perl and no additional modules. It runs under
50 most UNIX OSes and has been tested under Linux and FreeBSD. Supported
51 features include: operating as a daemon, manual and automatic updates,
52 static and dynamic updates, optimized updates for multiple addresses,
53 MX, wildcards, abuse avoidance, retrying failed updates, and sending
54 update status to syslog and through e-mail. This release may now
55 obtain your IP address from any interface, web based IP detection,
56 Watchguard's SOHO router, Netopia's R910 router, SMC's Barricade
57 broadband router, Netgear's RT3xx router, Linksys' broadband routers,
58 MaxGate's UGATE-3x00 routers, ELSA's LANCOM DSL/10 routers and now
59 provides Full support for DynDNS.org's NIC2 protocol. Support is also
60 included for other dynamic DNS services. Comes with sample scripts for
61 use with DHCP, PPP, and cron. See the README for more information.
62
63 %description -l pl.UTF-8
64 DDclient to mały, w pełni funkcjonalny klient z PEŁNĄ obsługą DynDNS
65 NIC2, wymagający tylko Perla bez żadnych dodatkowych modułów. Działa
66 pod większością systemów uniksowych, był testowany pod Linuksem i
67 FreeBSD. Jego możliwości to między innymi: praca jako demon, ręczne i
68 automatyczne uaktualnienia, statyczne i dynamiczne uaktualnienia,
69 uaktualnienia zoptymalizowane dla wielu adresów, MX-y, wildcardy,
70 zapobieganie nadużyciom, ponawianie nieudanych uaktualnień, wysyłanie
71 statusu uaktualnień do sysloga i pocztą. Ta wersja może pobrać adres
72 IP z dowolnego interfejsu, wykrywania przez WWW, routerów: Watchguard
73 SOGO, szerokopasmowych SMC Barricane, Netgear RT3xx, szerokopasmowych
74 Linksys, MaxGate UGATE-3x00, ELSA LANCOM DSL/10, a teraz także ma
75 pełną obsługę protokołu DynDNS NIC2. Ma także wsparcie dla innych
76 usług dynamicznego DNS. Zawiera przykładowe skrypty do używania z
77 DHCP, PPP i cronem. Więcej informacji w README.
78
79 %description -l pt_BR.UTF-8
80 O ddclient é um cliente perl usada para atualizar entradas DNS
81 dinâmicas em contas do serviço de DNS dinâmico gratuito. Veja
82 <http://www.dyndns.org> para obter detalhes sobre como obter uma conta
83 gratuita.
84
85 %prep
86 %setup -q
87 cp -p sample-etc_ddclient.conf %{name}.conf
88 %patch0 -p1
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,sysconfig,NetworkManager/dispatcher.d}} \
93         $RPM_BUILD_ROOT{%{_sbindir},%{systemdtmpfilesdir},%{?with_systemd:%{systemdunitdir},}%{cachedir},%{rundir}}
94
95 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
96 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}
97 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
98 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
99 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/50-%{name}
100 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
101 %{?with_systemd:cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service}
102 touch $RPM_BUILD_ROOT%{cachedir}/%{name}.cache
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %pre
108 %groupadd -g 325 ddclient
109 %useradd -u 525 -d /var/run/%{name} -g ddclient -c "ddclient user" ddclient
110
111 %post
112 /sbin/chkconfig --add %{name}
113 if [ "$1" = "2" ]; then
114         %service %{name} try-restart "%{name} daemon"
115 fi
116 %{?with_systemd:%systemd_post %{name}.service}
117
118 %preun
119 if [ "$1" = "0" ]; then
120         %service %{name} stop
121         /sbin/chkconfig --del %{name}
122 fi
123 %{?with_systemd:%systemd_preun %{name}.service}
124
125 %postun
126 if [ "$1" = "0" ]; then
127         %userremove ddclient
128         %groupremove ddclient
129 fi
130 %{?with_systemd:%systemd_reload}
131
132 %triggerpostun -- ddclient < 1:3.9.1-2
133 if [ -f /etc/ddclient.conf.rpmsave ]; then
134         echo "Moving config to new location /etc/ddclient"
135         mv -f /etc/ddclient/ddclient.conf /etc/ddclient/ddclient.conf.rpmnew
136         mv -f /etc/ddclient.conf.rpmsave /etc/ddclient/ddclient.conf
137         mv -f /etc/ddclient.cache /etc/ddclient.cache.rpmsave
138 fi
139 %{?with_systemd:%systemd_trigger %{name}.service}
140
141 %triggerin -- perl-base
142 [ "$2" = "2" ] || exit 0
143 %service %{name} try-restart "%{name} daemon"
144 %{?with_systemd:%systemd_service_restart %{name}.service}
145
146 %files
147 %defattr(644,root,root,755)
148 %doc ChangeLog Changelog.old README*
149 %attr(755,root,root) %{_sbindir}/ddclient
150 %dir %{_sysconfdir}/%{name}
151 # switch to %attr(640,root,ddclient) when this gets resolution: https://sourceforge.net/p/ddclient/bugs/77/
152 %attr(600,ddclient,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
153 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
154 %attr(754,root,root) /etc/rc.d/init.d/%{name}
155 %attr(755,root,root) /etc/NetworkManager/dispatcher.d/50-%{name}
156 %{systemdtmpfilesdir}/%{name}.conf
157 %{?with_systemd:%{systemdunitdir}/%{name}.service}
158
159 %dir %attr(770,root,ddclient) %{cachedir}
160 %ghost %attr(600,ddclient,ddclient) %ghost %{cachedir}/%{name}.cache
161 %dir %attr(770,root,ddclient) %{rundir}
This page took 0.109486 seconds and 4 git commands to generate.