SHA256
1
0
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:
Jan Engelhardt 2015-03-27 18:14:08 +00:00 committed by Git OBS Bridge
parent 2079fa56a4
commit 4f0aaf30f8

View File

@ -49,9 +49,7 @@ Prereq(post): %_sbindir/useradd %_sbindir/groupadd
%if 0%{?suse_version} >= 1010
Recommends: logrotate
%endif
%if 0%{?suse_version} >= 1210
BuildRequires: systemd-rpm-macros
%endif
%define pkg_home %_localstatedir/lib/%name
%define pkg_logdir %_localstatedir/log/%name
%define pkg_cachedir %_localstatedir/cache/%name
@ -113,7 +111,7 @@ make %{?_smp_mflags}
%install
b="%buildroot";
make install DESTDIR="%buildroot";
%make_install
# There is no use for them to normal users
mv "$b/%_bindir"/* "$b/%_sbindir/";
#
@ -123,15 +121,11 @@ install -Dpm 0644 "%{S:5}" "$b/%_sysconfdir/logrotate.d/varnish";
#
##init scripts
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:8}" "$b/%_unitdir/varnishlog.service";
%endif
mkdir -p "$b/%_sbindir";
ln -s "%_initddir/varnish" "$b/%_sbindir/rcvarnish";
ln -s "%_initddir/varnishlog" "$b/%_sbindir/rcvarnishlog";
ln -s service "$b/%_sbindir/rcvarnish";
ln -s service "$b/%_sbindir/rcvarnishlog";
#
##config files
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 || \
%_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \
-d %pkg_home varnish || :
%if 0%{?_unitdir:1}
%service_add_pre varnish.service
%service_add_pre varnishlog.service
%endif
%post
%fillup_and_insserv varnish
%fillup_and_insserv varnishlog
%if 0%{?_unitdir:1}
%service_add_post varnish.service
%service_add_post varnishlog.service
%endif
%preun
%stop_on_removal varnish
%stop_on_removal varnishlog
%if 0%{?_unitdir:1}
%service_del_preun varnish.service
%service_del_preun varnishlog.service
%endif
%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 varnishlog.service
%endif
%insserv_cleanup
%post -n %library_name -p /sbin/ldconfig
%postun -n %library_name -p /sbin/ldconfig
%files
%defattr(-,root,root)
%_initddir/varnish
%_initddir/varnishlog
%if 0%{?_unitdir:1}
%_unitdir
%endif
%_unitdir/*.service
%config(noreplace) %_sysconfdir/logrotate.d/varnish
%dir %attr(0750,root,varnish) %_sysconfdir/%name/
%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_cachedir
%dir %attr(0750,varnish,varnish) %pkg_logdir
%if 0%{?suse_version}
%_localstatedir/adm/fillup-templates/sysconfig.%name
%else
%config(noreplace) %_sysconfdir/sysconfig/%name
%doc redhat/README.redhat
%endif
%files -n %library_name
%defattr(-,root,root,-)