Changes between Version 14 and Version 15 of BuildingDebianPackages

09/27/09 22:29:50 (11 years ago)



  • BuildingDebianPackages

    v14 v15  
    33== Bcfg2 Packaging == 
    4  * Install packages necessary for building bcfg2 [[BR]] 
    5    {{{apt-get build-dep bcfg2 bcfg2-server}}} [[BR]] 
    6     or, if the available repositories do not have any version of bcfg2, try something like: [[BR]]  
    7    {{{apt-get install cdbs docbook-xsl libxslt1.1 python-dev python2.4-dev sgml-base xml-core xsltproc fakeroot}}} 
    8  * Untar the sources - or for bleeding edge, {{{svn co}}} 
    9  * cd into the debian/ subdirectory 
    10  * Optional: if you want to have a special name for your own package, edit the first line of changelog: change eg. "(" to "(" 
    11  * run ./ <python version> [[br]]This will setup the package to install python properly. [[br]] 
    12    <python version> is either: 
    13    * 2.3 (for debian sarge),  
    14    * 2.4 (for breezy, dapper, and nexenta <= alpha 6) 
    15    * pycentral (for etch, feisty and edgy, gutsy, hardy).  
    17  * cd .. 
    18  * run "fakeroot dpkg-buildpackage -uc -us" 
    19  * enjoy your freshly built packages 
     5The Bcfg2 project provides a `debian` subdirectory with the project's 
     6source that enables users to create their own Debian/Ubuntu compatible 
     7packages (`.deb` files).  The steps to do this, assuming that you are 
     8running on a Debian/Ubuntu system, are as follows: 
     10=== Install packages necessary for building bcfg2 === 
     12If the distribution you are building on already has packaged bcfg2 
     13(even an older version), the following command will likely install the 
     14necessary packages to enable it to be built: 
     17apt-get build-dep bcfg2 bcfg2-server 
     20Or, if the available repositories do not have any version of bcfg2, 
     21try something like: 
     24apt-get install cdbs docbook-xsl libxslt1.1 python-dev python2.4-dev sgml-base xml-core xsltproc fakeroot 
     27=== Install the Bcfg2 source code === 
     29Depending on which version of bcfg2 you want build, you can obtain the 
     30source code from [wiki:Download] or from the project's Subversion 
     31repository.  To create a local anonymous working copy of the latest 
     32version of the bcfg2 source code, use a command like the following: 
     35svn co bcfg2-trunk 
     38=== Configure the Bcfg2 working copy === 
     40Once you have a copy of the source code, there are a couple of final 
     43First, Bcfg2 as packaged for Debian supports several different 
     44versions of Python.  To select the appropriate version you will need 
     45to run the `` script from within the `debian` 
     46subdirectory.  You must pass it an argument ''<PYTHON_VERSION>'' that 
     47is one of the following values: 
     49 `2.3`:: for Debian sarge. 
     50 `2.4`:: for Ubuntu breezy, dapper, and Nexenta <= Alpha 6. 
     51 `pycentral`:: 
     52    for Debian etch or newer; Ubuntu edgy, feisty, gutsy, and hardy or 
     53    newer. 
     55As Debian and other related distributions have matured, many of these 
     56are fading from use and the correct choice for ''<PYTHON_VERSION>'' is 
     57almost always `pycentral`. 
     59Once you have figured out the correct value for ''<PYTHON_VERSION>'', 
     60run the following command: 
     63cd bcfg2-trunk/debian 
     64./ <PYTHON_VERSION> 
     67The next step is to update the Debian `changelog` file with an 
     68appropriate package version string.  Debian packages contain a version 
     69that is extracted from the latest entry in the `changelog` file.  An 
     70appropriate version will help you distinguish your locally built 
     71package from one provided by your distribution.  It also helps the 
     72packaging system know when a newer version of the package is available 
     73to install. 
     75It is possible to skip this step, but the packages you build will have 
     76the same version as the source distribution and will be easy to 
     77confuse with other similarly named (but maybe not equivalent) 
     80The basic format of the package version string to use is this: 
     84'''NOTE: The '~', '+', and '-' characters have significance in 
     85determining when one package is newer than another.  The following 
     86format is believed to do the right thing in all common situations.''' 
     88The components of the package version string are explained below: 
     90 `<UPSTREAM VER>`:: 
     91   This is the version of the Bcfg source code you are working from. 
     92   It will likely be something like `0.9.6` or `1.0`. 
     93 `~<UPSTREAM PRE-VER>`:: 
     94   If you are using a published pre-release of Bcfg2, it will have a 
     95   name like `pre1` or `rc1`.  Use that string here, otherwise drop 
     96   this component and the preceding tilde (`~`) character from the 
     97   package version string. 
     98 `+<UPSTREAM SVN REV>`:: 
     99   If you are building from a local working copy of the Subversion 
     100   repository, it is useful to include the repository revision in the 
     101   package version.  It will be a number like '5464'.  If you are 
     102   building from a downloaded copy of the source, drop this component 
     103   (including the preceding plus-sign (`+`) from the package version 
     104   string. 
     105 `+<LOCAL VER>`:: 
     106   This is a locally relevant name like your last name or your domain 
     107   name, plus the digit `1`.  For example, if your family name is 
     108   ''Smith'', you could use `smith1`.  If you work for ''Example Inc'', 
     109   you could use `example1`. 
     111Here are some examples: 
     113 * If you are building packages for revision 5463 of the Subversion 
     114   trunk, and the latest published version is 1.0pre5, the version 
     115   string should be `1.0~pre5+r5463-0.1+example1`. 
     116 * If you are building packages for the published 1.0 rc1 version, the 
     117   version string should be `1.0~rc1-0.1+example1`. 
     118 * If you are building packages for the published 1.0 version, the 
     119   version string should be `1.0-0.1+example1`. 
     121If you are working on a Subversion working copy of 1.0 pre5 and have 
     122the `devscripts` package installed, the following command is a 
     123convenient way to create a well formatted changelog entry: 
     126REV=$(svn info|grep '^Revision' |cut -d' ' -f2) 
     127debchange --force-bad-version --preserve --newversion "1.0~pre5+r${REV}-0.1+example1" SVN revision $REV 
     130=== Building the Bcfg2 Package === 
     132With the preliminaries out of the way, building the package is simple. 
     135cd ..  # Change into the top level of the source directory 
     136fakeroot dpkg-buildpackage -uc -us 
     139The freshly built packages will be deposited in the parent of the 
     140current directory (`..`).  Examine the output of `dpkg-buildpackage` 
     141for details. 
    22144== Python SSL Backport Packaging ==