Mailing List Archive

r1403 - trunk/varnish-cache/redhat
Author: ingvar
Date: 2007-05-11 09:51:11 +0200 (Fri, 11 May 2007)
New Revision: 1403

Added:
trunk/varnish-cache/redhat/varnish.logrotate
trunk/varnish-cache/redhat/varnishlog.initrc
Modified:
trunk/varnish-cache/redhat/varnish.initrc
trunk/varnish-cache/redhat/varnish.spec
trunk/varnish-cache/redhat/varnish.sysconfig
Log:
* Fri May 11 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.svn-20070511
- Threw latest changes into svn trunk
- Removed the conversion of manpages into utf8. They are all utf8 in trunk



Modified: trunk/varnish-cache/redhat/varnish.initrc
===================================================================
--- trunk/varnish-cache/redhat/varnish.initrc 2007-05-10 19:24:34 UTC (rev 1402)
+++ trunk/varnish-cache/redhat/varnish.initrc 2007-05-11 07:51:11 UTC (rev 1403)
@@ -5,7 +5,7 @@
# chkconfig: - 90 10
# description: HTTP accelerator
# processname: varnishd
-# config: /etc/varnish.conf
+# config: /etc/varnish/vcl.conf
# pidfile: /var/run/varnish/varnishd.pid

# Source function library.
@@ -24,9 +24,12 @@
-w ${VARNISH_MIN_WORKER_THREADS},${VARNISH_MAX_WORKER_THREADS},${VARNISH_WORKER_THREAD_TIMEOUT} \
-s ${VARNISH_BACKEND_STORAGE}"

-
mkdir -p /var/run/varnish 2>/dev/null

+# Open files (usually 1024, which is way too small for varnish)
+[ ! "${NFILES}" ] && NFILES="131072"
+ulimit -n ${NFILES}
+
# See how we were called.
case "$1" in
start)
@@ -38,7 +41,7 @@
if [ $RETVAL -eq 0 ]
then
echo_success
- touch /var/lock/subsys/varnishd
+ touch /var/lock/subsys/varnish
else
echo_failure
fi
@@ -51,7 +54,7 @@
if [ $RETVAL -eq 0 ]
then
echo_success
- rm -f /var/lock/subsys/varnishd
+ rm -f /var/lock/subsys/varnish
else
echo_failure
fi
@@ -66,8 +69,15 @@
$0 start
RETVAL=$?
;;
+ condrestart)
+ if [ -f /var/lock/subsys/varnish ]; then
+ $0 stop
+ $0 start
+ RETVAL=$?
+ fi
+ ;;
*)
- echo "Usage: $0 {start|stop|status|restart}"
+ echo "Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac


Added: trunk/varnish-cache/redhat/varnish.logrotate
===================================================================
--- trunk/varnish-cache/redhat/varnish.logrotate 2007-05-10 19:24:34 UTC (rev 1402)
+++ trunk/varnish-cache/redhat/varnish.logrotate 2007-05-11 07:51:11 UTC (rev 1403)
@@ -0,0 +1,8 @@
+/var/log/varnish/varnish.log {
+ missingok
+ notifempty
+ sharedscripts
+ postrotate
+ /bin/kill -HUP `cat /var/run/varnish/varnishlog.pid 2>/dev/null` 2> /dev/null || true
+ endscript
+}

Modified: trunk/varnish-cache/redhat/varnish.spec
===================================================================
--- trunk/varnish-cache/redhat/varnish.spec 2007-05-10 19:24:34 UTC (rev 1402)
+++ trunk/varnish-cache/redhat/varnish.spec 2007-05-11 07:51:11 UTC (rev 1403)
@@ -1,116 +1,194 @@
-Summary: Varnish is a high-performance HTTP accelerator.
+Summary: Varnish is a high-performance HTTP accelerator
Name: varnish
-Version: 1.0.3
-Release: 7
+Version: 1.0.svn
+Release: 20070511%{?dist}
License: BSD-like
Group: System Environment/Daemons
URL: http://www.varnish-cache.org/
-Packager: Ingvar Hagelund <ingvar at linpro.no>
-Source0: %{name}-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: gcc gcc-c++ ncurses-devel libtool autoconf automake
-Requires: gcc ncurses kernel >= 2.6.0
-Vendor: Linpro AS, http://www.linpro.no/
+Source0: http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: ncurses-devel
+Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release}
+Requires: logrotate
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/chkconfig
+Requires(preun): /sbin/service

+# Varnish actually needs gcc installed to work. It uses the C compiler
+# at runtime to compile the VCL configuration files. This is by design.
+Requires: gcc
+
%description
-This is the Varnish high-performance HTTP accelerator.
-Documentation and additional information about Varnish is available on
-the following web sites:
- http://www.varnish-cache.org/ Official web site
- http://varnish.projects.linpro.no/ Developer site and wiki
+This is the Varnish high-performance HTTP accelerator. Documentation
+wiki and additional information about Varnish is available on the following
+web site: http://www.varnish-cache.org/

-Technical questions about Varnish and this release should be addressed
-to <varnish-dev at projects.linpro.no>.
+%package libs
+Summary: Libraries for %{name}
+Group: System Environment/Libraries
+BuildRequires: ncurses-devel
+#Requires: ncurses

-Questions about commercial support and services related to Varnish
-should be addressed to <varnish at linpro.no>.
+%description libs
+Libraries for %{name}.
+Varnish is a high-performance HTTP accelerator.

-Copyright (c) 2006 Verdens Gang AS
-Copyright (c) 2006 Linpro AS
-All rights reserved.
-Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+## Removed the -devel package for now
+#%package devel
+#Summary: Development libraries for %{name}
+#Group: System Environment/Libraries
+#BuildRequires: ncurses-devel
+#Requires: kernel >= 2.6.0 varnish-libs = %{version}-%{release}
+#
+#%description devel
+#Development libraries for %{name}.
+#Varnish is a high-performance HTTP accelerator

%prep
%setup -q

+./autogen.sh
+
%build
-rm -rf $RPM_BUILD_ROOT

-./autogen.sh
-%configure --sbindir=/usr/sbin
-%{__make}
+# Remove "--disable static" if you want to build static libraries
+# (ie for the devel package)
+%configure --sbindir=/usr/sbin --disable-static

+# We have to remove rpath - not allowed in Fedora
+# (This problem only visible on 64 bit arches)
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+
+%{__make} %{?_smp_mflags}
+
sed -e ' s/8080/80/g ' etc/vcl.conf > redhat/vcl.conf

%install
-%{makeinstall}
-mkdir -p %{buildroot}%{_sbindir}
-mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}
-mkdir -p %{buildroot}/etc/varnish
-mkdir -p %{buildroot}/etc/init.d
-mkdir -p %{buildroot}/etc/sysconfig
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot} INSTALL="install -p"
+
+# None of these for fedora
+find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';'
+
+# Remove this line to build the devel package
+find %{buildroot}/%{_libdir}/ -name '*.so' -type l -exec rm -f {} ';'
+
mkdir -p %{buildroot}/var/lib/varnish
+mkdir -p %{buildroot}/var/log/varnish

-%{__install} -m 0644 INSTALL %{buildroot}%{_docdir}/%{name}-%{version}/INSTALL
-%{__install} -m 0644 LICENSE %{buildroot}%{_docdir}/%{name}-%{version}/LICENSE
-%{__install} -m 0644 README %{buildroot}%{_docdir}/%{name}-%{version}/README
-%{__install} -m 0644 ChangeLog %{buildroot}%{_docdir}/%{name}-%{version}/ChangeLog
-%{__install} -m 0644 redhat/README.redhat %{buildroot}%{_docdir}/%{name}-%{version}/README.redhat
-%{__install} -m 0644 redhat/vcl.conf %{buildroot}%{_docdir}/%{name}-%{version}/vcl.example.conf
-%{__install} -m 0644 redhat/vcl.conf %{buildroot}/etc/varnish/vcl.conf
-%{__install} -m 0644 redhat/varnish.sysconfig %{buildroot}/etc/sysconfig/varnish
-%{__install} -m 0755 redhat/varnish.initrc %{buildroot}/etc/init.d/varnish
+%{__install} -D -m 0644 redhat/vcl.conf %{buildroot}%{_sysconfdir}/varnish/vcl.conf
+%{__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

%clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
-%{_sbindir}/varnishd
-%{_bindir}/varnishhist
-%{_bindir}/varnishlog
-%{_bindir}/varnishncsa
-%{_bindir}/varnishstat
-%{_bindir}/varnishtop
-%{_libdir}/libvarnish.a
-%{_libdir}/libvarnish.la
-%{_libdir}/libvarnish.so.0.0.0
-%{_libdir}/libvarnish.so.0
-%{_libdir}/libvarnishapi.a
-%{_libdir}/libvarnishapi.la
-%{_libdir}/libvarnishapi.so.0.0.0
-%{_libdir}/libvarnishapi.so.0
-%{_libdir}/libvcl.a
-%{_libdir}/libvcl.la
-%{_libdir}/libvcl.so.0.0.0
-%{_libdir}/libvcl.so.0
+%{_sbindir}/*
+%{_bindir}/*
%{_var}/lib/varnish
-%{_mandir}/man1/varnishd.1.gz
-%{_mandir}/man1/varnishhist.1.gz
-%{_mandir}/man1/varnishlog.1.gz
-%{_mandir}/man1/varnishncsa.1.gz
-%{_mandir}/man1/varnishstat.1.gz
-%{_mandir}/man1/varnishtop.1.gz
-%{_mandir}/man7/vcl.7.gz
+%{_var}/log/varnish
+%{_mandir}/man1/*.1*
+%{_mandir}/man7/*.7*
+%doc INSTALL LICENSE README redhat/README.redhat redhat/vcl.conf ChangeLog
+%dir %{_sysconfdir}/varnish/
+%config(noreplace) %{_sysconfdir}/varnish/vcl.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/varnish
+%config(noreplace) %{_sysconfdir}/logrotate.d/varnish
+%{_sysconfdir}/init.d/varnish
+%{_sysconfdir}/init.d/varnishlog

-%doc %{_docdir}/%{name}-%{version}/INSTALL
-%doc %{_docdir}/%{name}-%{version}/LICENSE
-%doc %{_docdir}/%{name}-%{version}/README
-%doc %{_docdir}/%{name}-%{version}/README.redhat
-%doc %{_docdir}/%{name}-%{version}/ChangeLog
-%doc %{_docdir}/%{name}-%{version}/vcl.example.conf
-%config(noreplace) /etc/varnish/vcl.conf
-%config /etc/init.d/varnish
-%config /etc/sysconfig/varnish
+%files libs
+%defattr(-,root,root,-)
+%{_libdir}/*.so.*
+%doc LICENSE

+## Removed the -devel package for now
+#%files devel
+#%defattr(-,root,root,-)
+#%{_libdir}/libvarnish.so
+#%{_libdir}/libvarnishapi.so
+#%{_libdir}/libvcl.so
+
%post
/sbin/chkconfig --add varnish
-/sbin/chkconfig --list varnish
+/sbin/chkconfig --add varnishlog

+%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/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
+fi
+
+%post libs -p /sbin/ldconfig
+
+%postun libs -p /sbin/ldconfig
+
%changelog
-* Thu Oct 19 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.02-7
+* Fri May 11 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.svn-20070511
+- Threw latest changes into svn trunk
+- Removed the conversion of manpages into utf8. They are all utf8 in trunk
+
+* Wed May 09 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.3-7
+- Simplified the references to the subpackage names
+- Added init and logrotate scripts for varnishlog
+
+* Mon Apr 23 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.3-6
+- Removed unnecessary macro lib_name
+- Fixed inconsistently use of brackets in macros
+- Added a condrestart to the initscript
+- All manfiles included, not just the compressed ones
+- Removed explicit requirement for ncurses. rpmbuild figures out the
+ correct deps by itself.
+- Added ulimit value to initskript and sysconfig file
+- Many thanks to Matthias Saou for valuable input
+
+* Mon Apr 16 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.3-5
+- Added the dist tag
+- Exchanged RPM_BUILD_ROOT variable for buildroot macro
+- Removed stripping of binaries to create a meaningful debug package
+- Removed BuildRoot and URL from subpackages, they are picked from the
+ main package
+- Removed duplication of documentation files in the subpackages
+- 'chkconfig --list' removed from post script
+- Package now includes _sysconfdir/varnish/
+- Trimmed package information
+- Removed static libs and .so-symlinks. They can be added to a -devel package
+ later if anybody misses them
+
+* Wed Feb 28 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.3-4
+- More small specfile fixes for Fedora Extras Package
+ Review Request, see bugzilla ticket 230275
+- Removed rpath (only visible on x86_64 and probably ppc64)
+
+* Tue Feb 27 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.3-3
+- Made post-1.0.3 changes into a patch to the upstream tarball
+- First Fedora Extras Package Review Request
+
+* Fri Feb 23 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.3-2
+- A few other small changes to make rpmlint happy
+
+* Thu Feb 22 2007 Ingvar Hagelund <ingvar at linpro.no> - 1.0.3-1
+- New release 1.0.3. See the general ChangeLog
+- Splitted the package into varnish, libvarnish1 and
+ libvarnish1-devel
+
+* Thu Oct 19 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.0.2-7
- Added a Vendor tag
-* Thu Oct 19 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.02-6
+
+* Thu Oct 19 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.0.2-6
- Added redhat subdir to svn
- Removed default vcl config file. Used the new upstream variant instead.
- Based build on svn. Running autogen.sh as start of build. Also added
@@ -119,11 +197,14 @@
- Changed the sysconfig script to include a lot more nice features.
Most of these were ripped from the Debian package. Updated initscript
to reflect this.
-* Tue Oct 10 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.01-3
+
+* Tue Oct 10 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.0.1-3
- Moved Red Hat specific files to its own subdirectory
+
* Tue Sep 26 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.0.1-2
- Added gcc requirement.
- Changed to an even simpler example vcl in to /etc/varnish (thanks, perbu)
- Added a sysconfig entry
+
* Fri Sep 22 2006 Ingvar Hagelund <ingvar at linpro.no> - 1.0.1-1
- Initial build.

Modified: trunk/varnish-cache/redhat/varnish.sysconfig
===================================================================
--- trunk/varnish-cache/redhat/varnish.sysconfig 2007-05-10 19:24:34 UTC (rev 1402)
+++ trunk/varnish-cache/redhat/varnish.sysconfig 2007-05-11 07:51:11 UTC (rev 1403)
@@ -49,3 +49,6 @@
# Set default ttl in secounds
VARNISH_TTL=120

+# The Maximum number of open files (ulimit)
+# Default : 131072 (system default is usually 1024)
+NFILES=131072

Added: trunk/varnish-cache/redhat/varnishlog.initrc
===================================================================
--- trunk/varnish-cache/redhat/varnishlog.initrc 2007-05-10 19:24:34 UTC (rev 1402)
+++ trunk/varnish-cache/redhat/varnishlog.initrc 2007-05-11 07:51:11 UTC (rev 1403)
@@ -0,0 +1,90 @@
+#! /bin/sh
+#
+# varnishlog Control the varnish HTTP accelerator logging daemon
+#
+# chkconfig: - 90 10
+# description: HTTP accelerator logging daemon
+# processname: varnishlog
+# config:
+# pidfile: /var/run/varnish/varnishlog.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+RETVAL=0
+PROCNAME=varnishlog
+
+. /etc/sysconfig/varnish
+
+if [ "$LOGDAEMON" = "" ]
+then
+ DAEMON="/usr/bin/varnishlog"
+else
+ DAEMON="$LOGDAEMON"
+fi
+
+if [ "$LOGPIDFILE" = "" ]
+then
+ PIDFILE="/var/run/varnish/varnishlog.pid"
+else
+ PIDFILE="$LOGPIDFILE"
+fi
+
+if [ "$LOGFILE" = "" ]; then LOGFILE="/var/log/varnish/varnish.log"; fi
+
+DAEMON_OPTS="-a -w ${LOGFILE} -D -p $PIDFILE"
+
+mkdir -p /var/run/varnish 2>/dev/null
+
+# See how we were called.
+case "$1" in
+ start)
+ echo -n "Starting varnish logging daeon: "
+ daemon $DAEMON "$DAEMON_OPTS"
+ sleep 1
+ pkill -0 $PROCNAME
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]
+ then
+ echo_success
+ touch /var/lock/subsys/varnishlog
+ else
+ echo_failure
+ fi
+ echo
+ ;;
+ stop)
+ echo -n "Stopping varnish logging daemon: "
+ killproc $DAEMON
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]
+ then
+ echo_success
+ rm -f /var/lock/subsys/varnishlog
+ else
+ echo_failure
+ fi
+ echo
+ ;;
+ status)
+ status $PROCNAME
+ RETVAL=$?
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/varnishlog ]; then
+ $0 stop
+ $0 start
+ RETVAL=$?
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart|condrestart}"
+ exit 1
+esac
+
+exit $RETVAL
r1403 - trunk/varnish-cache/redhat [ In reply to ]
ingvar at projects.linpro.no writes:
> Modified: trunk/varnish-cache/redhat/varnish.initrc
> ===================================================================
> --- trunk/varnish-cache/redhat/varnish.initrc 2007-05-10 19:24:34 UTC (rev 1402)
> +++ trunk/varnish-cache/redhat/varnish.initrc 2007-05-11 07:51:11 UTC (rev 1403)
> @@ -5,7 +5,7 @@
> # chkconfig: - 90 10
> # description: HTTP accelerator
> # processname: varnishd
> -# config: /etc/varnish.conf
> +# config: /etc/varnish/vcl.conf
> # pidfile: /var/run/varnish/varnishd.pid

I'm not sure I like the "vcl.conf" name. VCL is already an acronym for
Varnish Configuration Language, so a better name might be "default.vcl".

Varnish will run fine without a VCL script, so preferably no default
script should be installed. If we must have a default script, it should
consist only of commented-out examples.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no