Changes between Initial Version and Version 1 of Rules


Ignore:
Timestamp:
01/23/13 17:00:07 (11 years ago)
Author:
jdreed
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Rules

    v1 v1  
     1= The `rules` file = 
     2 
     3The `rules` file is written in `make`, and provides the actual instructions to build the package.  See [[CaffeinatedMake]] for a brief overview of syntax. 
     4 
     5== CDBS and Debhelper == 
     6 
     7Writing `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.   
     8 
     9 
     10 
     11With 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: 
     12 
     13{{{ 
     14#!/usr/bin/make -f 
     15 
     16include /usr/share/cdbs/1/rules/debhelper.mk 
     17include /usr/share/cdbs/1/class/autotools.mk 
     18}}} 
     19 
     20For 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.  
     21 
     22=== Useful makefile variables === 
     23 
     24 * 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. 
     25 * DEB_CONFIGURE_EXTRA_FLAGS (autotools.mk): Any extra flags you want to pass to configure. 
     26 * DEB_MAKE_ENVVARS (makefile.mk): Any environment variables you want to set for make. 
     27 * DEB_MAKE_INVOKE += … (makefile.mk): Pass extra flags to make (note the += here). 
     28 * DEB_MAKE_{BUILD,CLEAN,…}_TARGET (makefile.mk): Control what make targets CDBS uses. Note that make install and make check unless you set their corresponding target variable. 
     29 * DEB_MAKE_CLEAN_TARGET (makefile.mk): Often you want to set this to distclean. 
     30 * CFLAGS,CPPFLAGS,LDFLAGS,… (makefile.mk): Control common compiler and linker flags. 
     31 * DEB_CONFIGURE_EXTRA_FLAGS (autotools.mk): Any extra flags you want to pass to configure. 
     32 * DEB_AUTO_UPDATE_AUTOAUTO = version (makefile.mk): Have autotools component AUTOAUTO-version run at build time. 
     33 * DEB_DH_LINK_ARGS: Create symlinks in your installation (or use a .links file, see below) 
     34 * DEB_DH_debhelper-tool_ARGS: Add flags to any of a number of debhelper tools.