forked from pool/varnish
Drop init scripts masked by service
OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=68
This commit is contained in:
parent
2079fa56a4
commit
4f0aaf30f8
40
varnish.spec
40
varnish.spec
@ -49,9 +49,7 @@ 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} >= 1210
|
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
%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
|
||||||
@ -113,7 +111,7 @@ make %{?_smp_mflags}
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
b="%buildroot";
|
b="%buildroot";
|
||||||
make install DESTDIR="%buildroot";
|
%make_install
|
||||||
# There is no use for them to normal users
|
# There is no use for them to normal users
|
||||||
mv "$b/%_bindir"/* "$b/%_sbindir/";
|
mv "$b/%_bindir"/* "$b/%_sbindir/";
|
||||||
#
|
#
|
||||||
@ -123,15 +121,11 @@ install -Dpm 0644 "%{S:5}" "$b/%_sysconfdir/logrotate.d/varnish";
|
|||||||
#
|
#
|
||||||
##init scripts
|
##init scripts
|
||||||
install -Dpm 0644 "%{S:3}" "$b/var/adm/fillup-templates/sysconfig.%name";
|
install -Dpm 0644 "%{S:3}" "$b/var/adm/fillup-templates/sysconfig.%name";
|
||||||
install -Dpm 0755 "%{S:2}" "$b/%_initddir/varnish";
|
|
||||||
install -Dpm 0755 "%{S:6}" "$b/%_initddir/varnishlog";
|
|
||||||
%if 0%{?_unitdir:1}
|
|
||||||
install -Dpm 0644 "%{S:7}" "$b/%_unitdir/varnish.service";
|
install -Dpm 0644 "%{S:7}" "$b/%_unitdir/varnish.service";
|
||||||
install -Dpm 0644 "%{S:8}" "$b/%_unitdir/varnishlog.service";
|
install -Dpm 0644 "%{S:8}" "$b/%_unitdir/varnishlog.service";
|
||||||
%endif
|
|
||||||
mkdir -p "$b/%_sbindir";
|
mkdir -p "$b/%_sbindir";
|
||||||
ln -s "%_initddir/varnish" "$b/%_sbindir/rcvarnish";
|
ln -s service "$b/%_sbindir/rcvarnish";
|
||||||
ln -s "%_initddir/varnishlog" "$b/%_sbindir/rcvarnishlog";
|
ln -s service "$b/%_sbindir/rcvarnishlog";
|
||||||
#
|
#
|
||||||
##config files
|
##config files
|
||||||
install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf";
|
install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf";
|
||||||
@ -148,47 +142,27 @@ cp -a ChangeLog LICENSE README "$b/%_docdir/%name/"
|
|||||||
%_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 || :
|
||||||
%if 0%{?_unitdir:1}
|
|
||||||
%service_add_pre varnish.service
|
%service_add_pre varnish.service
|
||||||
%service_add_pre varnishlog.service
|
%service_add_pre varnishlog.service
|
||||||
%endif
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%fillup_and_insserv varnish
|
|
||||||
%fillup_and_insserv varnishlog
|
|
||||||
%if 0%{?_unitdir:1}
|
|
||||||
%service_add_post varnish.service
|
%service_add_post varnish.service
|
||||||
%service_add_post varnishlog.service
|
%service_add_post varnishlog.service
|
||||||
%endif
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%stop_on_removal varnish
|
|
||||||
%stop_on_removal varnishlog
|
|
||||||
%if 0%{?_unitdir:1}
|
|
||||||
%service_del_preun varnish.service
|
%service_del_preun varnish.service
|
||||||
%service_del_preun varnishlog.service
|
%service_del_preun varnishlog.service
|
||||||
%endif
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
# Does sysv+systemd not very much conflict? But rpmlint wants to have it...
|
|
||||||
%restart_on_update varnish
|
|
||||||
%restart_on_update varnishlog
|
|
||||||
%if 0%{?_unitdir:1}
|
|
||||||
%service_del_postun varnish.service
|
%service_del_postun varnish.service
|
||||||
%service_del_postun varnishlog.service
|
%service_del_postun varnishlog.service
|
||||||
%endif
|
|
||||||
%insserv_cleanup
|
|
||||||
|
|
||||||
%post -n %library_name -p /sbin/ldconfig
|
%post -n %library_name -p /sbin/ldconfig
|
||||||
%postun -n %library_name -p /sbin/ldconfig
|
%postun -n %library_name -p /sbin/ldconfig
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%_initddir/varnish
|
%_unitdir/*.service
|
||||||
%_initddir/varnishlog
|
|
||||||
%if 0%{?_unitdir:1}
|
|
||||||
%_unitdir
|
|
||||||
%endif
|
|
||||||
%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
|
||||||
@ -202,13 +176,7 @@ cp -a ChangeLog LICENSE README "$b/%_docdir/%name/"
|
|||||||
%dir %attr(0750,varnish,varnish) %pkg_home
|
%dir %attr(0750,varnish,varnish) %pkg_home
|
||||||
%dir %attr(0750,varnish,varnish) %pkg_cachedir
|
%dir %attr(0750,varnish,varnish) %pkg_cachedir
|
||||||
%dir %attr(0750,varnish,varnish) %pkg_logdir
|
%dir %attr(0750,varnish,varnish) %pkg_logdir
|
||||||
|
|
||||||
%if 0%{?suse_version}
|
|
||||||
%_localstatedir/adm/fillup-templates/sysconfig.%name
|
%_localstatedir/adm/fillup-templates/sysconfig.%name
|
||||||
%else
|
|
||||||
%config(noreplace) %_sysconfdir/sysconfig/%name
|
|
||||||
%doc redhat/README.redhat
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files -n %library_name
|
%files -n %library_name
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
|
Loading…
Reference in New Issue
Block a user