gitpkg(1)

NAME

gitpkg - export a Debian source package from nominated git revisions

SYNOPSIS

gitpkg branch [origbranch]

DESCRIPTION

If gitpkg is run in a git repo with a single branch specified, then it will do a git-archive export of that branch to the $DEB_DIR directory. If the package is Debian native it will simply create a source package from it. If the package has a Debian version, then an orig.tar.gz will be created containing everything except the debian/ directory.

If gitpkg is invoked with two branches specified, then the first branch will be checked out as the unpacked complete source, while the second branch will be checked out for the orig.tar.gz. This allows all local changes to the source to be recorded in the resulting diff.gz if a pristine upstream branch exists in the repository.

The 'branch' should always have a debian/ dir and may be any tree-ish object that is accepted by git-archive. 'origbranch', if supplied, should usually not have a debian/ dir.

CONFIGURATION OPTIONS

When gitpkg is run the following configuration options are read from global, per-user, and per-project configuration files if present:

BUILD_ROOTCMD
May be set as a shell variable in a configuration file to override the default command used to get root for package build operations. Default is 'fakeroot'.
DEB_DIR
May be set as a shell variable in a configuration file to override the default destination directory for exported packages. Default is '../debpackages'.
HOOK_FILE
May be set as a shell variable in a configuration file to override the default gitpkg hook file name. Default is '.gitpkg_hook'. See below for more information on gitpkg hook files.

CONFIGURATION FILES

/etc/gitpkg.conf
Global configuration options. Will override hardcoded defaults.
~/.gitpkg
Per-user configuration options. Will override any global configuration.
.git/gitpkg.conf
Per-project configuration options. Will override any per-user or global configuration.

HOOK FILES

If the specified $HOOK_FILE exists in the top level directory of a checked out tree it will be sourced as a bash shell script, from the top level of the checked out source, prior to creating the package with dpkg-source.

WORKFLOW

Though gitpkg explicitly does not try to force any particular workflow procedure upon you in order to make full use of it, it probably is worth making quick mention of at least one simple way to manage Debian packages in git.

One common repo structure is to keep pristine upstream source on one branch, which is updated either directly from an upstream repo or by importing tar archives to it periodically, with the Debian patched source on another branch. In this situation the task of preparing a new upstream release from a tarball might look a bit like this:
$ # Check out the upstream branch
$ cd myrepo
$ git checkout upstream
$ # Remove all old upstream files from the repo
$ rm -rf $(all_files_except .git)
$ # Unpack the new tarball in their place
$ tar zxf $new_upstream.tar.gz
$ # Let git figure out what is renamed/new/gone in the new release by
itself
$ # Make sure you don't have any spurious things like vim .swp files
lurking
$ git add .
$ git commit -a
$ git tag v$upstream_version
$ # Prepare the Debian branch
$ git checkout debian
$ git merge upstream
$ $(update changelog and other debian patches etc.)
$ git commit -a
$ git tag v${upstream_version}-$debian_version
$ # Make a release
$ gitpkg v${upstream_version}-$debian_version v$upstream_version
$ cd ../deb-packages/mypackage && dpkg-buildpackage ...

SEE ALSO

git-debimport(1), git(7), git-archive(1).

AUTHOR

gitpkg was written by Ron <ron@debian.org>.
Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout