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