]> git.pld-linux.org Git - packages/dnsmasq.git/blame - dnsmasq.spec
install dbus configuration when building with dbus support
[packages/dnsmasq.git] / dnsmasq.spec
CommitLineData
9b0ebfda
PG
1# TODO:
2# - subpackage DNSmasq webmin module (contrib/webmin)
88e3f7fc
JB
3#
4# Conditional build:
5%bcond_with dbus # DBus interface
6%bcond_without idn # IDN via libidn2
7%bcond_without conntrack # conntrack support
8%bcond_with lua # Lua support
9b0ebfda 9
b3dc8096 10Summary: A lightweight caching server (DNS, DHCP)
919f5da6 11Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP
bf36b0e9 12Name: dnsmasq
621e4d11
JP
13Version: 2.82
14Release: 1
f624c799 15License: GPL v2
bf36b0e9 16Group: Networking/Daemons
88e3f7fc 17# TODO: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.xz
bacb38f2 18Source0: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz
621e4d11 19# Source0-md5: 3c710dee3edba510ed11a6e3d9e0d9cb
bf36b0e9 20Source1: %{name}.init
8d09dc76
JR
21Source2: %{name}.sysconfig
22Source3: %{name}.service
f624c799 23URL: http://www.thekelleys.org.uk/dnsmasq/doc.html
88e3f7fc 24%{?with_dbus:BuildRequires: dbus-devel}
ec98ae4a 25BuildRequires: gettext-tools
f3235ebc 26BuildRequires: gmp-devel
88e3f7fc
JB
27%{?with_idn:BuildRequires: libidn2-devel}
28%{?with_conntrack:BuildRequires: libnetfilter_conntrack-devel}
29%{?with_lua:BuildRequires: lua52-devel}
f3235ebc 30BuildRequires: nettle-devel
f438ee6b 31BuildRequires: pkgconfig
8d09dc76 32BuildRequires: rpmbuild(macros) >= 1.671
8243d602 33Requires(post,preun): /sbin/chkconfig
8d09dc76
JR
34Requires(post,preun,postun): systemd-units >= 38
35Requires: systemd-units >= 38
632e9725 36Requires: rc-scripts
e94c4cf2 37Provides: caching-nameserver
bf36b0e9 38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
88e3f7fc 40%define copts -DHAVE_DNSSEC%{?with_dbus: -DHAVE_DBUS}%{?with_idn: -DHAVE_LIBIDN2}%{?with_conntrack: -DHAVE_CONNTRACK}%{?with_lua: -DHAVE_LUASCRIPT}
f3235ebc 41
bf36b0e9 42%description
9c2b9b9a 43Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP
f438ee6b 44server. It is designed to provide DNS and, optionally, DHCP, to a
9c2b9b9a
JB
45small network. It can serve the names of local machines which are not
46in the global DNS. The DHCP server integrates with the DNS server and
47allows machines with DHCP-allocated addresses to appear in the DNS
48with names configured either in each host or in a central
49configuration file. Dnsmasq supports static and dynamic DHCP leases
50and BOOTP for network booting of diskless machines.
f624c799 51
9c2b9b9a
JB
52Dnsmasq is targeted at home networks using NAT and connected to the
53Internet via a modem, cable-modem or ADSL connection but would be a
54good choice for any small network where low resource use and ease of
f438ee6b 55configuration are important.
bf36b0e9 56
0475eba7
JR
57%description -l pl.UTF-8
58dnsmasq jest lekkim, łatwym w konfiguracji forwarderem DNS i serwerem
59DHCP zaprojektowanym do serwowania usługi DNS i opcjonalnie DHCP dla
60małych sieci. Może on serwować także nazwy dla lokalnych maszyn nie
61znajdujących się w globalnym DNS-ie. Serwer DHCP integruje się z
62serwerem DNS, umożliwiając maszynom o adresach przydzielonych przez
63DHCP pojawienie się w DNS-ie z nazwami konfigurowanymi dla każdego
64hosta lub w centralnym pliku konfiguracyjnym. dnsmasq obsługuje
65statyczne i dynamiczne dzierżawy DHCP oraz BOOTP do uruchamiania z
9c2b9b9a
JB
66sieci maszyn bezdyskowych.
67
0475eba7
JR
68dnsmasq jest przeznaczony głównie dla sieci domowych używających NAT-u
69i podłączonych do Internetu przez modem, modem kablowy lub łącze ADSL,
70ale jest dobrym wyborem dla dowolnej małej sieci, gdzie ważne jest
71małe wykorzystanie zasobów i łatwa konfiguracja.
bf36b0e9 72
73%prep
88e3f7fc 74%setup -q
bf36b0e9 75
76%build
6c28ce70 77%{__make} all-i18n \
b2c6a46f 78 CC="%{__cc}" \
88e3f7fc 79 CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_ISC_READER" \
f3235ebc
JP
80 LDFLAGS="%{rpmldflags}" \
81 COPTS="%{copts}" \
6c28ce70 82 PREFIX=%{_prefix}
bf36b0e9 83
84%install
85rm -rf $RPM_BUILD_ROOT
90c6cdae 86install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/dbus-1/system.d,/etc/sysconfig,/etc/rc.d/init.d} \
f3235ebc 87 $RPM_BUILD_ROOT{%{systemdunitdir},%{_mandir}/man8,%{_datadir}/dnsmasq}
bf36b0e9 88
58f543fd 89install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq
90install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq
b2c6a46f 91install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
bf36b0e9 92
05a995a0
KK
93install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir}
94install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir}
95
8d09dc76
JR
96install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service
97
f3235ebc
JP
98install -p trust-anchors.conf $RPM_BUILD_ROOT%{_datadir}/dnsmasq
99
6c28ce70 100%{__make} install-i18n \
f3235ebc 101 COPTS="%{copts}" \
6c28ce70 102 DESTDIR=$RPM_BUILD_ROOT \
103 PREFIX=%{_prefix}
104
88e3f7fc 105%{__mv} $RPM_BUILD_ROOT%{_datadir}/locale/{no,nb}
1bd1311c 106
90c6cdae
JP
107%if %{with dbus}
108cp -p dbus/dnsmasq.conf $RPM_BUILD_ROOT/etc/dbus-1/system.d/dnsmasq.conf
109%endif
110
6c28ce70 111%find_lang %{name}
112
bf36b0e9 113%clean
114rm -rf $RPM_BUILD_ROOT
115
116%post
117/sbin/chkconfig --add dnsmasq
632e9725 118%service dnsmasq restart
8d09dc76 119%systemd_post dnsmasq.service
bf36b0e9 120
121%preun
122if [ "$1" = "0" ]; then
632e9725 123 %service dnsmasq stop
bf36b0e9 124 /sbin/chkconfig --del dnsmasq
125fi
8d09dc76
JR
126%systemd_preun dnsmasq.service
127
128%postun
129%systemd_reload
130
131%triggerpostun -- dnsmasq < 2.68-1.1
132if [ -f /etc/sysconfig/dnsmasq ]; then
133 __OPT=
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
145 fi
146fi
147%systemd_trigger dnsmasq.service
bf36b0e9 148
6c28ce70 149%files -f %{name}.lang
bf36b0e9 150%defattr(644,root,root,755)
05a995a0 151%doc CHANGELOG FAQ *.html contrib/{dnslist,dynamic-dnsmasq}
90c6cdae 152%{?with_dbus:%config(noreplace) %verify(not md5 mtime size) /etc/dbus-1/system.d/dnsmasq.conf}
0184473f 153%attr(754,root,root) /etc/rc.d/init.d/dnsmasq
8d09dc76 154%{systemdunitdir}/dnsmasq.service
88e3f7fc
JB
155%attr(755,root,root) %{_sbindir}/dnsmasq
156%attr(755,root,root) %{_sbindir}/dnsmasq-portforward
b2c6a46f 157%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dnsmasq
158%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dnsmasq.conf
05a995a0 159%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/portforward
88e3f7fc
JB
160%{_mandir}/man8/dnsmasq.8*
161%lang(es) %{_mandir}/es/man8/dnsmasq.8*
162%lang(fr) %{_mandir}/fr/man8/dnsmasq.8*
f3235ebc
JP
163%dir %{_datadir}/dnsmasq
164%{_datadir}/dnsmasq/trust-anchors.conf
This page took 0.170928 seconds and 4 git commands to generate.