ReleaseEngineering/PuppetAgain/HowTo/Build DEBs: Difference between revisions
(Created page with "= Building = At the moment we don't have any shared resources to build Debian packages. You need to use Ubuntu 12.04 based VM on your laptop. To build a package in clean-room en...") |
|||
Line 84: | Line 84: | ||
= Landing = | = Landing = | ||
We use [http://mirrorer.alioth.debian.org/ reprepro] to manage packages. | |||
ATM, the repo lives in /home/raliiev/repo on releng-puppet1.srv.releng.scl3. | |||
There are 2 important files under <tt>conf</tt> directory: | |||
* options | |||
<pre> | |||
verbose | |||
outdir +b/releng | |||
logdir +b/logs | |||
dbdir +b/db | |||
morguedir +b/morgue | |||
keepunreferencedfiles | |||
keepunusednewfiles | |||
</pre> | |||
* distributions | |||
<pre> | |||
Origin: mozilla | |||
Label: Mozilla | |||
Codename: precise | |||
Version: 12.04 | |||
Architectures: amd64 i386 source | |||
Components: main | |||
Description: Releng repos | |||
DebIndices: Packages Release . .bz2 | |||
</pre> | |||
Until we have a shared location (an Ubuntu machine) for package building and repo updates (using incoming directory) you need to sync that directory to your machine. | |||
Example import: | |||
<pre> | |||
cd repo | |||
reprepro -V --basedir . include precise ~/debs/puppet/build-area/puppet_2.7.17-1mozilla1_amd64.changes | |||
</pre> | |||
It will copy packages to releng/, generate indices and update the database. Make sure to not get into a race condition with other people. | |||
When you are done with the repo rsync it back, then publish: | |||
sudo chown puppetagainsync:puppetagainsync -R releng | |||
sudo rsync -av ./releng/ /data/repos/apt/releng/ |
Revision as of 21:58, 28 January 2013
Building
At the moment we don't have any shared resources to build Debian packages. You need to use Ubuntu 12.04 based VM on your laptop.
To build a package in clean-room environment use pbuilder. It uses precreated images to build DEBs in chroot.
Create pbuilder images
Use the following command to create environments.
- 64 bit
sudo pbuilder --create --distribution precise --architecture amd64 \ --components "main restricted universe multiverse" \ --debootstrapopts --variant=buildd \ --basetgz /var/cache/pbuilder/base-precise-amd64.tgz \ --mirror http://archive.ubuntu.com/ubuntu \ --othermirror "deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse" \ --othermirror "deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse"
- 32 bit
sudo pbuilder --create --distribution precise --architecture i386 \ --components "main restricted universe multiverse" \ --debootstrapopts --variant=buildd \ --basetgz /var/cache/pbuilder/base-precise-i386.tgz \ --mirror http://archive.ubuntu.com/ubuntu \ --othermirror "deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse" \ --othermirror "deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse"
Building a package
There are some different ways to build a binary package
Building from orig.tar.gz, debian.tar.gz and dsc
sudo pbuilder --build --distribution precise --architecture amd64 --basetgz /var/cache/pbuilder/base-precise-amd64.tgz\ --buildresult ./out *.dsc
"out" directory will be populated with files you'll need to import into the repo.
By default if the same upstream version has 2 entries in debian/changelog, packaging tools don't add orig.tar.gz in the *.changes files (used when you import the package). If for some reason you need to add the upstream source into the "changes" file (for example, when you backport some package) pass "-sa" to the packaging tools:
sudo pbuilder --build --distribution precise --architecture amd64 --basetgz /var/cache/pbuilder/base-precise-amd64.tgz \ --buildresult out --debbuildopts "-sa" *.dsc
Building using git-buildpackage
git-buildpackage allows you to have everything related to a package under version control. Your git checkout contains the following branches needed to build the package:
- upstream: upstream sources
- debian: debianization work
- pristine-tar (optional): binary information needed to recreate orig.tar.gz from git with a proper final checksum
The following config (~/.gbp.conf) file is used:
[DEFAULT] cleaner = fakeroot debian/rules clean pristine-tar = True color = auto [git-buildpackage] export-dir = ../build-area/ tarball-dir = ../tarballs/ pbuilder = True dist = precise [git-import-orig] dch = False
The following scenario used to rebuild puppet-2.7.17:
# get Debian's package (apt-cache showsrc puppet|grep ^Vcs-Git:) git clone git://git.debian.org/git/pkg-puppet/puppet.git cd puppet git co -b pristine-tar origin/pristine-tar git co -b mozilla upstream/2.7.17 # checkout upstream version we need, by tag git merge debian/2.7.17-1 # merge debian changes for that version, by tag dch --local mozilla --distribution precise # bump debian/changelog with proper version suffix git commit -va # biuld it ARCH=amd64 BUILDER=pbuilder git-buildpackage --git-upstream-branch=origin/upstream --git-debian-branch=mozilla # add -sa to include source) # once you're happy with the package, tag it ARCH=amd64 BUILDER=pbuilder git-buildpackage --git-upstream-branch=origin/upstream --git-debian-branch=mozilla --git-tag
Testing
At the moment there is no testing repo. You need to manually install packages to test them.
Landing
We use reprepro to manage packages.
ATM, the repo lives in /home/raliiev/repo on releng-puppet1.srv.releng.scl3.
There are 2 important files under conf directory:
- options
verbose outdir +b/releng logdir +b/logs dbdir +b/db morguedir +b/morgue keepunreferencedfiles keepunusednewfiles
- distributions
Origin: mozilla Label: Mozilla Codename: precise Version: 12.04 Architectures: amd64 i386 source Components: main Description: Releng repos DebIndices: Packages Release . .bz2
Until we have a shared location (an Ubuntu machine) for package building and repo updates (using incoming directory) you need to sync that directory to your machine.
Example import:
cd repo reprepro -V --basedir . include precise ~/debs/puppet/build-area/puppet_2.7.17-1mozilla1_amd64.changes
It will copy packages to releng/, generate indices and update the database. Make sure to not get into a race condition with other people.
When you are done with the repo rsync it back, then publish:
sudo chown puppetagainsync:puppetagainsync -R releng sudo rsync -av ./releng/ /data/repos/apt/releng/