]> git.pld-linux.org Git - packages/dnsmasq.git/blame_incremental - dnsmasq.spec
up to 2.90
[packages/dnsmasq.git] / dnsmasq.spec
... / ...
CommitLineData
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
11Summary: A lightweight caching server (DNS, DHCP)
12Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP
13Name: dnsmasq
14Version: 2.90
15Release: 1
16License: GPL v2
17Group: Networking/Daemons
18# TODO: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.xz
19Source0: https://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz
20# Source0-md5: 23a767c3a6797d20492d06d352fd926b
21Source1: %{name}.init
22Source2: %{name}.sysconfig
23Source3: %{name}.service
24URL: http://www.thekelleys.org.uk/dnsmasq/doc.html
25%{?with_dbus:BuildRequires: dbus-devel}
26BuildRequires: gettext-tools
27BuildRequires: gmp-devel
28%{?with_idn:BuildRequires: libidn2-devel}
29%{?with_conntrack:BuildRequires: libnetfilter_conntrack-devel}
30%{?with_lua:BuildRequires: lua52-devel}
31BuildRequires: nettle-devel
32%{?with_nftables:BuildRequires: nftables-devel}
33BuildRequires: pkgconfig
34BuildRequires: rpmbuild(macros) >= 1.671
35Requires(post,preun): /sbin/chkconfig
36Requires(post,preun,postun): systemd-units >= 38
37Requires: systemd-units >= 38
38Requires: rc-scripts
39Provides: caching-nameserver
40BuildRoot: %{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
45Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP
46server. It is designed to provide DNS and, optionally, DHCP, to a
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.
53
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
57configuration are important.
58
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
68sieci maszyn bezdyskowych.
69
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.
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
87rm -rf $RPM_BUILD_ROOT
88install -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
91install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq
92install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq
93install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
94
95install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir}
96install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir}
97
98install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service
99
100install -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}
110cp -p dbus/dnsmasq.conf $RPM_BUILD_ROOT/etc/dbus-1/system.d/dnsmasq.conf
111%endif
112
113%find_lang %{name}
114
115%clean
116rm -rf $RPM_BUILD_ROOT
117
118%post
119/sbin/chkconfig --add dnsmasq
120%service dnsmasq restart
121%systemd_post dnsmasq.service
122
123%preun
124if [ "$1" = "0" ]; then
125 %service dnsmasq stop
126 /sbin/chkconfig --del dnsmasq
127fi
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
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
This page took 0.097671 seconds and 5 git commands to generate.