Started update series till 2.0. First out: beta1. Also fixed up init

scripts.
This commit is contained in:
Ingvar Hagelund 2008-09-02 17:54:03 +00:00
parent d2e2167f9a
commit df2061988b
6 changed files with 156 additions and 28 deletions

View File

@ -1 +1 @@
varnish-1.1.2.tar.gz
varnish-2.0-beta1.tar.gz

View File

@ -1 +1 @@
d9f74dae59a2158cdc31f446b6d92397 varnish-1.1.2.tar.gz
66582fd4baa3f7fb91727fa27f41aa94 varnish-2.0-beta1.tar.gz

13
varnish.coresize.patch Normal file
View File

@ -0,0 +1,13 @@
diff -Naur ../varnish-2.0-beta1.orig/redhat/varnish.sysconfig ./redhat/varnish.sysconfig
--- ../varnish-2.0-beta1.orig/redhat/varnish.sysconfig 2008-06-18 12:59:41.000000000 +0200
+++ ./redhat/varnish.sysconfig 2008-09-02 14:50:51.000000000 +0200
@@ -11,6 +11,9 @@
# Default log size is 82MB + header
MEMLOCK=82000
+# Maximum size of corefile (for ulimit -c). Default in Fedora is 0
+# DAEMON_COREFILE_LIMIT="unlimited"
+
# This file contains 4 alternatives, please use only one.
## Alternative 1, Minimal configuration, no VCL

24
varnish.lockfile.patch Normal file
View File

@ -0,0 +1,24 @@
diff -Naur ../varnish-2.0-beta1.orig/redhat/varnish.initrc ./redhat/varnish.initrc
--- ../varnish-2.0-beta1.orig/redhat/varnish.initrc 2008-08-27 09:45:40.000000000 +0200
+++ ./redhat/varnish.initrc 2008-08-29 22:52:23.000000000 +0200
@@ -31,8 +31,6 @@
# Include varnish defaults
[ -e /etc/sysconfig/varnish ] && . /etc/sysconfig/varnish
-lockfile=/var/lock/subsys/$prog
-
start() {
if [ ! -x $exec ]
diff -Naur ../varnish-2.0-beta1.orig/redhat/varnishlog.initrc ./redhat/varnishlog.initrc
--- ../varnish-2.0-beta1.orig/redhat/varnishlog.initrc 2008-08-27 09:45:40.000000000 +0200
+++ ./redhat/varnishlog.initrc 2008-08-29 22:53:30.000000000 +0200
@@ -32,8 +32,6 @@
# Include varnish defaults
[ -e /etc/sysconfig/varnishlog ] && . /etc/sysconfig/varnishlog
-lockfile=/var/lock/subsys/$prog
-
start() {
if [ ! -x $exec ]

View File

@ -1,22 +1,29 @@
Summary: Varnish is a high-performance HTTP accelerator
Name: varnish
Version: 1.1.2
Release: 6%{?dist}
Version: 2.0
Release: 0.6.beta1%{?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-cache.tar.gz
#Source0: http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.gz
Source0: http://downloads.sourceforge.net/varnish/varnish-2.0-beta1.tar.gz
Patch0: varnish.lockfile.patch
Patch1: varnish.coresize.patch
Patch2: varnish.vcl_changes.patch
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: ncurses-devel automake autoconf libtool libxslt
BuildRequires: ncurses-devel libxslt
#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.
@ -31,7 +38,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
@ -48,15 +54,30 @@ 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 -q
#%setup -q
%setup -q -n varnish-2.0-beta1
%patch0 -p0
%patch1 -p0
%patch2 -p0
# The svn sources needs to generate a suitable configure script
# Release tarballs would not need this
# ./autogen.sh
mkdir examples
cp etc/default.vcl etc/zope-plone.vcl examples
cp bin/varnishd/default.vcl etc/zope-plone.vcl examples
%build
@ -70,16 +91,27 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g;
%{__make} %{?_smp_mflags}
sed -e ' s/8080/80/g ' etc/default.vcl > redhat/default.vcl
head -6 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
%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
%check
%{__make} check LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs"
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALL="install -p"
@ -92,12 +124,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}
@ -116,8 +148,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,-)
@ -130,23 +162,27 @@ rm -rf %{buildroot}
%{_libdir}/libvarnishapi.so
%{_libdir}/libvarnishcompat.so
%{_libdir}/libvcl.so
%dir %{_includedir}/varnish
%{_includedir}/varnish/shmlog.h
%{_includedir}/varnish/shmlog_tags.h
%{_includedir}/varnish/stat_field.h
%{_includedir}/varnish/stats.h
%{_includedir}/varnish/varnishapi.h
%{_libdir}/pkgconfig/varnishapi.pc
%doc LICENSE
#%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
@ -155,16 +191,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
@ -172,6 +208,33 @@ fi
%postun libs -p /sbin/ldconfig
%changelog
* Tue Sep 02 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.6.beta1
- Added a commented option for max coresize in the sysconfig script
- Added a comment in README.redhat about upgrading from 1.x to 2.0
* Fri Aug 29 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.5.beta1
- Bumped version numbers and source url for first beta release \o/
- Added a missing directory to the libs-devel package (Michael Schwendt)
- Added the LICENSE file to the libs-devel package
- Moved make check to its proper place
- Removed superfluous definition of lockfile in initscripts
* Wed Aug 27 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.4.20080827svn3136
- Fixed up init script for varnishlog too
* Mon Aug 25 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.3.20080825svn3125
- 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
- Changed source, version and release to match 2.0-tp2
* Thu Aug 14 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.1.20080814svn
- default.vcl has moved
- Added groff to build requirements
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.1.2-6
- Autorebuild for GCC 4.3
@ -204,7 +267,7 @@ fi
- Added the devel package for the header files and static library files
- Added a varnish user, and fixed the init script accordingly
* Thu Jul 05 2007 Dag-Erling Smørgrav <des@linpro.no> - 1.1-1
* Thu Jul 05 2007 Dag-Erling Smørgrav <des@des.no> - 1.1-1
- Bump Version and Release for 1.1
* Mon May 28 2007 Ingvar Hagelund <ingvar@linpro.no> - 1.0.4-3

28
varnish.vcl_changes.patch Normal file
View File

@ -0,0 +1,28 @@
diff -Naur ../varnish-2.0-beta1.orig/redhat/README.redhat ./redhat/README.redhat
--- ../varnish-2.0-beta1.orig/redhat/README.redhat 2008-08-27 09:45:40.000000000 +0200
+++ ./redhat/README.redhat 2008-09-02 16:14:43.000000000 +0200
@@ -5,6 +5,24 @@
Varnish should work fine with GCC 3.3 and above.
+Upgrading from 1.x to 2.0
+=========================
+There are a few changes in the vcl language from varnish-1.x to 2.0.
+Because of varnish' dynamic vcl loading feature, there is no way to
+guarantee that the vcl file in use actually exists on disk. Thus,
+there is no way to securely automate this process, and one must do the
+changes by hand.
+
+In vcl, the word "insert" has been replaced by "deliver".
+
+In the vcl declaration of backends, where one earlier used "set
+backend", backend parts are now just prefixed with a dot, so the
+default localhost configuration will look like this:
+
+backend default {
+ .host = "127.0.0.1";
+ .port = "80";
+}
Configuration of addresses and ports
====================================