Tales from the Gryphon

Towards a generic, distribution agnostic tool for building packages from a VCS

  • Edit this page
  • RecentChanges
  • History
  • Preferences
  • Comment
Tales from the Gryphon

Relevant Links

  • New key
  • GPG key
  • PGP key
  • Policy

Categories(89)

  • Books(29)
    • Action(3)
    • Classics(1)
    • Espionage(9)
    • Fantasy(10)
    • Fiction(1)
    • Sci-Fi(5)
  • Debian(8)
    • Official(2)
  • Software(26)
    • Arch(1)
    • Git(4)
    • Packaging(7)
    • Debian(9)
    • IkiWiki(2)
    • Security(3)
  • Movies(6)
  • SysAdmin(1)
  • Spam(10)
  • Travel(2)
  • Miscellaneous(6)

Archives

← 2010
Months
Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec
March
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Indices

  • 2004
    • 05
    • 06
    • 07
    • 10
    • 11
  • 2005
    • 03
    • 05
    • 06
  • 2006
    • 01
    • 08
    • 12
  • 2007
    • 01
    • 08
    • 11
    • 12
  • 2008
    • 01
    • 04
    • 05
    • 06
  • 2009
    • 02
    • 03
    • 04
    • 05

My Books:
Widget_logo


Valid XHTML 1.1 Valid CSS! Linux Counter #69681 RSS Valid Ikiwiki hacker emblem

Manoj's hackergotchi
Thursday 16 April
2009
Towards a generic, distribution agnostic tool for building packages from a VCS
[
  • software :: 
  • packaging :: 
]

License: GPL

I have been involved in vcs-pkg.org since around the time it started, a couple of years ago. The discussion has been interesting, and I learned a lot about the benefits and disadvantages of serializing patches (and collecting integration deltas in the feature branches and the specific ordering of the feature branches) and maintaining integration branches (where the integration deltas are collected purely in the integration branch, but might tend to get lost in the history, and a fresh integration branch having to re-invent the integration deltas afresh).

However, one of the things we have been lax about is getting down to brass tacks and getting around to being able to create generic packaging tools (though for the folks on the serializing patches side of the debate we have the excellent quilt and the topgit packages).

I have recently mostly automated my git based work-flow, and have built fancy porcelain around my git repository setup. During IRC discussion, the gitpkg script came up. This seems almost usable, apart from not having any built-in pristine-tar support, and also not supporting git submodules, which make is less useful an alternative than my current porcelain.

But it seems to me that we are pretty close to being able to create a distribution, layout, and patch handler agnostic script that builds distribution packages directly from version control, as long as we take care not to bind people into distributions or tool specific straitjackets. To these ends, I wanted to see what are the tasks that we want a package building script to perform. Here is what I came up with.

  1. Provide a copy of one or more upstream source tar-balls in the staging area where the package will be built. This staging area may or may not be the working directory checked out from the underlying VCS; my experience has been that most tools of the ilk have a temporary staging directory of some kind.
  2. Provide a directory tree of the sources from which the package is to be built in the staging area
  3. Run one or more commands or shell scripts in the staging area to create the package. These series of commands might be very complex, creating and running virtual machines, chroot jails, satisfying build dependencies, using copy-on-write mechanisms, running unit tests and lintian/puiparts checks on the results. But the building a package script may just punt on these scripts to a user specified hook.

The first and third steps above are pretty straight forward, and fairly uncontroversial.

The upstream sources may be handled by one of these three alternatives:

  1. compressed tar archives of the upstream sources are available, and may be copied.
  2. There is a pristine-tar VCS branch, which in conjunction with the upstream branch, may be used to reproduce the upstream tr archive
  3. Export and create an archive from the upstream branch, which may not have the same checksum as the original branch

The command to run may be supplied by the user in a configuration file or option, and may default based on the native distribution, to dpkg-buildpackage or rpm. There are a number of already mature mechanisms to take a source directory and upstream tar archive and produce packages from that point, and the wheel need not be re-invented.

So the hardest part of the task is to present, in the staging area, for further processing, a directory tree of the source package, ready for the distribution specific build commands. This part of the solution is likely to be VCS specific.

This post is getting long, so I’ll defer presenting my evolving implementation of a generic vcs-pkg tool, git flavour, to the next blog post.

This is continued here.

Manoj

Comments


Add a comment
  • 18/Looking at porcelain: Towards a generic, distribution agnostic tool for building packages from a VCS

Webmaster <webmaster@golden-gryphon.com>
Last commit: Friday night, April 24th, 2009

License: GPL

Last edited Friday night, April 24th, 2009