[varnish] - New upstream version 3.0.2 - Removed INSTALL as requested by rpmlint - Added a ld.so.conf.d fragme
Ingvar Hagelund
ingvar at fedoraproject.org
Wed Mar 7 16:03:06 UTC 2012
commit 09fe4db73c4e62a8f8c7bf2561280a54cc60cf0e
Author: Ingvar Hagelund <ingvar at redpill-linpro.com>
Date: Wed Mar 7 17:00:11 2012 +0100
- New upstream version 3.0.2
- Removed INSTALL as requested by rpmlint
- Added a ld.so.conf.d fragment file listing libdir/varnish
- Removed redundant doc/html/_sources
- systemd support from fedora 17
- Stopped using macros for make and install, according to
Fedora's packaging guidelines
- Changes merged from upstream
- Removed unnecessary patch for system jemalloc, upstream now supports this
.gitignore | 1 +
sources | 2 +-
varnish.params | 40 +++++++++++++
varnish.service | 46 +++++++++++++++
varnish.spec | 154 +++++++++++++++++++++++++++++++++++---------------
varnishlog.service | 11 ++++
varnishncsa.service | 11 ++++
7 files changed, 218 insertions(+), 47 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3b7bd9e..5a0193f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ varnish-2.1.2.tar.gz
varnish-2.1.3.tar.gz
/varnish-2.1.4.tar.gz
/varnish-2.1.5.tar.gz
+/varnish-3.0.2.tar.gz
diff --git a/sources b/sources
index e93f6a8..df22176 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-2d2f227da36a2a240c475304c717b8e3 varnish-2.1.5.tar.gz
+c8eae0aabbe66b6daabdf3a1f58cd47a varnish-3.0.2.tar.gz
diff --git a/varnish.params b/varnish.params
new file mode 100644
index 0000000..d889ee4
--- /dev/null
+++ b/varnish.params
@@ -0,0 +1,40 @@
+# Varnish environment configuration description. This was derived from
+# the old style sysconfig/defaults settings
+
+# Set this to 1 to make systemd reload try to switch vcl without restart.
+RELOAD_VCL=1
+
+# Main configuration file. You probably want to change it.
+VARNISH_VCL_CONF=/etc/varnish/default.vcl
+
+# Default address and port to bind to. Blank address means all IPv4
+# and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
+# quad, or an IPv6 address in brackets.
+# VARNISH_LISTEN_ADDRESS=192.168.1.5
+VARNISH_LISTEN_PORT=6081
+
+# Admin interface listen address and port
+VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
+VARNISH_ADMIN_LISTEN_PORT=6082
+
+# Shared secret file for admin interface
+VARNISH_SECRET_FILE=/etc/varnish/secret
+
+# The minimum and maximum number of worker threads to start
+VARNISH_MIN_THREADS=1
+VARNISH_MAX_THREADS=1000
+
+# Idle timeout for worker threads
+VARNISH_THREAD_TIMEOUT=120
+
+# Backend storage specification, see Storage Types in the varnishd(5)
+# man page for details.
+VARNISH_STORAGE="file,/var/lib/varnish/varnish_storage.bin,1G"
+
+# Default TTL used when the backend does not specify one
+VARNISH_TTL=120
+
+# User and group for the varnishd worker processes
+VARNISH_USER=varnish
+VARNISH_GROUP=varnish
+
diff --git a/varnish.service b/varnish.service
new file mode 100644
index 0000000..ec255d7
--- /dev/null
+++ b/varnish.service
@@ -0,0 +1,46 @@
+[Unit]
+Description=Varnish a high-perfomance HTTP accelerator
+After=syslog.target network.target
+
+[Service]
+
+#
+# If you want to make changes to this file, please copy it to
+# /etc/systemd/system/varnish and make your changes there.
+# This will override the file kept at /lib/systemd/system/varnish
+#
+# Enviroment variables may be found in /etc/varnish/varnish.params
+#
+
+# Maximum number of open files (for ulimit -n)
+LimitNOFILE=131072
+
+# Locked shared memory (for ulimit -l)
+# Default log size is 82MB + header
+LimitMEMLOCK=82000
+
+# Maximum size of the corefile.
+LimitCORE=infinity
+
+EnvironmentFile=/etc/varnish/varnish.params
+
+Type=forking
+PIDFile=/var/run/varnish.pid
+ExecStart=/usr/sbin/varnishd \
+ -P /var/run/varnish.pid \
+ -f $VARNISH_VCL_CONF \
+ -a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
+ -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
+ -t $VARNISH_TTL \
+ -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \
+ -u $VARNISH_USER \
+ -g $VARNISH_GROUP \
+ -S $VARNISH_SECRET_FILE \
+ -s $VARNISH_STORAGE \
+ $DAEMON_OPTS
+
+ExecReload=/usr/sbin/varnish_reload_vcl
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/varnish.spec b/varnish.spec
index 145e2a7..bf5546d 100644
--- a/varnish.spec
+++ b/varnish.spec
@@ -1,19 +1,19 @@
Summary: High-performance HTTP accelerator
Name: varnish
-Version: 2.1.5
-Release: 4%{?dist}
+Version: 3.0.2
+Release: 1%{?dist}
License: BSD
Group: System Environment/Daemons
URL: http://www.varnish-cache.org/
Source0: http://repo.varnish-cache.org/source/%{name}-%{version}.tar.gz
-
-Patch6: varnish.jemalloc_as_system_library.patch
-
+Source1: varnish.service
+Source2: varnish.params
+Source3: varnishncsa.service
+Source4: varnishlog.service
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-# Needs to regenerate configure after patching in jemalloc system lib support
-BuildRequires: automake autoconf libtool
-
+# To build from git, start with a make dist, see redhat/README.redhat
+# You will need at least automake autoconf libtool python-docutils
+#BuildRequires: automake autoconf libtool python-docutils
BuildRequires: ncurses-devel libxslt groff pcre-devel pkgconfig jemalloc-devel
Requires: varnish-libs = %{version}-%{release}
Requires: logrotate
@@ -24,7 +24,16 @@ Requires(pre): shadow-utils
Requires(post): /sbin/chkconfig, /usr/bin/uuidgen
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
+%if %{undefined suse_version}
Requires(preun): initscripts
+%endif
+%if 0%{?fedora} >= 17
+Requires(post): systemd-units
+Requires(post): systemd-sysv
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+BuildRequires: systemd-units
+%endif
# Varnish actually needs gcc installed to work. It uses the C compiler
# at runtime to compile the VCL configuration files. This is by design.
@@ -76,27 +85,6 @@ Documentation files for %name
%setup -q
#%setup -q -n varnish-cache
-%patch6
-
-# Needs to regenerate configure after patching in jemalloc system lib support
-# Release tarballs would not need this
-./autogen.sh
-
-# Hack to get 32- and 64-bits tests run concurrently on the same build machine
-case `uname -m` in
- ppc64 | s390x | x86_64 | sparc64 )
- sed -i '
- s,9001,9011,g;
- s,9080,9090,g;
- s,9081,9091,g;
- s,9082,9092,g;
- s,9180,9190,g;
- ' bin/varnishtest/*.c bin/varnishtest/tests/*vtc
- ;;
- *)
- ;;
-esac
-
mkdir examples
cp bin/varnishd/default.vcl etc/zope-plone.vcl examples
@@ -108,16 +96,16 @@ cp bin/varnishd/default.vcl etc/zope-plone.vcl examples
# No pkgconfig/libpcre.pc in rhel4
%if 0%{?rhel} == 4
- export PCRE_CFLAGS=`pcre-config --cflags`
- export PCRE_LIBS=`pcre-config --libs`
+ export PCRE_CFLAGS="`pcre-config --cflags`"
+ export PCRE_LIBS="`pcre-config --libs`"
%endif
# Remove "--disable static" if you want to build static libraries
# jemalloc is not compatible with Red Hat's ppc64 RHEL kernel :-(
%ifarch ppc64 ppc
- %configure --disable-static --localstatedir=/var/lib --disable-jemalloc
+ %configure --disable-static --localstatedir=/var/lib --without-rst2man --without-rst2html --without-jemalloc
%else
- %configure --disable-static --localstatedir=/var/lib
+ %configure --disable-static --localstatedir=/var/lib --without-rst2man --without-rst2html
%endif
# We have to remove rpath - not allowed in Fedora
@@ -125,7 +113,7 @@ cp bin/varnishd/default.vcl etc/zope-plone.vcl examples
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 %{?_smp_mflags}
head -6 etc/default.vcl > redhat/default.vcl
@@ -146,6 +134,7 @@ tail -n +11 etc/default.vcl >> redhat/default.vcl
redhat/varnish.initrc redhat/varnishlog.initrc redhat/varnishncsa.initrc
%endif
+rm -rf doc/sphinx/\=build/html/_sources
mv doc/sphinx/\=build/html doc
rm -rf doc/sphinx/\=build
@@ -166,8 +155,8 @@ rm -rf doc/sphinx/\=build
%endif
%endif
-LD_LIBRARY_PATH="lib/libvarnish/.libs:lib/libvarnishcompat/.libs:lib/libvarnishapi/.libs:lib/libvcl/.libs" bin/varnishd/varnishd -b 127.0.0.1:80 -C -n /tmp/foo
-%{__make} check LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs"
+LD_LIBRARY_PATH="lib/libvarnish/.libs:lib/libvarnishcompat/.libs:lib/libvarnishapi/.libs:lib/libvcl/.libs:lib/libvgz/.libs" bin/varnishd/varnishd -b 127.0.0.1:80 -C -n /tmp/foo
+make check LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs:../../lib/libvgz/.libs"
%install
rm -rf %{buildroot}
@@ -182,13 +171,28 @@ 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}%{_initrddir}/varnish
-%{__install} -D -m 0755 redhat/varnishlog.initrc %{buildroot}%{_initrddir}/varnishlog
-%{__install} -D -m 0755 redhat/varnishncsa.initrc %{buildroot}%{_initrddir}/varnishncsa
-%{__install} -D -m 0755 redhat/varnish_reload_vcl %{buildroot}%{_sbindir}/varnish_reload_vcl
+mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d/
+install -D -m 0644 redhat/default.vcl %{buildroot}%{_sysconfdir}/varnish/default.vcl
+install -D -m 0644 redhat/varnish.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/varnish
+
+# systemd support
+%if 0%{?fedora} >= 17
+mkdir -p %{buildroot}%{_unitdir}
+install -D -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/varnish.service
+install -D -m 0644 %SOURCE2 %{buildroot}%{_sysconfdir}/varnish/varnish.params
+install -D -m 0644 %SOURCE3 %{buildroot}%{_unitdir}/varnishncsa.service
+install -D -m 0644 %SOURCE4 %{buildroot}%{_unitdir}/varnishlog.service
+sed -i 's,sysconfig/varnish,varnish/varnish.params,' redhat/varnish_reload_vcl
+# default is standard sysvinit
+%else
+install -D -m 0644 redhat/varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/varnish
+install -D -m 0755 redhat/varnish.initrc %{buildroot}%{_initrddir}/varnish
+install -D -m 0755 redhat/varnishlog.initrc %{buildroot}%{_initrddir}/varnishlog
+install -D -m 0755 redhat/varnishncsa.initrc %{buildroot}%{_initrddir}/varnishncsa
+%endif
+install -D -m 0755 redhat/varnish_reload_vcl %{buildroot}%{_sbindir}/varnish_reload_vcl
+
+echo %{_libdir}/varnish > %{buildroot}%{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf
%clean
rm -rf %{buildroot}
@@ -200,21 +204,35 @@ rm -rf %{buildroot}
%{_var}/lib/varnish
%{_var}/log/varnish
%{_mandir}/man1/*.1*
+%{_mandir}/man3/*.3*
%{_mandir}/man7/*.7*
-%doc INSTALL LICENSE README redhat/README.redhat ChangeLog
+%doc LICENSE README redhat/README.redhat ChangeLog
%doc examples
%dir %{_sysconfdir}/varnish/
%config(noreplace) %{_sysconfdir}/varnish/default.vcl
-%config(noreplace) %{_sysconfdir}/sysconfig/varnish
%config(noreplace) %{_sysconfdir}/logrotate.d/varnish
+
+# systemd from fedora 17
+%if 0%{?fedora} >= 17
+%{_unitdir}/varnish.service
+%{_unitdir}/varnishncsa.service
+%{_unitdir}/varnishlog.service
+%config(noreplace)%{_sysconfdir}/varnish/varnish.params
+
+# default is standard sysvinit
+%else
+%config(noreplace) %{_sysconfdir}/sysconfig/varnish
%{_initrddir}/varnish
%{_initrddir}/varnishlog
%{_initrddir}/varnishncsa
+%endif
%files libs
%defattr(-,root,root,-)
%{_libdir}/*.so.*
+%{_libdir}/varnish
%doc LICENSE
+%config %{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf
%files libs-devel
%defattr(-,root,root,-)
@@ -246,19 +264,42 @@ getent passwd varnish >/dev/null || \
exit 0
%post
+%if 0%{?fedora} >= 17
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%else
/sbin/chkconfig --add varnish
/sbin/chkconfig --add varnishlog
/sbin/chkconfig --add varnishncsa
+%endif
test -f /etc/varnish/secret || (uuidgen > /etc/varnish/secret && chmod 0600 /etc/varnish/secret)
+%triggerun -- varnish < 3.0.2-1
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply varnish
+# to migrate them to systemd targets
+%{_bindir}/systemd-sysv-convert --save varnish >/dev/null 2>&1 ||:
+
+# If the package is allowed to autostart:
+#/bin/systemctl --no-reload enable varnish.service >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del varnish >/dev/null 2>&1 || :
+#/bin/systemctl try-restart varnish.service >/dev/null 2>&1 || :
+
%preun
if [ $1 -lt 1 ]; then
+ # Package removal, not upgrade
+ %if 0%{?fedora} >= 17
+ /bin/systemctl --no-reload disable varnish.service > /dev/null 2>&1 || :
+ /bin/systemctl stop varnish.service > /dev/null 2>&1 || :
+ %else
/sbin/service varnish stop > /dev/null 2>&1
/sbin/service varnishlog stop > /dev/null 2>&1
/sbin/service varnishncsa stop > /dev/null 2>%1
/sbin/chkconfig --del varnish
/sbin/chkconfig --del varnishlog
/sbin/chkconfig --del varnishncsa
+ %endif
fi
%post libs -p /sbin/ldconfig
@@ -266,6 +307,27 @@ fi
%postun libs -p /sbin/ldconfig
%changelog
+* Tue Mar 06 2012 Ingvar Hagelund <ingvar at redpill-linpro.com> - 3.0.2-1
+- New upstream version 3.0.2
+- Removed INSTALL as requested by rpmlint
+- Added a ld.so.conf.d fragment file listing libdir/varnish
+- Removed redundant doc/html/_sources
+- systemd support from fedora 17
+- Stopped using macros for make and install, according to
+ Fedora's packaging guidelines
+- Changes merged from upstream:
+ - Added suse_version macro
+ - Added comments on building from a git checkout
+ - mkpasswd -> uuidgen for fewer dependencies
+ - Fixed missing quotes around cflags for pcre
+ - Removed unnecessary 32/64 bit parallell build hack as this is fixed upstream
+ - Fixed typo in configure call, disable -> without
+ - Added lib/libvgz/.libs to LD_LIBRARY_PATH in make check
+ - Added section 3 manpages
+ - Configure with --without-rst2man --without-rst2html
+ - changelog entries
+- Removed unnecessary patch for system jemalloc, upstream now supports this
+
* Fri Feb 10 2012 Petr Pisar <ppisar at redhat.com> - 2.1.5-4
- Rebuild against PCRE 8.30
diff --git a/varnishlog.service b/varnishlog.service
new file mode 100644
index 0000000..1e3e274
--- /dev/null
+++ b/varnishlog.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Varnish HTTP accelerator logging daemon
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/varnishlog.pid
+ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /run/varnishlog.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/varnishncsa.service b/varnishncsa.service
new file mode 100644
index 0000000..df5f19f
--- /dev/null
+++ b/varnishncsa.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Varnish NCSA logging
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/varnishncsa.pid
+ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log -D -P /run/varnishncsa.pid
+
+[Install]
+WantedBy=multi-user.target
More information about the scm-commits
mailing list