From: ingvar Date: Mon, 25 Aug 2008 23:02:47 +0000 (+0000) Subject: Fixing up init script according to newer Fedora standards X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e8d8d3d85755c9a38dd36027c48a727fd52b924;p=varnish Fixing up init script according to newer Fedora standards git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3124 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/redhat/varnish.spec b/varnish-cache/redhat/varnish.spec index 10b4ace7..06fe88d4 100644 --- a/varnish-cache/redhat/varnish.spec +++ b/varnish-cache/redhat/varnish.spec @@ -1,23 +1,25 @@ Summary: Varnish is a high-performance HTTP accelerator Name: varnish Version: 2.0 -Release: 0.2.tp2 +Release: 0.3.20080826svn3124%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.varnish-cache.org/ -#Source0: http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.gz -Source0: http://varnish.projects.linpro.no/static/varnish-%{version}-tp2.tar.gz +Source0: http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.gz +#Source0: http://varnish.projects.linpro.no/static/varnish-cache.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -# The svn sources needs autoconf, automake and libtoolto generate a suitable +# The svn sources needs autoconf, automake and libtool to generate a suitable # configure script. Release tarballs would not need this #BuildRequires: automake autoconf libtool BuildRequires: ncurses-devel libxslt groff Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release} Requires: logrotate +Requires: ncurses Requires(pre): shadow-utils Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service +Requires(preun): initscripts # Varnish actually needs gcc installed to work. It uses the C compiler # at runtime to compile the VCL configuration files. This is by design. @@ -32,7 +34,6 @@ web site: http://www.varnish-cache.org/ Summary: Libraries for %{name} Group: System Environment/Libraries BuildRequires: ncurses-devel -#Requires: ncurses #Obsoletes: libvarnish1 %description libs @@ -49,12 +50,23 @@ Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release} Development files for %{name}-libs Varnish is a high-performance HTTP accelerator +#%package libs-static +#Summary: Files for static linking of %{name} library functions +#Group: System Environment/Libraries +#BuildRequires: ncurses-devel +#Requires: kernel >= 2.6.0 varnish-libs-devel = %{version}-%{release} +# +#%description libs-static +#Files for static linking of varnish library functions +#Varnish is a high-performance HTTP accelerator + %prep -%setup -n varnish-%{version}-tp2 +%setup -q +#%setup -n varnish-cache # The svn sources needs to generate a suitable configure script # Release tarballs would not need this -# ./autogen.sh +#./autogen.sh mkdir examples cp bin/varnishd/default.vcl etc/zope-plone.vcl examples @@ -70,14 +82,24 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g; s|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %{__make} %{?_smp_mflags} +#%{__make} check LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs" + +head -6 etc/default.vcl > redhat/default.vcl -sed -e ' s/8080/80/g ' etc/default.vcl > redhat/default.vcl +cat << EOF >> redhat/default.vcl +backend default { + .host = "127.0.0.1"; + .port = "80"; +} +EOF +tail -n +11 etc/default.vcl >> redhat/default.vcl +# This part probably broken now %if "%dist" == "el4" - sed -i 's,daemon --pidfile \${\?PIDFILE}\?,daemon,g; - s,status -p \$PIDFILE,status,g; - s,killproc -p \$PIDFILE,killproc,g' \ + sed -i 's,--pidfile \$pidfile,,g; + s,status -p \$pidfile,status,g; + s,killproc -p \$pidfile,killproc,g' \ redhat/varnish.initrc redhat/varnishlog.initrc %endif @@ -93,12 +115,12 @@ find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';' mkdir -p %{buildroot}/var/lib/varnish mkdir -p %{buildroot}/var/log/varnish - +mkdir -p %{buildroot}/var/run/varnish %{__install} -D -m 0644 redhat/default.vcl %{buildroot}%{_sysconfdir}/varnish/default.vcl %{__install} -D -m 0644 redhat/varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/varnish %{__install} -D -m 0644 redhat/varnish.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/varnish -%{__install} -D -m 0755 redhat/varnish.initrc %{buildroot}%{_sysconfdir}/init.d/varnish -%{__install} -D -m 0755 redhat/varnishlog.initrc %{buildroot}%{_sysconfdir}/init.d/varnishlog +%{__install} -D -m 0755 redhat/varnish.initrc %{buildroot}%{_initrddir}/varnish +%{__install} -D -m 0755 redhat/varnishlog.initrc %{buildroot}%{_initrddir}/varnishlog %clean rm -rf %{buildroot} @@ -117,8 +139,8 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/varnish/default.vcl %config(noreplace) %{_sysconfdir}/sysconfig/varnish %config(noreplace) %{_sysconfdir}/logrotate.d/varnish -%{_sysconfdir}/init.d/varnish -%{_sysconfdir}/init.d/varnishlog +%{_initrddir}/varnish +%{_initrddir}/varnishlog %files libs %defattr(-,root,root,-) @@ -137,17 +159,19 @@ rm -rf %{buildroot} %{_includedir}/varnish/stats.h %{_includedir}/varnish/varnishapi.h %{_libdir}/pkgconfig/varnishapi.pc + +#%files libs-static #%{_libdir}/libvarnish.a #%{_libdir}/libvarnishapi.a #%{_libdir}/libvarnishcompat.a #%{_libdir}/libvcl.a -%doc LICENSE +#%doc LICENSE %pre getent group varnish >/dev/null || groupadd -r varnish getent passwd varnish >/dev/null || \ -useradd -r -g varnish -d /var/lib/varnish -s /sbin/nologin \ - -c "Varnish http accelerator user" varnish + useradd -r -g varnish -d /var/lib/varnish -s /sbin/nologin \ + -c "Varnish http accelerator user" varnish exit 0 %post @@ -156,16 +180,16 @@ exit 0 %preun if [ $1 -lt 1 ]; then - /sbin/service varnish stop > /dev/null 2>/dev/null - /sbin/service varnishlog stop > /dev/null 2>/dev/null + /sbin/service varnish stop > /dev/null 2>&1 + /sbin/service varnishlog stop > /dev/null 2>&1 /sbin/chkconfig --del varnish /sbin/chkconfig --del varnishlog fi %postun if [ $1 -ge 1 ]; then - /sbin/service varnish condrestart > /dev/null 2>/dev/null - /sbin/service varnishlog condrestart > /dev/null 2>/dev/null + /sbin/service varnish condrestart > /dev/null 2>&1 + /sbin/service varnishlog condrestart > /dev/null 2>&1 fi %post libs -p /sbin/ldconfig @@ -173,6 +197,12 @@ fi %postun libs -p /sbin/ldconfig %changelog +* Mon Aug 25 2008 Ingvar Hagelund - 2.0-0.3.20080825svn3120 +- Fixing up init script according to newer Fedora standards +- The build now runs the test suite after compiling +- Requires initscripts +- Change default.vcl from nothing but comments to point to localhost:80, + * Mon Aug 18 2008 Ingvar Hagelund - 2.0-0.2.tp2 - Changed source, version and release to match 2.0-tp2