Modernize spec to recent changes
Add dhcpcd user on installation, make local state directory writable by it.
This commit is contained in:
parent
0e7b0e19cd
commit
6ea6558ed4
19
dhcpcd.spec
19
dhcpcd.spec
@ -12,8 +12,9 @@ Source1: %{name}.service
|
||||
Source2: %{name}@.service
|
||||
Source3: http://roy.marples.name/downloads/%{name}/%{name}-%{version}.tar.xz.distinfo.asc
|
||||
Source4: http://keys.gnupg.net/pks/lookup?op=get&search=0x597F97EA9AD45549&options=mr#/roy-marples.name.asc
|
||||
BuildRequires: gcc
|
||||
BuildRequires: systemd
|
||||
Source5: systemd-sysusers.conf
|
||||
BuildRequires: gcc
|
||||
BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: chrony
|
||||
BuildRequires: systemd-devel
|
||||
BuildRequires: ypbind
|
||||
@ -21,9 +22,7 @@ BuildRequires: make
|
||||
%if %{with SIGCHECK}
|
||||
BuildRequires: gnupg2
|
||||
%endif
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
%{?systemd_requires}
|
||||
%description
|
||||
The dhcpcd package provides a minimalistic network configuration daemon
|
||||
that supports IPv4 and IPv6 configuration including configuration discovery
|
||||
@ -55,14 +54,17 @@ install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
||||
install -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}@.service
|
||||
install -d %{buildroot}%{_sharedstatedir}/%{_name}
|
||||
|
||||
%pre
|
||||
%sysusers_create_compat %{SOURCE5}
|
||||
|
||||
%post
|
||||
%systemd_post dhcpcd.service
|
||||
%systemd_post %{name}.service
|
||||
|
||||
%preun
|
||||
%systemd_preun dhcpcd.service
|
||||
%systemd_preun %{name}.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart dhcpcd.service
|
||||
%systemd_postun_with_restart %{name}.service
|
||||
|
||||
%files
|
||||
%config(noreplace) %{_sysconfdir}/%{name}.conf
|
||||
@ -79,6 +81,7 @@ install -d %{buildroot}%{_sharedstatedir}/%{_name}
|
||||
%{_sbindir}/%{name}
|
||||
%{_unitdir}/%{name}.service
|
||||
%{_unitdir}/%{name}@.service
|
||||
%defattr(0664,dhcpcd,root,0775)
|
||||
%{_sharedstatedir}/%{name}
|
||||
|
||||
%changelog
|
||||
|
@ -2,12 +2,10 @@
|
||||
Description=dhcpcd on %I
|
||||
Wants=network.target
|
||||
Before=network.target
|
||||
BindsTo=sys-subsystem-net-devices-%i.device
|
||||
After=sys-subsystem-net-devices-%i.device
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/dhcpcd-%I.pid
|
||||
PIDFile=/run/dhcpcd/%I.pid
|
||||
ExecStart=/usr/sbin/dhcpcd -q %I
|
||||
ExecStop=/usr/sbin/dhcpcd -x %I
|
||||
|
||||
|
1
systemd-sysusers.conf
Normal file
1
systemd-sysusers.conf
Normal file
@ -0,0 +1 @@
|
||||
u dhcpcd - "Minimalistic DHCP client" /var/lib/dhcpcd
|
Loading…
Reference in New Issue
Block a user