dnsmasq/dnsmasq.spec

179 lines
6.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package dnsmasq
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: dnsmasq
Summary: Lightweight, Easy-to-Configure DNS Forwarder and DHCP Server
Accepting request 236965 from home:dirkmueller:branches:network - license update: GPL-2.0 or GPL-3.0 correct license is dual GPL-2.0 or GPL-3.0; please add COPYING-v3-file to RPM. - update to 2.71: Subtle change to error handling to help DNSSEC validation when servers fail to provide NODATA answers for non-existent DS records. Tweak code which removes DNSSEC records from answers when not required. Fixes broken answers when additional section has real records in it. Thanks to Marco Davids for the bug report. Fix DNSSEC validation of ANY queries. Thanks to Marco Davids for spotting that too. Fix total DNS failure and 100% CPU use if cachesize set to zero, regression introduced in 2.69. Thanks to James Hunt and the Ubuntu crowd for assistance in fixing this. Fix crash, introduced in 2.69, on TCP request when dnsmasq compiled with DNSSEC support, but running without DNSSEC enabled. Thanks to Manish Sing for spotting that one. Fix regression which broke ipset functionality. Thanks to Wang Jian for the bug report. Implement dynamic interface discovery on *BSD. This allows the contructor: syntax to be used in dhcp-range for DHCPv6 on the BSD platform. Thanks to Matthias Andree for valuable research on how to implement this. Fix infinite loop associated with some --bogus-nxdomain configs. Thanks fogobogo for the bug report. Fix missing RA RDNS option with configuration like --dhcp-option=option6:23,[::] Thanks to Tsachi Kimeldorfer OBS-URL: https://build.opensuse.org/request/show/236965 OBS-URL: https://build.opensuse.org/package/show/network/dnsmasq?expand=0&rev=58
2014-06-12 15:39:16 +02:00
License: GPL-2.0 or GPL-3.0
Group: Productivity/Networking/DNS/Servers
Version: 2.72
Release: 0
Provides: dns_daemon
PreReq: /usr/sbin/useradd /bin/mkdir
Url: http://www.thekelleys.org.uk/dnsmasq/
Source: http://www.thekelleys.org.uk/%{name}/%{name}-%{version}.tar.gz
Source1: dnsmasq.reg
Source2: dnsmasq.service
Source3: rc.dnsmasq-suse
Source4: SuSEFirewall.dnsmasq-dhcp
Source5: SuSEFirewall.dnsmasq-dns
Source6: %{name}-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: dbus-1-devel
BuildRequires: dos2unix
BuildRequires: libidn-devel
BuildRequires: libnettle-devel
BuildRequires: pkg-config
BuildRequires: pkgconfig(libnetfilter_conntrack)
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%endif
%{?systemd_requires}
%description
Dnsmasq is a lightweight, easy-to-configure DNS forwarder and DHCP
server. It is designed to provide DNS and, optionally, DHCP, to a small
network. It can serve the names of local machines that are not in the
global DNS. The DHCP server integrates with the DNS server and allows
machines with DHCP-allocated addresses to appear in DNS with names
configured either in each host or in a central configuration file.
Dnsmasq supports static and dynamic DHCP leases and BOOTP for network
booting of diskless machines.
%package utils
Summary: Utilities for manipulating DHCP server leases
Group: Productivity/Networking/DNS/Servers
%description utils
Utilities that use the standard DHCP protocol to query/remove a DHCP
server's leases.
%prep
%setup -q -n %{name}-%{version}
# Some docs have the DOS line ends
dos2unix contrib/systemd/dbus_activation
# SED-FIX-UPSTREAM -- Fix paths
sed -i -e 's|\(PREFIX *= *\)/usr/local|\1/usr|;
s|$(LDFLAGS)|$(CFLAGS) $(LDFLAGS)|' \
Makefile
# SED-FIX-UPSTREAM -- Fix man page
sed -i -e 's|The defaults to "dip",|The default is "nogroup",|' \
man/dnsmasq.8
# SED-FIX-UPSTREAM -- Fix cachesize, group and user
sed -i -e 's|CACHESIZ 150|CACHESIZ 2000|;
s|CHUSER "nobody"|CHUSER "dnsmasq"|;
s|CHGRP "dip"|CHGRP "nogroup"|' \
src/config.h
# Fix trust-anchor.conf location
sed -i -e '/trust-anchors.conf/c\#conf-file=/etc/dnsmasq.d/trust-anchors.conf' \
dnsmasq.conf.example
%build
echo "#define HAVE_DBUS" >> src/config.h
echo "#define HAVE_CONNTRACK" >> src/config.h
echo "#define HAVE_IDN" >> src/config.h
echo "#define HAVE_DNSSEC" >> src/config.h
mv po/no.po po/nb.po
export CFLAGS="%optflags -std=gnu99 -fPIC -DPIC -fpie -DHAVE_DBUS -DHAVE_CONNTRACK -DHAVE_IDN -DHAVE_DNSSEC"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
make %{?_smp_mflags} AWK=gawk all-i18n CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
make -C contrib/wrt %{?_smp_mflags}
%pre
if ! /usr/bin/getent group tftp >/dev/null; then
%{_sbindir}/groupadd -r tftp 2>/dev/null || :
fi
if ! /usr/bin/getent passwd tftp >/dev/null; then
%{_sbindir}/useradd -c "TFTP account" -d /srv/tftpboot -G tftp -g tftp \
-r -s /bin/false tftp 2>/dev/null || :
fi
if ! /usr/bin/getent passwd dnsmasq >/dev/null; then
/usr/sbin/useradd -r -d /var/lib/empty -s /bin/false -c "dnsmasq" -g nogroup -G tftp dnsmasq || :
fi
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%install
make install-i18n DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr AWK=gawk
install -d -m 755 ${RPM_BUILD_ROOT}/%{_sysconfdir}/slp.reg.d
install -d -m 755 ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
install -m 644 dnsmasq.conf.example $RPM_BUILD_ROOT/%{_sysconfdir}/dnsmasq.conf
install -m 644 %SOURCE1 $RPM_BUILD_ROOT/%{_sysconfdir}/slp.reg.d/
install -m 644 %SOURCE5 ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dns
install -m 644 %SOURCE4 ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dhcp
install -d 755 ${RPM_BUILD_ROOT}/etc/dbus-1/system.d/
install -m 644 dbus/dnsmasq.conf ${RPM_BUILD_ROOT}/etc/dbus-1/system.d/dnsmasq.conf
install -D -m 0644 %SOURCE2 %{buildroot}%{_unitdir}/dnsmasq.service
install -d -m 0750 ${RPM_BUILD_ROOT}/srv/tftpboot
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT/usr/sbin/rcdnsmasq
install -d -m 755 ${RPM_BUILD_ROOT}/%{_sysconfdir}/dnsmasq.d
install -m 644 trust-anchors.conf ${RPM_BUILD_ROOT}/%{_sysconfdir}/dnsmasq.d/trust-anchors.conf
# utils subpackage
mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_mandir}/man1
install -m 755 contrib/wrt/dhcp_release ${RPM_BUILD_ROOT}%{_bindir}/dhcp_release
install -m 644 contrib/wrt/dhcp_release.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/dhcp_release.1
install -m 755 contrib/wrt/dhcp_lease_time ${RPM_BUILD_ROOT}%{_bindir}/dhcp_lease_time
install -m 644 contrib/wrt/dhcp_lease_time.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/dhcp_lease_time.1
rm contrib/wrt/{dhcp_release,dhcp_lease_time}
rm -rf contrib/Suse
rm -rf contrib/Solaris10
rm -rf contrib/dnsmasq_MacOSX-pre10.4
rm -rf contrib/slackware-dnsmasq
rm -rf contrib/MacOSX-launchd
%find_lang %{name} --with-man
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc CHANGELOG COPYING COPYING-v3 FAQ doc.html setup.html dnsmasq.conf.example contrib dbus
%config(noreplace) %{_sysconfdir}/dnsmasq.conf
%{_sbindir}/dnsmasq
%{_sbindir}/rcdnsmasq
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dns
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dhcp
%dir %{_sysconfdir}/slp.reg.d/
%config %attr(0644,root,root) /%{_sysconfdir}/slp.reg.d/dnsmasq.reg
%{_mandir}/man8/dnsmasq.8.gz
%config(noreplace) /etc/dbus-1/system.d/dnsmasq.conf
%{_unitdir}/dnsmasq.service
%dir %{_sysconfdir}/dnsmasq.d
%config(noreplace) %{_sysconfdir}/dnsmasq.d/trust-anchors.conf
%dir %attr(0750,tftp,tftp) /srv/tftpboot
%files utils
%defattr(-,root,root,-)
%{_bindir}/dhcp_*
%{_mandir}/man1/dhcp_*
%changelog