Modernize the spec file a bit

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-02-25 12:24:56 +01:00
parent dc378b565b
commit f5bcbb09d9
1 changed files with 7 additions and 13 deletions

View File

@ -16,7 +16,6 @@ Version: 2.78
Release: 5%{?extraversion:.%{extraversion}}%{?dist} Release: 5%{?extraversion:.%{extraversion}}%{?dist}
Summary: A lightweight DHCP/caching DNS server Summary: A lightweight DHCP/caching DNS server
Group: System Environment/Daemons
License: GPLv2 or GPLv3 License: GPLv2 or GPLv3
URL: http://www.thekelleys.org.uk/dnsmasq/ URL: http://www.thekelleys.org.uk/dnsmasq/
Source0: http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?extraversion}.tar.xz Source0: http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?extraversion}.tar.xz
@ -35,9 +34,7 @@ BuildRequires: nettle-devel
Buildrequires: gcc Buildrequires: gcc
BuildRequires: systemd BuildRequires: systemd
Requires(post): systemd %{?systemd_requires}
Requires(preun): systemd
Requires(postun): systemd
%description %description
Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server. Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server.
@ -51,11 +48,10 @@ machines.
%package utils %package utils
Summary: Utilities for manipulating DHCP server leases Summary: Utilities for manipulating DHCP server leases
Group: System Environment/Daemons
%description utils %description utils
Utilities that use the standard DHCP protocol to Utilities that use the standard DHCP protocol to query/remove a DHCP
query/remove a DHCP server's leases. server's leases.
%prep %prep
@ -90,12 +86,11 @@ EOF
%build %build
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" %make_build CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
make -C contrib/lease-tools %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" %make_build -C contrib/lease-tools CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
%install %install
rm -rf $RPM_BUILD_ROOT
# normally i'd do 'make install'...it's a bit messy, though # normally i'd do 'make install'...it's a bit messy, though
mkdir -p $RPM_BUILD_ROOT%{_sbindir} \ mkdir -p $RPM_BUILD_ROOT%{_sbindir} \
$RPM_BUILD_ROOT%{_mandir}/man8 \ $RPM_BUILD_ROOT%{_mandir}/man8 \
@ -124,7 +119,7 @@ install -m644 %{SOURCE1} %{buildroot}%{_unitdir}
rm -rf %{buildroot}%{_initrddir} rm -rf %{buildroot}%{_initrddir}
#install systemd sysuser file #install systemd sysuser file
install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/sysusers.d/dnsmasq.conf install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/dnsmasq.conf
%post %post
#https://fedoraproject.org/wiki/Changes/SystemdSysusers #https://fedoraproject.org/wiki/Changes/SystemdSysusers
@ -138,7 +133,6 @@ install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/sysusers.d/dnsmasq.conf
%systemd_postun_with_restart dnsmasq.service %systemd_postun_with_restart dnsmasq.service
%files %files
%defattr(-,root,root,-)
%doc CHANGELOG FAQ doc.html setup.html dbus/DBus-interface %doc CHANGELOG FAQ doc.html setup.html dbus/DBus-interface
%license COPYING COPYING-v3 %license COPYING COPYING-v3
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnsmasq.conf %config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnsmasq.conf
@ -151,7 +145,7 @@ install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/sysusers.d/dnsmasq.conf
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%{_datadir}/%{name}/trust-anchors.conf %{_datadir}/%{name}/trust-anchors.conf
%dir /usr/lib/sysusers.d %dir /usr/lib/sysusers.d
/usr/lib/sysusers.d/dnsmasq.conf %{_sysusersdir}/dnsmasq.conf
%files utils %files utils
%license COPYING COPYING-v3 %license COPYING COPYING-v3