Compare commits

..

No commits in common. "rawhide" and "f25" have entirely different histories.

6 changed files with 239 additions and 1 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
/2.1.tar.gz
/vagent2-4.0.0-1b8447b.tar.gz
/vagent2-4.0.0-8352e30.tar.gz
/vagent2-4.1.0-28eacbb.tar.gz
/varnish-agent-4.1.1.tar.gz

14
agent.params Normal file
View file

@ -0,0 +1,14 @@
# Varnish-agent environment configuration description. This was derived
# from the old style sysconfig/defaults settings
# Default port to bind to.
VAGENT_PORT=6085
# Default location of the HTML interface.
VAGENT_HTML_DIRECTORY=/usr/share/varnish-agent/html
# Additional options if needed.
VAGENT_OPTS=
# Shared secret file, used to authenticate with varnishd
VAGENT_SECRET_FILE=/etc/varnish/agent_secret

View file

@ -1 +0,0 @@
not compatible with varnish 5+

1
sources Normal file
View file

@ -0,0 +1 @@
12d3e4fb564c8c75660dcf3e8d9f50d2 varnish-agent-4.1.1.tar.gz

23
varnish-agent.service Normal file
View file

@ -0,0 +1,23 @@
[Unit]
Description=Administration agent for Varnish Cache
Documentation=man:varnish-agent(1)
After=varnish
[Service]
EnvironmentFile=/etc/varnish/*.params
Type=forking
PIDFile=/var/run/varnish-agent.pid
PrivateTmp=true
ExecStart=/usr/bin/varnish-agent \
-P /var/run/varnish-agent.pid \
-c $VAGENT_PORT \
-H $VAGENT_HTML_DIRECTORY \
-u $VARNISH_USER \
-g $VARNISH_GROUP \
-S $VARNISH_SECRET_FILE \
$VAGENT_OPTS
[Install]
WantedBy=multi-user.target

196
varnish-agent.spec Normal file
View file

@ -0,0 +1,196 @@
%global agent_secret %{_sysconfdir}/varnish/agent_secret
Name: varnish-agent
Version: 4.1.1
Release: 1%{?dist}
Summary: Administration agent for Varnish Cache
Group: System Environment/Daemons
License: BSD
URL: https://github.com/varnish/vagent2
Source: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz
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
BuildRequires: varnish-libs-devel
Requires: varnish
%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
%setup -q
# varnish-agent expects to be built from the git repository
sed -i s/NOGIT/%{version}/ include/Makefile.am
%build
%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
* Wed Aug 31 2016 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 4.1.1-1
- Bumped version to 4.1.1
- Relied on libvarnishapi binary dependency for the varnish requirement
- Switched to a dist tarball from upstream
- Removed existing patches
* Mon Feb 08 2016 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 0.4.20160201git28eacbb
- Merged in upstream/Ingvar's spec
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-0.7.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Mon Feb 01 2016 Ingvar Hagelund <ingvar@redpill-linpro.com> - 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 <klember@redhat.com> - 4.0.0-0.6.RC2
- Rebuilt for libmicrohttpd soname bump
* Mon Nov 02 2015 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.3.git.846d880
- Fixed reported 32 bit build bug. Dropped workaround patch.
* Thu Oct 22 2015 Ingvar Hagelund <ingvar@redpill-linpro.com> - 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 <rel-eng@lists.fedoraproject.org> - 4.0.0-0.5.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-0.4.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-0.3.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue Jun 03 2014 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 4.0.0-0.2.RC2
- Bumped version to 4.0.0-RC2
* Mon Apr 28 2014 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 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 <dridi.boukelmoune@gmail.com> - 2.1-5
- Removed the %%optflags on the %%configure command line
* Sat Dec 07 2013 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 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 <dridi.boukelmoune@gmail.com> - 2.1-3
- Added a patch for subdir-objects in automake
- Moved CFLAGS to the configure command line
* Sun Oct 27 2013 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 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 <dridi.boukelmoune@gmail.com> - 2.1-1
- Initial spec.