]> git.pld-linux.org Git - packages/ddclient.git/blob - ddclient.spec
up to 3.11.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.11.2
10 Release:        1
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:  5ef2ff089cfe4d4b9e1248881199eb4a
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:  autoconf
24 BuildRequires:  automake
25 BuildRequires:  perl-base
26 BuildRequires:  rpm-perlprov
27 BuildRequires:  rpmbuild(macros) >= 1.268
28 Provides:       group(ddclient)
29 Provides:       user(ddclient)
30 Requires(post,preun):   /sbin/chkconfig
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
37 Requires:       rc-scripts
38 %{?with_systemd:Requires:       systemd-units >= 1:250.1}
39 # for freedns: Digest::SHA1, IO::Socket::SSL
40 Suggests:       perl-Digest-SHA1
41 Suggests:       perl-IO-Socket-SSL
42 # for cloudflare JSON::Any
43 Suggests:       perl-JSON-Any
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %define         cachedir        %{_localstatedir}/cache/ddclient
48 %define         rundir          %{_localstatedir}/run/ddclient
49 %define         _sysconfdir     /etc/ddclient
50
51 %description
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
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
71 FreeBSD. Jego możliwości to między innymi: praca jako demon, ręczne i
72 automatyczne uaktualnienia, statyczne i dynamiczne uaktualnienia,
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
77 SOGO, szerokopasmowych SMC Barricane, Netgear RT3xx, szerokopasmowych
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.
82
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
86 <http://www.dyndns.org> para obter detalhes sobre como obter uma conta
87 gratuita.
88
89 %prep
90 %setup -q
91 %patch0 -p1
92
93 %build
94 %{__aclocal}
95 %{__autoconf}
96 %{__automake}
97 %configure \
98         CURL=/usr/bin/curl
99 %{__make}
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/{rc.d/init.d,sysconfig,NetworkManager/dispatcher.d}} \
104         $RPM_BUILD_ROOT{%{_sbindir},%{systemdtmpfilesdir},%{?with_systemd:%{systemdunitdir},}%{cachedir},%{rundir}}
105
106 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
107 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}
108 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
109 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
110 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/50-%{name}
111 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
112 %{?with_systemd:cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service}
113 touch $RPM_BUILD_ROOT%{cachedir}/%{name}.cache
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118 %pre
119 %groupadd -g 325 ddclient
120 %useradd -u 525 -d /var/run/%{name} -g ddclient -c "ddclient user" ddclient
121
122 %post
123 /sbin/chkconfig --add %{name}
124 if [ "$1" = "2" ]; then
125         %service %{name} try-restart "%{name} daemon"
126 fi
127 %{?with_systemd:%systemd_post %{name}.service}
128
129 %preun
130 if [ "$1" = "0" ]; then
131         %service %{name} stop
132         /sbin/chkconfig --del %{name}
133 fi
134 %{?with_systemd:%systemd_preun %{name}.service}
135
136 %postun
137 if [ "$1" = "0" ]; then
138         %userremove ddclient
139         %groupremove ddclient
140 fi
141 %{?with_systemd:%systemd_reload}
142
143 %triggerpostun -- ddclient < 1:3.9.1-2
144 if [ -f /etc/ddclient.conf.rpmsave ]; then
145         echo "Moving config to new location /etc/ddclient"
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
150 %{?with_systemd:%systemd_trigger %{name}.service}
151
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
157 %files
158 %defattr(644,root,root,755)
159 %doc ChangeLog.md README*
160 %attr(755,root,root) %{_sbindir}/ddclient
161 %dir %{_sysconfdir}
162 # switch to %attr(640,root,ddclient) when this gets resolution: https://sourceforge.net/p/ddclient/bugs/77/
163 %attr(600,ddclient,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
164 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
165 %attr(754,root,root) /etc/rc.d/init.d/%{name}
166 %attr(755,root,root) /etc/NetworkManager/dispatcher.d/50-%{name}
167 %{systemdtmpfilesdir}/%{name}.conf
168 %{?with_systemd:%{systemdunitdir}/%{name}.service}
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}
This page took 0.096568 seconds and 3 git commands to generate.