]> git.pld-linux.org Git - packages/dnsmasq.git/blame_incremental - dnsmasq.spec
install dbus configuration when building with dbus support
[packages/dnsmasq.git] / dnsmasq.spec
... / ...
CommitLineData
1# TODO:
2# - subpackage DNSmasq webmin module (contrib/webmin)
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
9
10Summary: A lightweight caching server (DNS, DHCP)
11Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP
12Name: dnsmasq
13Version: 2.82
14Release: 1
15License: GPL v2
16Group: Networking/Daemons
17# TODO: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.xz
18Source0: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz
19# Source0-md5: 3c710dee3edba510ed11a6e3d9e0d9cb
20Source1: %{name}.init
21Source2: %{name}.sysconfig
22Source3: %{name}.service
23URL: http://www.thekelleys.org.uk/dnsmasq/doc.html
24%{?with_dbus:BuildRequires: dbus-devel}
25BuildRequires: gettext-tools
26BuildRequires: gmp-devel
27%{?with_idn:BuildRequires: libidn2-devel}
28%{?with_conntrack:BuildRequires: libnetfilter_conntrack-devel}
29%{?with_lua:BuildRequires: lua52-devel}
30BuildRequires: nettle-devel
31BuildRequires: pkgconfig
32BuildRequires: rpmbuild(macros) >= 1.671
33Requires(post,preun): /sbin/chkconfig
34Requires(post,preun,postun): systemd-units >= 38
35Requires: systemd-units >= 38
36Requires: rc-scripts
37Provides: caching-nameserver
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%define copts -DHAVE_DNSSEC%{?with_dbus: -DHAVE_DBUS}%{?with_idn: -DHAVE_LIBIDN2}%{?with_conntrack: -DHAVE_CONNTRACK}%{?with_lua: -DHAVE_LUASCRIPT}
41
42%description
43Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP
44server. It is designed to provide DNS and, optionally, DHCP, to a
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.
51
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
55configuration are important.
56
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
66sieci maszyn bezdyskowych.
67
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.
72
73%prep
74%setup -q
75
76%build
77%{__make} all-i18n \
78 CC="%{__cc}" \
79 CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_ISC_READER" \
80 LDFLAGS="%{rpmldflags}" \
81 COPTS="%{copts}" \
82 PREFIX=%{_prefix}
83
84%install
85rm -rf $RPM_BUILD_ROOT
86install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/dbus-1/system.d,/etc/sysconfig,/etc/rc.d/init.d} \
87 $RPM_BUILD_ROOT{%{systemdunitdir},%{_mandir}/man8,%{_datadir}/dnsmasq}
88
89install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq
90install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq
91install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
92
93install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir}
94install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir}
95
96install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service
97
98install -p trust-anchors.conf $RPM_BUILD_ROOT%{_datadir}/dnsmasq
99
100%{__make} install-i18n \
101 COPTS="%{copts}" \
102 DESTDIR=$RPM_BUILD_ROOT \
103 PREFIX=%{_prefix}
104
105%{__mv} $RPM_BUILD_ROOT%{_datadir}/locale/{no,nb}
106
107%if %{with dbus}
108cp -p dbus/dnsmasq.conf $RPM_BUILD_ROOT/etc/dbus-1/system.d/dnsmasq.conf
109%endif
110
111%find_lang %{name}
112
113%clean
114rm -rf $RPM_BUILD_ROOT
115
116%post
117/sbin/chkconfig --add dnsmasq
118%service dnsmasq restart
119%systemd_post dnsmasq.service
120
121%preun
122if [ "$1" = "0" ]; then
123 %service dnsmasq stop
124 /sbin/chkconfig --del dnsmasq
125fi
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
148
149%files -f %{name}.lang
150%defattr(644,root,root,755)
151%doc CHANGELOG FAQ *.html contrib/{dnslist,dynamic-dnsmasq}
152%{?with_dbus:%config(noreplace) %verify(not md5 mtime size) /etc/dbus-1/system.d/dnsmasq.conf}
153%attr(754,root,root) /etc/rc.d/init.d/dnsmasq
154%{systemdunitdir}/dnsmasq.service
155%attr(755,root,root) %{_sbindir}/dnsmasq
156%attr(755,root,root) %{_sbindir}/dnsmasq-portforward
157%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dnsmasq
158%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dnsmasq.conf
159%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/portforward
160%{_mandir}/man8/dnsmasq.8*
161%lang(es) %{_mandir}/es/man8/dnsmasq.8*
162%lang(fr) %{_mandir}/fr/man8/dnsmasq.8*
163%dir %{_datadir}/dnsmasq
164%{_datadir}/dnsmasq/trust-anchors.conf
This page took 0.029013 seconds and 4 git commands to generate.