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