Git pkg

Mer Project packaging in git project.

gitpkg is deprecated

Migrating to tar_git
Since with pristine-tar we store the contents of the tarball in git it was quite straightforward to turn it into tar_git packaging, sample result: https://github.com/mer-tools/sudo/tree/mer-unified-master

git checkout pkg-mer -b pkg-mer-move-to-rpmdir mkdir rpm git mv sudo* rpm/ git rm _src git rm .gitignore git commit -m 'Move relevant contents of pkg-mer branch into rpm/' git checkout mer-master -b mer-unified-master git merge pkg-mer-move-to-rpmdir --allow-unrelated-histories

Upstream repository

 * github.com/lbt/git-pkg (documentation can also be found there)

Installing gitpkg
root@mer:~# zypper in gitpkg

Naming branches and tags

 * Upstream's master branch is still called that (obviously)
 * Upstream's releases are tagged in some way (e.g. X.Y.Z or PKGNAME-X.Y.Z)
 * gitpkg's orphan branch containing packaging files is called pkg-mer
 * Changes from an upstream release (e.g. X.Y.Z) are tagged mer-X.Y.Z-R (where R is the RPM release number)
 * Packaging files for a specific RPM release are tagged pkg-mer-X.Y.Z-R

Generic example

 * Branch master (upstream source code)
 * Tag X.Y.Z: Describes upstream's vanilla X.Y.Z release
 * Tag mer-X.Y.Z-R: Builds on top of X.Y.Z and (possibly) describes patches for the R release


 * Branch pkg-mer (packaging information)
 * Tag pkg-mer-X.Y.Z-R: Contains the 4 packaging files for the R release

Specific example: Packaging zsh
See https://github.com/thp/mer-tools-zsh:


 * Branch master
 * Tag zsh-5.0.2: Upstream 5.0.2 release
 * Tag mer-5.0.2-2: Packaging-related patches against 5.0.2
 * Branch pkg-mer
 * Tag pkg-mer-5.0.2-2: Contains _src, zsh.changes, zsh.yaml and zsh.spec

Contents of the orphan branch (pkg-mer)
The trees in the pkg-mer branch usually contains 4 files:


 * _src
 * .changes
 * .yaml
 * .spec

Specific example: Packaging zsh
Contents of the _src file:

git:zsh-5.0.2.tar.bz2:zsh-5.0.2:mer-5.0.2-2

This means:


 * The source tarball zsh-5.0.2.tar.bz2 is generated from Git commit zsh-5.0.2
 * The patches are generated from zsh-5.0.2 to mer-5.0.2-2
 * Therefore: Tarball + patches will end up representing the state of code in mer-5.0.2-2

The patches are generated by running gp_mkpkg - it takes the _src file as input and generates the tarball and patches (if any), and outputs the changes required to the .yaml file.