Introductory mail

Sam Liddicott sam at liddicott.com
Wed Nov 19 14:33:09 UTC 2008


I've been using CVS, SVN, QUILT and GIT over 10 years.

I'm lately playing with building rpm's from GIT and SVN repositories.

I have a nice set of scripts called make-srpm (with a git helper and a
less mature svn helper).

The scripts will export a "pristine" source and a set of patches from
the archive and make an srpm

The release for the pristine source can be automatically determined
based on the most recent tag matching a glob, or be specified directly.

A set of patches between the source tar and the target released is
automatically generated, coping with merging and branching by selecting
the paths that have the most number of commits - as was done for the
bitkeeper exports.

Arguments can be specified as magic comments in the spec file, or on the
command line - perhaps to make it easy to use makefile variables too.

Build an srpm may be something like:

$ make-srpm RELEASE=LOCAL VERSION=1.2

To build and RPM of checked out and uncommited source and call it
version 1.2. For non-tagged release the git-hash is part of the release
information, and for LOCAL builds, the date appended to the release
infomation as well as the git hash.

The hardest bit was the "find longest path" to break the patches into
the most number of smaller patches, and that was written in awk,
embedded in the scripts.

Another hard bit was dealing with git-diff's delete/add empty file
patches, which was solved by generating a double patch to use an
intermediate 1 line file.

Another hard bit was filtering out of empty patch files which occur at
some merge points.

All in all it produces srpms's and spec files full of patches just like
the old redhat kernel rpm's.

And they work.

bash is required, but I think that is not too harsh a requirement for
building rpm's.

err.... how shall I post it for comment?

Sam



More information about the vcs-pkg-discuss mailing list