Package-building procedure

Ingvar Hagelund ingvar at linpro.no
Fri May 18 09:42:07 CEST 2007


* Dag-Erling Smørgrav
> I would like to have the following items documented for each
> distribution we support (Debian, Fedora, OpenSUSE):
> 
>  - assuming the only things that need changing are the version number
>    and the changelog, which files need to be updated for a new release?

For the RedHat (and its relatives') package, edit redhat/varnish.spec.
The tags to edit are "Version", for example "1.0.4", "Release", a
counting number starting at 1, and a matching changelog item below
"%changelog", like this:

* Sun May 20 2007 Dag Erling Smørgrav <des at linpro.no> - 1.0.4-1
- Bumping version to 1.0.4
- Other changes
- Even more changes

Note that only changes to the redhat files should be noted. The general
ChangeLog file is included in the package.

You should also remove or comment out the line under "%prep" running
autogen.sh, as the necessary files should be included in the tarball.

>  - assuming all you have is the release tarball and the necessary build
>    tools, which command(s) are needed to produce a binary package?

First: Always build rpms as a non priveleged user, see
http://users.linpro.no/ingvar/rpm.html

On a redhat or derivate system, run

rpmbuild -tb varnish-1.0.4.tar.gz

This will produce a package for the current system/arch, for example

varnish-1.0.4-1.x86_64.rpm
varnish-libs-1.0.4-1.x86_64.rpm

You might want to name the package with a proper %dist, if this is not
done automatically (some systems don't)

rpmbuild -tb --define "dist el4" varnish-1.0.4.tar.gz

varnish-1.0.4-1el4.x86_64.rpm
varnish-libs-1.0.4-1el4.x86_64.rpm

To build a source package, use -ts

To do a quick test build from svn, try something like this:

#!/bin/bash
VERSION=$( awk ' /^Version:/ { print $2 } ' \
  varnish-cache/redhat/varnish.spec )
ln -s varnish-cache varnish-$VERSION
tar $(
    find varnish-$VERSION/ -type d -name .svn | \
        while read i; do
            echo -n "--exclude $i "
            done
) -cvzf varnish-$VERSION.tar.gz varnish-$VERSION/*
rm varnish-$VERSION
rpmbuild -tb --define "dist el4" varnish-$VERSION.tar.gz
rpmbuild -ts varnish-$VERSION.tar.gz
#EOF


Ingvar

-- 
When everything else fail: Symlink


More information about the varnish-dist mailing list