Changes between Version 2 and Version 3 of Rules


Ignore:
Timestamp:
01/23/13 17:29:10 (12 years ago)
Author:
jdreed
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Rules

    v2 v3  
    77Writing `rules` files from scratch is difficult and time-consuming, and virtually nobody does it.  (For an example of a `rules` file written entirely from scratch, see the one included with the `hello` package.)  Instead, there exist two suites to simply this task: Common Debian Build System (CDBS), and Debhelper.  (CDBS, in turn, uses Debhelper internally.)  
    88 
    9 With CDBS, a simple package whose build system is based on autotools but where autoconf, automake, libtool, and aclocal should not be regenerated will probably look something like the following: 
     9=== CDBS === 
     10 
     11When using CDBS, your `control` file must declare a build-dependency on `cdbs`.  With CDBS, a makefile might look like this: 
    1012 
    1113{{{ 
     
    1618}}} 
    1719 
    18 For packages that use other build systems, there are rules files in `/usr/share/cdbs/1/class/` for make, python-distutils, ant, and a few others. If you plan to use quilt patches, you’ll want to include `/usr/share/cdbs/1/rules/patchsys-quilt.mk`. CDBS is primarily controlled through the setting of make variables in the rules file or through the existence of special files in the debian directory. Many changes to flags passed to during the build process can be implemented by just setting a single variable. Many of these variables can also be set on a per-package basis using names like CFLAGS_package. To get a definitive answer, one should inspect the code of debhelper.mk or the class file that you are using.  
     20CDBS includes `debhelper.mk` to get Debhelper functionality, and then includes `autotools.mk` because the software being packaged uses GNU autotools (e.g. autoconf, automake, etc.).   For simple packages that merely ship with a Makefile, for which one types "make; make install", the second line would instead be `include /usr/share/cdbs/1/class/makefile.mk`.  For packages that use other build systems, there are rules files in `/usr/share/cdbs/1/class/` for python-distutils, ant, and a few others. If you plan to use quilt patches, you’ll want to include `/usr/share/cdbs/1/rules/patchsys-quilt.mk`.  
    1921 
    20 === Useful makefile variables === 
     22CDBS is primarily controlled through the setting of make variables in the rules file or through the existence of special files in the debian directory. Many changes to flags passed to during the build process can be implemented by just setting a single variable. Many of these variables can also be set on a per-package basis using names like CFLAGS_package. To get a definitive answer, one should inspect the code of debhelper.mk or the class file that you are using.  
     23 
     24==== Useful makefile variables ==== 
    2125 
    2226 * DEB_AUTO_UPDATE_DEBIAN_CONTROL: Set this to enabled auto-generation of debian/control from debian/control.in. This option is basically banned in Debian because it apparently causes problems with NMUs, but it can save work. 
     
    3135 * DEB_DH_LINK_ARGS: Create symlinks in your installation (or use a .links file, see below) 
    3236 * DEB_DH_debhelper-tool_ARGS: Add flags to any of a number of debhelper tools. 
     37 
     38=== Debhelper === 
     39 
     40A debhelper rules file is even simpler: 
     41 
     42{{{ 
     43#!/usr/bin/make -f 
     44 
     45%: 
     46        dh $@  
     47}}} 
     48 
     49Note that Debathena still uses primarily CDBS, because `config-package-dev` is not available for pure Debhelper packages.  During the Spring and Summer of 2013, we hope to convert the repository to primarily Debhelper packages.