Technology Software

Ubuntu

Using CDBS in packages


Using CDBS for Ubuntu packages is very easy. After adding cdbs to the Build-Depends in debian/control, a basic debian/rules file using CDBS can fit in 2 lines. For a simple C/C++ application with no extra rules, such as hello, debian/rules can look like this :
#!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk

That is all you need to build the program!


CDBS handles installing and cleaning. You can then use the .install and .info files to tune your package with the usual debhelper functions in the various sections for debian/rules.

    [Warning]    
   

Do not use DEB_AUTO_UPDATE_DEBIAN_CONTROL:=yes to automatically change debian/control. It can cause bad things, and Debian considers it a reason to reject a package from entering the archives. See http://ftp-master.debian.org/REJECT-FAQ.html for more information.

As you can see, CDBS mostly works by including .mk Makefiles in debian/rules. The cdbs package provides such files in /usr/share/cdbs/1/ that allow you to do quite a lot of packaging tasks. Other packages, such as quilt, add modules to CDBS and can be used as Build-Depends. Note that you can also use your own CDBS rules and include them in the package. The most useful modules included with the cdbs package are:
  • rules/debhelper.mk: Calls debhelper in all required sections
  • rules/dpatch.mk: Allows you to use dpatch to ease patching the source


  • rules/simple-patchsys.mk: Provides a very easy way to patch the source
  • rules/tarball.mk: Allows you to build packages using the compressed tarball in the package
  • class/autotools.mk: Calls autotools in all required sections
  • class/gnome.mk: Builds GNOME programs (requires the proper Build-Depends in debian/control)
  • class/kde.mk: Builds KDE programs (requires the proper Build-Depends in debian/control)
  • class/python-distutils.mk: Facilitates packaging Python programs

* License

* Ubuntu Packaging Guide Index


Leave a reply