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