%global commit 751466828c30464a15a8c8606220491f2be26e33 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global varnishver 4.1.1 %global vbranch .4.1 %global vabi 3.1 %global vabistrict 66bb824 Summary: varnish-agent Name: varnish-agent Version: 4.1.0 Release: 0.6.20160201git%{?shortcommit}%{?vbranch}%{?dist} License: BSD Group: System Environment/Daemons # Source tarball built like this: # git clone https://github.com/varnish/vagent2.git # cd vagent2 # git checkout 28eacbb # sed -i 's,^EXTRA_DIST.*,EXTRA_DIST = autogen.sh include html INSTALL.rst README.rst debian tests redhat LICENSE NEWS.rst THANKS,g;' Makefile.am # ./autogen.sh && ./configure && make dist Source0: http://github.com/varnish/vagent2/archive/%{commit}/vagent2-%{version}-%{shortcommit}.tar.gz#/%{name}-4.1.0.tar.gz Patch1: varnish-agent-4.1.0.fix_for_old_lwp.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: varnish = %varnishver Requires: varnishabi-%vabi Requires: varnishabi-strict-%vabistrict %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 Requires(post): systemd-units Requires(post): systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units BuildRequires: systemd-units %endif BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: varnish-libs-devel = %{varnishver} BuildRequires: varnish = %{varnishver} BuildRequires: nc BuildRequires: sed BuildRequires: gcc BuildRequires: curl BuildRequires: strace BuildRequires: libmicrohttpd-devel BuildRequires: python-docutils BuildRequires: perl(LWP) BuildRequires: python-demjson BuildRequires: libedit-devel %if 0%{?el5} BuildRequires: curl-devel %else BuildRequires: libcurl-devel %endif %description Varnish Agent is a small daemon meant to communicate with Varnish and other varnish-related services to allow remote control and monitoring of Varnish. Required component for running the Varnish Administration Console (VAC) from Varnish Software. %prep #%setup -n vagent2-%{commit} %setup -q %patch1 -p0 %build # sed -i 's,^EXTRA_DIST.*,EXTRA_DIST = autogen.sh include html INSTALL.rst README.rst debian tests redhat LICENSE NEWS.rst THANKS,g;' Makefile.am #./autogen.sh export RST2MAN=/bin/true %configure make VERBOSE=1 %check make check || make check VERBOSE=1 %install make install DESTDIR=%{buildroot} %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 install -D -m 0644 redhat/%{name}.service %{buildroot}%{_unitdir}/%{name}.service install -D redhat/%{name}.params %{buildroot}%{_sysconfdir}/varnish/%{name}.params %else install -D redhat/%{name}.sysconfig %{buildroot}/etc/sysconfig/%{name} install -D redhat/%{name}.initrc %{buildroot}%{_initrddir}/%{name} %endif mkdir -p %{buildroot}/etc/varnish touch %{buildroot}/etc/varnish/agent_secret mkdir -p %{buildroot}/var/lib/%{name} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %{_bindir}/%{name} %{_mandir}/man1/%{name}.1.gz %{_datadir}/%{name}/html %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 %{_unitdir}/%{name}.service %config(noreplace)%{_sysconfdir}/varnish/%{name}.params %license LICENSE %else %config(noreplace) %{_initrddir}/%{name} %config(noreplace) /etc/sysconfig/%{name} %doc LICENSE %endif %doc NEWS.rst README.rst THANKS %ghost %attr(600, -, -) /etc/varnish/agent_secret %attr(-, varnish, varnish) /var/lib/%{name} %post test -f /etc/varnish/agent_secret || \ (echo "varnish:$(head -c 8 /dev/urandom | base64)" > /etc/varnish/agent_secret \ && chmod 0600 /etc/varnish/agent_secret) %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 /bin/systemctl daemon-reload >/dev/null 2>&1 || : %else /sbin/chkconfig --add %{name} %endif %preun if [ $1 -lt 1 ]; then %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 %systemd_preun %{name}.service %else /sbin/service %{name} stop > /dev/null 2>&1 /sbin/chkconfig --del %{name} %endif fi %changelog * Fri Feb 12 2016 Ingvar Hagelund - 0.6.20160201git7514668 - Update to latest git master - Set correct mode on service file - Use _initrddir macro * Fri Feb 05 2016 Ingvar Hagelund - 0.5.20160201git28eacbb - Use name macro extensively to avoid typos, thus also fixing a typo when calling systemd_preun macro * Mon Feb 01 2016 Ingvar Hagelund - 0.4.20160201git28eacbb - Updated to new git checkout for varnish-4.1.1 support - Added missing doc items - Use systemd_preun macro when available * Mon Nov 02 2015 Ingvar Hagelund - 0.3.git.846d880 - Fixed reported 32 bit build bug. Dropped workaround patch. * Thu Oct 22 2015 Ingvar Hagelund - 4.1.0-0.2.git.a50ebc2 - First wrap for fedora/copr, based on upstream specfile - Added a patch replacing old lwp calls with curl on el5 - Added a patch removing -Werror for i386 on el5 and el6 * Mon May 19 2014 Yves Hwang - 4.0.0 - Compatible with varnish >= 4.0.0 * Fri Apr 25 2014 Yves Hwang - 2.2.1 - Compatible with varnish >= 3.0.5 - #109 Do not set CURLOPT_NOBODY if we have data to send. - #108 libcurl issues HEAD instead of PUT in rhel5 - Fix an issue related to unsafe sigalarm use in older versions of libcurl. * Mon Oct 28 2013 Dridi Boukelmoune - 2.2-1 - Added /etc/varnish/agent_secret in the files list * Sat Mar 16 2013 Patricio Bruna - 2.2-1 - Added dependencies for rpmbuild * Fri Feb 22 2013 Kristian Lyngstøl - 2.2-1 - Release * Wed Jan 30 2013 Kristian Lyngstol - 2.1-1 - 2.1 dev version * Fri Jan 18 2013 Lasse Karstensen - 2.0-1 - Initial version.