2 # - subpackage DNSmasq webmin module (contrib/webmin)
4 Summary: A lightweight caching server (DNS, DHCP)
5 Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP
10 Group: Networking/Daemons
11 #Source0: http://thekelleys.org.uk/dnsmasq/test-releases/%{name}-%{version}%{_rc}.tar.gz
12 Source0: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz
13 # Source0-md5: 1f071fd11454e1cffea73bdadcf70b21
15 Source2: %{name}.sysconfig
16 Source3: %{name}.service
17 URL: http://www.thekelleys.org.uk/dnsmasq/doc.html
18 BuildRequires: gettext-tools
19 BuildRequires: gmp-devel
20 BuildRequires: libidn-devel
21 BuildRequires: nettle-devel
22 BuildRequires: pkgconfig
23 BuildRequires: rpmbuild(macros) >= 1.671
24 Requires(post,preun): /sbin/chkconfig
25 Requires(post,preun,postun): systemd-units >= 38
26 Requires: systemd-units >= 38
28 Provides: caching-nameserver
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define copts -DHAVE_DNSSEC
34 Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP
35 server. It is designed to provide DNS and, optionally, DHCP, to a
36 small network. It can serve the names of local machines which are not
37 in the global DNS. The DHCP server integrates with the DNS server and
38 allows machines with DHCP-allocated addresses to appear in the DNS
39 with names configured either in each host or in a central
40 configuration file. Dnsmasq supports static and dynamic DHCP leases
41 and BOOTP for network booting of diskless machines.
43 Dnsmasq is targeted at home networks using NAT and connected to the
44 Internet via a modem, cable-modem or ADSL connection but would be a
45 good choice for any small network where low resource use and ease of
46 configuration are important.
48 %description -l pl.UTF-8
49 dnsmasq jest lekkim, łatwym w konfiguracji forwarderem DNS i serwerem
50 DHCP zaprojektowanym do serwowania usługi DNS i opcjonalnie DHCP dla
51 małych sieci. Może on serwować także nazwy dla lokalnych maszyn nie
52 znajdujących się w globalnym DNS-ie. Serwer DHCP integruje się z
53 serwerem DNS, umożliwiając maszynom o adresach przydzielonych przez
54 DHCP pojawienie się w DNS-ie z nazwami konfigurowanymi dla każdego
55 hosta lub w centralnym pliku konfiguracyjnym. dnsmasq obsługuje
56 statyczne i dynamiczne dzierżawy DHCP oraz BOOTP do uruchamiania z
57 sieci maszyn bezdyskowych.
59 dnsmasq jest przeznaczony głównie dla sieci domowych używających NAT-u
60 i podłączonych do Internetu przez modem, modem kablowy lub łącze ADSL,
61 ale jest dobrym wyborem dla dowolnej małej sieci, gdzie ważne jest
62 małe wykorzystanie zasobów i łatwa konfiguracja.
65 %setup -q -n %{name}-%{version}
70 CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_ISC_READER -D_GNU_SOURCE" \
71 LDFLAGS="%{rpmldflags}" \
76 rm -rf $RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/sysconfig,/etc/rc.d/init.d} \
78 $RPM_BUILD_ROOT{%{systemdunitdir},%{_mandir}/man8,%{_datadir}/dnsmasq}
80 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq
81 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq
82 install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
84 install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir}
85 install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir}
87 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service
89 install -p trust-anchors.conf $RPM_BUILD_ROOT%{_datadir}/dnsmasq
91 %{__make} install-i18n \
93 DESTDIR=$RPM_BUILD_ROOT \
96 mv -f $RPM_BUILD_ROOT%{_datadir}/locale/{no,nb}
101 rm -rf $RPM_BUILD_ROOT
104 /sbin/chkconfig --add dnsmasq
105 %service dnsmasq restart
106 %systemd_post dnsmasq.service
109 if [ "$1" = "0" ]; then
110 %service dnsmasq stop
111 /sbin/chkconfig --del dnsmasq
113 %systemd_preun dnsmasq.service
118 %triggerpostun -- dnsmasq < 2.68-1.1
119 if [ -f /etc/sysconfig/dnsmasq ]; then
121 . /etc/sysconfig/dnsmasq
122 [ -n "$MAILHOSTNAME" ] && __OPT="-m $MAILHOSTNAME"
123 [ -n "$RESOLV_CONF" ] && __OPT="$__OPT -r $RESOLV_CONF"
124 [ -n "$DHCP_LEASE" ] && __OPT="$__OPT -l $DHCP_LEASE"
125 [ -n "$DOMAIN_SUFFIX" ] && __OPT="$__OPT -s $DOMAIN_SUFFIX"
126 [ -n "$INTERFACE" ] && __OPT="$__OPT -i $INTERFACE"
127 if [ -n "$__OPT" ]; then
128 %{__cp} -f /etc/sysconfig/dnsmasq{,.rpmsave}
129 echo >>/etc/sysconfig/dnsmasq
130 echo "# Added by rpm trigger" >>/etc/sysconfig/dnsmasq
131 echo "OPTIONS=\"$OPTIONS $__OPT\"" >>/etc/sysconfig/dnsmasq
134 %systemd_trigger dnsmasq.service
136 %files -f %{name}.lang
137 %defattr(644,root,root,755)
138 %doc CHANGELOG FAQ *.html contrib/{dnslist,dynamic-dnsmasq}
139 %attr(754,root,root) /etc/rc.d/init.d/dnsmasq
140 %{systemdunitdir}/dnsmasq.service
141 %attr(755,root,root) %{_sbindir}/dnsmasq*
142 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dnsmasq
143 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dnsmasq.conf
144 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/portforward
146 %lang(es) %{_mandir}/es/man8/*
147 %lang(fr) %{_mandir}/fr/man8/*
148 %dir %{_datadir}/dnsmasq
149 %{_datadir}/dnsmasq/trust-anchors.conf