SlideShare a Scribd company logo
1 of 27
Download to read offline
The Common Debian Build System
                    (CDBS)


            Peter Eisentraut


             FOSDEM 2009




        Peter Eisentraut   CDBS
What is CDBS?




    A set of makefile fragments to include into debian/rules
    Makes packaging complex packages easier.
    Makes packaging simple packages harder.
    Initiates you to a secret subculture of Debian packagers.
    Causes you to lose all your not-CDBS-using friends.




                    Peter Eisentraut   CDBS
Simple Example


  #!/usr/bin/make -f

  include /usr/share/cdbs/1/rules/debhelper.mk
  include /usr/share/cdbs/1/class/autotools.mk

  DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz
  DEB_INSTALL_DOCS_ALL = readme.txt
  LDFLAGS += -Wl,--as-needed

  binary-install/mypackage-tools::
          chmod a+x debian/mypackage-tools/
              usr/lib/mypackage/*



                 Peter Eisentraut   CDBS
Simple Example


  #!/usr/bin/make -f

  include /usr/share/cdbs/1/rules/debhelper.mk
  include /usr/share/cdbs/1/class/autotools.mk

  DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz
  DEB_INSTALL_DOCS_ALL = readme.txt
  LDFLAGS += -Wl,--as-needed

  binary-install/mypackage-tools::
          chmod a+x debian/mypackage-tools/
              usr/lib/mypackage/*



                 Peter Eisentraut   CDBS
Simple Example


  #!/usr/bin/make -f

  include /usr/share/cdbs/1/rules/debhelper.mk
  include /usr/share/cdbs/1/class/autotools.mk

  DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz
  DEB_INSTALL_DOCS_ALL = readme.txt
  LDFLAGS += -Wl,--as-needed

  binary-install/mypackage-tools::
          chmod a+x debian/mypackage-tools/
              usr/lib/mypackage/*



                 Peter Eisentraut   CDBS
Background




    First published in 2003 by Colin Walters
    Co-maintained 2003-2005 by Colin Walters and Jeff Bailey
    Hijacked in 2006 by me after a period of no maintenance
    Currently 2 or 3 maintainers plus Ubuntu feedback




                    Peter Eisentraut   CDBS
Package Parameters


  Source: cdbs
  Section: devel
  Priority: optional
  Maintainer:
   CDBS Hackers <build-common-hackers@lists.alioth.debian.org>
  Build-Depends-Indep: debhelper (>= 5), graphviz, realpath, fakeroot,
   python-dev, python2.4-dev, python2.5-dev, libxml2-utils, xsltproc,
   docbook-xml, docbook-xsl, dblatex, ant, kaffe, sharutils, gs-common,
   texlive-extra-utils
  Uploaders: Jonas Smedegaard <dr@jones.dk>,
   Marc Dequènes (Duck) <Duck@DuckCorp.org>,
   Peter Eisentraut <petere@debian.org>
  Standards-Version: 3.7.3
  Vcs-Browser: http://svn.debian.org/wsvn/build-common/
  Vcs-Svn: svn://svn.debian.org/build-common/

  Bugs: 1 I, 31 N, 7 M, 33 W
  Last upload: 01 Apr 2008



                               Peter Eisentraut   CDBS
Statistics




      Currently 13077 source packages in unstable
      3185 use CDBS (24.4%)
      Appears to be increasing by 0.2% or so per month
      Archive takeover completed by 2020 :-)




                      Peter Eisentraut   CDBS
Architecture


     Yes, there is one:
         Classes contain the logic for the package’s upstream build
         system: make, autotools, MakeMaker, distutils, cmake, etc.
         Rules contain additional rules of various utility: debhelper,
         tarball-in-tarball, patch tools
         Classes use inheritance (a.k.a. makefile inclusion):
         autotools inherits make, gnome inherits autotools, etc.
     In practice, this is arcane, so just remember:
         Exactly one class per debian/rules
         Zero or more rules per debian/rules
         Usually, you want at least the debhelper rules set
         Deviations are possible, but rarely useful




                      Peter Eisentraut   CDBS
Advantages

  Technical advantages:
      Writing debian/rules becomes quick and easy (usually)
      You get the details right for free:
          dh_* sequencing
          configure --build/--host (see autotools-dev
          README)
          DEB_BUILD_OPTIONS: noopt, nostrip
          CFLAGS, CXXFLAGS, etc. (try passing them to cmake or
          qmake correctly)
          parallel make
          Java packaging policy
      You follow policy evolvement for free:
          Python policy
          patch, unpatch targets
          KDE 4 packaging practices


                       Peter Eisentraut   CDBS
Advantages



  Conceptual advantages:
      debian/rules highlights the nonstandard packaging
      steps, rather than hiding them in boilerplate.
      Avoids propagation of mistakes through copy-and-paste or
      dh_make.
      Avoids home-brewed and half-baked alternative
      debian/rules makefile fragments packages.




                     Peter Eisentraut   CDBS
Disadvantages




     If your package has an unusual build system, CDBS might
     be in your way.
     If you are a control-freak, CDBS will be in your way.
     If GNU make syntax confuses you, CDBS will confuse you.
     CDBS is not good for learning Debian packaging.




                      Peter Eisentraut   CDBS
Makefile Class




  include /usr/share/cdbs/1/class/makefile.mk

  DEB_MAKE_BUILD_TARGET = all
  DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/
  DEB_MAKE_CLEAN_TARGET = clean

     Sets CFLAGS etc. according to policy
     Observes DEB_BUILD_OPTIONS




                     Peter Eisentraut   CDBS
Autotools Class


  include /usr/share/cdbs/1/class/autotools.mk

  DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz

     “Inherits” makefile class
     Calls configure with proper options (host tuple, installation
     paths)
     Calls make distclean instead of make clean
     Handles config.guess, config.sub updates
     Supports autoreconf, libtoolize before build
     (dubious)



                      Peter Eisentraut   CDBS
Perl Class




  include /usr/share/cdbs/1/class/perlmodule.mk

  DEB_MAKEMAKER_USER_FLAGS = --with-foo

     “Inherits” makefile class
     Calls MakeMaker with proper options and paths




                     Peter Eisentraut   CDBS
Python Class




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

  # mandatory
  DEB_PYTHON_SYSTEM = pycentral | pysupport

     “Inherits” makefile class
     Figures out all the Python policy details :-)
     Documentation needs updates :-(




                      Peter Eisentraut   CDBS
KDE Class




  include /usr/share/cdbs/1/class/kde.mk

  (for KDE <= 3.5)
      “Inherits” autotools class
      Sets proper configure flags, additional installation paths
      Documentation installation
      Used for all major KDE packages
  KDE 4 class will be based on CMake.




                       Peter Eisentraut   CDBS
Ant Class



  include /usr/share/cdbs/1/class/ant.mk

  JAVA_HOME = /usr/lib/kaffe
  DEB_JARS = junit
  DEB_ANT_BUILD_TARGET = jars
  DEB_ANT_COMPILER = jikes

  install/libjline-java:: DEB_FINALDIR=$(CURDIR)/debian/libjline-java
  install/libjline-java::
          install -m 644 -D release/jline-0_9_5.jar 
              $(DEB_FINALDIR)/usr/share/java/jline-$(DEB_UPSTREAM_VERSION).jar
          dh_link /usr/share/java/jline-$(DEB_UPSTREAM_VERSION).jar 
              /usr/share/java/jline.jar




        Most Java library packags are built this way.
        Tuned to Java packaging policy (at some point in time).




                                Peter Eisentraut   CDBS
Other classes




     CMake
     GNOME
     Haskell
     QMake
     OCaml (external)
     PEAR (external)




                       Peter Eisentraut   CDBS
Debhelper Rules



  include /usr/share/cdbs/1/rules/debhelper.mk

     Usually put this first in every debian/rules
     Takes care of proper sequencing and sequence points
     Arguments for every command can be overridden on a
     per-package basis, e.g.,
     DEB_INSTALL_EXAMPLES_libjline-java-doc = 
        release/jline-demo.jar
     Easy and automatic debug package support




                    Peter Eisentraut   CDBS
Patch Systems Support




  include /usr/share/cdbs/1/rules/. . .
   dpatch.mk DPatch rules
  patchsys-quilt.mk Quilt rules (contained in quilt package)
  simple-patchsys.mk Home-grown “simple” patch system
              (TANSTAA“S”PS)




                      Peter Eisentraut   CDBS
What CDBS Is Not




     No support for un-Common build systems
     Not a dumping ground for rejected debhelper features.
     Not a workaround for missing dpkg functionality.
     Not a way to enforce packaging behavior (but to enable or
     encourage it).
     Individual teams sometimes create a local subclass to
     enforce local policy.




                     Peter Eisentraut   CDBS
Comparisons and Contrasts



  vs. Debhelper only Debhelper is only the steps, CDBS puts
              them together.
  vs. dh (Debhelper 7) Does not allow for customization, only
              suitable for dead-simple packages.
  vs. BSD ports Very similar setup. Difference: Variables at the
              top, include bsd.port.mk at the bottom.
  vs. Automake Same declarative approach; details about actual
             make rules are hidden.




                       Peter Eisentraut   CDBS
Problems




    Patching the clean rule of a makefile (or equivalent) is
    broken
    Feature creep/unbounded user requests
    Certain old features/behaviors are not documented or
    understood
    CDBS maintainer must know all subpolicies in Debian ;-)




                     Peter Eisentraut   CDBS
Plans: CDBS 2



     Original idea: replace
     /usr/share/cdbs/1/rules/foo.mk by
     /usr/share/cdbs/2/rules/foo.mk
     Upcoming idea: similar to Debhelper compat levels, e.g.,
     CDBS_COMPAT = 2
     Throw out some obsolete features
     Synchronize default values with Debhelper 7
     Maybe move the include to the bottom
     Need a better/useful version numbering system




                     Peter Eisentraut   CDBS
How to Help




     Bugs, patches, ideas welcome.
     Join bug discussions.
     Enhance the test suite.
     Drive the right features into debhelper and dpkg.




                     Peter Eisentraut   CDBS
Summary




    Include CDBS rules rather than writing debian/rules by
    hand.
    Takes care of details and policy requirements
    automatically.
    Particularly useful for packages with uniform build
    processes.
    Not suitable for all packages and packagers.




                     Peter Eisentraut   CDBS

More Related Content

What's hot

What's hot (20)

Mastering Python 3 I/O
Mastering Python 3 I/OMastering Python 3 I/O
Mastering Python 3 I/O
 
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
 
Docker: automation for the rest of us
Docker: automation for the rest of usDocker: automation for the rest of us
Docker: automation for the rest of us
 
The Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deploymentThe Docker ecosystem and the future of application deployment
The Docker ecosystem and the future of application deployment
 
In Search of the Perfect Global Interpreter Lock
In Search of the Perfect Global Interpreter LockIn Search of the Perfect Global Interpreter Lock
In Search of the Perfect Global Interpreter Lock
 
An Introduction to Python Concurrency
An Introduction to Python ConcurrencyAn Introduction to Python Concurrency
An Introduction to Python Concurrency
 
FreeBSD: The Next 10 Years (MeetBSD 2014)
FreeBSD: The Next 10 Years (MeetBSD 2014)FreeBSD: The Next 10 Years (MeetBSD 2014)
FreeBSD: The Next 10 Years (MeetBSD 2014)
 
Mastering Python 3 I/O (Version 2)
Mastering Python 3 I/O (Version 2)Mastering Python 3 I/O (Version 2)
Mastering Python 3 I/O (Version 2)
 
Why you should use the Yocto Project
Why you should use the Yocto ProjectWhy you should use the Yocto Project
Why you should use the Yocto Project
 
Python Generator Hacking
Python Generator HackingPython Generator Hacking
Python Generator Hacking
 
Deploy microservices in containers with Docker and friends - KCDC2015
Deploy microservices in containers with Docker and friends - KCDC2015Deploy microservices in containers with Docker and friends - KCDC2015
Deploy microservices in containers with Docker and friends - KCDC2015
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
How to build Debian packages
How to build Debian packages How to build Debian packages
How to build Debian packages
 
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Containers, docker, and security: state of the union (Bay Area Infracoders Me...Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
 
Python in Action (Part 1)
Python in Action (Part 1)Python in Action (Part 1)
Python in Action (Part 1)
 
Introduction to FreeBSD 7.0
Introduction to FreeBSD 7.0Introduction to FreeBSD 7.0
Introduction to FreeBSD 7.0
 
Lavigne aug11 bsdmag
Lavigne aug11 bsdmagLavigne aug11 bsdmag
Lavigne aug11 bsdmag
 
Docker_AGH_v0.1.3
Docker_AGH_v0.1.3Docker_AGH_v0.1.3
Docker_AGH_v0.1.3
 
Generator Tricks for Systems Programmers, v2.0
Generator Tricks for Systems Programmers, v2.0Generator Tricks for Systems Programmers, v2.0
Generator Tricks for Systems Programmers, v2.0
 

Viewers also liked

Around "Hello World" in 30 Days
Around "Hello World" in 30 DaysAround "Hello World" in 30 Days
Around "Hello World" in 30 Days
David Eisinger
 
Scala and Lift presentation
Scala and Lift presentationScala and Lift presentation
Scala and Lift presentation
Scalac
 
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
Havoc Pennington
 

Viewers also liked (19)

Around "Hello World" in 30 Days
Around "Hello World" in 30 DaysAround "Hello World" in 30 Days
Around "Hello World" in 30 Days
 
Scala 3camp 2011
Scala   3camp 2011Scala   3camp 2011
Scala 3camp 2011
 
Java to scala
Java to scalaJava to scala
Java to scala
 
Scala and Lift presentation
Scala and Lift presentationScala and Lift presentation
Scala and Lift presentation
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
Liftweb
LiftwebLiftweb
Liftweb
 
Scala Sjug 09
Scala Sjug 09Scala Sjug 09
Scala Sjug 09
 
Scala == Effective Java
Scala == Effective JavaScala == Effective Java
Scala == Effective Java
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scala
 
Scala-Ls1
Scala-Ls1Scala-Ls1
Scala-Ls1
 
MySQL Monitoring Shoot Out
MySQL Monitoring Shoot OutMySQL Monitoring Shoot Out
MySQL Monitoring Shoot Out
 
Why Scala for Web 2.0?
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?
 
MySQL DBA
MySQL DBAMySQL DBA
MySQL DBA
 
Scala
ScalaScala
Scala
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 
A Brief Intro to Scala
A Brief Intro to ScalaA Brief Intro to Scala
A Brief Intro to Scala
 
Scala Days NYC 2016
Scala Days NYC 2016Scala Days NYC 2016
Scala Days NYC 2016
 
Real time Analytics with Apache Kafka and Apache Spark
Real time Analytics with Apache Kafka and Apache SparkReal time Analytics with Apache Kafka and Apache Spark
Real time Analytics with Apache Kafka and Apache Spark
 
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
 

Similar to The Common Debian Build System (CDBS)

Debian packaging howto
Debian packaging howtoDebian packaging howto
Debian packaging howto
Ding Zhou
 
Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: Debian
Anne Nicolas
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In Practice
Qasim Khawaja
 

Similar to The Common Debian Build System (CDBS) (20)

Debian Packaging tutorial
Debian Packaging tutorialDebian Packaging tutorial
Debian Packaging tutorial
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.
 
Debian packaging howto
Debian packaging howtoDebian packaging howto
Debian packaging howto
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Debian Packaging
Debian PackagingDebian Packaging
Debian Packaging
 
OpenEmbedded
OpenEmbeddedOpenEmbedded
OpenEmbedded
 
Building Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 ArchBuilding Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 Arch
 
DPKG caching framework-latest .pptx
DPKG caching framework-latest .pptxDPKG caching framework-latest .pptx
DPKG caching framework-latest .pptx
 
Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: Debian
 
packaging
packagingpackaging
packaging
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS Distribution
 
Kernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneKernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyone
 
Managing Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's ViewManaging Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's View
 
Linuxconcepts
LinuxconceptsLinuxconcepts
Linuxconcepts
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to love
 
Sahul
SahulSahul
Sahul
 
Sahul
SahulSahul
Sahul
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In Practice
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 

More from Peter Eisentraut

Replication Solutions for PostgreSQL
Replication Solutions for PostgreSQLReplication Solutions for PostgreSQL
Replication Solutions for PostgreSQL
Peter Eisentraut
 

More from Peter Eisentraut (20)

Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
Getting Started with PL/Proxy
Getting Started with PL/ProxyGetting Started with PL/Proxy
Getting Started with PL/Proxy
 
Most Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesMost Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL Features
 
Porting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQLPorting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQL
 
Porting Oracle Applications to PostgreSQL
Porting Oracle Applications to PostgreSQLPorting Oracle Applications to PostgreSQL
Porting Oracle Applications to PostgreSQL
 
PostgreSQL and XML
PostgreSQL and XMLPostgreSQL and XML
PostgreSQL and XML
 
XML Support: Specifications and Development
XML Support: Specifications and DevelopmentXML Support: Specifications and Development
XML Support: Specifications and Development
 
PostgreSQL: Die Freie Datenbankalternative
PostgreSQL: Die Freie DatenbankalternativePostgreSQL: Die Freie Datenbankalternative
PostgreSQL: Die Freie Datenbankalternative
 
The Road to the XML Type: Current and Future Developments
The Road to the XML Type: Current and Future DevelopmentsThe Road to the XML Type: Current and Future Developments
The Road to the XML Type: Current and Future Developments
 
Access ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsAccess ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-Frontends
 
PostgreSQL and PL/Java
PostgreSQL and PL/JavaPostgreSQL and PL/Java
PostgreSQL and PL/Java
 
Replication Solutions for PostgreSQL
Replication Solutions for PostgreSQLReplication Solutions for PostgreSQL
Replication Solutions for PostgreSQL
 
PostgreSQL News
PostgreSQL NewsPostgreSQL News
PostgreSQL News
 
PostgreSQL News
PostgreSQL NewsPostgreSQL News
PostgreSQL News
 
Access ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsAccess ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-Frontends
 
Docbook: Textverarbeitung mit XML
Docbook: Textverarbeitung mit XMLDocbook: Textverarbeitung mit XML
Docbook: Textverarbeitung mit XML
 
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
 
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail S...
Collateral Damage:
Consequences of Spam and Virus Filtering for the E-Mail S...Collateral Damage:
Consequences of Spam and Virus Filtering for the E-Mail S...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail S...
 
Spaß mit PostgreSQL
Spaß mit PostgreSQLSpaß mit PostgreSQL
Spaß mit PostgreSQL
 
SQL/MED and PostgreSQL
SQL/MED and PostgreSQLSQL/MED and PostgreSQL
SQL/MED and PostgreSQL
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

The Common Debian Build System (CDBS)

  • 1. The Common Debian Build System (CDBS) Peter Eisentraut FOSDEM 2009 Peter Eisentraut CDBS
  • 2. What is CDBS? A set of makefile fragments to include into debian/rules Makes packaging complex packages easier. Makes packaging simple packages harder. Initiates you to a secret subculture of Debian packagers. Causes you to lose all your not-CDBS-using friends. Peter Eisentraut CDBS
  • 3. Simple Example #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz DEB_INSTALL_DOCS_ALL = readme.txt LDFLAGS += -Wl,--as-needed binary-install/mypackage-tools:: chmod a+x debian/mypackage-tools/ usr/lib/mypackage/* Peter Eisentraut CDBS
  • 4. Simple Example #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz DEB_INSTALL_DOCS_ALL = readme.txt LDFLAGS += -Wl,--as-needed binary-install/mypackage-tools:: chmod a+x debian/mypackage-tools/ usr/lib/mypackage/* Peter Eisentraut CDBS
  • 5. Simple Example #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz DEB_INSTALL_DOCS_ALL = readme.txt LDFLAGS += -Wl,--as-needed binary-install/mypackage-tools:: chmod a+x debian/mypackage-tools/ usr/lib/mypackage/* Peter Eisentraut CDBS
  • 6. Background First published in 2003 by Colin Walters Co-maintained 2003-2005 by Colin Walters and Jeff Bailey Hijacked in 2006 by me after a period of no maintenance Currently 2 or 3 maintainers plus Ubuntu feedback Peter Eisentraut CDBS
  • 7. Package Parameters Source: cdbs Section: devel Priority: optional Maintainer: CDBS Hackers <build-common-hackers@lists.alioth.debian.org> Build-Depends-Indep: debhelper (>= 5), graphviz, realpath, fakeroot, python-dev, python2.4-dev, python2.5-dev, libxml2-utils, xsltproc, docbook-xml, docbook-xsl, dblatex, ant, kaffe, sharutils, gs-common, texlive-extra-utils Uploaders: Jonas Smedegaard <dr@jones.dk>, Marc Dequènes (Duck) <Duck@DuckCorp.org>, Peter Eisentraut <petere@debian.org> Standards-Version: 3.7.3 Vcs-Browser: http://svn.debian.org/wsvn/build-common/ Vcs-Svn: svn://svn.debian.org/build-common/ Bugs: 1 I, 31 N, 7 M, 33 W Last upload: 01 Apr 2008 Peter Eisentraut CDBS
  • 8. Statistics Currently 13077 source packages in unstable 3185 use CDBS (24.4%) Appears to be increasing by 0.2% or so per month Archive takeover completed by 2020 :-) Peter Eisentraut CDBS
  • 9. Architecture Yes, there is one: Classes contain the logic for the package’s upstream build system: make, autotools, MakeMaker, distutils, cmake, etc. Rules contain additional rules of various utility: debhelper, tarball-in-tarball, patch tools Classes use inheritance (a.k.a. makefile inclusion): autotools inherits make, gnome inherits autotools, etc. In practice, this is arcane, so just remember: Exactly one class per debian/rules Zero or more rules per debian/rules Usually, you want at least the debhelper rules set Deviations are possible, but rarely useful Peter Eisentraut CDBS
  • 10. Advantages Technical advantages: Writing debian/rules becomes quick and easy (usually) You get the details right for free: dh_* sequencing configure --build/--host (see autotools-dev README) DEB_BUILD_OPTIONS: noopt, nostrip CFLAGS, CXXFLAGS, etc. (try passing them to cmake or qmake correctly) parallel make Java packaging policy You follow policy evolvement for free: Python policy patch, unpatch targets KDE 4 packaging practices Peter Eisentraut CDBS
  • 11. Advantages Conceptual advantages: debian/rules highlights the nonstandard packaging steps, rather than hiding them in boilerplate. Avoids propagation of mistakes through copy-and-paste or dh_make. Avoids home-brewed and half-baked alternative debian/rules makefile fragments packages. Peter Eisentraut CDBS
  • 12. Disadvantages If your package has an unusual build system, CDBS might be in your way. If you are a control-freak, CDBS will be in your way. If GNU make syntax confuses you, CDBS will confuse you. CDBS is not good for learning Debian packaging. Peter Eisentraut CDBS
  • 13. Makefile Class include /usr/share/cdbs/1/class/makefile.mk DEB_MAKE_BUILD_TARGET = all DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/ DEB_MAKE_CLEAN_TARGET = clean Sets CFLAGS etc. according to policy Observes DEB_BUILD_OPTIONS Peter Eisentraut CDBS
  • 14. Autotools Class include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS = --enable-funnybiz “Inherits” makefile class Calls configure with proper options (host tuple, installation paths) Calls make distclean instead of make clean Handles config.guess, config.sub updates Supports autoreconf, libtoolize before build (dubious) Peter Eisentraut CDBS
  • 15. Perl Class include /usr/share/cdbs/1/class/perlmodule.mk DEB_MAKEMAKER_USER_FLAGS = --with-foo “Inherits” makefile class Calls MakeMaker with proper options and paths Peter Eisentraut CDBS
  • 16. Python Class include /usr/share/cdbs/1/class/python-distutils.mk # mandatory DEB_PYTHON_SYSTEM = pycentral | pysupport “Inherits” makefile class Figures out all the Python policy details :-) Documentation needs updates :-( Peter Eisentraut CDBS
  • 17. KDE Class include /usr/share/cdbs/1/class/kde.mk (for KDE <= 3.5) “Inherits” autotools class Sets proper configure flags, additional installation paths Documentation installation Used for all major KDE packages KDE 4 class will be based on CMake. Peter Eisentraut CDBS
  • 18. Ant Class include /usr/share/cdbs/1/class/ant.mk JAVA_HOME = /usr/lib/kaffe DEB_JARS = junit DEB_ANT_BUILD_TARGET = jars DEB_ANT_COMPILER = jikes install/libjline-java:: DEB_FINALDIR=$(CURDIR)/debian/libjline-java install/libjline-java:: install -m 644 -D release/jline-0_9_5.jar $(DEB_FINALDIR)/usr/share/java/jline-$(DEB_UPSTREAM_VERSION).jar dh_link /usr/share/java/jline-$(DEB_UPSTREAM_VERSION).jar /usr/share/java/jline.jar Most Java library packags are built this way. Tuned to Java packaging policy (at some point in time). Peter Eisentraut CDBS
  • 19. Other classes CMake GNOME Haskell QMake OCaml (external) PEAR (external) Peter Eisentraut CDBS
  • 20. Debhelper Rules include /usr/share/cdbs/1/rules/debhelper.mk Usually put this first in every debian/rules Takes care of proper sequencing and sequence points Arguments for every command can be overridden on a per-package basis, e.g., DEB_INSTALL_EXAMPLES_libjline-java-doc = release/jline-demo.jar Easy and automatic debug package support Peter Eisentraut CDBS
  • 21. Patch Systems Support include /usr/share/cdbs/1/rules/. . . dpatch.mk DPatch rules patchsys-quilt.mk Quilt rules (contained in quilt package) simple-patchsys.mk Home-grown “simple” patch system (TANSTAA“S”PS) Peter Eisentraut CDBS
  • 22. What CDBS Is Not No support for un-Common build systems Not a dumping ground for rejected debhelper features. Not a workaround for missing dpkg functionality. Not a way to enforce packaging behavior (but to enable or encourage it). Individual teams sometimes create a local subclass to enforce local policy. Peter Eisentraut CDBS
  • 23. Comparisons and Contrasts vs. Debhelper only Debhelper is only the steps, CDBS puts them together. vs. dh (Debhelper 7) Does not allow for customization, only suitable for dead-simple packages. vs. BSD ports Very similar setup. Difference: Variables at the top, include bsd.port.mk at the bottom. vs. Automake Same declarative approach; details about actual make rules are hidden. Peter Eisentraut CDBS
  • 24. Problems Patching the clean rule of a makefile (or equivalent) is broken Feature creep/unbounded user requests Certain old features/behaviors are not documented or understood CDBS maintainer must know all subpolicies in Debian ;-) Peter Eisentraut CDBS
  • 25. Plans: CDBS 2 Original idea: replace /usr/share/cdbs/1/rules/foo.mk by /usr/share/cdbs/2/rules/foo.mk Upcoming idea: similar to Debhelper compat levels, e.g., CDBS_COMPAT = 2 Throw out some obsolete features Synchronize default values with Debhelper 7 Maybe move the include to the bottom Need a better/useful version numbering system Peter Eisentraut CDBS
  • 26. How to Help Bugs, patches, ideas welcome. Join bug discussions. Enhance the test suite. Drive the right features into debhelper and dpkg. Peter Eisentraut CDBS
  • 27. Summary Include CDBS rules rather than writing debian/rules by hand. Takes care of details and policy requirements automatically. Particularly useful for packages with uniform build processes. Not suitable for all packages and packagers. Peter Eisentraut CDBS