Commit 6f4fee46 authored by Geoff Simmons's avatar Geoff Simmons

Set version 1.0.0, and add RPM packaging.

parent b9fb4c59
AC_PREREQ(2.68)
AC_COPYRIGHT([Copyright (c) 2019 UPLEX - Nils Goroll Systemoptimierung])
AC_INIT([libvmod-file], [trunk], [varnish-support@uplex.de], [vmod-file])
AC_INIT([libvmod-file], [1.0.0], [varnish-support@uplex.de], [vmod-file])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src/vmod_file.vcc)
AM_CONFIG_HEADER(config.h)
......
#! /bin/bash -ex
# Build script for a VMOD file el7 RPM
# to be run in the rpmbuild/centos7 docker container.
# Env variables VERSION and RELEASE MUST be set in the docker invocation.
# DIST is set by the rpmbuild/centos7 container.
# The directory mounted to /srv MUST contain these files:
# - this script (named pkg)
# - VMOD file tarball (vmod-file-$VERSION.tar.gz)
# - RPM spec file (vmod-file.spec)
# - yum repo config for varnish66@packagecloud (varnishcache_varnish66.repo)
# (see https://packagecloud.io/varnishcache/varnish66/install#manual-rpm)
# So this is a sample docker invocation:
#
# $ docker run -t -v $PWD:/srv -e VERSION=1.2.3 -e RELEASE=4711 \
# rpmbuild/centos7 /srv/pkg
# At the end of the run, binary, source and debuginfo RPMs are in the
# directory mounted to /srv.
if [ -z $VERSION ]; then
echo "Env variable VERSION MUST be set"
exit 1
fi
if [ -z $RELEASE ]; then
echo "Env variable RELEASE MUST be set"
exit 1
fi
# delete the peculiar macros from the rpmbuild/centos7 image
rm /home/builder/.rpmmacros
# set up the build environment
cd /home/builder
mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp /srv/vmod-file.spec rpmbuild/SPECS
cp /srv/vmod-file-${VERSION}.tar.gz rpmbuild/SOURCES
# install epel7 repo
sudo yum install -y -q \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# set up varnish repo
sudo cp /srv/varnishcache_varnish66.repo /etc/yum.repos.d/
sudo yum -q makecache -y --disablerepo='*' --enablerepo='varnishcache_varnish66'
# build requirements
sudo yum install -y -q \
varnish-devel pkgconfig make gcc gcc-c++ python-docutils
# build RPMs
rpmbuild -ba -D "dist .${DIST}" \
-D "_version ${VERSION}" \
-D "_release ${RELEASE}" \
rpmbuild/SPECS/vmod-file.spec
sudo cp rpmbuild/RPMS/*/* /srv
sudo cp rpmbuild/SRPMS/* /srv
[varnishcache_varnish66]
name=varnishcache_varnish66
baseurl=https://packagecloud.io/varnishcache/varnish66/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish66/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[varnishcache_varnish66-source]
name=varnishcache_varnish66-source
baseurl=https://packagecloud.io/varnishcache/varnish66/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish66/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
# -D MUST pass in _version and _release, and SHOULD pass in dist.
Summary: Varnish Module for reading files that may be updated at intervals
Name: vmod-file
Version: %{_version}
Release: %{_release}%{?dist}
License: BSD
Group: System Environment/Daemons
URL: https://code.uplex.de/uplex-varnish/libvmod-file
Source0: %{name}-%{version}.tar.gz
# varnish from varnish66 at packagecloud
# This is the Requires for VMOD ABI compatibility with VRT >= 13.0.
Requires: varnishd(vrt)%{?_isa} >= 13
BuildRequires: varnish-devel >= 6.6.0
BuildRequires: pkgconfig
BuildRequires: make
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: python-docutils >= 0.6
# git builds
#BuildRequires: automake
#BuildRequires: autoconf
#BuildRequires: autoconf-archive
#BuildRequires: libtool
#BuildRequires: python-docutils >= 0.6
Provides: vmod-file, vmod-file-debuginfo
%description
VMOD file is a Varnish module for reading the contents of a file and
caching its contents, returning the contents for use in the Varnish
Configuration Language (VCL), and checking if the file has changed
after specified time intervals elapse.
%prep
%setup -q -n %{name}-%{version}
%build
# if this were a git build
# ./autogen.sh
%configure
make -j
%check
make -j check
%install
make install DESTDIR=%{buildroot}
# Only use the version-specific docdir created by %doc below
rm -rf %{buildroot}%{_docdir}
# None of these for fedora/epel
find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';'
find %{buildroot}/%{_libdir}/ -name '*.a' -exec rm -f {} ';'
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_libdir}/varnish*/vmods/
%{_mandir}/man3/*.3*
%doc README.rst COPYING LICENSE
%post
/sbin/ldconfig
%changelog
* Wed Jan 26 2022 Geoff Simmons <geoff@uplex.de> - %{_version}-%{_release}
- Require VRT 13.0, compatible with Varnish 6.6
* Tue Oct 8 2019 Geoff Simmons <geoff@uplex.de> - 0.2.3-1
- Require VRT 10.0, compatible with Varnish 6.3
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment