Add systemd macros as per http://en.opensuse.org/openSUSE:Systemd_packaging_guidelines
OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=54
This commit is contained in:
parent
cdbd881dad
commit
06d2f47997
15
varnish.spec
15
varnish.spec
@ -41,6 +41,10 @@ Prereq(post): %_sbindir/useradd %_sbindir/groupadd
|
|||||||
%if 0%{?suse_version} >= 1010
|
%if 0%{?suse_version} >= 1010
|
||||||
Recommends: logrotate
|
Recommends: logrotate
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?suse_version} >= 1140
|
||||||
|
BuildRequires: systemd
|
||||||
|
%{?systemd_requires}
|
||||||
|
%endif
|
||||||
%define pkg_home %_localstatedir/lib/%name
|
%define pkg_home %_localstatedir/lib/%name
|
||||||
%define pkg_logdir %_localstatedir/log/%name
|
%define pkg_logdir %_localstatedir/log/%name
|
||||||
%define pkg_cachedir %_localstatedir/cache/%name
|
%define pkg_cachedir %_localstatedir/cache/%name
|
||||||
@ -135,18 +139,27 @@ mkdir -p "%buildroot/%pkg_logdir"
|
|||||||
%_bindir/getent passwd varnish >/dev/null || \
|
%_bindir/getent passwd varnish >/dev/null || \
|
||||||
%_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \
|
%_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \
|
||||||
-d %pkg_home varnish || :
|
-d %pkg_home varnish || :
|
||||||
|
%service_add_pre varnish.service
|
||||||
|
%service_add_pre varnishlog.service
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%fillup_and_insserv varnish
|
%fillup_and_insserv varnish
|
||||||
%fillup_and_insserv varnishlog
|
%fillup_and_insserv varnishlog
|
||||||
|
%service_add_post varnish.service
|
||||||
|
%service_add_post varnishlog.service
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%stop_on_removal varnish
|
%stop_on_removal varnish
|
||||||
%stop_on_removal varnishlog
|
%stop_on_removal varnishlog
|
||||||
|
%service_del_preun varnish.service
|
||||||
|
%service_del_preun varnishlog.service
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
# Does not this very much conflict? But rpmlint wants to have it...
|
||||||
%restart_on_update varnish
|
%restart_on_update varnish
|
||||||
%restart_on_update varnishlog
|
%restart_on_update varnishlog
|
||||||
|
%service_del_postun varnish.service
|
||||||
|
%service_del_postun varnishlog.service
|
||||||
%insserv_cleanup
|
%insserv_cleanup
|
||||||
|
|
||||||
%post -n %library_name -p /sbin/ldconfig
|
%post -n %library_name -p /sbin/ldconfig
|
||||||
@ -156,7 +169,7 @@ mkdir -p "%buildroot/%pkg_logdir"
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%_initddir/varnish
|
%_initddir/varnish
|
||||||
%_initddir/varnishlog
|
%_initddir/varnishlog
|
||||||
/lib/systemd
|
%_unitdir
|
||||||
%config(noreplace) %_sysconfdir/logrotate.d/varnish
|
%config(noreplace) %_sysconfdir/logrotate.d/varnish
|
||||||
%dir %attr(0750,root,varnish) %_sysconfdir/%name/
|
%dir %attr(0750,root,varnish) %_sysconfdir/%name/
|
||||||
%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf
|
%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user