2007-01-16 00:10:19 +01:00
|
|
|
#
|
2011-05-05 10:40:27 +02:00
|
|
|
# spec file for package dnsmasq
|
2007-01-16 00:10:19 +01:00
|
|
|
#
|
2019-01-24 09:33:18 +01:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-16 00:10:19 +01:00
|
|
|
#
|
2008-08-15 23:07:27 +02:00
|
|
|
# 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.
|
|
|
|
|
2018-10-22 10:10:05 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:10:19 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: dnsmasq
|
2018-10-22 11:28:32 +02:00
|
|
|
Summary: DNS Forwarder and DHCP Server
|
2018-07-17 10:06:47 +02:00
|
|
|
License: GPL-2.0-only OR GPL-3.0-only
|
2007-01-16 00:10:19 +01:00
|
|
|
Group: Productivity/Networking/DNS/Servers
|
2018-10-22 10:10:05 +02:00
|
|
|
Version: 2.80
|
2012-02-07 16:24:59 +01:00
|
|
|
Release: 0
|
2007-01-16 00:10:19 +01:00
|
|
|
Provides: dns_daemon
|
2013-04-04 10:35:14 +02:00
|
|
|
PreReq: /usr/sbin/useradd /bin/mkdir
|
2007-12-06 17:48:32 +01:00
|
|
|
Url: http://www.thekelleys.org.uk/dnsmasq/
|
2016-03-06 09:08:56 +01:00
|
|
|
Source0: http://www.thekelleys.org.uk/%{name}/%{name}-%{version}.tar.xz
|
|
|
|
Source1: http://www.thekelleys.org.uk/%{name}/%{name}-%{version}.tar.xz.asc
|
|
|
|
Source2: %{name}.keyring
|
|
|
|
Source3: dnsmasq.reg
|
|
|
|
Source4: dnsmasq.service
|
|
|
|
Source5: rc.dnsmasq-suse
|
|
|
|
Source6: SuSEFirewall.dnsmasq-dhcp
|
|
|
|
Source7: SuSEFirewall.dnsmasq-dns
|
|
|
|
Source8: %{name}-rpmlintrc
|
2016-06-16 14:44:49 +02:00
|
|
|
Patch0: dnsmasq-groups.patch
|
2019-07-10 09:24:12 +02:00
|
|
|
Patch1: 0001-fix-build-after-y2038-changes-in-glibc.patch
|
2007-01-16 00:10:19 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-02-07 16:24:59 +01:00
|
|
|
BuildRequires: dbus-1-devel
|
2014-12-29 09:46:59 +01:00
|
|
|
BuildRequires: dos2unix
|
2019-01-24 09:33:18 +01:00
|
|
|
BuildRequires: libidn2-devel
|
2014-08-26 14:34:11 +02:00
|
|
|
BuildRequires: libnettle-devel
|
2018-10-19 20:44:49 +02:00
|
|
|
BuildRequires: lua-devel
|
2012-02-07 16:24:59 +01:00
|
|
|
BuildRequires: pkg-config
|
2012-06-28 08:18:18 +02:00
|
|
|
BuildRequires: pkgconfig(libnetfilter_conntrack)
|
2018-08-29 18:22:36 +02:00
|
|
|
Requires(pre): group(nogroup)
|
2014-08-06 13:50:45 +02:00
|
|
|
%if 0%{?suse_version} >= 1210
|
2019-06-12 08:05:10 +02:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
2014-08-06 13:50:45 +02:00
|
|
|
%endif
|
2018-10-22 11:28:32 +02:00
|
|
|
Requires(pre): group(nogroup)
|
2007-01-16 00:10:19 +01:00
|
|
|
|
|
|
|
%description
|
2018-10-22 11:28:32 +02:00
|
|
|
Dnsmasq provides network infrastructure for small networks: DNS,
|
|
|
|
DHCP, router advertisement and network boot.
|
|
|
|
|
|
|
|
The DNS subsystem supprots forwarding of all query types, and caching
|
|
|
|
of common record types, DNSSEC included. The DHCP subsystem supports
|
|
|
|
DHCPv4, DHCPv6, BOOTP and PXE. RA can be used stand-alone or in
|
|
|
|
conjunction with DHCPv6.
|
2007-01-16 00:10:19 +01:00
|
|
|
|
2013-03-12 19:56:12 +01:00
|
|
|
%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.
|
|
|
|
|
2007-01-16 00:10:19 +01:00
|
|
|
%prep
|
2016-03-06 09:08:56 +01:00
|
|
|
%setup -q
|
2016-06-16 14:44:49 +02:00
|
|
|
%patch0
|
2019-07-10 09:24:12 +02:00
|
|
|
%patch1 -p1
|
2014-12-29 09:46:59 +01:00
|
|
|
|
2017-12-01 16:00:21 +01:00
|
|
|
# Remove the executable bit from python example files to
|
|
|
|
# avoid unwanted automatic dependencies
|
2018-10-22 11:28:32 +02:00
|
|
|
find contrib -name *.py -exec chmod a-x '{}' +
|
2017-12-01 16:00:21 +01:00
|
|
|
|
2014-12-29 09:46:59 +01:00
|
|
|
# Some docs have the DOS line ends
|
|
|
|
dos2unix contrib/systemd/dbus_activation
|
|
|
|
|
|
|
|
# SED-FIX-UPSTREAM -- Fix paths
|
2015-01-06 11:58:42 +01:00
|
|
|
sed -i -e 's|\(PREFIX *= *\)/usr/local|\1/usr|;
|
|
|
|
s|$(LDFLAGS)|$(CFLAGS) $(LDFLAGS)|' \
|
|
|
|
Makefile
|
2014-12-29 09:46:59 +01:00
|
|
|
|
2018-10-19 20:44:49 +02:00
|
|
|
# use lua5.3 instead of lua5.3
|
|
|
|
sed -i -e 's|lua5.2|lua5.3|' Makefile
|
|
|
|
|
2014-12-29 09:46:59 +01:00
|
|
|
# SED-FIX-UPSTREAM -- Fix man page
|
2015-01-06 11:58:42 +01:00
|
|
|
sed -i -e 's|The defaults to "dip",|The default is "nogroup",|' \
|
|
|
|
man/dnsmasq.8
|
2014-12-29 09:46:59 +01:00
|
|
|
|
|
|
|
# SED-FIX-UPSTREAM -- Fix cachesize, group and user
|
2015-01-06 11:58:42 +01:00
|
|
|
sed -i -e 's|CACHESIZ 150|CACHESIZ 2000|;
|
|
|
|
s|CHUSER "nobody"|CHUSER "dnsmasq"|;
|
|
|
|
s|CHGRP "dip"|CHGRP "nogroup"|' \
|
|
|
|
src/config.h
|
2007-01-16 00:10:19 +01:00
|
|
|
|
2015-04-24 10:43:40 +02:00
|
|
|
# Fix trust-anchor.conf location
|
|
|
|
sed -i -e '/trust-anchors.conf/c\#conf-file=/etc/dnsmasq.d/trust-anchors.conf' \
|
|
|
|
dnsmasq.conf.example
|
|
|
|
|
2007-01-16 00:10:19 +01:00
|
|
|
%build
|
|
|
|
mv po/no.po po/nb.po
|
2015-08-25 09:22:17 +02:00
|
|
|
export CFLAGS="%optflags -std=gnu99 -fPIC -DPIC -fpie"
|
2012-02-07 16:24:59 +01:00
|
|
|
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
|
2015-08-25 09:22:17 +02:00
|
|
|
# the dnsmasq make system hashes the configuration flags, so we have to supply the
|
|
|
|
# same flags for make and make install, else everything gets recompiled
|
2019-01-24 09:33:18 +01:00
|
|
|
%define _copts "-DHAVE_DBUS -DHAVE_CONNTRACK -DHAVE_LIBIDN2 -DHAVE_DNSSEC -DHAVE_LUASCRIPT"
|
2015-08-25 09:22:17 +02:00
|
|
|
make %{?_smp_mflags} AWK=gawk all-i18n CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" COPTS=%{_copts}
|
2016-08-03 16:02:20 +02:00
|
|
|
make -C contrib/lease-tools %{?_smp_mflags}
|
2007-01-16 00:10:19 +01:00
|
|
|
|
2008-06-23 21:00:42 +02:00
|
|
|
%pre
|
2012-02-08 17:00:07 +01:00
|
|
|
if ! /usr/bin/getent group tftp >/dev/null; then
|
2018-10-22 11:28:32 +02:00
|
|
|
%{_sbindir}/groupadd -r tftp
|
2012-02-08 17:00:07 +01:00
|
|
|
fi
|
2012-02-08 17:16:51 +01:00
|
|
|
if ! /usr/bin/getent passwd tftp >/dev/null; then
|
|
|
|
%{_sbindir}/useradd -c "TFTP account" -d /srv/tftpboot -G tftp -g tftp \
|
2018-10-22 11:28:32 +02:00
|
|
|
-r -s /bin/false tftp
|
2012-02-08 17:16:51 +01:00
|
|
|
fi
|
2008-06-23 21:00:42 +02:00
|
|
|
if ! /usr/bin/getent passwd dnsmasq >/dev/null; then
|
2018-10-22 11:28:32 +02:00
|
|
|
/usr/sbin/useradd -r -d /var/lib/empty -s /bin/false -c "dnsmasq" -g nogroup -G tftp dnsmasq
|
2008-06-23 21:00:42 +02:00
|
|
|
fi
|
2012-02-08 17:00:07 +01:00
|
|
|
|
2012-02-07 16:24:59 +01:00
|
|
|
%service_add_pre %{name}.service
|
2012-02-08 17:00:07 +01:00
|
|
|
|
2007-01-16 00:10:19 +01:00
|
|
|
%post
|
2012-02-07 16:24:59 +01:00
|
|
|
%service_add_post %{name}.service
|
2017-08-18 13:16:45 +02:00
|
|
|
# reload dbus after install or upgrade to apply new policies
|
2018-07-17 10:06:47 +02:00
|
|
|
if [ -z "${TRANSACTIONAL_UPDATE}" -a -x /usr/bin/systemctl ]; then
|
|
|
|
/usr/bin/systemctl reload dbus.service 2>/dev/null || :
|
|
|
|
fi
|
2012-02-08 17:00:07 +01:00
|
|
|
|
2007-01-16 00:10:19 +01:00
|
|
|
%preun
|
2012-02-07 16:24:59 +01:00
|
|
|
%service_del_preun %{name}.service
|
2012-02-08 17:00:07 +01:00
|
|
|
|
2007-01-16 00:10:19 +01:00
|
|
|
%postun
|
2012-02-07 16:24:59 +01:00
|
|
|
%service_del_postun %{name}.service
|
2017-08-18 13:16:45 +02:00
|
|
|
# reload dbus after uninstall, our policies are gone again
|
2019-02-22 11:44:04 +01:00
|
|
|
if [ $1 -eq 0 -a -z "${TRANSACTIONAL_UPDATE}" \
|
2018-07-17 10:06:47 +02:00
|
|
|
-a -x /usr/bin/systemctl ]; then
|
2017-08-18 13:16:45 +02:00
|
|
|
/usr/bin/systemctl reload dbus.service 2>/dev/null || :
|
|
|
|
fi
|
2007-01-16 00:10:19 +01:00
|
|
|
|
|
|
|
%install
|
2018-10-22 11:28:32 +02:00
|
|
|
make install-i18n DESTDIR=%{buildroot} PREFIX=/usr AWK=gawk COPTS=%{_copts}
|
|
|
|
install -d -m 755 %{buildroot}/%{_sysconfdir}/slp.reg.d
|
|
|
|
install -d -m 755 %{buildroot}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
|
|
|
|
install -m 644 dnsmasq.conf.example %{buildroot}/%{_sysconfdir}/dnsmasq.conf
|
|
|
|
install -m 644 %SOURCE3 %{buildroot}/%{_sysconfdir}/slp.reg.d/
|
|
|
|
install -m 644 %SOURCE7 %{buildroot}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dns
|
|
|
|
install -m 644 %SOURCE6 %{buildroot}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dhcp
|
|
|
|
install -d 755 %{buildroot}/etc/dbus-1/system.d/
|
|
|
|
install -m 644 dbus/dnsmasq.conf %{buildroot}/etc/dbus-1/system.d/dnsmasq.conf
|
2016-03-06 09:08:56 +01:00
|
|
|
install -D -m 0644 %SOURCE4 %{buildroot}%{_unitdir}/dnsmasq.service
|
2018-10-22 11:28:32 +02:00
|
|
|
install -d -m 0755 %{buildroot}/srv/tftpboot
|
|
|
|
ln -sf %{_sbindir}/service %{buildroot}/usr/sbin/rcdnsmasq
|
|
|
|
install -d -m 755 %{buildroot}/%{_sysconfdir}/dnsmasq.d
|
|
|
|
install -m 644 trust-anchors.conf %{buildroot}/%{_sysconfdir}/dnsmasq.d/trust-anchors.conf
|
2013-03-12 19:56:12 +01:00
|
|
|
|
|
|
|
# utils subpackage
|
2018-10-22 11:28:32 +02:00
|
|
|
mkdir -p %{buildroot}/%{_bindir} %{buildroot}/%{_mandir}/man1
|
|
|
|
install -m 755 contrib/lease-tools/dhcp_release %{buildroot}/%{_bindir}/dhcp_release
|
|
|
|
install -m 644 contrib/lease-tools/dhcp_release.1 %{buildroot}/%{_mandir}/man1/dhcp_release.1
|
|
|
|
install -m 755 contrib/lease-tools/dhcp_lease_time %{buildroot}/%{_bindir}/dhcp_lease_time
|
|
|
|
install -m 644 contrib/lease-tools/dhcp_lease_time.1 %{buildroot}/%{_mandir}/man1/dhcp_lease_time.1
|
2016-08-03 16:02:20 +02:00
|
|
|
rm contrib/lease-tools/{dhcp_release,dhcp_lease_time}
|
2014-08-06 13:50:45 +02:00
|
|
|
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
|
2013-03-12 19:56:12 +01:00
|
|
|
|
2012-06-28 08:18:18 +02:00
|
|
|
%find_lang %{name} --with-man
|
2007-01-16 00:10:19 +01:00
|
|
|
|
2008-01-07 02:45:31 +01:00
|
|
|
%files -f %{name}.lang
|
2014-12-29 09:46:59 +01:00
|
|
|
%defattr(-,root,root,-)
|
2018-07-17 10:06:47 +02:00
|
|
|
%license COPYING COPYING-v3
|
|
|
|
%doc CHANGELOG FAQ doc.html setup.html dnsmasq.conf.example contrib dbus
|
2012-06-28 08:18:18 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/dnsmasq.conf
|
2008-01-07 02:45:31 +01:00
|
|
|
%{_sbindir}/dnsmasq
|
2013-04-22 13:35:55 +02:00
|
|
|
%{_sbindir}/rcdnsmasq
|
2008-09-13 03:47:51 +02:00
|
|
|
%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
|
2008-01-07 02:45:31 +01:00
|
|
|
%{_mandir}/man8/dnsmasq.8.gz
|
2014-08-06 13:50:45 +02:00
|
|
|
%config(noreplace) /etc/dbus-1/system.d/dnsmasq.conf
|
2013-04-04 10:35:14 +02:00
|
|
|
%{_unitdir}/dnsmasq.service
|
2015-04-24 10:43:40 +02:00
|
|
|
%dir %{_sysconfdir}/dnsmasq.d
|
|
|
|
%config(noreplace) %{_sysconfdir}/dnsmasq.d/trust-anchors.conf
|
2014-08-06 13:50:45 +02:00
|
|
|
|
2017-09-13 16:15:31 +02:00
|
|
|
%dir %attr(0755,tftp,tftp) /srv/tftpboot
|
2007-01-16 00:10:19 +01:00
|
|
|
|
2013-03-12 19:56:12 +01:00
|
|
|
%files utils
|
2014-12-29 09:46:59 +01:00
|
|
|
%defattr(-,root,root,-)
|
2013-03-12 19:56:12 +01:00
|
|
|
%{_bindir}/dhcp_*
|
|
|
|
%{_mandir}/man1/dhcp_*
|
|
|
|
|
2007-03-06 17:48:16 +01:00
|
|
|
%changelog
|