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
17
dhcpcd.spec
17
dhcpcd.spec
@ -12,8 +12,9 @@ Source1: %{name}.service
|
|||||||
Source2: %{name}@.service
|
Source2: %{name}@.service
|
||||||
Source3: http://roy.marples.name/downloads/%{name}/%{name}-%{version}.tar.xz.distinfo.asc
|
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
|
Source4: http://keys.gnupg.net/pks/lookup?op=get&search=0x597F97EA9AD45549&options=mr#/roy-marples.name.asc
|
||||||
|
Source5: systemd-sysusers.conf
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: chrony
|
BuildRequires: chrony
|
||||||
BuildRequires: systemd-devel
|
BuildRequires: systemd-devel
|
||||||
BuildRequires: ypbind
|
BuildRequires: ypbind
|
||||||
@ -21,9 +22,7 @@ BuildRequires: make
|
|||||||
%if %{with SIGCHECK}
|
%if %{with SIGCHECK}
|
||||||
BuildRequires: gnupg2
|
BuildRequires: gnupg2
|
||||||
%endif
|
%endif
|
||||||
Requires(post): systemd
|
%{?systemd_requires}
|
||||||
Requires(preun): systemd
|
|
||||||
Requires(postun): systemd
|
|
||||||
%description
|
%description
|
||||||
The dhcpcd package provides a minimalistic network configuration daemon
|
The dhcpcd package provides a minimalistic network configuration daemon
|
||||||
that supports IPv4 and IPv6 configuration including configuration discovery
|
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 -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}@.service
|
||||||
install -d %{buildroot}%{_sharedstatedir}/%{_name}
|
install -d %{buildroot}%{_sharedstatedir}/%{_name}
|
||||||
|
|
||||||
|
%pre
|
||||||
|
%sysusers_create_compat %{SOURCE5}
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%systemd_post dhcpcd.service
|
%systemd_post %{name}.service
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%systemd_preun dhcpcd.service
|
%systemd_preun %{name}.service
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
%systemd_postun_with_restart dhcpcd.service
|
%systemd_postun_with_restart %{name}.service
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%config(noreplace) %{_sysconfdir}/%{name}.conf
|
%config(noreplace) %{_sysconfdir}/%{name}.conf
|
||||||
@ -79,6 +81,7 @@ install -d %{buildroot}%{_sharedstatedir}/%{_name}
|
|||||||
%{_sbindir}/%{name}
|
%{_sbindir}/%{name}
|
||||||
%{_unitdir}/%{name}.service
|
%{_unitdir}/%{name}.service
|
||||||
%{_unitdir}/%{name}@.service
|
%{_unitdir}/%{name}@.service
|
||||||
|
%defattr(0664,dhcpcd,root,0775)
|
||||||
%{_sharedstatedir}/%{name}
|
%{_sharedstatedir}/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@ -2,12 +2,10 @@
|
|||||||
Description=dhcpcd on %I
|
Description=dhcpcd on %I
|
||||||
Wants=network.target
|
Wants=network.target
|
||||||
Before=network.target
|
Before=network.target
|
||||||
BindsTo=sys-subsystem-net-devices-%i.device
|
|
||||||
After=sys-subsystem-net-devices-%i.device
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/run/dhcpcd-%I.pid
|
PIDFile=/run/dhcpcd/%I.pid
|
||||||
ExecStart=/usr/sbin/dhcpcd -q %I
|
ExecStart=/usr/sbin/dhcpcd -q %I
|
||||||
ExecStop=/usr/sbin/dhcpcd -x %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