SHA256
1
0
forked from pool/varnish

Add rc symlinks, guard systemd lines

OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=55
This commit is contained in:
Jan Engelhardt 2012-02-28 15:45:40 +00:00 committed by Git OBS Bridge
parent 06d2f47997
commit d23012279c

View File

@ -106,32 +106,33 @@ export CFLAGS="%optflags -fstack-protector"
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
b="%buildroot";
%makeinstall %makeinstall
find %buildroot -ls
# There is no use for them to normal users # There is no use for them to normal users
mv %buildroot/%_bindir/* %buildroot/%_sbindir/ mv "$b/%_bindir"/* "$b/%_sbindir/";
#
# remove unneeded files
# libvarnish.la has -lrt as dependency lib
#rm -fv %buildroot%_libdir/*.la
# #
##missing directories ##missing directories
install -d -m 0755 %buildroot{%pkg_logdir,%pkg_home} install -dm 0755 "$b"/{%pkg_logdir,%pkg_home};
install -Dpm 0644 %{S:5} %buildroot%_sysconfdir/logrotate.d/varnish install -Dpm 0644 "%{S:5}" "$b/%_sysconfdir/logrotate.d/varnish";
# #
##init scripts ##init scripts
install -Dpm 0644 %{S:3} %buildroot/var/adm/fillup-templates/sysconfig.%name install -Dpm 0644 "%{S:3}" "$b/var/adm/fillup-templates/sysconfig.%name";
install -Dpm 0755 %{S:2} %buildroot/%_initddir/varnish install -Dpm 0755 "%{S:2}" "$b/%_initddir/varnish";
install -Dpm 0755 %{S:6} %buildroot/%_initddir/varnishlog install -Dpm 0755 "%{S:6}" "$b/%_initddir/varnishlog";
install -Dpm 0644 "%{S:7}" "%buildroot/lib/systemd/system/varnish.service"; %if 0%{?_unitdir:1}
install -Dpm 0644 "%{S:8}" "%buildroot/lib/systemd/system/varnishlog.service"; 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";
# #
##config files ##config files
install -Dpm 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf";
install -Dpm 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf.example install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf.example";
find "%buildroot" -type f -name "*.la" -delete find "$b" -type f -name "*.la" -delete
mkdir -p "%buildroot/%pkg_logdir" mkdir -p "$b/%pkg_logdir"
%pre %pre
%_bindir/getent group varnish >/dev/null || \ %_bindir/getent group varnish >/dev/null || \
@ -139,27 +140,35 @@ 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 || :
%if 0%{?service_add_pre: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 varnish
%fillup_and_insserv varnishlog %fillup_and_insserv varnishlog
%if 0%{?service_add_post: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 varnish
%stop_on_removal varnishlog %stop_on_removal varnishlog
%if 0%{?service_del_preun: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 not this very much conflict? But rpmlint wants to have it... # 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
%if 0%{?service_del_postun:1}
%service_del_postun varnish.service %service_del_postun varnish.service
%service_del_postun varnishlog.service %service_del_postun varnishlog.service
%endif
%insserv_cleanup %insserv_cleanup
%post -n %library_name -p /sbin/ldconfig %post -n %library_name -p /sbin/ldconfig
@ -169,7 +178,9 @@ mkdir -p "%buildroot/%pkg_logdir"
%defattr(-,root,root) %defattr(-,root,root)
%_initddir/varnish %_initddir/varnish
%_initddir/varnishlog %_initddir/varnishlog
%if 0%{?_unitdir:1}
%_unitdir %_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
@ -177,6 +188,7 @@ mkdir -p "%buildroot/%pkg_logdir"
%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/default.vcl %config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/default.vcl
%_libdir/varnish %_libdir/varnish
%_sbindir/varnish* %_sbindir/varnish*
%_sbindir/rcvarnish*
%_mandir/man*/* %_mandir/man*/*
%doc ChangeLog LICENSE README %doc ChangeLog LICENSE README
%dir %attr(0750,varnish,varnish) %pkg_home %dir %attr(0750,varnish,varnish) %pkg_home