]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - subpackage DNSmasq webmin module (contrib/webmin) | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_without dbus # DBus interface | |
6 | %bcond_without idn # IDN via libidn2 | |
7 | %bcond_without conntrack # conntrack support | |
8 | %bcond_without nftables # nftables support | |
9 | %bcond_with lua # Lua support | |
10 | ||
11 | Summary: A lightweight caching server (DNS, DHCP) | |
12 | Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP | |
13 | Name: dnsmasq | |
14 | Version: 2.90 | |
15 | Release: 1 | |
16 | License: GPL v2 | |
17 | Group: Networking/Daemons | |
18 | # TODO: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.xz | |
19 | Source0: https://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz | |
20 | # Source0-md5: 23a767c3a6797d20492d06d352fd926b | |
21 | Source1: %{name}.init | |
22 | Source2: %{name}.sysconfig | |
23 | Source3: %{name}.service | |
24 | URL: http://www.thekelleys.org.uk/dnsmasq/doc.html | |
25 | %{?with_dbus:BuildRequires: dbus-devel} | |
26 | BuildRequires: gettext-tools | |
27 | BuildRequires: gmp-devel | |
28 | %{?with_idn:BuildRequires: libidn2-devel} | |
29 | %{?with_conntrack:BuildRequires: libnetfilter_conntrack-devel} | |
30 | %{?with_lua:BuildRequires: lua52-devel} | |
31 | BuildRequires: nettle-devel | |
32 | %{?with_nftables:BuildRequires: nftables-devel} | |
33 | BuildRequires: pkgconfig | |
34 | BuildRequires: rpmbuild(macros) >= 1.671 | |
35 | Requires(post,preun): /sbin/chkconfig | |
36 | Requires(post,preun,postun): systemd-units >= 38 | |
37 | Requires: systemd-units >= 38 | |
38 | Requires: rc-scripts | |
39 | Provides: caching-nameserver | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %define copts -DHAVE_DNSSEC%{?with_dbus: -DHAVE_DBUS}%{?with_idn: -DHAVE_LIBIDN2}%{?with_conntrack: -DHAVE_CONNTRACK}%{?with_lua: -DHAVE_LUASCRIPT}%{?with_nftables: -DHAVE_NFTSET} | |
43 | ||
44 | %description | |
45 | Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP | |
46 | server. It is designed to provide DNS and, optionally, DHCP, to a | |
47 | small network. It can serve the names of local machines which are not | |
48 | in the global DNS. The DHCP server integrates with the DNS server and | |
49 | allows machines with DHCP-allocated addresses to appear in the DNS | |
50 | with names configured either in each host or in a central | |
51 | configuration file. Dnsmasq supports static and dynamic DHCP leases | |
52 | and BOOTP for network booting of diskless machines. | |
53 | ||
54 | Dnsmasq is targeted at home networks using NAT and connected to the | |
55 | Internet via a modem, cable-modem or ADSL connection but would be a | |
56 | good choice for any small network where low resource use and ease of | |
57 | configuration are important. | |
58 | ||
59 | %description -l pl.UTF-8 | |
60 | dnsmasq jest lekkim, łatwym w konfiguracji forwarderem DNS i serwerem | |
61 | DHCP zaprojektowanym do serwowania usługi DNS i opcjonalnie DHCP dla | |
62 | małych sieci. Może on serwować także nazwy dla lokalnych maszyn nie | |
63 | znajdujących się w globalnym DNS-ie. Serwer DHCP integruje się z | |
64 | serwerem DNS, umożliwiając maszynom o adresach przydzielonych przez | |
65 | DHCP pojawienie się w DNS-ie z nazwami konfigurowanymi dla każdego | |
66 | hosta lub w centralnym pliku konfiguracyjnym. dnsmasq obsługuje | |
67 | statyczne i dynamiczne dzierżawy DHCP oraz BOOTP do uruchamiania z | |
68 | sieci maszyn bezdyskowych. | |
69 | ||
70 | dnsmasq jest przeznaczony głównie dla sieci domowych używających NAT-u | |
71 | i podłączonych do Internetu przez modem, modem kablowy lub łącze ADSL, | |
72 | ale jest dobrym wyborem dla dowolnej małej sieci, gdzie ważne jest | |
73 | małe wykorzystanie zasobów i łatwa konfiguracja. | |
74 | ||
75 | %prep | |
76 | %setup -q | |
77 | ||
78 | %build | |
79 | %{__make} all-i18n \ | |
80 | CC="%{__cc}" \ | |
81 | CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_ISC_READER" \ | |
82 | LDFLAGS="%{rpmldflags}" \ | |
83 | COPTS="%{copts}" \ | |
84 | PREFIX=%{_prefix} | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/dbus-1/system.d,/etc/sysconfig,/etc/rc.d/init.d} \ | |
89 | $RPM_BUILD_ROOT{%{systemdunitdir},%{_mandir}/man8,%{_datadir}/dnsmasq} | |
90 | ||
91 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq | |
92 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq | |
93 | install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf | |
94 | ||
95 | install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir} | |
96 | install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir} | |
97 | ||
98 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service | |
99 | ||
100 | install -p trust-anchors.conf $RPM_BUILD_ROOT%{_datadir}/dnsmasq | |
101 | ||
102 | %{__make} install-i18n \ | |
103 | COPTS="%{copts}" \ | |
104 | DESTDIR=$RPM_BUILD_ROOT \ | |
105 | PREFIX=%{_prefix} | |
106 | ||
107 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/locale/{no,nb} | |
108 | ||
109 | %if %{with dbus} | |
110 | cp -p dbus/dnsmasq.conf $RPM_BUILD_ROOT/etc/dbus-1/system.d/dnsmasq.conf | |
111 | %endif | |
112 | ||
113 | %find_lang %{name} | |
114 | ||
115 | %clean | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %post | |
119 | /sbin/chkconfig --add dnsmasq | |
120 | %service dnsmasq restart | |
121 | %systemd_post dnsmasq.service | |
122 | ||
123 | %preun | |
124 | if [ "$1" = "0" ]; then | |
125 | %service dnsmasq stop | |
126 | /sbin/chkconfig --del dnsmasq | |
127 | fi | |
128 | %systemd_preun dnsmasq.service | |
129 | ||
130 | %postun | |
131 | %systemd_reload | |
132 | ||
133 | %triggerpostun -- dnsmasq < 2.68-1.1 | |
134 | if [ -f /etc/sysconfig/dnsmasq ]; then | |
135 | __OPT= | |
136 | . /etc/sysconfig/dnsmasq | |
137 | [ -n "$MAILHOSTNAME" ] && __OPT="-m $MAILHOSTNAME" | |
138 | [ -n "$RESOLV_CONF" ] && __OPT="$__OPT -r $RESOLV_CONF" | |
139 | [ -n "$DHCP_LEASE" ] && __OPT="$__OPT -l $DHCP_LEASE" | |
140 | [ -n "$DOMAIN_SUFFIX" ] && __OPT="$__OPT -s $DOMAIN_SUFFIX" | |
141 | [ -n "$INTERFACE" ] && __OPT="$__OPT -i $INTERFACE" | |
142 | if [ -n "$__OPT" ]; then | |
143 | %{__cp} -f /etc/sysconfig/dnsmasq{,.rpmsave} | |
144 | echo >>/etc/sysconfig/dnsmasq | |
145 | echo "# Added by rpm trigger" >>/etc/sysconfig/dnsmasq | |
146 | echo "OPTIONS=\"$OPTIONS $__OPT\"" >>/etc/sysconfig/dnsmasq | |
147 | fi | |
148 | fi | |
149 | %systemd_trigger dnsmasq.service | |
150 | ||
151 | %files -f %{name}.lang | |
152 | %defattr(644,root,root,755) | |
153 | %doc CHANGELOG FAQ *.html contrib/{dnslist,dynamic-dnsmasq} | |
154 | %{?with_dbus:%config(noreplace) %verify(not md5 mtime size) /etc/dbus-1/system.d/dnsmasq.conf} | |
155 | %attr(754,root,root) /etc/rc.d/init.d/dnsmasq | |
156 | %{systemdunitdir}/dnsmasq.service | |
157 | %attr(755,root,root) %{_sbindir}/dnsmasq | |
158 | %attr(755,root,root) %{_sbindir}/dnsmasq-portforward | |
159 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dnsmasq | |
160 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dnsmasq.conf | |
161 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/portforward | |
162 | %{_mandir}/man8/dnsmasq.8* | |
163 | %lang(es) %{_mandir}/es/man8/dnsmasq.8* | |
164 | %lang(fr) %{_mandir}/fr/man8/dnsmasq.8* | |
165 | %dir %{_datadir}/dnsmasq | |
166 | %{_datadir}/dnsmasq/trust-anchors.conf |