]> git.pld-linux.org Git - packages/dnsmasq.git/blame - dnsmasq.spec
up to 2.90
[packages/dnsmasq.git] / dnsmasq.spec
CommitLineData
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 11Summary: A lightweight caching server (DNS, DHCP)
919f5da6 12Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP
bf36b0e9 13Name: dnsmasq
f6fa5572 14Version: 2.90
7f874ea2 15Release: 1
f624c799 16License: GPL v2
bf36b0e9 17Group: Networking/Daemons
88e3f7fc 18# TODO: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.xz
e6bf1e56 19Source0: https://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz
f6fa5572 20# Source0-md5: 23a767c3a6797d20492d06d352fd926b
bf36b0e9 21Source1: %{name}.init
8d09dc76
JR
22Source2: %{name}.sysconfig
23Source3: %{name}.service
f624c799 24URL: http://www.thekelleys.org.uk/dnsmasq/doc.html
88e3f7fc 25%{?with_dbus:BuildRequires: dbus-devel}
ec98ae4a 26BuildRequires: gettext-tools
f3235ebc 27BuildRequires: gmp-devel
88e3f7fc
JB
28%{?with_idn:BuildRequires: libidn2-devel}
29%{?with_conntrack:BuildRequires: libnetfilter_conntrack-devel}
30%{?with_lua:BuildRequires: lua52-devel}
f3235ebc 31BuildRequires: nettle-devel
b1fdd9c8 32%{?with_nftables:BuildRequires: nftables-devel}
f438ee6b 33BuildRequires: pkgconfig
8d09dc76 34BuildRequires: rpmbuild(macros) >= 1.671
8243d602 35Requires(post,preun): /sbin/chkconfig
8d09dc76
JR
36Requires(post,preun,postun): systemd-units >= 38
37Requires: systemd-units >= 38
632e9725 38Requires: rc-scripts
e94c4cf2 39Provides: caching-nameserver
bf36b0e9 40BuildRoot: %{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 45Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP
f438ee6b 46server. It is designed to provide DNS and, optionally, DHCP, to a
9c2b9b9a
JB
47small network. It can serve the names of local machines which are not
48in the global DNS. The DHCP server integrates with the DNS server and
49allows machines with DHCP-allocated addresses to appear in the DNS
50with names configured either in each host or in a central
51configuration file. Dnsmasq supports static and dynamic DHCP leases
52and BOOTP for network booting of diskless machines.
f624c799 53
9c2b9b9a
JB
54Dnsmasq is targeted at home networks using NAT and connected to the
55Internet via a modem, cable-modem or ADSL connection but would be a
56good choice for any small network where low resource use and ease of
f438ee6b 57configuration are important.
bf36b0e9 58
0475eba7
JR
59%description -l pl.UTF-8
60dnsmasq jest lekkim, łatwym w konfiguracji forwarderem DNS i serwerem
61DHCP zaprojektowanym do serwowania usługi DNS i opcjonalnie DHCP dla
62małych sieci. Może on serwować także nazwy dla lokalnych maszyn nie
63znajdujących się w globalnym DNS-ie. Serwer DHCP integruje się z
64serwerem DNS, umożliwiając maszynom o adresach przydzielonych przez
65DHCP pojawienie się w DNS-ie z nazwami konfigurowanymi dla każdego
66hosta lub w centralnym pliku konfiguracyjnym. dnsmasq obsługuje
67statyczne i dynamiczne dzierżawy DHCP oraz BOOTP do uruchamiania z
9c2b9b9a
JB
68sieci maszyn bezdyskowych.
69
0475eba7
JR
70dnsmasq jest przeznaczony głównie dla sieci domowych używających NAT-u
71i podłączonych do Internetu przez modem, modem kablowy lub łącze ADSL,
72ale jest dobrym wyborem dla dowolnej małej sieci, gdzie ważne jest
73mał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
87rm -rf $RPM_BUILD_ROOT
90c6cdae 88install -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 91install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq
92install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq
b2c6a46f 93install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
bf36b0e9 94
05a995a0
KK
95install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir}
96install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir}
97
8d09dc76
JR
98install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service
99
f3235ebc
JP
100install -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}
110cp -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
116rm -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
124if [ "$1" = "0" ]; then
632e9725 125 %service dnsmasq stop
bf36b0e9 126 /sbin/chkconfig --del dnsmasq
127fi
8d09dc76
JR
128%systemd_preun dnsmasq.service
129
130%postun
131%systemd_reload
132
133%triggerpostun -- dnsmasq < 2.68-1.1
134if [ -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
148fi
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
This page took 0.107889 seconds and 4 git commands to generate.