Differences between revisions 1 and 2
Revision 1 as of 2007-05-14 09:05:58
Size: 3209
Editor: JonnyLamb
Comment:
Revision 2 as of 2007-05-15 10:32:43
Size: 3381
Editor: JonnyLamb
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
There are two ways to start a repository for managing package development:

 * With an already packaged piece of software, using its {{{dsc}}} file
 * With a new, unpackaged, piece of software, using its upstream tarball.

=== Importing an already packaged tool ===

This is simply imported using the {{{git-import-dsc}}} tool. The directory in which it is called will be the parent directory of the new Git repository.
It is easiest to first create the first version of a package, outside of Git. Once this is done, you should import the package using the {{{git-import-dsc}}} tool. The directory in which it is called will be the parent directory of the new Git repository.
Line 35: Line 28:

=== Importing an unpackaged tool ===

This uses the {{{git-import-orig}}} tool to import an upstream tarball.

TODO
Line 60: Line 47:

== Upgrading to new upstream version ==

When a new upstream version comes out, use the {{{git-import-orig}}} tool to add it to the repository, like so:

{{{$ git-import-orig /path/to/new-upstream.tar.gz -u 0.2
}}}

where 0.2 is the new upstream version number.

{i} If the upstream tarball is already in the form ''packagename''_''version''.orig.tar.gz (E.g. {{{package_0.2.orig.tar.gz}}}), then the {{{-u}}} option is not required.

== Conclusion ==

Packaging with Git

{i} Note, that this is just a very general introductory guide. Full, official documentation can be found in the [http://packages.debian.org/git-buildpackage git-buildpackage] package.

Getting started

It is easiest to first create the first version of a package, outside of Git. Once this is done, you should import the package using the git-import-dsc tool. The directory in which it is called will be the parent directory of the new Git repository.

$ git-import-dsc /path/to/package_0.1-1.dsc

This will give output of its progress and make a few commits. Afterwards, you will have some new files and directories:

{{{$ ls package/ package_0.1-1.orig.tar.gz}}}

Looking in the new repository shows git-buildpackage has done the following:

  • Imported the package files (but not debian/ directory) into the upstream branch

  • This has then been tagged upstream/0.1 where 0.1 is your package's version number

  • Imported the debian/ directory into master as well as upstream's files

  • Tagged the last commit as debian/0.1-1 as it assumes the package is finished.

Further packaging workflow

Now you can work in the master branch to edit the package. Commit with:

{{{$ commit -a }}}

and build the package with:

{{{$ git-buildpackage }}}

Once you have produced a release-ready package, you should tag it, in the following way:

{{{$ git-buildpackage --git-tag }}}

Make sure that your debian/changelog file is correct, as that is what will be used to create the tag. The tag will be named debian/0.1-2 where 0.1-2 is the Debian version.

Upgrading to new upstream version

When a new upstream version comes out, use the git-import-orig tool to add it to the repository, like so:

{{{$ git-import-orig /path/to/new-upstream.tar.gz -u 0.2 }}}

where 0.2 is the new upstream version number.

{i} If the upstream tarball is already in the form packagename_version.orig.tar.gz (E.g. package_0.2.orig.tar.gz), then the -u option is not required.

Conclusion

That is all to the basics of building packages with Git! I would recommend making copies of packages and trying out the tools on temporary repositories, to start with. Once you feel you have mastered it, there are other options that should be looked at.

Further options

pbuilder

To use pbuilder, you must simply change builder in either ~/.gbp.conf or /etc/git-buildpackage/gbp.conf to /usr/local/bin/git-pbuilder, and then:

{{{# cp /usr/share/doc/git-buildpackage/examples/git-pbuilder /usr/local/bin/ }}}

{i} /usr/local/bin/git-pbuilder can be edited to use additional options, such as --builddir and --debsign-k...

Signing tags

On calling either of the git-import-dsc or git-import-orig tools, the following options may be used:

--sign-tags

Whether to sign tags

--keyid=gpg-keyid

With what gpg key to sign tags with

More Info

See also:


CategoryDeveloper