Cdbs

Published on August 2022 | Categories: Documents | Downloads: 8 | Comments: 0 | Views: 115
of x
Download PDF   Embed   Report

Comments

Content

 

CDBS Documentation i

CDBS Documentation

 

CDBS Documentation ii

Copyright © 2004-2009 DuckCorp

Permission is granted to copy, distribute and/or modify this document under the terms of the   GNU General Public License, License, Version 3 or any later version published by the Free Software Foundation.

 

CDBS Documentation iii

COLLABORATORS TITLE   :

CDBS Documentation ACTION

NAME

DATE

SIGNATURE  

WRITTEN BY

Marc (Duck) Dequènes and Arnaud (Rtp) Patard

2005-03-29

REVISION HISTOR HISTORY Y NUMBER

DATE

DESCRIPTION

0.1.0

2005-04-03

First Public Release (for CDBS V0.4.27-3)

0.1.1

2005-06-07

Updated for CDBS V0.4.30 (perl class build dependency management, cdbs-edit-patch management,  cdbs-edit-patch script)

0.1.2

2005-07-05

Added DEB_CONFIGURE_SCRIPT_ENV usage warning, fixed typo.

0.1.3

2005-09-16

Added info about dpatch extension requirements (additional include + include order). Added warning and workaround for DEB_AUTO_UPDATE_DEBIAN_CONTROL ). Fixed typos. problems (see #311724 (see  #311724).

0.1.4

2005-10-02

Added info about quilt extension for patching sources.

0.2.0

2006-01-05

Added info about Ruby classes (Team & setup.rb). Reordered makefile and autotools setup.rb). class, and explaned relationship. Document extraordinary use of  DEB_MAKE_ENVVARS  in autotools class.

NAME

 

CDBS Documentation iv

REVISION HISTOR HISTORY Y NUMBER

DATE

0.3.0

2006-04-23

DESCRIPTION Fixed typo (s/foo-date/foo-data/ reporte rted by tioui). Warned of possible breakage if spaces in  #306941). ). Removed hacks in CURDIR  (see  (see #306941 examples because of #300149 of  #300149,,  #284231  #284231 and  and #239128 /  #341275. Updated for CDBS 0.4.37 #239128 /   #341275. (document  DEB_MAKE_MAKEFILE, and special case when DEB_MAKE_CLEAN_TARGET  can be empty + dh_installmime and dh_installcatalogs now called in debhelper debhelper class + s/ DEB_ANT_TEST_TARDEB_ANT_TEST_TARGET / DEB_ANT_CHECK_TARGET DEB_ANT_CHECK_TARGET / which was a mistake in code, see #307813 see  #307813 +  + document DEB_CLEAN_EXCLUDE  + default compat mode changed to 5 and   DEB_DH_STRIP_ARGS usage too). Warn rules MUST come after CDBS ). Improved includes (see #273835 (see  #273835). documentation of common build options.

0.4.0

2006-04-24

Updated for CDBS 0.4.39 (ability to use uuencoded patches + dh_installudev +  dh_installudev now  now called in debhelper class + KDE class improvements + config.*  left over autotools files not removed anymore + new   DEB_DH_COMPAT_DISABLE variable + improved scrollkeeper and Python cleanup + updated common variables available in debian/rules ). Updated some examples accordingly. Improved part on compat. Improved fixes related to DEB_AUTO_UPDATE_DEBIAN_CONTROL problems.

0.5.0

2009-04-18

Updated for CDBS 0.4.56 (Python class update + updated  DEB_CONFIGURE_SCRIPT_ENV usage + compat level 7 + documented new cmake and qmake classes). Made clear cdbs-edit-patch is cdbs-edit-patch  is for the simple-patchsys patch system. Added dh_icons to list of debhelper scripts handled by the GNOME class. Improved documentation of   DEB_AUTO_UPDATE_ * variables. Improved docbook tags a lot. Fixed punctuation a bit.

NAME

 

CDBS Documentation v

Contents

1

2

3

4

 

Intr Introdu oducti ction on

1

1.1

A bit of history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   1

1.2

Why CDBS ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   1

Firs Firstt steps steps

 

2

2.1

Convert pkg to CDBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   2

2.2

Basic settings and available variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   2

2.3

Basic custom build rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   3

2.4

Common Build Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4

2.5

Debhelper stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4 2.5.1

Not managing Debhelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4

2.5.2

Debhelper parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   5

2.5.3

Debhelper custom build rules

Co Comm mmon on task taskss

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   6  

7

3.1

Patching sources (using simple-patchsys) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   7

3.2

Patching sources (using dpatch)

3.3

Patching sources (using quilt) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   8

3.4

Automatic tarball management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   8

Adva Advanced nced custom customisatio isation n

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   7

 

10

4.1   debian/control  management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   10 4.2

Using the Makefile class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   11

4.3

Using the Autotools class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   12

4.4

Using the Perl class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   13

4.5

Using the Python class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   14

4.6

Using the Ruby setup.rb class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   15

4.7

Using the Debian Ruby Extras Team class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   16

4.8

Using the GNOME class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   16

4.9 Using the Debian GNOME Team class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   17 4.10 Using the KDE class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   17

 

CDBS Documentation vi

4.11 Using the Ant class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   18 4.12 Using the HBuild class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   19 4.13 Using the CMake class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   19 4.14 Using the qmake class 5

6

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   19

Hal Halll of exampl examples es

 

20

5.1

GNOME + autotools + simple patchsys example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   20

5.2

Python example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   22

5.3

Makefile + Dpatch example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   23

5.4

Perl example

Us Usef eful ul tool toolss

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   24  

26

6.1   cdbs-edit-patch  (provided with CDBS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   26 7

Co Conc nclu lusi sion on

 

27

 

CDBS Documentation vii

List of Tables

2.1

Common Common var variable iabless availab available le in debian/rules   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   3

2.2

Debhelper scripts commonly managed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   5

4.1

Debhelper scripts managed by the GNOME class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   16

 

CDBS Documentation viii

Foreword This documentation describes what we succeeded succeeded to learn about CDBS usage, with as much details as possible. Nevertheless, Nevertheless, we are not using the whole set of available features ourselves, and some parts of this documentation were written for mere conviniencee and completeness. convinienc Please note some examples in this documentation contain folded content which is necessary to keep the pages at a reasonnable width; take care to unfold them when necessary before using them (eg:   debian/control  content must not be folded or build will fail or result be incorrect). If you find mistakes or missing information, feel free to contact Marc Dequènes (Duck)  [email protected].  [email protected].

 

CDBS Documentation 1 / 28

Chapter 1

Introduction

1. 1.1 1

A bit bit of hist history ory

CDBS was written by Jeff Bailey and Colin Walters in march 2003, later joined by 4 other developers. provided a  a small set of examples  (also available in the Basic information can be found on their project their  project page. page.  In the package is provided package here: /usr/share/doc/cdbs/examples/). Since we were experimenting CDBS, it was obvious the lack of documention was preventing us from using it widely in our packages. packa ges. Thus we started to write some notes on CDBS usage usage,, quickly quickly growin growing g to sev several eral pages. pages. This documentat documentation ion is a revised version from the original DuckCorp original  DuckCorp Wiki page. page.

1.2 1.2

Wh Why y CD CDBS BS ?

CDBS is designed to simplify the maintainer’s work so that they only need to think about packaging and not maintaining a debian/rules file that keeps growing bigger and more complicated. So CDBS can handle for you most of common rules and detect some parts of your configuration. CDBS only uses simple makefile rules and is easily extensible using classes. Classes for handling autotools buildsys, applying patches to source, GNOME softwares, Python intall, and so on are available. CDBS advantages : • short, readable and efficient efficient  debian/rules • automates debhelper and autotools for you so you don’ don’tt have to bother about this unpleasant unpleasant and repetitive tasks • maintainer can focus on real packaging problems be because cause CDBS helps you but do not limit customiza customization tion • classes used in CDBS have bee been n well tested so you are using error-proof rules and avoid dirty hacks to solve common problems • switc switching hing to CDBS CDBS is easy easy • can be used to gener generate ate Debian Debian files (like  debian/control  for GNOME Team Uploaders inclusion) • CDBS is ea easily sily extendab extendable le • It |7 |70>< 0>< !!!

 

CDBS Documentation 2 / 28

Chapter 2

First steps 2.1 Con Convert vert pkg to CDB CDBS S Converting to CDBS is easy; A simple  debian/rules  for a C/C++ software with no extra rules would be written as this : #!/usr/bin #!/us r/bin/make /make -f include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/debhelper.mk debhelper.mk include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/autotools.mk autotools.mk

No, i’m not joking, this is sufficient to handle autotools management, like updating   config.{guess|sub}, cleanup temp files after build and launch all common debhelper stuff. Just use compat level 7 (or lower if needed, but not lower than 4 or it may not work), create your  pkg.install,  pkg .info, etc as you usually do with  dh_*  scripts, and CDBS would call them if necessary, autodetecting a lot of things. In case of a missing compat information, CDBS would create a   debian/compat  file with compatibility level 7. If you are using an obsolete  DH _COMPAT variable in your debian/rules , you should get rid of it. In this case, or in case you would like CDBS not to create a  debian/compat file, you can disable this feature by setting   DEB_DH_COMPAT_DISABLE  to a non-void value.

Important If debian/control management is activated (see below), build dependency on cdbs on  cdbs is  is automatically added, if not, you will have to do it yourself.

Warning Beware your working directory  MUST NOT  have spaces or CDBS would probably fail; see #306941 see  #306941

2.2

Basi Basic cs settin ettings gs and av availab ailable le var variable iables s

Remember you can get the pkg directory using the  CURDIR  variable. You can change common build parameters this way : # wh wher ere e so sour urce ces s ar are e DEB_SRCDIR DEB_S RCDIR = $(CUR $(CURDIR)/ DIR)/src src # in wh whic ich h di dire rect ctor ory y to bu buil ild d DEB_BUILDD DEB_B UILDDIR IR = $(DEB $(DEB_SRCD _SRCDIR)/b IR)/build uild

 

CDBS Documentation 3 / 28

# in wh whic ich h di dire rect ctor ory y to in inst stal all l th the e so sofw fwar are e DEB_DESTDI DEB_D ESTDIR R = $(CUR $(CURDIR)/ DIR)/plop/ plop/

Some various variables you can use in  debian/rules  :  

DEB_SOURCE_PACKAGE DEB_VERSION DEB_NOEPOCH_VERSION

name of the source package full Debian version Debian version without epoch

   

DEB_UPSTREAM_VERSION DEB_ISNATIVE

 

   

DEB_ALL_PACKAGES DEB_INDEP_PACKAGES DEB_ARCH_PACKAGES DEB_PACKAGES DEB_UDEB_PACKAGES

list of all binary packages list of architecture independant binary packages list of architecture dependant binary packages list of normal (non-udeb) binary packages list of udeb binary packages, if any

         

DEB_HOST_GNU_TYPE DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_CPU DEB_HOST_ARCH

GNU type on the host machine system part of GNU type on the host machine CPU part of GNU type on the host machine Debian architecture name on the host machine CPU part of the Debian architecture name on the host machine OS part of the Debian architecture name on the host machine

       

DEB_HOST_ARCH_CPU

  DEB_HOST_ARCH_OS

 

DEB_BUILD_GNU_TYPE DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_CPU DEB_BUILD_ARCH DEB_BUILD_ARCH_CPU DEB_BUILD_ARCH_OS DEB_ARCH

upstream version non-empty if package is native

           

GNU type for this build system part of GNU type for this build CPU part of GNU type for this build Debian architecture name for this build CPU part of the Debian architecture name for this build OS part of the Debian architecture name for this build old Debian architecture name  /!\ deprecated, only use to prov provide ide backward compatibility  /!\ 

(see man dpkg-architecture for more information)

Table 2.1: Common variables available in  debian/rules

2.3 Bas Basic ic cus custom tom bu build ild rul rules es

Warning Beware to add rules  after  needed CDBS includes.

Suppose you want custom rules for the source package foo, creating foo (arch-dep) and foo-data (arch-indep), you simply need to add some lines to  debian/rules. To add pre-configure actions : makebuilddir/foo:: ln -s plop plop plop plop2 2

 

CDBS Documentation 4 / 28

To add post-configure actions : configure/foo:: sed -ri ’s/PLOP/PL ’s/PLOP/PLIP/’ IP/’ Makefile Makefile configure/foo-data:: touch src/z src/z.xml .xml

 /!\ in this case we are talking about package configuration and NOT about a configure script made with autotools.

To add post-build actions : build/foo:: /bin/bash debian/scripts/toto.sh build/foo-data:: $(MAKE) $(MAK E) helpf helpfiles iles

To add post-install actions : install/foo:: cp debia debian/tmp n/tmp/myfo /myfoocmd ocmd debian/foo debian/foo/fooc /foocmd md fi find nd de debi bian an/f /foo oo/ / -n -nam ame e "C "CVS VS" " -d -dep epth th -e -exe xec c rm -r -rf f {} \; install/foo-data:: cp dat data/ a/*.png debian/foo-data/usr/sha debian/foo-data/usr/share/foo-data/images/ re/foo-data/images/ dh_stuff dh_st uff -m ipot -f plop. plop.bz3 bz3 debian/foo debian/foo-data -data/libe /libexec/ xec/

To add post deb preparation actions : binary/foo:: strip --rem --remove-s ove-sectio ection=.co n=.comment mment --remove-s --remove-sectio ection=.no n=.note te --strip-un --strip-unneede needed d \ debian/foo/usr/lib/foo/totoz.so

To add pre-clean actions : cleanbuilddir/foo:: rm -f debia debian/foo n/fooman.1 man.1

2.4 Com Common mon Bui Build ld Optio Options ns Default optimization is set using   DEB_OPT_FLAG  which default to "-O2"; you can override it.   CFLAGS  and  CXXFLAGS  are set to "-g -Wall $(DEB_OPT_FLAG)", CPPFLAGS is untouched from environment, but you can override these settings on a per-package basis using  CFLAGS_  package,  CXXFLAGS_  package, and  CPPFLAGS_  package variables. DEB_BUILD_OPTIONS  is a well known Debian environment variable, not a CDBS one, containing special build options (a comma-separated list of keywords). CDBS does check   DEB_BUILD_OPTIONS  to take these options into account; see details

in each class.

2.5 Deb Debhel helper per stu stuff ff 2.5.1 2.5. 1

Not managing managing Debhelper Debhelper

Yes, CDBS is doing almost everything for you :) . Just add this line to the beginning of your  debian/rules file : include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/debhelper.mk debhelper.mk

 

CDBS Documentation 5 / 28

dh_builddeb dh_clean dh_compress dh_fixperms dh_prep dh_shlibdeps dh_strip

dh_installcatalogs dh_installchangelogs dh_installcron dh_installdeb dh_gencontrol dh_install

dh_installdocs dh_installemacsen dh_installexamples dh_installinfo dh_installdebconf dh_installdirs

dh_installlogrotate dh_installman d dh h_installmenu dh_installmime dh_installinit dh_installlogcheck

dh_link dh_makeshlibs dh_md5sums dh_perl dh_installpam dh_installudev

Table 2.2: Debhelper scripts commonly managed CDBS debhelper rules handle the following Debhelper scripts for each binary package automatically : Other Debhelper scripts can be handled in specific classes or may be called in custom rules. Important If  debian/control  management is activated (see below), build dependency on  debhelper  debhelper is  is automatically added, if not, you will have to do it yourself. Having a versioned dependency on debhelper on  debhelper is  is recommended as it will ensure people will use the version providing the necessary features (CDBS  debian/control  management will do it).

2.5.2 2.5. 2

Debhelper Debhelper parameter parameters s

The following parameters allow debhelper calls customization while most common calls are still handled without writing any rule. Some of them apply on all binary packaged, like   DEB_INSTALL_DOCS_ALL, and some apply only to a specific package, like DEB_SHLIBDEPS_LIBRARY_  pkg   pkg  (where  (where  pkg  is  is the name of the binary package). Read the comments in /usr/share/ cdbs/1/rules/debhelper.mk  for a complete listing. Some non-exhaustive examples follow. To specify a tight dependency on a package containing shared libraries: DEB_DH_MAK DEB_D H_MAKESHLI ESHLIBS_AR BS_ARGS_li GS_libfoo bfoo := -V"libfoo -V"libfoo (>= 0.1.2-3)" 0.1.2-3)" DEB_SHLIBDEPS_L DEB_SHLIBD EPS_LIBRAR IBRARY_ark Y_arkrpg rpg := libfoo libfoo DEB_SHLIBDEPS_INCLUDE_arkrpg DEB_SHLIBDEPS_INCLUDE_a rkrpg := debian/libfoo/usr/lib/

To install a changelog file with an uncommon name as   ProjectChanges.txt.gz: DEB_INSTALL_CHANGELOGS_ALL DEB_INSTALL_CHANGELOGS_ ALL := ProjectChanges.txt

To avoid compressing files with i.py  extension : DEB_COMPRE DEB_C OMPRESS_EX SS_EXCLUDE CLUDE := .py

To register a debug library package libfoo-dbg for libfoo (which needs unstripped  .so ) in compat mode 4: DEB_DH_STR DEB_D H_STRIP_AR IP_ARGS GS := --dbg --dbg-pack -package=l age=libfoo ibfoo

Starting from compat mode 5, CDBS automatically detect -dbg packages and pass the needed arguments to dh_strip;  DEB_DH _STRIP_ARGS  can still be useful to pass additional parameters like excluded items ( --exclude= item item). Perl-specific debhelper options (dh_perl call is always performed): # Ad Add d a sp spac acee-se sepa para rate ted d li list st of pa path ths s to se sear arch ch fo for r pe perl rl mo modu dule les s DEB_PERL_I DEB_P ERL_INCLUD NCLUDE E := /usr/ /usr/lib/p lib/perl-z erl-z # Like Like the above, above, but for the ’libpe ’libperlrl-stu stuff’ ff’ packag package e DEB_PERL_INCLUDE_libperl-stuff DEB_PERL_INCLUDE_libper l-stuff := /usr/lib/perl-plop # Overri Overrides des option options s pas passed sed to dh_per dh_perl l DEB_DH_PER DEB_D H_PERL_ARG L_ARGS S := -d

 

CDBS Documentation 6 / 28

To avoid loosing temporary generated files in dh_clean processing (rarely useful): # files files con contai tainin ning g the these se patter pattern n would would not be delete deleted d # (bewar (beware e CDB CDBS~c S~chan hangel gelog og has a typo typo while while highli highlight ghting ing new DEB_CL DEB_CLEAN EAN_EX _EXCLU CLUDE DE*S*   feature) DEB_CLEAN_ DEB_C LEAN_EXCLU EXCLUDE DE := preci precious ous keep

2.5.3 2.5. 3

Debhelper Debhelper custom custom build build rules

CDBS debhelper rules also add more adequate build rules. To add post deb preparation (including debhelper stuff) actions : binary-install/foo:: chmod a+x debian/foo debian/foo/usr/ /usr/bin/p bin/pouet ouet

To add post clean actions : clean:: rm -rf plop.t plop.tmp mp

Several other rules exists, but we have not tested them : • binary-strip/foo (c (called alled after stripping) • binary-fixup/foo (called after gz gzipping ipping and fixing permissions) permissions) • binary-predeb (called just before creating creating .deb)

 

CDBS Documentation 7 / 28

Chapter 3

Common tasks

3.1

Pa Patch tching ing s sour ources ces (usin (using g sim simple-p ple-patch atchsys) sys)

First, patching sources directly is really BAD(tm), so you need a way to apply patches without touching any files. These rules, inpired by the Dpatch system, are quite similar and powerful. All you need is diff/patch knowledge, CDBS is doing the rest. That’s quite hard, so please listen carefully and prepare for examination. First, add this line to your  debian/rules  : include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/simple-patchsys.mk simple-patchsys.mk

And then use it ! Create the directory   debian/patches  and put your patches in it. Files should be named so as to reflect in which order they have to be applied, and must finish with the  .patch  or  .diff  suffix. The class would take care of patching before configure and unpatch after clean. It is possible to use patch level 0 to 3, and CDBS would try them and use the right level automatically. The system can handle compressed patch with additional .gz or .bz2 suffix and uu-encoded patches with additional .uu suffix. You can customize the directories where patches are searched, and the suffix like this : (defaults are: .diff .diff.gz .diff.bz2 .diff.uu .patch .patch.gz .patch.bz2 .patch.uu) DEB_PATCHDIRS DEB_PATCHD IRS := debia debian/myp n/mypatche atches s DEB_PATCH_ DEB_P ATCH_SUFFI SUFFIX X := .plop

In case of errors when applying, for example   debian/patches/01_hurd_ftbfs_pathmax.patch, you can read the log log for for this this patc patch h in debian/patches/01_hurd_ftbfs_pathmax.patch.level-0.log (’0’ (’0’ beca becaus usee a le leve vell 0 patc patch) h)..

Important If   debian/control  management is activated (see below), build dependency on  patchutils  patchutils is  is automatically added, if not, you will have to do it yourself.

3.2

Pa Patch tching ing sour sources ces (usin (using g dpatch) dpatch)

To use Dpatch as an alternative to the CDBS included patch system, just add his line to your   debian/rules : include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/dpatch.mk dpatch.mk # needed needed to use the dpatch dpatch tools tools (like (like dpatch dpatch-ed -editit-pat patch) ch) include /usr/share/dpatch/dpatch /usr/share/dpatch/dpatch.make .make

 

CDBS Documentation 8 / 28

Now you can use Dpatch as usual and CDBS would call it automatically.

Warning You should include dpatch.mk  AFTER  autotools.mk   autotools.mk or gnome.mk in order to have dpatch extension work correctly.

Important If debian/control management is activated (see below), build dependency on  dpatch  dpatch and  and patchutils  patchutils is  is automatically added, if not, you will have to do it yourself.

3.3

Pa Patch tching ing sour sources ces (usin (using g quilt)

 as an alternative to the CDBS included patch system, just add his line to your  debian/rules : To use Quilt use Quilt as include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/patchsys-quilt.mk patchsys-quilt.mk

Now you can use Quilt as usual and CDBS would call it automatically.

Important If   debian/control  management is activated (see below), build dependency on  quilt  quilt and  and  patchutils  patchutils is  is automatically added, if not, you will have to do it yourself.

3.4

Au Automa tomatic tic tarba tarball ll manageme management nt

To use the CDBS tarball system, just add his line to your   debian/rules, and specify the name of the top directory of the extracted tarball : include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/tarball.mk tarball.mk DEB_TAR_SR DEB_T AR_SRCDIR CDIR := fooso foosoft ft

CDBS will recognize tarballs with the following extensions: .tar .tgz .tar.gz .tar.bz .tar.bz2 .zip The tarball location is autodetected if in the top source directory, or can be specified : DEB_TARBALL := $(CURDIR)/tarballdir/mygnustuff_beta-1.2.3.tar.gz $(CURDIR)/tarballdir/mygnustuff_beta-1.2.3.tar.gz

CDBS will handle automatic uncompression and cleanups, automagically set  DEB_SRCDIR and  DEB_BUILDDIR  for you, and integrate well with other CDBS parts (like autotools class). Moreover, if you want sources to be cleaned up from dirty SCM-specific dirs and file, just add this at the top of your  debian/ rules, before any include : DEB_AUTO_C DEB_A UTO_CLEANU LEANUP_RCS P_RCS := yes

Warning The   DEB_AUTO_CLEANUP_RCS  fea  feature ture has been removed for no good reason since version version 0.4.39. Fee Feell free to bugreport if you want it resurrected.

 

CDBS Documentation 9 / 28

Important If needed, and if   debian/control   management is activated (see below), build dependency on  bzip2  bzip2 or  or  unzip  unzip is  is automatically added, if not, you will have to do it yourself.

 

CDBS Documentation 10 / 28

Chapter 4

Advanced customisation 4.1   debian/control  management Caution Automatic  debian/control  generation using any tool is permitted into Debian as long as it is triggered manually by the developer and the latter checks the result carefully. Autogenerating   debian/control   without without any any hum human an interv intervent ention ion could could be harmful harmful in som some e wa ways ys detail detailed ed in #311724..  This is not allowed in Debian. #311724 We then urge you to avoid using DEB_AUTO_UPDATE_DEBIAN_CONTROL directly and instead invoke the autogeneration rules manually after you modified   debian/control.in   (this way users or buildds wouldn’t have different Build-Depends when building, avoiding many problems). Do not forget to proofread the result before any upload. Manual  debian/control  regeneration: DEB_AUTO_U DEB_A UTO_UPDATE PDATE_DEBI _DEBIAN_CO AN_CONTROL NTROL=yes =yes fakeroot fakeroot debian/rul debian/rules es clean

This feature allow : • CDBS to automatically manage some b build-related uild-related Build-Depends auto automatically matically • use of embedded shell shell commands  EXPERIMENTA ENTAL L) • use of CPU and System criterias to specify architecture architecture ( EXPERIM

Build-related Build-Depends are dependencies introduced by the use of certain CDBS features, or autodetected needs. Embedded shell commands allows including hacks like : Build-Depe Build -Depends: nds: libgp libgpm-dev m-dev [‘type-han [‘type-handling dling any linux-gnu‘ linux-gnu‘] ]

CPU and System criterias implements support for Cpu/System fields, as a replacement for the Architecture field (which is to be implemented in dpkg in the long term, but still  EXPERIMENTAL). Here is an exemple, before : Architectu Archi tecture: re: all

and after : Cpu: all Cpu: System: Syste m: all

If these fields are used, it is also possible to include special tags to easily take advantage of the  type-handling  tool, like in this example :

 

CDBS Documentation 11 / 28

BuildBui ld-Dep Depend ends: s: @cd @cdbs@ bs@, , procps procps [syste [system: m: linux] linux], , plop plop [cpu: [cpu: s390] s390]

(look at the type-handling package documentation, for more information) Here is the recipe :

1. Rename Rename  debian/control into  debian/control.in. 2. Replace cdbs / debhelper debhelper / ... Build-Depends with @cdbs@ in your  debian/control.in like this : Build-Dep BuildDepend ends-I s-Inde ndep: p: @cdbs@ @cdbs@, , python python-de -dev v (>= 2.3), 2.3), python python-so -soya ya (>= 0.9), 0.9), \ python-soy pytho n-soya a (<< 0.10), 0.10), python-ope python-openal(> nal(>= = 0.1.4-4), 0.1.4-4), gettext gettext

3. Then manually (re)generate  debian/control as explained above (see the caution part).

4.2 Usi Using ng the Mak Makefil efile e cl clas ass s This class is for the guys who only have a Makefile (no autotools availab available) le) to build build the program program.. You only need to have four rules in the Makefile: • one for cleaning the build directory (i.e. mrproper) • one for buildin building g your software (i.e. myprog) • one for checking if the so software ftware is working properly properly (i.e. check) • one for installing your software (i.e. install) To be honest, the install rules is not a must-have, but it always helps a lot when you’ve got it. The first operation, is to write the  debian/rules. First, we add the include lines: include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/makefile.mk makefile.mk

Now, it remains to tell cdbs the name of our four Makefile rules. For the previous examples it gives: DE DEB_ B_MA MAKE KE_C _CLE LEAN AN_T _TAR ARGE GET T := mr mrpr prop oper er # if yo you u dete detect ct au auth thor ors’ s’s s lo loss ss of sa sani nity ty, , te tell ll CD CDBS BS no not t to tr try y ru runn nnin ing g th the e no none nexi xist sten ent t cl clea ean n ru rule le, , an and d do th the e jo job b yo your urse self lf in de debi bian an/r /rul ules es DE DEB_ B_MA MAKE KE_C _CLE LEAN AN_T _TAR ARGE GET T := DE DEB_ B_MA MAKE KE_B _BUI UILD LD_T _TAR ARGE GET T := my mypr prog og DEB_MAKE_I DEB_M AKE_INSTAL NSTALL_TAR L_TARGET GET := install install DESTDIR=$( DESTDIR=$(CURDI CURDIR)/de R)/debian/ bian/tmp/ tmp/ # no ch chec eck k fo for r th this is so soft ftwa ware re DEB_MAKE_CHECK_TARGET :=

 

 ←

# allow allow cha changi nging ng the makefi makefile le filena filename me in case case of emerge emergency ncy exotic exotic practi practices ces DEB_MAKE_MAKEFILE := MaKeFiLe # exampl example e whe when n cha changi nging ng env enviro ironne nnemen ment t variab variables les is necess necessary ary : DEB_MA DEB _MAKE_ KE_ENV ENVVAR VARS S := CFL CFLAGS AGS="="-fom fomitit-fra frameme-poi pointe nter" r"

DEB_BUILD_OPTIONS  is checked for the following options :

• noopt noopt:: use -O0 instea instead d of -O2 • noche nocheck: ck: skip the check check rule If your Makefile doesn’t support the  DESTDIR variable, take a look in it and find the variable responsible for setting installation directory. If you don’t find some variable to do this, you’ll have to patch the file... That’s all :)

 

CDBS Documentation 12 / 28

4.3 Usi Using ng the Auto utotoo tools ls cl class ass This class is able to use configur configuree scripts and makefiles generated generated with autotools autotools (and possibly libtool). libtool). All rules are called automatically and clean rules to remove generated files during build are also added. This class in fact improves the makefile class to support autotools features and provide good defaults. To use it, just add this line to your  debian/rules include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/autotools.mk autotools.mk

CDBS automatically handles common flags to pass to the configure script, but it is possible to give some extra parameters : DEB_CONFIG DEB_C ONFIGURE_E URE_EXTRA_ XTRA_FLAGS FLAGS := --with-ipv --with-ipv6 6 --with-foo --with-foo

If the build system uses non-standard configure options you can override CDBS default behavior : COMMON_CONFIGURE_FLAGS := --program-dir=/usr

(notice that   DEB_CONFIGURE_EXTRA_FLAGS  would still be appended) If some specific environnement variables need to be setup, use : DEB_CONFIGURE_SCRIPT_ENV DEB_CONFIGURE_SCRIPT_EN V += BUILDOPT="someopt"

Warning Prefer use of += instead of := not to override other environment variables (CC / CXX / CFLAGS / CXXFLAGS /  CPPFLAGS / LDFLAGS) propagated in the CDBS default.

CDBS will automatically update  config.sub,  config.guess, and  config.rpath  before build and restore the old ones at clean stage (even if using the tarball system). If needed, and if   debian/control  management is activated,  autotools-dev and/or gnulib  will then be automatically added to the build dependencies (needed to find updated versions of the files). If the program does not use the top source directory to store autoconf files, you can teach CDBS where it is to be found : DEB_AC_AUX DEB_A C_AUX_DIR _DIR = $(DEB_SRCD $(DEB_SRCDIR)/a IR)/autoco utoconf nf

CDBS can be asked asked to update update libtool, autoconf, autoconf, and automake automake files, files, but this behavior behavior is likely to break the build system and is  discouraged.   discouraged. Nevertheless, if you still want this feature, set the following variables : STRONGLY  •   DEB_AUTO_UPDATE_LIBTOOL:  pre  to call libtoolize, or  post  to copy system-wide  libtool after configure is done •   DEB_AUTO_UPDATE_ACLOCAL: aclocal version to use •   DEB_AUTO_UPDATE_AUTOCONF:  autoconf  version  version to use •   DEB_AUTO_UPDATE_AUTOHEADER: autoheader  version to use •   DEB_AUTO_UPDATE_AUTOMAKE:  automake  version to use •   DEB_AUTOMAKE_ARGS: extra arguments to  automake call (corresponding build dependencies will automatically be added) The following make parameters can be overridden :

 

CDBS Documentation 13 / 28

# th thes ese e ar are e the the de defa faul ults ts CD CDBS BS pr prov ovid ides es DEB_MAKE_I DEB_M AKE_INSTAL NSTALL_TAR L_TARGET GET := install install DESTDIR=$( DESTDIR=$(DEB_D DEB_DESTDI ESTDIR) R) DEB_MAKE_C DEB_M AKE_CLEAN_ LEAN_TARGE TARGET T := distclean distclean DEB_MAKE_CHECK_TARGET := # exampl example e to wor work k aro around und dirty dirty makefi makefile le DEB_MAKE_INSTALL_TARGET := install prefix=$(CURDIR)/debian/tmp/usr # exampl example e wit with h une unexis xistan tant t instal install l rule rule for make make DEB_MAKE_INSTALL_TARGET := # ex exam ampl ple e to ac acti tiva vate te ch chec eck k ru rule le DEB_MAKE_C DEB_M AKE_CHECK_ HECK_TARGE TARGET T := check # overri overridin ding g mak make-o e-only nly enviro environne nnemen ment t variab variables les : # (s (sho houl uld d ne neve ver r be ne nece cess ssar ary y in a cl clea ean n bu buil ild d sy syst stem em) ) # (examp (example le bor borrow rowed ed fro from m the bioapi bioapi packag package) e) DEB_MA DEB _MAKE_ KE_ENV ENVVAR VARS S := "SK "SKIPC IPCONF ONFIG= IG=tru true" e"

DEB_BUILD_OPTIONS  is checked for the following options :

• noopt noopt:: use -O0 instea instead d of -O2 • noche nocheck: ck: skip the check check rule If you are using CDBS version < 0.4.39, it automatically cleans autotools files generated during build ( config.cache , version 0.4.39, 0.4.39, CDBS leave them all considerin considering g it is not his job to correct config.log , and   config.status). Since version an upstream buildsys misbehavior (but you may remove them in the clean rule if necessary before you get the issue solved by authors).

4.4 Usi Using ng the Perl cl class ass This class can manage standard perl build and install with MakeMaker method. To use this class, add this line to your  debian/rules  : include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/perlmodule.mk perlmodule.mk

Optionally, it can take care of using dh_perl, depending the debhelper class is declared before the perl class or not. Install path defaults to ’first_pkg  /usr’ where  first_pkg  is   is the first package in   debian/control. You can customize build options like this : # change change MakeMa MakeMaker ker defaul defaults ts (shoul (should d never never be useful usefull) l) DEB_MAKE_B DEB_M AKE_BUILD_ UILD_TARGE TARGET T := build-all build-all DEB_MAKE_C DEB_M AKE_CLEAN_ LEAN_TARGE TARGET T := realclean realclean DEB_MAKE_CHECK_TARGET := DEB_MAKE_I DEB_M AKE_INSTAL NSTALL_TAR L_TARGET GET := install install PREFIX=deb PREFIX=debian/s ian/stuff tuff # add custom custom MakeMa MakeMaker ker option options s DEB_MAKEMAKER_U DEB_MAKEMA KER_USER_F SER_FLAGS LAGS := --with-ipv --with-ipv6 6

Common makefile or general options can still be overrided:   DEB_MAKE_ENVVARS,  DEB_BUILDDIR  (must match  DEB_SRCDIR  for Perl) Have a look at Perl-specific debhelper options described above.

 

CDBS Documentation 14 / 28

Important If  debian/control  management is activated (see below), build dependency on  perl  perl is  is automatically added, if not, you will have to do it yourself.

4.5 Usi Using ng the Py Pytho thon n cl class ass This class can manage common Python builds using  distutils automatically.  distutils  automatically.

Warning Since 0.4.53, this class does not handle old-policy packages (pre-Etch) anymore.

With the new policy all versionned packages (pythonver -app) are collapsed into a single package (python-app). The class is able to move python scripts and .so files in the new locations automatically. You can use the auto control file generation feature to ensure your Build-Depends are set correctly for the new needed tools. To use this class, add these lines to your  debian/rules : # se sele lect ct the the py pyth thon on sy syst stem em yo you u wa want nt to us use e : py pysu supp ppor ort t or py pyce cent ntra ral l # (t (thi his s MU MUST ST be do done ne be befo fore re in incl clud udin ing g th the e cl clas ass) s) DEB_PYTHON DEB_P YTHON_SYST _SYSTEM EM = pysup pysupport port include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/python-distutils.mk python-distutils.mk

The class also takes care of calling dh_pysupport or dh_pycentral. You can customize build options like this : ###### ### ###### ###### ##### ## The These se var variab iables les are additi additions ons for the new policy policy # packag packages es hol holdin ding g the collap collapsed sed conten content t of all suppor supported ted versio versions ns # CDBS CDBS def defaul aults ts to the first first non -doc/-doc/-dev dev/-c /-comm ommon on packag package e listed listed in "debia "debian/c n/cont ontrol rol" " # this this var variab iable le all allows ows to overri override de automa automatic tic detect detection ion DEB_PYTHON DEB_P YTHON_MODU _MODULE_PA LE_PACKAGE CKAGES S = mypyapp mypyapp # list list of pri privat vate e mod module ules s privat private e direct directori oris s (neede (needed d to automa automatic ticall ally y handle handle bytecompilation) DEB_PYTHON_PRIVATE_MODULES_DIRS DEB_PYTHON_PRIVATE_MODU LES_DIRS = /usr/share/mypyapp/my-pv-module /usr/share/mypyapp/my-pv-module

 

 ←

# overri overrides des the defaul default t Python Python instal installat lation ion root root direct directory ory DEB_PYTHON_DESTDIR = $(CURDIR)/debian/python-stuff $(CURDIR)/debian/python-stuff ###### ### ###### ###### ##### ## The These se var variab iables les have have not change changed d (same (same in the old and new policy policy) ) # change change the Python Python build build script script name name (defau (default lt is ’setup ’setup.py .py’) ’) DEB_PYTHON DEB_P YTHON_SETU _SETUP_CMD P_CMD := insta install.py ll.py # cl clea ean n op opti tion ons s fo for r th the e Py Pyth thon on bu buil ild d sc scri ript pt DEB_PYTHON DEB_P YTHON_CLEA _CLEAN_ARG N_ARGS S = -all # bu buil ild d op opti tion ons s fo for r th the e Py Pyth thon on bu buil ild d sc scri ript pt DEB_PYTHON_BUILD_ARGS = --build-base="$(DEB_BUIL --build-base="$(DEB_BUILDDIR)/specific-build-dir" DDIR)/specific-build-dir" # common common additi additiona onal l ins instal tall l option options s for all binary binary packag packages es # (’-(’--ro root ot’ ’ op opti tion on i is s alwa always ys set set) ) DEB_PYTHON DEB_P YTHON_INST _INSTALL_A ALL_ARGS_A RGS_ALL LL = --no-compi --no-compile le --optimize --optimize --force --force

 

CDBS Documentation 15 / 28

You may use some read-only (meaning you MUST NOT alter them) variables in your  debian/rules  : •   cdbs_python_current_version: current python version number (defined only if selected package is a module) •   cdbs_python_build_versions: list of space space separated separated version version numbers for which the selected module module/exte /extension nsion is gonna be built •   cdbs_python_destdir: Python installation root directory (works even when you didn’t used   DEB_PYTHON_DESTDIR •   cdbs_python_packages: list of all Python packages •   cdbs_python_arch_packages: list of all Python architecture dependent packages •   cdbs_python_indep_packages: list of all Python architecture independent packages Complete debian/rules example using python-support for a module (editobj): #!/usr/bin #!/us r/bin/make /make -f # -*- mode: mode: mak makefi efile; le; coding coding: : utf-8 utf-8 -*include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/debhelper.mk debhelper.mk DEB_PYTHON DEB_P YTHON_SYST _SYSTEM EM = pysup pysupport port include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/python-distutils.mk python-distutils.mk include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/patchsys-quilt.mk patchsys-quilt.mk

DEB_COMPRE DEB_C OMPRESS_EX SS_EXCLUDE CLUDE := .py

$(patsubst %,install/%,$(cdbs_python %,install/%,$(cdbs_python_packages)) _packages)) mv debian/$(cdbs_curpkg)/usr debian/$(cdbs_curpkg)/usr/lib/python /lib/python*/site-packages/editobj/ic /site-packages/editobj/icons ons \ debian/$(cdbs_curpkg)/usr/share/$(cdbs_curpkg) $(patsubst %,binary-install/%,$(cdbs %,binary-install/%,$(cdbs_python_packages)) _python_packages)) find fin d deb debian ian/$( /$(cdb cdbs_c s_curp urpkg) kg)/us /usr/s r/shar hare/ e/ -type -type f -exec -exec chmod chmod -R a-x {} \;

Warning Do not use the   DEB_PYTHON_MODULE_PACKAGE  varia  variable ble anymo anymore, re, it has been obsolete obsoleted. d. Use the   DEB_PYTHON_MODULE_PACKAGES   to force the list of module packages, or   cdbs_python_packages  variable in rules generation. Do not use the   cdbs_python_support_path   and   cdbs_python_module_arch   variables anumore, they have been obsoleted.   cdbs_python_support_path  is not usefull anymore, just install files in the standard way and python-support would do the rest (messing into python-support internals was only a workaround when it was incomplete).   cdbs_python_module_arch   can easily be replace by a rule rewrite or a membership test using cdbs_python_arch_packages  or   cdbs_python_indep_packages.

4.6 Usi Using ng tthe he R Rub uby y setu setup.r p.rb b clas class s This class can manage common setup.rb installer automatically. To use this class, add this line to your  debian/rules  : include /usr/share/ruby-pkg-tool /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.m s/1/class/ruby-setup-rb.mk k

Optionally, it can of using declared before thetake rubycare setup.rb classdh_rdoc, or not. to generate and install Rdoc documentation, depending the debhelper class is

 

CDBS Documentation 16 / 28

Most ruby packages are architecture all, and then don’t need being build for multiple ruby versions; your package should then be called ’libfoo-ruby’ or ’foo’ and CDBS would automatically use the current Debian ruby version to build it. If your package contains a compiled part or a binding to an external lib, then you will have packages named ’libfoo-ruby1.6’, ’libfoo-ruby1.8’, and so on, then CDBS would automatically build each package with the corresponding ruby version. In this case, don’t forget to add a ’libfoo-ruby’ convenience dummy package depending on the current Debian ruby version. If you have documentation you want split into a separate package, then call it ’lib foo-ruby -ruby-doc’ -doc’.. If this is Rdoc documentat documentation, ion, you may want to include the debhelper class, as explained before, to have it generated and installed automagically. You can customize build options like this :

# fo forc rce e us usin ing g a sp spec ecif ific ic ru ruby by ve vers rsio ion n fo for r bu buil ild d # (shoul (should d not be nec necess essary ary) ) DEB_RUBY_V DEB_R UBY_VERSIO ERSIONS NS := 1.9 # use ancest ancestor or DEB_RUBY_SETUP_ DEB_RUBY_S ETUP_CMD CMD := install.rb install.rb # co conf nfig ig opti option ons s for for th the e ru ruby by bu buil ild d sc scri ript pt # (older (older setup. setup.rb rb use used d --site --site-ru -ruby by instea instead d of --site --siterub ruby) y) DEB_RUBY_CONFIG_ARGS = --site-ruby=/usr/lib/ruby/1.9-beta --site-ruby=/usr/lib/ruby/1.9-beta

4.7

Using the D Debian ebian Rub Ruby y Ex Extras tras Team cla class ss

If you are part of the Ruby Extras Team, or having the Team as Uploaders, and you feel bored maintaining the list of developers, this class is made for you. To use this class, add this line to your  debian/rules  : include /usr/share/ruby-pkg-tool /usr/share/ruby-pkg-tools/1/rules/uploaders.mk s/1/rules/uploaders.mk

Rename your   debian/control  file to   debian/control.in  and run the clean rule (./debian/rules clean) to regenerate the  debian/control file, replacing the  @RUBY_TEAM@  tag with the list of developers automatically.

4.8 Usi Using ng the GN GNOME OME cl class ass This class adds a make environnement variable : GCONF_DISABLE_MAKEFILE_SCH GCONF_DISABLE_MAKEFILE_SCHEMA_INST EMA_INSTALL ALL = 1 (”This is necessary essa ry because the Gconf schemas schemas have to be registered registered at install time. In the case of packagin packaging, g, this registratio registration n cannot be done when building the package, so this variable disable schema registration in   make install. This pro procedur ceduree if defered until gconftool-2 is called in debian/postinst to register them, and in debian/prerm to unregister them. The dh_gconf script is able to add the right rules automatically for you.”) It can handle the following Debhelper scripts automagically : dh_desktop

dh_gconf

dh_icons

Table 4.1: Debhelper scripts managed by the GNOME class Moreover it adds some more clean rules to remove: • intlto intltool ol generated generated files files • scrollkeeper ge generated nerated files (left over .omf.out  files in  doc  and  help  directories) To use it, just add this line to your  debian/rules, after the debhelper class include : include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/gnome.mk gnome.mk

policy.. For more information on GNOME specific packaging rules, look at the Debian the  Debian GNOME packaging policy

 

CDBS Documentation 17 / 28

4.9

Using the Debia Debian nG GNOME NOME Team cla class ss

If you are part of the GNOME Team, or having the Team as Uploaders, and you feel bored maintaining the list of developers, this class is made for you. To use this class, add this line to your  debian/rules  : include /usr/share/gnome-pkg-too /usr/share/gnome-pkg-tools/1/rules/uploaders.mk ls/1/rules/uploaders.mk

Rename your   debian/control  file to   debian/control.in  and run the clean rule (./debian/rules clean) to regenerate the  debian/control file, replacing the ’@GNOME_TEAM@’ tag with the list of developers automatically. Warning If you are using the   debian/control  file management described below, please note this class will override this feature To cope with this problem, allowing at least Build-Depends handling, use the following work-arround (until it is solved in a proper way) : # deactivate deactivate debian/co debian/control ntrol file management management #DEB_AUTO_UPDAT #DEB_AUTO_ UPDATE_DEB E_DEBIAN_C IAN_CONTRO ONTROL L := yes # ... ... # incl includ udes es an and d ot othe her r st stuf uff f # ... ... clean:: sed -i "s/@c "s/@cdbs@/ dbs@/$(CDB $(CDBS_BUI S_BUILD_DE LD_DEPENDS PENDS)/g" )/g" debian/con debian/control trol # ot othe her r cl clea ean n st stuf uff f

4.10 4.1 0

Usi Using ng the KDE cl class ass

To use this class, add this line to your  debian/rules  file : include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/kde.mk kde.mk

CDBS automatically exports the following variables with the right value : • kde_cgidir (/usr/lib/cgi-bin) • kde_confdir (/etc/kde3) • kde_htmldir (/usr/share/doc/kde/HTML) (/usr/share/doc/kde/HTML) DEB_BUILDDIR ,   DEB_AC_AUX_DIR  and   DEB_CONFIGURE_INCLUDEDIR are set to KDE defaults.

The following files are excluded from compression : • .dcl • .docb .docbook  ook  • -lice -license nse • .tag • .sty • .el

 

CDBS Documentation 18 / 28

(take care of them if you override the   DEB_COMPRESS_EXCLUDE variable) It can handle configure options specific to KDE (not forgeting disabling rpath and activating xinerama), set the correct autotools directory, and launch make rules adequately. You can enable APIDOX build by setting the   DEB_KDE_APIDOX  variable to a non-void value. you can enable the final mode build by setting   DEB_KDE_ENABLE_FINAL  variable to a non-void value. DEB_BUILD_OPTIONS  is checked for the following options :

• noopt: disable optimisations (and KDE fina finall mode, overriding  DEB_KDE_ENABLE_FINAL) • nostrip: enable KDE debug (and dis disable able KDE final mode mode,, overriding  DEB_KDE_ENABLE_FINAL) You can prepare the build using the ’buildprep’ convenience target:  fakeroot debian/rules buildprep  (which is in fact calling the dist target of   admin/Makefile.common).

4.11 4.1 1

Usi Using ng the Ant cl class ass

(Ant is a java-based build tool) To use this class, add this include to your  debian/rules  and set the following variables : include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/ant.mk ant.mk # Set either either a sin single gle (JAVA_ (JAVA_HOM HOME) E) or multip multiple le (JAVA_ (JAVA_HOM HOME_D E_DIRS IRS) ) java java locati locations ons JAVA_HOME JAVA_ HOME := /usr/ /usr/lib/k lib/kaffe affe # or set JAVACM JAVACMD D if you don’t don’t use defaul default t ’<JAVA ’<JAVA_HO _HOME> ME>/bi /bin/j n/java ava’ ’ path path #JAVACMD #JAVA CMD := /usr/ /usr/bin/j bin/java ava # Se Set t Ant Ant lo loca cati tion on ANT_HOME ANT_H OME := /usr/ /usr/share share/ant/ant-cvs cvs

You may add additional JARs like in the following example : # li list st of ad addi diti tion onal al JA JAR R fi file les s (’ (’.j .jar ar’ ’ ex exte tens nsio ion n ma may y be om omit ited ed) ) # (pat (path h mu must st be ab abso solu lute te of re rela lati tive ve to ’/ ’/us usr/ r/sh shar are/ e/ja java va’) ’) DEB_JARS DEB_J ARS := /usr/ /usr/lib/j lib/java-b ava-bonus/ onus/ldapldap-conne connector ctor adml-adapt adml-adapter.ja er.jar r

The property file defaults to   debian/ant.properties. You can provide additional JVM arguments using ANT_OPTS. You can provide as well additional Ant command line arguments using ANT_ARGS (global) and/or ANT_ARGS_ pkg  (for package   pkg ), ), thus overriding the settings in   build.xml  and the property file. CDBS will build and clean using defaults target from  build.xml. To override these rules, or run the install / check rules, set the following variables to your needs : # overri override de bui build ld and clean clean target target DEB_ANT_BU DEB_A NT_BUILD_T ILD_TARGET ARGET = makeitrule makeitrule DEB_ANT_CL DEB_A NT_CLEAN_T EAN_TARGET ARGET = super-clea super-clean n # i want want inst instal all l and and te test st ru rule les s to be ru run n DEB_ANT_IN DEB_A NT_INSTALL STALL_TARG _TARGET ET = install-al install-all l DEB_ANT_CH DEB_A NT_CHECK_T ECK_TARGET ARGET = check

DEB_BUILD_OPTIONS  is checked for the following options :

• noopt: set ’compile.optimize’ Ant option to false false You should be able to fetch some more information on this java-based build tool in the  Ant Apache web site site..

 

CDBS Documentation 19 / 28

4.12 4.1 2

Usi Using ng the HBu HBuild ild cl class ass

(HBuild is the Haskell mini-distutils) CDBS can take care of -hugs and -ghc packages: invoke  Setup.lhs properly for clean and install part. To use this class, add this line to your  debian/rules  : include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/hbuild.mk hbuild.mk

thread.. You should be able to fetch some more information on Haskell distutils in  this thread

4.13 4.1 3

Usi Using ng the CMa CMake ke cl class ass

This class is intended to handle build systems using CMake using CMake.. To use this class, add this line to your  debian/rules  : include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/cmake.mk cmake.mk

This class is an extension of the Makefile class, calling  cmake  in  DEB_SRCDIR  with classic parameters and then calling  make. In the call to  cmake, the install prefix and path to CC/CXX as well as CFLAGS/CXXFLAGS are given automatically. You can pass extra arguments using   DEB_CMAKE_EXTRA_FLAGS, and in strange cases where you need a special configuration you can override the default arguments using  DEB_CMAKE_NORMAL_ARGS.

4.14 4.1 4

Usi Using ng the qma qmake ke cl class ass

This class is intended to handle build systems using qmake using qmake,, mostly used to build Qt applications. To use this class, add this line to your  debian/rules  : include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/qmake.mk qmake.mk

This class is an extension of the Makefile class, calling  qmake   in   DEB_BUILDDIR  with classic parameters and then calling make. In the the call call to  qmake, the path to CC/CXX as well as CPPFLAGS/CFLAGS/CPPFLAGS/CXXFLAGS are given automatically. Configuration options can be given using   DEB_QMAKE_CONFIG_VAL  (resulting in adding content to  CONFIG), the later defaulting to  nostrip if this option is set in   DEB_BUILD_OPTIONS.

 

CDBS Documentation 20 / 28

Chapter 5

Hall of examples 5.1

GNOM GNOME E+a autoto utotools ols + simp simple le pa patchs tchsys ys e examp xample le

(example from the ’gnome-panel’ package) debian/control.in : Source: Sourc e: gnome gnome-pane -panel l Section: Secti on: gnome Priority: optio Priority: optional nal Maintainer Maint ainer: : Marc Dequè Dequènes nes (Duck) (Duck) <Duck@Duck <Duck@DuckCorp. Corp.org> org> Uploaders: Uploa ders: Sebastien Bache Bacher r <seb128@de <seb128@debian. bian.org>, org>, Arnaud Patard Patard \ <[email protected]>, <[email protected] g>, @GNOME_TEAM@ Standards-Version: 3.6.1.1 Build-Depe Build -Depends: nds: @cdbs @cdbs@, @, libor liborbit2bit2-dev dev (>= 2.10.2-1.1 2.10.2-1.1), ), intltool, intltool, gnome-pkggnome-pkg-tools tools, , \ libglade2libgl ade2-dev dev (>= 1:2.4.0), 1:2.4.0), libwnck-de libwnck-dev v (>= 2.8.1-3), 2.8.1-3), scrollkeeper scrollkeeper \ (>= 0.3.14-9.1 0.3.14-9.1), ), libgn libgnome-d ome-deskto esktop-dev p-dev (>= 2.8.3-2), 2.8.3-2), libpng3-de libpng3-dev, v, sharutils, sharutils, \ libbonobo2 libbo nobo2-dev -dev (>= 2.8.0-3), 2.8.0-3), libxmu-dev libxmu-dev, , autotoolsautotools-dev, dev, libedata-c libedata-cal-de al-dev v \ (>= 1.0.2-3) 1.0.2-3) Package: Packa ge: gnome-pane gnome-panel l Architecture: Architectu re: any Depends: Depen ds: ${shlibs:D ${shlibs:Depend epends}, s}, ${misc:Dep ${misc:Depends} ends}, , gnome-pane gnome-panel-dat l-data a \ (= ${Sou ${Source-V rce-Versio ersion}), n}), gnome-desk gnome-desktop-d top-data ata (>= 2.8.1-2), 2.8.1-2), gnome-sess gnome-session ion \ (>= 2.8.1-4), 2.8.1-4), gnome gnome-cont -control-c rol-center enter (>= 1:2.8.1-3) 1:2.8.1-3) Conflicts: gnome Conflicts: gnome-pane -panel2, l2, quick-loun quick-lounge-ap ge-applet plet (<= 0.98-1), 0.98-1), system-tra system-tray-app y-applet, let, \ metaci met acity ty (<= 2.6.0) 2.6.0), , menu menu (<< 2.1.92.1.9-1) 1) Recommends Recom mends: : gnome gnome-appl -applets ets (>= 2.8.2-1) 2.8.2-1) Sugges Sug gests: ts: menu menu (>= 2.1.92.1.9-1), 1), yelp, yelp, gnome2 gnome2-us -userer-gui guide, de, gnomegnome-ter termin minal al | \ x-terminal-emulator, gnome-system-tools Descri Des cripti ption: on: launch launcher er and dockin docking g facili facility ty for GNOME GNOME 2 This Thi s packag package e con contai tains ns too toolba lbar-l r-like ike “panel “panels” s” which which can be attach attached ed to th the e si side des s of your your X de desk skto top, p, or le left ft “f “flo loat atin ing” g”. . It is de desi sign gned ed to be used use d in con conjun juncti ction on wit with h the Gnome Gnome Deskto Desktop p Enviro Environme nment. nt. Many Many featur features es ar are e pr prov ovid ided ed for for us use e wi with th th the e pa pane nels ls - in incl clud udin ing g an ap appl plic icat atio ion n me menu nu, , clock, clo ck, mail mail che checke cker, r, net networ work k monito monitor, r, quick quick launch launch ico icons ns and the like. like. Package: libpanel-applet2-0 Section: Secti on: libs Architectu Archi tecture: re: any Depends: ${shlibs:Depends} Replaces: Repla ces: gnome gnome-pane -panel l (<< 2.6.0-2) 2.6.0-2) Descripti Descri ption: on: librar library y for GNOME GNOME 2 panel panel applet applets s Th This is libr librar ary y is used used by GN GNOM OME E 2 pa pane nel l ap appl plet ets. s.

 

CDBS Documentation 21 / 28

Package: libpanel-applet2-dbg Section: Secti on: libdevel libdevel Architectu Archi tecture: re: any Depends: Depen ds: libpanel-a libpanel-applet pplet2-0 2-0 (= ${Source-V ${Source-Versio ersion}) n}) Descri Des cripti ption: on: librar library y for GNOME GNOME 2 panel panel applet applets s - librar library y with with debugg debugging ing symbol symbols s Th This is libr librar ary y is used used by GN GNOM OME E 2 pa pane nel l ap appl plet ets. s. . This Thi s packag package e con contai tains ns uns unstri trippe pped d shared shared librar libraries ies. . It is provid provided ed primar primarily ily to prov provid ide e a back backtr trac ace e wi with th na name mes s in a de debu bugg gger er, , th this is ma make kes s it so some mewh what at easier eas ier to int interp erpret ret core core dumps. dumps. The librar libraries ies are instal installed led in /usr/l /us r/lib/ ib/deb debug ug and can be used used by placin placing g that that direct directory ory in LD_LIBRARY_PATH. Most Mos t people people will will not need need this this packag package. e. Package: libpanel-applet2-dev Section: Secti on: libdevel libdevel Architectu Archi tecture: re: any Depends: Depen ds: libpanel-a libpanel-applet pplet2-0 2-0 (= ${Source-V ${Source-Versio ersion}), n}), libgnomeui libgnomeui-dev -dev (>= 2.7.1-1) 2.7.1-1) Replaces: Repla ces: gnome gnome-pane -panel l (<< 2.6.0-2), 2.6.0-2), gnome-pane gnome-panel-dat l-data a (<< 2.6.0) 2.6.0) Descri Des cripti ption: on: librar library y for GNOME GNOME 2 panel panel applet applets s - develo developme pment nt files files Th This is pack packag ages es pr prov ovid ides es th the e in incl clud ude e fi file les s an and d st stat atic ic li libr brar ary y fo for r th the e GN GNOM OME E 2 panel applet libra library ry funct functions. ions. Package: libpanel-applet2-doc Section: Secti on: doc Architectu Archi tecture: re: all Suggests: doc-b Suggests: doc-base ase Replaces: Repla ces: libpa libpanel-a nel-applet pplet2-dev 2-dev (<= 2.0.11-1) 2.0.11-1) Descri Des cripti ption: on: librar library y for GNOME GNOME 2 panel panel applet applets s - docume documenta ntatio tion n files files This Thi s packag packages es pro provid vides es the docume documenta ntatio tion n files files for the GNOME GNOME 2 panel panel applet applet library libra ry funct functions. ions. Package: gnome-panel-data Section: Secti on: gnome Architectu Archi tecture: re: all Depends: Depen ds: gnome-pane gnome-panel l (= ${Source-V ${Source-Versio ersion}), n}), scrollkeep scrollkeeper er (>= 0.3.14-9.1 0.3.14-9.1), ), \ ${misc:Depends} Conflicts: Confl icts: gnome gnome-pane -panel-dat l-data2, a2, gnome-core gnome-core (<< 1.5) Replaces: Repla ces: gnome gnome-desk -desktop-d top-data ata (<= 2.2.2-1), 2.2.2-1), gnome-pane gnome-panel l (<< 2.6.0-2) 2.6.0-2) Descri Des cripti ption: on: common common files files for GNOME GNOME 2 panel panel Th This is pack packag age e incl includ udes es so some me fi file les s th that at ar are e ne need eded ed by th the e GN GNOM OME E 2 pa pane nel l (Pixmaps, (Pixm aps, .desk .desktop top files and internatio internationaliz nalization ation files). files).

debian/rules : #!/usr/bin #!/us r/bin/make /make -f # Gn Gnom ome e Te Team am include /usr/share/gnome-pkg-too /usr/share/gnome-pkg-tools/1/rules/uploaders.mk ls/1/rules/uploaders.mk include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/debhelper.mk debhelper.mk # In Incl clud udin ing g this this fil file e ge gets ts us a si simp mple le patch patch sy syst stem em. . Yo You u ca can n ju just st # drop drop pat patche ches s in deb debian ian/pa /patch tches, es, and they they will will be automa automatic ticall ally y # applie applied d and unappl unapplied ied. . include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/simple-patchsys.mk simple-patchsys.mk # In Incl clud udin ing g this this give gives s us a nu numb mber er of ru rule les s ty typi pica cal l to a GN GNOM OME E # program, program, including including setting setting GCONF_DISA GCONF_DISABLE_M BLE_MAKEFI AKEFILE_SC LE_SCHEMA_ HEMA_INSTA INSTALL=1. LL=1. # Note Note tha that t thi this s cla class ss inh inheri erits ts from from autoto autotools ols.mk .mk and docboo docbookxm kxml.m l.mk, k, # so yo you u don’ don’t t ne need ed to in incl clud ude e th thos ose e to too. o. include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/gnome.mk gnome.mk DEB_CONFIG DEB_C ONFIGURE_S URE_SCRIPT CRIPT_ENV _ENV := LDFLAGS="LDFLAGS="-Wl,-z Wl,-z,defs ,defs -Wl,-O1" -Wl,-O1"

 

CDBS Documentation 22 / 28

DEB_CONFIG DEB_C ONFIGURE_E URE_EXTRA_ XTRA_FLAGS FLAGS := --enable-e --enable-eds ds # de debu bug g li lib b DEB_DH_STRIP_ARGS := --dbg-package=libpanel-applet-2 --dbg-package=libpanel-applet-2 # tight tight ver versio sionin ning g DEB_NOREVI DEB_N OREVISION_ SION_VERSI VERSION ON := $(she $(shell ll dpkg-parse dpkg-parsechang changelog elog | egrep ’^Version:’ ’^Version:’ | \ cut -f 2 -d ’ ’ | cut -f 1 -d ’-’) DEB_DH_MAKESHLIBS_ARGS_libpanel-applet2-0 := -V"libpanel-applet2-0 \ DEB_DH_MAKESHLIBS_ARGS_libpanel-applet2-0 (>= $(DEB_NOREVISION_VERSION))" $(DEB_NOREVISION_VERSION))" DEB_SHLIBDEPS_LIBRARY_gnome-panel:= DEB_SHLIBDEPS_LIBRARY_g nome-panel:= libpanel-applet2-0 DEB_SHLIBDEPS_INCLUDE_gnome-panel DEB_SHLIBDEPS_INCLUDE_g nome-panel := debian/libpanel-applet2-0/usr/lib/ debian/libpanel-applet2-0/usr/lib/

binary-install/gnome-panel:: chmod a+x debian/gnome-panel/usr debian/gnome-panel/usr/lib/gnome-panel/ /lib/gnome-panel/* binary-install/gnome-panel-data:: chmod a+x debian/gnome-panel-data/etc/menu-methods/gnomedebian/gnome-panel-data/etc/menu-methods/gnome-panel-data panel-data find fin d deb debian ian/gn /gnome ome-pa -panel nel-da -data/ ta/usr usr/sh /share are -type -type f -exec -exec chmod chmod -R a-x {} \; binary-install/libpanel-applet2-doc:: find debian/libpanel-applet2 debian/libpanel-applet2-doc/usr/share/doc/libpan -doc/usr/share/doc/libpanel-applet2-doc/ el-applet2-doc/ \ -n -nam ame e ". ".ar arch ch-i -ids ds" " -d -dep epth th -e -exe xec c rm -r -rf f {} \;

clean::

# GNOME GNOME Tea Team m ’uploa ’uploader ders.m s.mk’ k’ should should not overri override de this this behavi behavior or # here is a wo workarround : sed -i "s/@c "s/@cdbs@/ dbs@/$(CDB $(CDBS_BUI S_BUILD_DE LD_DEPENDS PENDS)/g" )/g" debian/con debian/control trol # cl clea eanu nup p no not t do done ne by bu buil ilds dsys ys -f -fin ind d . -n -nam ame e "M "Mak akef efil ile" e" -e -exe xec c rm -f {} \;

5.2 Py Pytho thon n ex exam ample ple (example from ’python-dice’, an unofficial DC package) debian/control.in : Source: Sourc e: pytho python-dic n-dice e Section: Secti on: python python Priority: optio Priority: optional nal Maintainer Maint ainer: : Marc Dequè Dequènes nes (Duck) (Duck) <Duck@Duck <Duck@DuckCorp. Corp.org> org> Standards-Version: 3.6.1.1 Build-Depe Build -Depends: nds: @cdbs @cdbs@, @, pytho python2.3n2.3-dev, dev, python2.4python2.4-dev, dev, swig, libdice2-d libdice2-dev ev \ (>= 0.6.2.fixe 0.6.2.fixed.1) d.1) Package: Packa ge: python-dic python-dice e Architecture: Architectu re: all Depends: python2.3-dice Descri Des cripti ption: on: python python bindin bindings gs for dice dice rollin rolling g and simula simulatio tion n librar library y Py PyDi Dice ce is a py pyth thon on mo modu dule le fo for r di dice ce ro roll llin ing g an and d si simu mula lati tion on (u (usi sing ng fu fuzz zzy y logic). . It prov provid ides es a Py Pyth thon on AP API I to th the e li libd bdic ice2 e2 li libr brar ary. y. . This Thi s is a dum dummy my pac packag kage e automa automatic ticall ally y select selecting ing the curren current t Debian Debian python pytho n version. version. Package: python2.3-dice

 

CDBS Documentation 23 / 28

Architecture: Architectu re: any Depends: ${python:Depends} Descri Des cripti ption: on: python python bindin bindings gs for dice dice rollin rolling g and simula simulatio tion n librar library y Py PyDi Dice ce is a py pyth thon on mo modu dule le fo for r di dice ce ro roll llin ing g an and d si simu mula lati tion on (u (usi sing ng fu fuzz zzy y logic). . It prov provid ides es a Py Pyth thon on AP API I to th the e li libd bdic ice2 e2 li libr brar ary. y.

Package: python2.4-dice Architectu Archi tecture: re: any Depends: ${python:Depends} Descri Des cripti ption: on: python python 2.4 bindin bindings gs for dice dice rollin rolling g and simula simulatio tion n librar library y Py PyDi Dice ce is a py pyth thon on mo modu dule le fo for r di dice ce ro roll llin ing g an and d si simu mula lati tion on (u (usi sing ng fu fuzz zzy y logic). . It prov provid ides es a Py Pyth thon on 2. 2.4 4 AP API I to th the e li libd bdic ice2 e2 li libr brar ary. y.

debian/rules : #!/usr/bin #!/us r/bin/make /make -f

include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/debhelper.mk debhelper.mk include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/python-distutils.mk python-distutils.mk

5.3 Mak Makefil efile e + Dpa Dpatc tch he exam xample ple (example from the ’apg’ package) debian/control.in : Source: apg Source: Section: Secti on: admin Priority: Prior ity: optio optional nal Maintainer Maint ainer: : Marc Haber <mh+d <mh+debian ebian-pack -packages@ ages@zugsc zugschlus. hlus.de> de> Build-Depe Build -Depends: nds: @cdbs @cdbs@ @ Standards-Version: 3.6.1 Package: Packa ge: apg Architectu Archi tecture: re: any Depends: ${shlibs:Depends} Descriptio Descr iption: n: Autom Automated ated Password Password Generator Generator - Standalone Standalone version version APG (Autom (Automate ated d Pas Passwo sword rd Genera Generator tor) ) is the tool tool set for random random passwo pas sword rd gen genera eratio tion. n. It gen genera erates tes some some random random words words of requir required ed type type and prints prints them them to sta standa ndard rd output output. . This This binary binary packag package e contai contains ns only only the standa standalon lone e ver versio sion n of apg. apg. Advantages: Built-in ANSI X9.17 RNG (Random (Random Number Number Generator) Generator)(CAST (CAST/SHA1 /SHA1) ) *   Built-in Built-in in pas passwo sword rd qua qualit lity y checki checking ng system system (now (now it has suppor support t for Bloom Bloom *   Builtfilter fil ter for faster faster access access) ) Password ord Generation Generation Algorithms Algorithms: : *   Two Passw 1. Pro Pronou nounce nceabl able e Passwo Password rd Genera Generatio tion n Algori Algorithm thm (ac (accor cordin ding g to NIST NIST FIPS FIP S 181 181) ) 2. Ran Random dom Charac Character ter Passwo Password rd Genera Generatio tion n Algori Algorithm thm with with 35 configurab confi gurable le modes of operation operation Configurable le passw password ord length length parameters parameters *   Configurab *   Configur Configurable able amoun amount t of generated generated passwords passwords Ability y to ini initia tializ lize e RNG with with user user string string *   Abilit   Supp Support ort for /dev/rando /dev/ random m *

 

CDBS Documentation 24 / 28

Ability y to cry crypt( pt() ) genera generated ted passwo passwords rds and print print them them as additi additiona onal l output output. . *   Abilit Special al para parame mete ters rs to us use e AP APG G in sc scri ript pt *   Speci   Abi Abilit lity y to log passwo pas sword rd genera gen eratio tion n reques req uests ts for net networ work k versio version n * Ability y to con contro trol l APG servic service e access access using using tcpd tcpd *   Abilit   Abi Abili lity ty to us use e pa pass sswo word rd ge gene nera rati tion on se serv rvic ice e fr from om an any y ty type pe of bo box x (M (Mac ac, , * WinXX, Win XX, etc.) etc.) tha that t connec connected ted to networ network k   Abi Abili lity ty to en enfo forc rce e re remo mote te us user ers s to us use e on only ly al allo lowe wed d ty type pe of pa pass sswo word rd * generation The client client/se /serve rver r ver versio sion n of apg has been been delibe deliberat rately ely omitte omitted. d. . Upstream URL: http://www.adel.nursat.kz http://www.adel.nursat.kz/apg/download.shtml /apg/download.shtml

debian/rules : #!/usr/bin #!/us r/bin/make /make -f

DE DEB_ B_MA MAKE KE_C _CLE LEAN AN_T _TAR ARGE GET T DE DEB_ B_MA MAKE KE_B _BUI UILD LD_T _TAR ARGE GET T DEB_MAKE_I DEB_M AKE_INSTAL NSTALL_TAR L_TARGET GET

:= cl clea ean n := st stan anda dalo lone ne := install install INSTALL_PR INSTALL_PREFIX= EFIX=$(CUR $(CURDIR)/ DIR)/debia debian/apg n/apg/usr /usr

include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/debhelper.mk debhelper.mk include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/dpatch.mk dpatch.mk include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/makefile.mk makefile.mk

cleanbuilddir/apg:: rm -f build build-stam -stamp p configureconfigure-stamp stamp php.tar.gz php.tar.gz install/apg:: mv $(CUR $(CURDIR)/ DIR)/debia debian/apg n/apg/usr/ /usr/bin/a bin/apg pg \ $(CURDIR)/debian/apg/usr/lib/apg/apg tar --crea --create te --g --gzip zip --file --file php.ta php.tar.g r.gz z --dire --directo ctory ry \ $(CURDIR)/php/apgonline/ $(CURDIR)/php/apgonline / . instal ins tall l -D --m --mode ode=06 =0644 44 php.ta php.tar.g r.gz z \ $(CURDIR)/debian/apg/usr/share/doc/apg/php.tar.gz rm php.t php.tar.gz ar.gz install insta ll -D --mod --mode=075 e=0755 5 $(CURDIR)/ $(CURDIR)/debia debian/apg n/apg.wrap .wrapper per \ $(CURDIR)/debian/apg/usr/bin/apg install insta ll -D --mod --mode=064 e=0644 4 $(CURDIR)/ $(CURDIR)/debia debian/apg n/apg.conf .conf \ $(CURDIR)/debian/apg/etc/apg.conf

5. 5.4 4

Per erll ex exam ampl ple e

(example from the ’libmidi-perl’ package) debian/control : Source: libmi Source: libmidi-pe di-perl rl Section: Secti on: interprete interpreters rs Priority: Prior ity: optio optional nal BuildBui ld-Dep Depend ends: s: cdb cdbs s (>= 0.4.4) 0.4.4), , debhel debhelper per (>= 4.1.0) 4.1.0), , perl perl (>= 5.8.05.8.0-7) 7) Maintainer Maint ainer: : Mario Lang <mlang@deb <[email protected] ian.org> rg> Standards-Version: 3.5.10 Package: libmidi-pe Package: libmidi-perl rl Architectu Archi tecture: re: all Depends: ${perl:Depends} Descripti Descri ption: on: read, read, com compos pose, e, modify modify, , and write write MIDI MIDI files files in Perl Perl This Thi s suite suite of Per Perl l mod module ules s provid provides es routin routines es for readin reading, g, compos composing ing, , modify mod ifying ing, , and writin writing g MIDI MIDI files. files.

 

CDBS Documentation 25 / 28

debian/rules : #!/usr/bin #!/us r/bin/make /make -f include /usr/share/cdbs/1/rules/ /usr/share/cdbs/1/rules/debhelper.mk debhelper.mk include /usr/share/cdbs/1/class/ /usr/share/cdbs/1/class/perlmodule.mk perlmodule.mk

 

CDBS Documentation 26 / 28

Chapter 6

Useful tools

6.1

cdbs cdbs-edit -edit-pat -patch ch (provide (provided dw with ith CDBS CDBS))

This script is intended to help lazy people edit or easily create patches for the simple-patchsys patch system. Invoke this script with the name of the patch as argument, and you will enter a copy of your work directory in a subshell where you can edit sources. sources. When your work is done and you are satisfied satisfied with your changes, changes, just exit the subshell subshell and you will get back to normal world with   debian/patches/patch_name.patch  created or modified accordingly. The script takes care to apply previous patches (ordered patches needed !), current patch if already existing (in case you want to update it), then generate an incremental diff to only get desired modifications. If you want to cancel the patch creation / modification, you only need to exit the subshell with a non-zero value and the diff will not be generated (only cleanups will be done).

 

CDBS Documentation 27 / 28

Chapter 7

Conclusion CDBS solves most common problems and is very pleasant to use. More and more DD are using it, not because they are obliged to, but because they tasted and found it could improve their packages and avoid loosing time on designing silly and complicated rules. CDBS is not perfect, the BTS entry is not clear, but fixing a single bug most of the time fix a problem for plenty of other packages. CDBS is not yet capable of handling very complicated situations (like packages where multiple C/C++ C/C++ builds with different options and/or patches are required), but this only affects a very small number of packages. These limitations would be [email protected] r.com if  if you want to help). solved in CDBS2, which is work in progress (please contact Jeff Bailey  jbailey@raspberryginge Using CDBS more widely would improve Debian’s overall quality. Don’t hesitate trying it, talking to your friends about it, and contributing. Have a Lot of FUN with CDBS !!! :-)

 

CDBS Documentation 28 / 28

Thanks Thanks to Jeff for his patience and for replying my so many questions. Special thanks to GuiHome for his help to review this documentation.   application, checked using xmllint (from libxml2 (from  libxml2), ), produ produced ced using xsltproc (from (from libxslt  libxslt), ), using This document is a DocBook  a  DocBook  application, the the N.  N. Walsh Walsh and  and dblatex  dblatex XLST  XLST stylesheets, and converted with LaTeX with  LaTeX tools  tools (latex, mkindex, pdflatex & dvips) /  pstotext /  pstotext (with  (with GS GS). ).

Sponsor Documents

Recommended

No recommend documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close