%global commit 28eacbb0ef5df7ea274bccbaca5a4a6ce5eda916 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global varnishver 4.1.1 %global vabi 3.1 %global vabistrict 66bb824 %global agent_secret %{_sysconfdir}/varnish/agent_secret Name: varnish-agent Version: 4.1.0 Release: 0.5.git%{?shortcommit}%{?dist} Summary: Administration agent for Varnish Cache Group: System Environment/Daemons License: BSD URL: https://github.com/varnish/vagent2 Source0: https://github.com/varnish/vagent2/archive/%{commit}/vagent2-%{version}-%{shortcommit}.tar.gz Patch0: vagent.disable_test.patch Patch1: varnish-agent-4.1.0.fix_for_old_lwp.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: curl-devel BuildRequires: libedit-devel BuildRequires: libmicrohttpd-devel BuildRequires: libtool BuildRequires: nc BuildRequires: perl(LWP) BuildRequires: python-demjson BuildRequires: python-docutils BuildRequires: sed BuildRequires: strace BuildRequires: varnish = %{varnishver} BuildRequires: varnish-libs-devel = %{varnishver} Requires: varnish = %varnishver Requires: varnishabi-%vabi Requires: varnishabi-strict-%vabistrict %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd-units Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %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 %autosetup -n vagent2-%{commit} -p1 # varnish-agent expects to be built from the git repository sed -i s/NOGIT/%{version}/ include/Makefile.am %build ./autogen.sh %configure make %{?_smp_mflags} %install %make_install install -m 755 -d %{buildroot}%{_sharedstatedir}/%{name} install -m 755 -d %{buildroot}%{_unitdir} install -m 755 -d %{buildroot}%{_sysconfdir}/varnish %if 0%{?fedora} || 0%{?rhel} >= 7 install -pm 644 -t %{buildroot}%{_unitdir} redhat/%{name}.service install -pm 644 -t %{buildroot}%{_sysconfdir}/varnish redhat/%{name}.params %else install -pm 644 -t %{buildroot}%{_sysconfdir}/sysconfig redhat/%{name}.sysconfig install -pm 644 -t %{buildroot}%{_initddir} redhat/%{name}.initrc %endif touch %{buildroot}%{agent_secret} %check make check %files %doc NEWS.rst README.rst THANKS %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %{_datadir}/%{name} %if 0%{?fedora} || 0%{?rhel} >= 7 %{_unitdir}/%{name}.service %config(noreplace) %{_sysconfdir}/varnish/%{name}.params %license LICENSE %else %config(noreplace) %{_initddir}/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %doc LICENSE %endif %ghost %attr(600, -, -) %{agent_secret} %attr(-, varnish, varnish) %{_sharedstatedir}/%{name} %post test -f %{agent_secret} || ( password="$(head -c 8 /dev/urandom | base64)" echo "varnish:$password" > %{agent_secret} && chmod 0600 %{agent_secret} ) %if 0%{?fedora} || 0%{?rhel} >= 7 %systemd_post %{name}.service %else /sbin/chkconfig --add %{name} %endif %preun %if 0%{?fedora} || 0%{?rhel} >= 7 %systemd_preun %{name}.service %else if [ $1 -lt 1 ] then /sbin/service %{name} stop >/dev/null /sbin/chkconfig --del %{name} fi %endif %postun %if 0%{?fedora} || 0%{?rhel} >= 7 %systemd_postun_with_restart %{name}.service %endif %changelog * Mon Feb 08 2016 Dridi Boukelmoune - 0.4.20160201git28eacbb - Merged in upstream/Ingvar's spec * Fri Feb 05 2016 Fedora Release Engineering - 4.0.0-0.7.RC2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * 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 when available * Thu Nov 05 2015 Kalev Lember - 4.0.0-0.6.RC2 - Rebuilt for libmicrohttpd soname bump * 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 * Fri Jun 19 2015 Fedora Release Engineering - 4.0.0-0.5.RC2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Mon Aug 18 2014 Fedora Release Engineering - 4.0.0-0.4.RC2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sun Jun 08 2014 Fedora Release Engineering - 4.0.0-0.3.RC2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Tue Jun 03 2014 Dridi Boukelmoune - 4.0.0-0.2.RC2 - Bumped version to 4.0.0-RC2 * Mon Apr 28 2014 Dridi Boukelmoune - 4.0.0-0.1 - Bumped version to experimental 4.0.0 - Switched to a commit tarball from github - Removed the upstreamed patches * Sun Dec 08 2013 Dridi Boukelmoune - 2.1-5 - Removed the %%optflags on the %%configure command line * Sat Dec 07 2013 Dridi Boukelmoune - 2.1-4 - Added a patch to make the test suites work offline - Added a patch to disable the ban test suite - Removed the default -S option from the service * Fri Nov 01 2013 Dridi Boukelmoune - 2.1-3 - Added a patch for subdir-objects in automake - Moved CFLAGS to the configure command line * Sun Oct 27 2013 Dridi Boukelmoune - 2.1-2 - Requires: varnish - BuildRequires: varnish python-demjson - Added a patch for root privileges on the secret file - Added a patch for the deprecated AM_CONFIG_HEADER macro - Added a check section - sed -i s/NOGIT/%%{version}/ include/Makefile.am - mv vagent.params agent.params * Sun Sep 15 2013 Dridi Boukelmoune - 2.1-1 - Initial spec.