2006-06-01 18:23:24 -04:00
|
|
|
How to build the Debian wx packages
|
|
|
|
===================================
|
|
|
|
|
|
|
|
This file is currently just a brain dump of my experiences with
|
|
|
|
building the Debian wx packages, based on various experimentations,
|
|
|
|
and Googling around. Please don't take anything said here as
|
2006-06-03 16:34:10 -04:00
|
|
|
authoritative or written in stone. Although I've been able to get
|
2006-06-01 18:23:24 -04:00
|
|
|
things to work fairly reliably, I still feel pretty clueless about
|
|
|
|
some things.
|
|
|
|
|
|
|
|
|
|
|
|
Overview
|
|
|
|
--------
|
|
|
|
|
2006-06-03 16:34:10 -04:00
|
|
|
Contrary to how RPM and other packaging systems work, building Debian
|
2006-06-01 18:23:24 -04:00
|
|
|
packages is done with an expanded source tree instead of using a
|
|
|
|
tarball. Inside the toplevel of the source tree you'll find a subdir
|
|
|
|
named debian, and within this dir are various files used by the build.
|
|
|
|
The most important of these are the control file and the rules file.
|
2006-06-03 16:34:10 -04:00
|
|
|
The control file specifies the metadata about each package, such as
|
2006-06-01 18:23:24 -04:00
|
|
|
name, description, dependencies, etc. Interestingly, the version
|
|
|
|
number of the current build is not in the control file as might be
|
|
|
|
expected, but is instead taken from the changelog file. I guess this
|
|
|
|
is a way for debian to make sure that there is always an updated
|
|
|
|
changelog for every release, but it is very non-intuitive to say the
|
|
|
|
least. The rules file is a Makefile, and is executable with a #! that
|
|
|
|
runs make on itself. This lets you execute commands from the toplevel
|
|
|
|
source dir like:
|
|
|
|
|
|
|
|
./debian/rules build
|
|
|
|
|
|
|
|
While theoretically you could build the wx packages directly from your
|
|
|
|
CVS workspace this won't work (currently) for a couple reasons.
|
|
|
|
First, the debian/rules file is currently looking at the name of the
|
|
|
|
toplevel source dir and extracting from it the flavour name (if
|
|
|
|
present) for use in passing to --with-flavor configure flag. (I'm
|
|
|
|
considering changing how it finds this value for 2.7 so, for example,
|
2006-06-27 15:16:11 -04:00
|
|
|
the debian packages could also be built from the wxPython source
|
2006-06-01 18:23:24 -04:00
|
|
|
tarball...) Second, since the build tools use the current source dir
|
|
|
|
for creating the source package, you'll probably want to start with a
|
2006-06-03 16:34:10 -04:00
|
|
|
clean source tree that has had unnecessary things removed from it.
|
2006-06-01 18:23:24 -04:00
|
|
|
There is a Makefile target that will create a minimized and clean
|
|
|
|
source tree for you, and will name it as debian/rules expects. To use
|
|
|
|
it go to a build dir where you've already run configure, and then run:
|
|
|
|
|
|
|
|
make debian-dist
|
|
|
|
|
|
|
|
This will result in a new source tree with a name like
|
|
|
|
wxwidgets2.7-2.7.0.0 that is located as a sibling to the toplevel of
|
|
|
|
the current source tree.
|
|
|
|
|
|
|
|
|
|
|
|
Environment
|
|
|
|
-----------
|
|
|
|
|
2006-06-03 16:34:10 -04:00
|
|
|
The various dpkg helper tools will use some environment settings to
|
2006-06-01 18:23:24 -04:00
|
|
|
provide default values. I have these set:
|
|
|
|
|
|
|
|
DEBFULLNAME='Robin Dunn'
|
|
|
|
DEBEMAIL=robin@alldunn.com
|
|
|
|
DEBSIGN_KEYID='Robin Dunn <robin@alldunn.com>'
|
|
|
|
DEBUILD_DPKG_BUILDPACKAGE_OPTS='-i -ICVS -I.svn'
|
|
|
|
|
|
|
|
Notice the DEBSIGN_KEYID value. If this is set (and you have a
|
|
|
|
matching gnupg key) then the packages will be digitally signed when
|
|
|
|
they are built.
|
|
|
|
|
|
|
|
If you are building packages that you intend to be installable on
|
2006-06-03 16:34:10 -04:00
|
|
|
machines other than your own, then I recommend that you either have a
|
|
|
|
separate machine with a minimal OS install, or set up a chroot
|
2006-06-01 18:23:24 -04:00
|
|
|
environment and do the builds there. The reason for this is to
|
2006-06-03 16:34:10 -04:00
|
|
|
minimize unexpected extra dependencies that the built packages will
|
2006-06-01 18:23:24 -04:00
|
|
|
have because of extra things you have installed on your desktop
|
|
|
|
system, for example OpenGL libs installed by your video card drivers.
|
|
|
|
Using a chroot will also allow you to build packages for different
|
|
|
|
versions of Debian (or Ubuntu) if desired. There is a good
|
|
|
|
description of setting up a chroot environment here:
|
|
|
|
|
|
|
|
https://wiki.ubuntu.com/DebootstrapChroot
|
|
|
|
|
2006-06-03 16:34:10 -04:00
|
|
|
In addition to the base system packages, you'll need to install in
|
|
|
|
the chroot environment any packages needed for building wxWidgets
|
2006-06-01 18:23:24 -04:00
|
|
|
(compilers, make, autoconf, gtk and image libs, lib-dev's, python,
|
|
|
|
python-dev, etc.) as well as the packages listed in the next section.
|
|
|
|
|
|
|
|
|
|
|
|
Build Packages
|
|
|
|
--------------
|
|
|
|
|
2006-06-03 16:34:10 -04:00
|
|
|
There are a number of helper packages that are used when building
|
2006-06-01 18:23:24 -04:00
|
|
|
debian packages. Here are some that I have in my chroot, there may be
|
|
|
|
some others that I am not seeing at the moment:
|
|
|
|
|
|
|
|
debhelper
|
|
|
|
devscripts
|
|
|
|
dh-make
|
|
|
|
dpkg-dev
|
|
|
|
fakeroot
|
|
|
|
lintian
|
|
|
|
diff
|
|
|
|
patch
|
|
|
|
|
|
|
|
|
|
|
|
Doing the Build
|
|
|
|
---------------
|
|
|
|
|
|
|
|
Ok, if you are not totally confused by this point you should have a
|
|
|
|
minimal source tree produced by "make debian-dist" that is accessible
|
|
|
|
by your chroot or other minimal install system. (Unless you are only
|
|
|
|
making packages for yourself, then doing the build on in your main
|
|
|
|
desktop environment would be okay.) The first step is to chdir to
|
|
|
|
the top level of this source tree.
|
|
|
|
|
2006-06-03 16:34:10 -04:00
|
|
|
If you haven't already you'll want to edit debian/changelog to make an
|
2006-06-01 18:23:24 -04:00
|
|
|
entry for the current build. If the version number is changing since
|
|
|
|
the last build then you'll need a whole new section. If you are just
|
|
|
|
updating something in the same version then you can just get by with
|
|
|
|
editing the current changelog entry. The 'dch' tool can be used to
|
|
|
|
open the file in an editor with the cursor positioned for you. If you
|
|
|
|
use 'dch -i' then it will create a new changelog entry for you with
|
|
|
|
the proper syntax. Don't forget to copy this file back to your CVS
|
|
|
|
workspace if appropriate.
|
|
|
|
|
|
|
|
Our debian/control file is generated from debian/control.in, so you
|
|
|
|
can force it to be created now by running the following. You may want
|
2006-06-03 16:34:10 -04:00
|
|
|
to do this to verify its contents before proceeding with the build.
|
2006-06-01 18:23:24 -04:00
|
|
|
|
|
|
|
./debian/rules debian/control
|
|
|
|
|
|
|
|
To run just the compile/link/etc. portions of the build you can do
|
|
|
|
this:
|
|
|
|
|
|
|
|
./debian/rules build
|
|
|
|
|
|
|
|
To also make a set of test binaries you can do this:
|
|
|
|
|
|
|
|
fakeroot ./debian/rules binaries
|
|
|
|
|
|
|
|
To clean up from prior builds you can do this:
|
|
|
|
|
|
|
|
fakeroot ./debian/rules clean
|
|
|
|
|
2006-06-03 16:34:10 -04:00
|
|
|
And to automate the entire process (build, binaries, source packages,
|
2006-06-01 18:23:24 -04:00
|
|
|
digital signing, etc.) you can do this:
|
|
|
|
|
|
|
|
dpkg-buildpackage -rfakeroot
|
|
|
|
|
|
|
|
When finished the binary and source packages will be left in the
|
|
|
|
parent dir of the source tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other Sources of Information
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
http://liw.iki.fi/liw/talks/debian-packaging-tutorial.pdf
|
|
|
|
http://women.alioth.debian.org/wiki/index.php/English/BuildingTutorial
|
|
|
|
http://women.alioth.debian.org/wiki/index.php/English/AdvancedBuildingTips
|
|
|
|
http://www.wiggy.net/presentations/2001/DebianWalkThrough/handouts/handouts.html
|
|
|
|
http://www.debian.org/doc/manuals/maint-guide/index.en.html
|
|
|
|
http://www.isotton.com/debian/docs/repository-howto/repository-howto.html
|
|
|
|
|