Mailing List Archive

Package-building procedure
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?

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

One additional question for OpenSUSE:

- what do we need to include to allow OpenSUSE packages to be built
straight from the release tarball? I assume that it's not very
different from Fedora, since OpenSUSE is rpm-based, but I know that
the init scripts, at least, are different.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no
Package-building procedure [ In reply to ]
* 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@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
Package-building procedure [ In reply to ]
Dag-Erling Sm?rgrav <des@linpro.no> writes:

> 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?

The file needed to be updated is debian/changelog. The version number
of the generated package is taken from there. It should also contain
an entry with:

* New upstream release

There is a tool in the debian package "devscripts" which can be used
to add changelog entries with the correct magic format:

dch -v 1.0.5 "New upstream release"

(This will also rename the current directory to "varnish-1.0.5")

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

To build a package without signing it with gnupg, and package via
"fakeroot", cd to the source directory, and use:

dpkg-buildpackage -us -uc -rfakeroot

The following files will be generated in the parent directory:

-rw-r--r-- 1 ssm ssm 367 2007-05-21 06:46 varnish_1.0.4-1.dsc
-rw-r--r-- 1 ssm ssm 1135 2007-05-21 06:48 varnish_1.0.4-1_i386.changes
-rw-r--r-- 1 ssm ssm 198964 2007-05-21 06:48 varnish_1.0.4-1_i386.deb
-rw-r--r-- 1 ssm ssm 703947 2007-05-21 06:46 varnish_1.0.4-1.tar.gz

--
Stig Sandbeck Mathisen, Linpro