]>
Commit | Line | Data |
---|---|---|
9b0ebfda PG |
1 | # TODO: |
2 | # - subpackage DNSmasq webmin module (contrib/webmin) | |
88e3f7fc JB |
3 | # |
4 | # Conditional build: | |
39273115 | 5 | %bcond_without dbus # DBus interface |
88e3f7fc JB |
6 | %bcond_without idn # IDN via libidn2 |
7 | %bcond_without conntrack # conntrack support | |
b1fdd9c8 | 8 | %bcond_without nftables # nftables support |
88e3f7fc | 9 | %bcond_with lua # Lua support |
9b0ebfda | 10 | |
b3dc8096 | 11 | Summary: A lightweight caching server (DNS, DHCP) |
919f5da6 | 12 | Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP |
bf36b0e9 | 13 | Name: dnsmasq |
f6fa5572 | 14 | Version: 2.90 |
7f874ea2 | 15 | Release: 1 |
f624c799 | 16 | License: GPL v2 |
bf36b0e9 | 17 | Group: Networking/Daemons |
88e3f7fc | 18 | # TODO: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.xz |
e6bf1e56 | 19 | Source0: https://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz |
f6fa5572 | 20 | # Source0-md5: 23a767c3a6797d20492d06d352fd926b |
bf36b0e9 | 21 | Source1: %{name}.init |
8d09dc76 JR |
22 | Source2: %{name}.sysconfig |
23 | Source3: %{name}.service | |
f624c799 | 24 | URL: http://www.thekelleys.org.uk/dnsmasq/doc.html |
88e3f7fc | 25 | %{?with_dbus:BuildRequires: dbus-devel} |
ec98ae4a | 26 | BuildRequires: gettext-tools |
f3235ebc | 27 | BuildRequires: gmp-devel |
88e3f7fc JB |
28 | %{?with_idn:BuildRequires: libidn2-devel} |
29 | %{?with_conntrack:BuildRequires: libnetfilter_conntrack-devel} | |
30 | %{?with_lua:BuildRequires: lua52-devel} | |
f3235ebc | 31 | BuildRequires: nettle-devel |
b1fdd9c8 | 32 | %{?with_nftables:BuildRequires: nftables-devel} |
f438ee6b | 33 | BuildRequires: pkgconfig |
8d09dc76 | 34 | BuildRequires: rpmbuild(macros) >= 1.671 |
8243d602 | 35 | Requires(post,preun): /sbin/chkconfig |
8d09dc76 JR |
36 | Requires(post,preun,postun): systemd-units >= 38 |
37 | Requires: systemd-units >= 38 | |
632e9725 | 38 | Requires: rc-scripts |
e94c4cf2 | 39 | Provides: caching-nameserver |
bf36b0e9 | 40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
b1fdd9c8 | 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} |
f3235ebc | 43 | |
bf36b0e9 | 44 | %description |
9c2b9b9a | 45 | Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP |
f438ee6b | 46 | server. It is designed to provide DNS and, optionally, DHCP, to a |
9c2b9b9a JB |
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. | |
f624c799 | 53 | |
9c2b9b9a JB |
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 | |
f438ee6b | 57 | configuration are important. |
bf36b0e9 | 58 | |
0475eba7 JR |
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 | |
9c2b9b9a JB |
68 | sieci maszyn bezdyskowych. |
69 | ||
0475eba7 JR |
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. | |
bf36b0e9 | 74 | |
75 | %prep | |
88e3f7fc | 76 | %setup -q |
bf36b0e9 | 77 | |
78 | %build | |
6c28ce70 | 79 | %{__make} all-i18n \ |
b2c6a46f | 80 | CC="%{__cc}" \ |
88e3f7fc | 81 | CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_ISC_READER" \ |
f3235ebc JP |
82 | LDFLAGS="%{rpmldflags}" \ |
83 | COPTS="%{copts}" \ | |
6c28ce70 | 84 | PREFIX=%{_prefix} |
bf36b0e9 | 85 | |
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
90c6cdae | 88 | install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/dbus-1/system.d,/etc/sysconfig,/etc/rc.d/init.d} \ |
f3235ebc | 89 | $RPM_BUILD_ROOT{%{systemdunitdir},%{_mandir}/man8,%{_datadir}/dnsmasq} |
bf36b0e9 | 90 | |
58f543fd | 91 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq |
92 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq | |
b2c6a46f | 93 | install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf |
bf36b0e9 | 94 | |
05a995a0 KK |
95 | install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir} |
96 | install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir} | |
97 | ||
8d09dc76 JR |
98 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service |
99 | ||
f3235ebc JP |
100 | install -p trust-anchors.conf $RPM_BUILD_ROOT%{_datadir}/dnsmasq |
101 | ||
6c28ce70 | 102 | %{__make} install-i18n \ |
f3235ebc | 103 | COPTS="%{copts}" \ |
6c28ce70 | 104 | DESTDIR=$RPM_BUILD_ROOT \ |
105 | PREFIX=%{_prefix} | |
106 | ||
88e3f7fc | 107 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/locale/{no,nb} |
1bd1311c | 108 | |
90c6cdae JP |
109 | %if %{with dbus} |
110 | cp -p dbus/dnsmasq.conf $RPM_BUILD_ROOT/etc/dbus-1/system.d/dnsmasq.conf | |
111 | %endif | |
112 | ||
6c28ce70 | 113 | %find_lang %{name} |
114 | ||
bf36b0e9 | 115 | %clean |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %post | |
119 | /sbin/chkconfig --add dnsmasq | |
632e9725 | 120 | %service dnsmasq restart |
8d09dc76 | 121 | %systemd_post dnsmasq.service |
bf36b0e9 | 122 | |
123 | %preun | |
124 | if [ "$1" = "0" ]; then | |
632e9725 | 125 | %service dnsmasq stop |
bf36b0e9 | 126 | /sbin/chkconfig --del dnsmasq |
127 | fi | |
8d09dc76 JR |
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 | |
bf36b0e9 | 150 | |
6c28ce70 | 151 | %files -f %{name}.lang |
bf36b0e9 | 152 | %defattr(644,root,root,755) |
05a995a0 | 153 | %doc CHANGELOG FAQ *.html contrib/{dnslist,dynamic-dnsmasq} |
90c6cdae | 154 | %{?with_dbus:%config(noreplace) %verify(not md5 mtime size) /etc/dbus-1/system.d/dnsmasq.conf} |
0184473f | 155 | %attr(754,root,root) /etc/rc.d/init.d/dnsmasq |
8d09dc76 | 156 | %{systemdunitdir}/dnsmasq.service |
88e3f7fc JB |
157 | %attr(755,root,root) %{_sbindir}/dnsmasq |
158 | %attr(755,root,root) %{_sbindir}/dnsmasq-portforward | |
b2c6a46f | 159 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dnsmasq |
160 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dnsmasq.conf | |
05a995a0 | 161 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/portforward |
88e3f7fc JB |
162 | %{_mandir}/man8/dnsmasq.8* |
163 | %lang(es) %{_mandir}/es/man8/dnsmasq.8* | |
164 | %lang(fr) %{_mandir}/fr/man8/dnsmasq.8* | |
f3235ebc JP |
165 | %dir %{_datadir}/dnsmasq |
166 | %{_datadir}/dnsmasq/trust-anchors.conf |