SHA256
1
0
forked from pool/varnish
varnish/varnish.spec
OBS User autobuild e96c016473 Accepting request 48519 from server:http
Copy from server:http/varnish based on submit request 48519 from user jengelh

OBS-URL: https://build.opensuse.org/request/show/48519
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/varnish?expand=0&rev=1
2010-09-23 23:07:49 +00:00

225 lines
6.7 KiB
RPMSpec

#
# spec file for package varnish (Version 2.1.3)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: varnish
Version: 2.1.3
Release: 1
#
License: BSD
Group: Productivity/Networking/Web/Proxy
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libxslt ncurses-devel pcre-devel pkg-config
Prereq(post): /usr/sbin/useradd /usr/sbin/groupadd
%if 0%{?suse_version}
Recommends: logrotate
%endif
%define _bindir %{_sbindir}
%define pkg_home %{_var}/lib/%{name}
%define pkg_logdir %{_var}/log/%{name}
%define pkg_cachedir %{_var}/cache/%{name}
%define pkg_name %{name}
#
Url: http://www.varnish-cache.org/
Source0: http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.gz
# http://downloads.sourceforge.net/varnish/varnish-%{version}.tar.bz2
Source1: upstream-config.tar.bz2
Source2: varnish.init
Source3: varnish.sysconfig
#
Summary: Varnish is a high-performance HTTP accelerator
%description
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
Proxy) is an application that stores (caches) documents that have been
requested over the HTTP protocol.
Based on certain criteria the next client requesting the document is either
given the cached document, or a "fresh" document requested from a backend
server. The purpose of this is to minimize the requests going to the backend
server(s) by serving the same document to potentially many users.
Authors:
--------
Poul-Henning Kamp <phk@phk.freebsd.dk>
%define library_name libvarnish1
%package -n %{library_name}
Group: Productivity/Networking/Web/Proxy
#
Summary: Shared libraries for Varnish
%description -n %{library_name}
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
Proxy) is an application that stores (caches) documents that have been
requested over the HTTP protocol.
Based on certain criteria the next client requesting the document is either
given the cached document, or a "fresh" document requested from a backend
server. The purpose of this is to minimize the requests going to the backend
server(s) by serving the same document to potentially many users.
This package holds the shared libraries for varnish.
Authors:
--------
Poul-Henning Kamp <phk@phk.freebsd.dk>
%package devel
License: BSD
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
#
Summary: Development files for Varnish
%description devel
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
Proxy) is an application that stores (caches) documents that have been
requested over the HTTP protocol.
Based on certain criteria the next client requesting the document is either
given the cached document, or a "fresh" document requested from a backend
server. The purpose of this is to minimize the requests going to the backend
server(s) by serving the same document to potentially many users.
This package holds the development files for varnish.
Authors:
--------
Poul-Henning Kamp <phk@phk.freebsd.dk>
%prep
%setup -qa1
#sed -e ' s/8080/80/g ' etc/vcl.conf > redhat/vcl.conf
%build
%if 0%{?suse_version} > 1000
export CFLAGS="%{optflags} -fstack-protector"
%endif
%configure --disable-static --localstatedir=%{_var}/cache/ \
--enable-debugging-symbols \
--enable-developer-warnings
%{__make}
%install
%makeinstall
find %{buildroot} -ls
#
# remove unneeded files
# libvarnish.la has -lrt as dependency lib
#%{__rm} -fv %{buildroot}%{_libdir}/*.la
#
##missing directories
%{__install} -d -m 0755 %{buildroot}{%{pkg_logdir},%{pkg_home}}
%{__install} -D -m 0644 redhat/varnish.logrotate %{buildroot}/etc/logrotate.d/varnish
%if 0%{?suse_version}
#
##init scripts
%{__install} -D -m 0644 %{S:3} %{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
%{__install} -D -m 0755 %{S:2} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
#
##config files
%{__install} -D -m 0644 etc/vcl.conf %{buildroot}%{_sysconfdir}/%{name}/vcl.conf
%{__install} -D -m 0644 etc/vcl.conf %{buildroot}%{_sysconfdir}/%{name}/vcl.conf.example
%else
#
##init scripts
%{__install} -D -m 0644 redhat/varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}
%{__install} -D -m 0755 redhat/varnish.initrc %{buildroot}%{_sysconfdir}/init.d/%{name}
#
##config files
%{__install} -D -m 0644 redhat/vcl.conf %{buildroot}%{_sysconfdir}/%{name}/vcl.conf
%{__install} -D -m 0644 redhat/vcl.conf %{buildroot}%{_sysconfdir}/%{name}/vcl.conf.example
%endif
find "%buildroot" -type f -name "*.la" -delete
%clean
%{__rm} -rf %{buildroot}
%pre
/usr/sbin/groupadd -r %{pkg_name} 2>/dev/null || :
/usr/sbin/useradd -g %{pkg_name} -s /bin/false -r -c "user for %{pkg_name}" -d %{pkg_home} %{pkg_name} 2>/dev/null || :
%if 0%{?suse_version}
%post
%fillup_and_insserv %{pkg_name}
%preun
%stop_on_removal %{pkg_name}
%postun
%restart_on_update %{pkg_name}
%{insserv_cleanup}
%else
# how to do the same for RH/mandriva?
%endif
%post -n %{library_name} -p /sbin/ldconfig
%postun -n %{library_name} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%if 0%{?suse_version}
%{_sbindir}/rc%{name}
/var/adm/fillup-templates/sysconfig.%{name}
%else
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%endif
%config(noreplace) %{_sysconfdir}/init.d/%{name}
#
%dir %attr(750,%{pkg_name},%{pkg_name}) %{_sysconfdir}/%{name}/
%config(noreplace) %attr(640,%{pkg_name},%{pkg_name}) %{_sysconfdir}/%{name}/vcl.conf
%config %attr(640,%{pkg_name},%{pkg_name}) %{_sysconfdir}/%{name}/vcl.conf.example
%config(noreplace) %attr(640,%{pkg_name},%{pkg_name}) %{_sysconfdir}/%{name}/default.vcl
#
%_sbindir/*
%doc %_mandir/*/*
%doc ChangeLog LICENSE README
%if ! 0%{?suse_version}
%doc redhat/README.redhat
%endif
%dir %attr(750,%{pkg_name},%{pkg_name}) %{pkg_home}
%dir %attr(750,%{pkg_name},%{pkg_name}) %{pkg_cachedir}
%config(noreplace) /etc/logrotate.d/varnish
%files -n %{library_name}
%defattr(-,root,root,-)
%_libdir/*.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/varnish/
%{_libdir}/pkgconfig/*
%{_libdir}/*.so
%changelog