Changes between Initial Version and Version 1 of HowtoCDBS


Ignore:
Timestamp:
Jun 12, 2009, 3:53:27 AM (15 years ago)
Author:
Thanatermesis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowtoCDBS

    v1 v1  
     1[[Image(http://main.elivecd.org/images/misc/tux-debian.png)]]
     2
     3== What is ==
     4
     5CDBS is the most easy tool in debian to create debian packages, you will need just 2-3 lines of code so that you will create your own debian packages
     6
     7On this howto I will explain the basic steps to do this, but cdbs is a lot more powerful (hooks in pre-config, post-config, pre-compile, post-compile, etc etc), so for more information just follow the documented PDF as, of course, '''/usr/share/doc/cdbs'''
     8
     9== Dependencies ==
     10
     11You basically only need the package '''cdbs''', but is recommended also to install these packages: '''dpkg-dev devscripts'''
     12
     13== Hands on ! ==
     14
     15On this example we will create a debian package for ''enna'', first of all, create the directory ''debian'' (if is already created and has files mean that is already ready for create debian packages, or supposed to... in any case, if is created, just remove it in order to follow this howto).
     16
     17On it you need to have 2 files, '''control.in''' and '''rules''', the control.in file has the description of the package, we can fill up with something like:
     18{{{
     19Source: enna
     20Section: enlightenment
     21Priority: optional
     22Maintainer: yourname <youremail@email.com>
     23Build-Depends: @cdbs@, libplayer, gettext, libsqlite3-dev
     24
     25Package: enna
     26Architecture: any
     27Depends: libcddb2, libcurl3, libdbus-1-3, libexif12, libhal-storage1, libhal1, libplayer, libsqlite3-0, libxml2, lightmediascanner, libxrandr2
     28Description: enna media player
     29 This is the enna media player using EFL
     30}}}
     31
     32The first block is for the source packages (so that you can ''apt-get source enna'' in the future in order to recompile it), it also contains the information about which dependencies you need to have in order to compile it. The second block is for the binary end package.
     33
     34About the rules file, you need to fill up with something like:
     35{{{
     36#!/usr/bin/make -f
     37
     38DEB_AUTO_UPDATE_DEBIAN_CONTROL := yes
     39
     40include /usr/share/cdbs/1/rules/debhelper.mk
     41include /usr/share/cdbs/1/class/autotools.mk
     42
     43DEB_CONFIGURE_EXTRA_FLAGS := --disable-browser-netstreams --enable-libcddb --disable-browser-lms
     44}}}
     45
     46The first line means that the control file will be updated automatically (it was really needed to explain this point ? anyways...), the next lines means which pieces of cdbs we want to have, like a dependency, if we don't include them, we don't have its support, like, debhelper contains all the needed things for build the package, autotools contains the needed things for compile a simple C/C++ program that has its makefiles structure and such... so, the basic needed ones. The final line includes the option of compilation
     47
     48You are almost ready, altough these are the only ''real'' needed files, you need a few last tricks... but they are almost automatic:
     49
     50You need the '''changelog''' file, since we are lazy, we use the tool '''debchange''' to create/update it, see that there's a warning saying that there's no any changelog found and so on we need to use the option '''---create''' for create a new one
     51
     52Also, you need the ''real'' control file, control.in is a kind of base, for generate the ''real'' control file we just run '''debian/rules clean''' and we have it :)
     53
     54Your ''debian'' directory is ready, you can add a lot more of options and tricks for your package but for that, just follow the official documentation at /usr/share/doc/cdbs, im not going to write all the features because im lazy too :)
     55
     56
     57== Time to build the package ! ==
     58
     59Before to compile you need to see if you have all the dependencies for the compilation, for that, just run the command '''dpkg-checkbuilddeps'''
     60
     61When you have installed all the needed dependencies, run the command '''dpkg-buildpackage'''
     62
     63You have it !
     64
     65
     66
     67== Final points ==
     68
     69You are free to edit this document in order to fix any thing, making it better, or to add a few nice tricks to know, for that just fill up a collaborator thingy at http://www.elivecd.org/Help/Collaborate
     70
     71Tested on a clean Elive system, live mode, version (1.9.29), the package builds without problems :D