ReleaseEngineering/PuppetAgain/HowTo/Build DEBs: Difference between revisions

(comment on upstream package upgrades from dustin)
 
(10 intermediate revisions by 5 users not shown)
Line 9: Line 9:
= Building =
= Building =


Log in to a package builder host (a node that includes toplevel::server::pkgbuilder; see your org's nodes.pp to find the hostname) as yourself (not root), and get a checkout of the puppetagain repo.
Log in to a package builder host (a node that includes toplevel::server::pkgbuilder; see your org's nodes.pp to find the hostname) as yourself (not root), and get a checkout of the puppetagain repo. See [[ReleaseEngineering/How_To/Start_RPM_Ubuntu_Packager_Instances|moco instructions]].


For the package you want, find or create the appropriately-named orig tarball in the same directory as the package-debian dir, e.g., <tt>modules/packages/manifests/mozilla</tt>.  Then run <tt>puppetagain-build-deb</tt> with the path to the package-debian dir:
For the package you want, find or create the appropriately-named orig tarball in the same directory as the package-debian dir, e.g., <tt>modules/packages/manifests/mozilla</tt>.  Then run <tt>puppetagain-build-deb</tt> with the path to the package-debian dir:
Line 36: Line 36:
See [[ReleaseEngineering/PuppetAgain/Packages#Ubuntu: Landing Custom Repository Changes]].
See [[ReleaseEngineering/PuppetAgain/Packages#Ubuntu: Landing Custom Repository Changes]].


----
= Other Approaches =
= Old Stuff =
 
In addition to the instructions below, these bugs also have package building pointers relevant to their specific situation:
* {{Bug|975034}} - Patch our current version of Mesa (8.0.2) for our EC2 test machines
* {{Bug|975216}} - Please update libxcb on the linux test slaves to a more recent release
* {{Bug|961279}} - [https://bugzilla.mozilla.org/show_bug.cgi?id=961279#c31 Comment 31] contains detailed instructions about how deb packages for hg 3.1.2 have been built. 
 
You can read how to generate a "debian" directory with what you need for "puppetagain-build-deb" by [https://bugzilla.mozilla.org/show_bug.cgi?id=975034#c4 reading this comment by rail].
 
You can also read this blog post to understand the whole picture:
[http://armenzg.blogspot.ca/2014/03/debian-packaging-and-deployment-in.html http://armenzg.blogspot.ca/2014/03/debian-packaging-and-deployment-in.html]
 
== Building ==
== 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.
You can use Ubuntu 12.04 based VM on your laptop or ubuntu64packager1.


To build a package in clean-room environment use <tt>pbuilder</tt>. It uses precreated images to build DEBs in chroot.
To build a package in clean-room environment use <tt>pbuilder</tt>. It uses precreated images to build DEBs in chroot.


=== Create pbuilder images ===
=== Create pbuilder images ===
Use the following command to create environments.
Use the following command to create pbuilder environments.


* 64 bit
* Ubuntu 12.04 Precise 64 bit
<pre>
<pre>
sudo pbuilder --create --distribution precise --architecture amd64 \
sudo pbuilder --create --distribution precise --architecture amd64 \
     --components "main restricted universe multiverse" \
     --components "main restricted universe multiverse" \
    --override-config \
     --debootstrapopts --variant=buildd \
     --debootstrapopts --variant=buildd \
     --basetgz /var/cache/pbuilder/base-precise-amd64.tgz \
     --basetgz /var/cache/pbuilder/base-precise-amd64.tgz \
     --mirror http://archive.ubuntu.com/ubuntu \
     --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-updates main restricted universe multiverse|deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse"
    --othermirror "deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse"
</pre>
</pre>


* 32 bit
* Ubuntu 12.04 Precise 32 bit
<pre>
<pre>
sudo pbuilder --create --distribution precise --architecture i386 \
sudo pbuilder --create --distribution precise --architecture i386 \
     --components "main restricted universe multiverse" \
     --components "main restricted universe multiverse" \
    --override-config \
     --debootstrapopts --variant=buildd \
     --debootstrapopts --variant=buildd \
     --basetgz /var/cache/pbuilder/base-precise-i386.tgz \
     --basetgz /var/cache/pbuilder/base-precise-i386.tgz \
     --mirror http://archive.ubuntu.com/ubuntu \
     --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-updates main restricted universe multiverse|deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse"
    --othermirror "deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse"
</pre>


* Ubuntu 14.04 Trusty 32 bit
<pre>
sudo pbuilder --create --distribution trusty --architecture i386 \
    --components "main restricted universe multiverse" \
    --override-config \
    --debootstrapopts --variant=buildd \
    --basetgz /var/cache/pbuilder/base-trusty-i386.tgz \
    --mirror http://archive.ubuntu.com/ubuntu \
    --othermirror "deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse|deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse"
</pre>
* Ubuntu 14.04 Trusty 64 bit
<pre>
sudo pbuilder --create --distribution trusty --architecture amd64 \
    --components "main restricted universe multiverse" \
    --override-config \
    --debootstrapopts --variant=buildd \
    --basetgz /var/cache/pbuilder/base-trusty-amd64.tgz \
    --mirror http://archive.ubuntu.com/ubuntu \
    --othermirror "deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse|deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse"
</pre>
</pre>


Line 72: Line 103:
There are some different ways to build a binary package
There are some different ways to build a binary package
==== Building from orig.tar.gz, debian.tar.gz and dsc ====
==== 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\
  sudo pbuilder --build --distribution precise --architecture amd64 \
    --buildresult ./out *.dsc
--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.
"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:
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 \
  sudo pbuilder --build --distribution precise --architecture amd64 \
    --buildresult out --debbuildopts "-sa" *.dsc
--basetgz /var/cache/pbuilder/base-precise-amd64.tgz --buildresult out --debbuildopts "-sa" *.dsc


==== Building using git-buildpackage ====
==== Building using git-buildpackage ====
Line 113: Line 144:
dch --local mozilla --distribution precise # bump debian/changelog with proper version suffix
dch --local mozilla --distribution precise # bump debian/changelog with proper version suffix
git commit -va
git commit -va
# biuld it
# build it
ARCH=amd64 BUILDER=pbuilder git-buildpackage --git-upstream-branch=origin/upstream --git-debian-branch=mozilla  # add -sa to include source)
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
# once you're happy with the package, tag it
Confirmed users
3,104

edits