Commit 75679661 authored by Ingvar Hagelund's avatar Ingvar Hagelund

Fixing up init script according to newer Fedora standards

git-svn-id: http://www.varnish-cache.org/svn/trunk@3124 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent d4995ae4
Summary: Varnish is a high-performance HTTP accelerator Summary: Varnish is a high-performance HTTP accelerator
Name: varnish Name: varnish
Version: 2.0 Version: 2.0
Release: 0.2.tp2 Release: 0.3.20080826svn3124%{?dist}
License: BSD License: BSD
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://www.varnish-cache.org/ URL: http://www.varnish-cache.org/
#Source0: http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.gz Source0: http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.gz
Source0: http://varnish.projects.linpro.no/static/varnish-%{version}-tp2.tar.gz #Source0: http://varnish.projects.linpro.no/static/varnish-cache.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 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 # configure script. Release tarballs would not need this
#BuildRequires: automake autoconf libtool #BuildRequires: automake autoconf libtool
BuildRequires: ncurses-devel libxslt groff BuildRequires: ncurses-devel libxslt groff
Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release} Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release}
Requires: logrotate Requires: logrotate
Requires: ncurses
Requires(pre): shadow-utils Requires(pre): shadow-utils
Requires(post): /sbin/chkconfig Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service Requires(preun): /sbin/service
Requires(preun): initscripts
# Varnish actually needs gcc installed to work. It uses the C compiler # Varnish actually needs gcc installed to work. It uses the C compiler
# at runtime to compile the VCL configuration files. This is by design. # at runtime to compile the VCL configuration files. This is by design.
...@@ -32,7 +34,6 @@ web site: http://www.varnish-cache.org/ ...@@ -32,7 +34,6 @@ web site: http://www.varnish-cache.org/
Summary: Libraries for %{name} Summary: Libraries for %{name}
Group: System Environment/Libraries Group: System Environment/Libraries
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
#Requires: ncurses
#Obsoletes: libvarnish1 #Obsoletes: libvarnish1
%description libs %description libs
...@@ -49,12 +50,23 @@ Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release} ...@@ -49,12 +50,23 @@ Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release}
Development files for %{name}-libs Development files for %{name}-libs
Varnish is a high-performance HTTP accelerator 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 %prep
%setup -n varnish-%{version}-tp2 %setup -q
#%setup -n varnish-cache
# The svn sources needs to generate a suitable configure script # The svn sources needs to generate a suitable configure script
# Release tarballs would not need this # Release tarballs would not need this
# ./autogen.sh #./autogen.sh
mkdir examples mkdir examples
cp bin/varnishd/default.vcl etc/zope-plone.vcl 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; ...@@ -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 s|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%{__make} %{?_smp_mflags} %{__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" %if "%dist" == "el4"
sed -i 's,daemon --pidfile \${\?PIDFILE}\?,daemon,g; sed -i 's,--pidfile \$pidfile,,g;
s,status -p \$PIDFILE,status,g; s,status -p \$pidfile,status,g;
s,killproc -p \$PIDFILE,killproc,g' \ s,killproc -p \$pidfile,killproc,g' \
redhat/varnish.initrc redhat/varnishlog.initrc redhat/varnish.initrc redhat/varnishlog.initrc
%endif %endif
...@@ -93,12 +115,12 @@ find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';' ...@@ -93,12 +115,12 @@ find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';'
mkdir -p %{buildroot}/var/lib/varnish mkdir -p %{buildroot}/var/lib/varnish
mkdir -p %{buildroot}/var/log/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/default.vcl %{buildroot}%{_sysconfdir}/varnish/default.vcl
%{__install} -D -m 0644 redhat/varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/varnish %{__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 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/varnish.initrc %{buildroot}%{_initrddir}/varnish
%{__install} -D -m 0755 redhat/varnishlog.initrc %{buildroot}%{_sysconfdir}/init.d/varnishlog %{__install} -D -m 0755 redhat/varnishlog.initrc %{buildroot}%{_initrddir}/varnishlog
%clean %clean
rm -rf %{buildroot} rm -rf %{buildroot}
...@@ -117,8 +139,8 @@ rm -rf %{buildroot} ...@@ -117,8 +139,8 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/varnish/default.vcl %config(noreplace) %{_sysconfdir}/varnish/default.vcl
%config(noreplace) %{_sysconfdir}/sysconfig/varnish %config(noreplace) %{_sysconfdir}/sysconfig/varnish
%config(noreplace) %{_sysconfdir}/logrotate.d/varnish %config(noreplace) %{_sysconfdir}/logrotate.d/varnish
%{_sysconfdir}/init.d/varnish %{_initrddir}/varnish
%{_sysconfdir}/init.d/varnishlog %{_initrddir}/varnishlog
%files libs %files libs
%defattr(-,root,root,-) %defattr(-,root,root,-)
...@@ -137,17 +159,19 @@ rm -rf %{buildroot} ...@@ -137,17 +159,19 @@ rm -rf %{buildroot}
%{_includedir}/varnish/stats.h %{_includedir}/varnish/stats.h
%{_includedir}/varnish/varnishapi.h %{_includedir}/varnish/varnishapi.h
%{_libdir}/pkgconfig/varnishapi.pc %{_libdir}/pkgconfig/varnishapi.pc
#%files libs-static
#%{_libdir}/libvarnish.a #%{_libdir}/libvarnish.a
#%{_libdir}/libvarnishapi.a #%{_libdir}/libvarnishapi.a
#%{_libdir}/libvarnishcompat.a #%{_libdir}/libvarnishcompat.a
#%{_libdir}/libvcl.a #%{_libdir}/libvcl.a
%doc LICENSE #%doc LICENSE
%pre %pre
getent group varnish >/dev/null || groupadd -r varnish getent group varnish >/dev/null || groupadd -r varnish
getent passwd varnish >/dev/null || \ getent passwd varnish >/dev/null || \
useradd -r -g varnish -d /var/lib/varnish -s /sbin/nologin \ useradd -r -g varnish -d /var/lib/varnish -s /sbin/nologin \
-c "Varnish http accelerator user" varnish -c "Varnish http accelerator user" varnish
exit 0 exit 0
%post %post
...@@ -156,16 +180,16 @@ exit 0 ...@@ -156,16 +180,16 @@ exit 0
%preun %preun
if [ $1 -lt 1 ]; then if [ $1 -lt 1 ]; then
/sbin/service varnish stop > /dev/null 2>/dev/null /sbin/service varnish stop > /dev/null 2>&1
/sbin/service varnishlog stop > /dev/null 2>/dev/null /sbin/service varnishlog stop > /dev/null 2>&1
/sbin/chkconfig --del varnish /sbin/chkconfig --del varnish
/sbin/chkconfig --del varnishlog /sbin/chkconfig --del varnishlog
fi fi
%postun %postun
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
/sbin/service varnish condrestart > /dev/null 2>/dev/null /sbin/service varnish condrestart > /dev/null 2>&1
/sbin/service varnishlog condrestart > /dev/null 2>/dev/null /sbin/service varnishlog condrestart > /dev/null 2>&1
fi fi
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig
...@@ -173,6 +197,12 @@ fi ...@@ -173,6 +197,12 @@ fi
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%changelog %changelog
* Mon Aug 25 2008 Ingvar Hagelund <ingvar@linpro.no> - 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 <ingvar@linpro.no> - 2.0-0.2.tp2 * Mon Aug 18 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.2.tp2
- Changed source, version and release to match 2.0-tp2 - Changed source, version and release to match 2.0-tp2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment