Search Results: "tats"

4 February 2011

Robert Millan: Diskless Debian GNU/kFreeBSD HOWTO

It was completely non-obvious; In some cases I had to figure it out by reading kFreeBSD source code; I write it down here so it s not forgotten ;-) This is a short guide on how to boot Debian GNU/kFreeBSD via network on a diskless machine, using GRUB as the bootloader.
  • Step 1: Configure your DHCP/TFTP environment to load GRUB from network. See the PXE GRUB documentation for details.
  • Step 2: Rebuild kfreebsd-8 package with BOOTP and BOOTP_NFSROOT options, as described in upstream handbook. They need to be added to the debian/arch/*/*.config file for your architecture. This kernel can still be used for normal, disk-based boot, but it will issue DHCP requests to attempt network boot every time you start it.
  • Step 3: Put your kFreeBSD in TFTP directory and configure GRUB to load it. This requires only one command in grub.cfg. My setup:
    set timeout=1
    set default=0 menuentry Debian GNU/kFreeBSD
    echo Loading kFreeBSD
    kfreebsd /beastie/boot/kfreebsd-8.1-1-amd64.gz
    echo Booting
    boot
  • Step 4: Build a directory tree with your GNU/kFreeBSD userland, and export it via NFS. I copied it from an existing Debian GNU/kFreeBSD install, but I suppose debootstrap could do the job as well.
  • Step 5: kFreeBSD mounts root NFS in readonly mode initially, and Debian userland turns out to be very unhappy with that. If you want things to work you ll need to either setup tmpfs in a few places (e.g. /tmp) or adjust fstab so that / is remounted as writable by the INIT scripts. Example fstab line:
    192.168.1.3:/srv/netboot/beastie / nfs rw 0 0
    This, however, will only work if mount_nfs(8) is in your system. And (well, too bad) it hasn t been packaged yet. So you can copy it from a FreeBSD base tarball, along with its dependencies (/lib/libc.so.7, /libexec and /etc/netconfig).
  • Step 6: Finally the system boots, but you ll soon notice that file locks don t work. This breaks some daemons (rsyslog), dpkg, apt and possibly a lot other things. Actual (i.e. non-local) file locking on NFS requires a running lock daemon, both on client and on server. However, since FreeBSD lockd isn t packaged either, and you probably don t need global locks anyway, I suggest you disable it with nolockd mount option.
    The tricky part is that as explained in mount_nfs manpage, nolockd will only be honored when performing the initial mount, and it will be silently ignored if used while updating the mount options. So fstab is not an option.
    The only way I could find of telling the kernel to use arbitrary options when mounting / is by sending them via DHCP. Use the following options in your dhcpd.conf:
    option option-130 code 130 = text;
    option option-130 nolockd ;
  • Et voil . A Debian GNU/kFreeBSD system running completely in diskless mode. Enjoy!

    Alexander Reichle-Schmehl: Release Critical Bug report for Week 05

    The bug webinterface of the Ultimate Debian Database currently knows about the following release critical bugs:
    In Total:574
    Affecting Squeeze:2
    Squeeze only:2
    Remaining to be fixed in Squeeze:0
    Of these 0 bugs, the following tags are set:
    Pending in Squeeze:0
    Patched in Squeeze:0
    Duplicates in Squeeze:0
    Can be fixed in a security Update:0
    Contrib or non-free in Squeeze:0
    Claimed in Squeeze:0
    Delayed in Squeeze:0
    Otherwise fixed in Squeeze:0
    Ignoring all the above (multiple tags possible) 0 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 2 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

    2 February 2011

    Dominique Dumont: My synopsis suck

    Hello I ve taken a step back and looked at the synopsis of the Config::Model man
    pages. Boy, I m not proud of what I ve released. Except the ones I ve reworked recently, most of them are worthless. The next release of Config::Model will feature new synopsis. Each synopsis will contain a valid example that can be run with a cut n'paste in a test file. The code in the synopsis will actually do something visible. Here s an example extracted from the next version of Config::Model::Dumper:
     use Config::Model ;
     use Log::Log4perl qw(:easy) ;
     Log::Log4perl->easy_init($WARN);
     # define configuration tree object
     my $model = Config::Model->new ;
     $model ->create_config_class (
        name => "MyClass",
        element => [
            [qw/foo bar/] =>  
                type => 'leaf',
                value_type => 'string'
             ,
            baz =>  
                type => 'hash',
                index_type => 'string' ,
                cargo =>  
                    type => 'leaf',
                    value_type => 'string',
                 ,
             ,
        ],
     ) ;
     my $inst = $model->instance(root_class_name => 'MyClass' );
     my $root = $inst->config_root ;
     # put some data in config tree the hard way
     $root->fetch_element('foo')->store('yada') ;
     $root->fetch_element('bar')->store('bla bla') ;
     $root->fetch_element('baz')->fetch_with_id('en')->store('hello') ;
     # put more data the easy way
     my $step = 'baz:fr=bonjour baz:hr="dobar dan"';
     $root->load( step => $step ) ;
     # dump data
     print $root->dump_tree;
    
    Feel free to log bugs on Debian BTS or on CPAN RT if the next synopsis still have problems. All the best

    31 January 2011

    Tiago Bortoletto Vaz: new website

    I m switching from WordPress to a virtual private server. I m playing with a Gandi.net VPS. So far, I m happy with their domain registration service. Also, they offer some discounts for Debian people. Btw, I still have a promo code for a one month free VPS share which I m allowed to give away. For my new website (same old URL) I m using PyBlosxom over Lighttpd in a Debian GNU/Linux system. I want to keep things simple by git-pushing plain text files for all html content. For the blog system I ve just written a plugin which gives PyBlosxom the (very nice!) txt2tags formatter (source: t2t.py). There re still issues to fix but it s working quite well. So, thanks WordPress for all the fish. This is probably my last post here. (although I m keeping the current account active for comments)

    30 January 2011

    Dominique Dumont: How to configure OpenSsh through a virtual filesystem

    Hello My blog How about a configfs with Config::Model ? mentioned the on-going work to provide an access to configuration data through a virtual file system , i.e. through fuse. This new feature is now working since Config::Model 1.231. As an example, let s see how Fuse can be used to your ssh client. I.e. how to use config-edit command to modify your ~/.ssh/config through a virtual file system. Note that this is just an example, Fuse can also be used for other configuration withan existing model. First, you need to install Config::Model and Fuse and the fuse software. If you re on Debian/Sid, installing all this is straightforward:
    $ sudo aptitude install libconfig-model-perl libfuse-perl
    On other systems, you can use CPAN to install the Perl modules
    $ cpanp i Fuse
    $ cpanp i Config::Model
    Hopefully, fuse library will be available through a package on your favorite repository. Let s start from an empty ssh configuration file. First you need to create a directory that will be used by Fuse as a mount point:
    $ mkdir my_fuse_dir
    Then run config-edit-ssh (which will be changed later to config-edit -applit ssh ):
    $ config-edit-ssh -ui fuse -fuse_dir my_fuse_dir
    Mounting config on my_fuse_dir in background.
    Use command fusermount -u my_fuse_dir to unmount
    Now, all parameters that can be configured in /.ssh/config are shown as files and directories in the fuse directory (the list was reduced to save electrons):
    $ tree my_fuse_dir/
    my_fuse_dir/
    AddressFamily
    BatchMode
    BindAddress
    ForwardX11
    ForwardX11Trusted
    [snip]
    HashKnownHosts
    Host
    *
    ConnectionAttempts
    [snip]
    User
    UserKnownHostsFile
    VerifyHostKeyDNS
    VisualHostKey
    XAuthLocation
    HostbasedAuthentication
    HostKeyAlgorithms
    [snip] 14 directories, 119 files
    Let s say that we want to configure specific settings for 2 hosts: First step is to create the repoman entry:
    $ mkdir my_fuse_dir/Host/repoman
    A ls command in that new directory will show a lot of files:
    $ ls my_fuse_dir/Host/repoman
    IdentityFile Protocol Tunnel
    CheckHostIP ForwardX11 KbdInteractiveAuthentication ProxyCommand TunnelDevice
    Lo and behold, one of them is ForwardX11 ! Let s check what s in there:
    $ cat my_fuse_dir/Host/repoman/ForwardX11
    Since the entry is new, it s still empty. Enabling X11Forward for repoman is quite easy:
    $ echo 1 > my_fuse_dir/Host/repoman/ForwardX11
    Let s check:
    $ cat my_fuse_dir/Host/repoman/ForwardX11
    1
    Now, unmount the fuse directory:
    $ fusermount -u my_fuse_dir
    And see the modified .ssh/config file:
    $ cat ~/.ssh/config
    Host repoman
    ForwardX11 yes
    You can see that ForwardX11 is indeed set to yes for host repoman. Last but not least, you may consider that handling files and directories through shell commands is not very easy for the end user. You re right. But that s not the point. The idea is to enable programmers to access and edit configuration data with any language (not only Perl). Just like a lot of program can access kernel data through /proc and /sys, configuration data can now be accessed in a unified way through this virtual file system. May be, one day, exploring /config will be as common as exploring /sys All the best

    28 January 2011

    Alexander Reichle-Schmehl: Release Critical Bug report for Week 04

    The bug webinterface of the Ultimate Debian Database currently knows about the following release critical bugs:
    In Total:575
    Affecting Squeeze:14
    Squeeze only:6
    Remaining to be fixed in Squeeze:8
    Of these 8 bugs, the following tags are set:
    Pending in Squeeze:1
    Patched in Squeeze:0
    Duplicates in Squeeze:0
    Can be fixed in a security Update:2
    Contrib or non-free in Squeeze:0
    Claimed in Squeeze:0
    Delayed in Squeeze:0
    Otherwise fixed in Squeeze:0
    Ignoring all the above (multiple tags possible) 5 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 9 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

    Dominique Dumont: FOSDEM: see you there

    I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting I ll make 2 presentations about Config::Model applications. One on configuration upgrades. The other one is more presenting ideas on sharing packaging work between distributions. Note that I ll make these presentations quite late Sunday and I ll have to leave about 30mns after the last presentation. So if you already have questions about Config::Model, it would be better to contact me before the presentations. See you there

    21 January 2011

    Alexander Reichle-Schmehl: Release Critical Bug report for Week 03

    The bug webinterface of the Ultimate Debian Database currently knows about the following release critical bugs:
    In Total:575
    Affecting Squeeze:25
    Squeeze only:10
    Remaining to be fixed in Squeeze:15
    Of these 15 bugs, the following tags are set:
    Pending in Squeeze:0
    Patched in Squeeze:7
    Duplicates in Squeeze:2
    Can be fixed in a security Update:1
    Contrib or non-free in Squeeze:0
    Claimed in Squeeze:0
    Delayed in Squeeze:0
    Otherwise fixed in Squeeze:6
    Ignoring all the above (multiple tags possible) 6 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 21 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

    19 January 2011

    Robert Millan: Finally, amd32 is taking shape

    When AMD launched its now widely used 64-bit architecture in year 2000, it started marketing it as a significant step forward because of it having longer word and pointer size. One just has to check the advertising material and notice those big 64 being touted as the main improvement. But it is commonly accepted that most applications don t need a 64-bit address space for anything. Building them in LP64 model is just a waste of memory due to increase of pointer size. Even though this made most applications lag behind, the new architecture still was an improvement in terms of speed because of the AMD revised ISA, featuring changes like: To summarize, most of the merit from AMD64 architecture was in fixing some of the insanity of Intel 386 ISA (instruction set architecture), rather than the increased pointer size which was a source of inefficiency most of the time. Perhaps AMD didn t evaluate this correctly, or perhaps its marketing side won over technical merit. However, although the new hardware is biased towards LP64 data model, it s not actually enforced. It was a matter of time until an independent project took over and attempted to fix this, combining the AMD64 ISA with ILP32 data model. I ve been reading with much interest in the binutils and gcc mailing lists that such project is beginning to take shape. A port of binutils, GCC, GDB and Linux is already available. Future plans include porting Glibc which will make it possible to build a standard GNU derivative out of this. Sadly, I don t have the time to devote to this project myself, but I ll continue following its progress. I m looking forward to bringing this speed boost to my machines.

    18 January 2011

    Benjamin Drung: Poll: How to call the library?

    Dear lazy web, I am writing a library that implements the Units Policy of Ubuntu. This library can be used to format sizes (of files, disks, memory, etc.) for displaying them and the other way around. For example, the size 12345 bytes can be formatted to 12.3 kB, 12.1 KiB, or 12.1 KB depending on the configuration. An other function will give you the possibility to convert 12.3 kB, 12.1 KiB, or 12.1 KB back to 12345 bytes. The preferred binary unit can be configured by an text file (per system and per user) and by an environment variable. The library is written in C and doesn t have any dependency. Therefore it can be used by any program on any desktop environment. Binding to other languages like C++, Python, Java are planned. Before creating a project for this library, I need a name for the library. The current prototype is called libdisplayunits, but this name reflect only the half of the project. It does not indicate that the library can be used for inputting sizes. What do you think? What is the best name for the library? Please poll and/or comment below.

    <script charset="utf-8" language="javascript" src="http://static.polldaddy.com/p/3972978.js" type="text/javascript"></script> <noscript> View This Poll
    survey software </noscript>

    Benjamin Drung: Poll: libkibi VS libbyteprefix (or: How to call the library? 2)

    Dear lazy web, thanks for voting the best name for the library that helps implementing the Units Policy of Ubuntu. The winner with the most votes has been libkibi. There was one suggestion that got my attention: libbyteprefix. The suggestion came too late to have a chance. Therefore I ask you again to vote for the library name, but this time only these two names are open for voting: libkibi and libbyteprefix. libkibi is short and sounds good. On the other hand, libbyteprefix describes exactly what the library is supposed to do. I was asked to use a free (as in freedom) poll-service. So please go to the Selectricity unitspolity vote and select your favorite. Thanks.

    14 January 2011

    Alexander Reichle-Schmehl: Release Critical Bug report for Week 02

    The bug webinterface of the Ultimate Debian Database currently knows about the following release critical bugs:
    In Total:620
    Affecting Squeeze:82
    Squeeze only:36
    Remaining to be fixed in Squeeze:46
    Of these 46 bugs, the following tags are set:
    Pending in Squeeze:4
    Patched in Squeeze:9
    Duplicates in Squeeze:8
    Can be fixed in a security Update:1
    Contrib or non-free in Squeeze:0
    Claimed in Squeeze:0
    Delayed in Squeeze:0
    Otherwise fixed in Squeeze:8
    Ignoring all the above (multiple tags possible) 20 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 65 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

    13 January 2011

    Dominique Dumont: Debian copyright DEP5 parser/editor/validator/migrator is released

    Hello The new version of libconfig-model-perl 1.229 is now available in Debian/Sid. This new version provides a model of Debian s DEP-5 copyright file specification updated according to the CANDIDATE version. (Among other features, like editor/validator for debian/control). The DEP-5 editor must be run in the source package directory (I ll provide an example below) with the following command:
    config-edit -application dpkg-copyright
    Features: Known issues: Example: The copyright file of libconfig-model-backend-augeas-perl needs to be updated: Here s the original copyright file (slightly edited to protect my mail box and save electrons) :
    $ cat debian/copyright
    Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196 Upstream-Maintainer: Dominique Dumont (ddumont at cpan.org)
    Upstream-Source: http://search.cpan.org/dist/Config-Model-Backend-Augeas/
    Upstream-Name: Config-Model-Backend-Augeas Copyright: 2008-2009, Dominique Dumont (ddumont at cpan.org)
    License: LGPL-2+ Files: debian/*
    Copyright: 2009, Dominique Dumont
    License: LGPL-2+ License: LGPL-2+
    This program is free software; you can redistribute it and/or
    [snip]
    First, let s just check issues:
    $ config-edit -application dpkg-copyright -ui none
    Element Upstream-Maintainer of node Debian::Dpkg::Copyright is deprecated
    Element Upstream-Source of node Debian::Dpkg::Copyright is deprecated
    Element Upstream-Name of node Debian::Dpkg::Copyright is deprecated
    Missing Files: specification at top of section number 2. Adding Files: * spec
    Then, let s see what s config-edit can fix all by itself:
    $ config-edit -application dpkg-copyright -ui none -save
    [ same warnings displayed ]
    Let s check the result of the migration:
    $ config-edit -application dpkg-copyright -ui none
    [ good: no more warnings ]
    And here s the content of the upgraded file (drum rolls, please):
    $ cat debian/copyright
    Format: http://dep.debian.net/deps/dep5/
    Upstream-Name: Config-Model-Backend-Augeas
    Upstream-Contact: Dominique Dumont (ddumont at cpan.org)
    Source: http://search.cpan.org/dist/Config-Model-Backend-Augeas/ Files: *
    Copyright: 2008-2009, Dominique Dumont (ddumont at cpan.org)
    License: LGPL-2+ Files: debian/*
    Copyright: 2009, Dominique Dumont
    License: LGPL-2+ License: LGPL-2+
    This program is free software; you can redistribute it and/or
    [snip]
    You can see that: Please provide feedback! If you have problem migrating DEP5 files, yell, and we ll fix them. If this migration works fine, don t be shy, please say so. Under the hood:

    Most of the migration work is specified in DEP-5 model [2]. Using config-model s GUI [3] to update DEP-5 model, about one hour was spent to: This shows one important feature of Config::Model: maintenance and evolution of a model is not a huge task. Even though copyright files are not configuration files, the same approach can be used to specify model and migration of other configuration files. Now comes the question of the migration as seen by the user. Well, it s your turn now. Try it and tell us how it works! Hopefully, encouraged by your feedback, other people will apply config-model to other specifications or other configuration. All the best (*) E.g, in the text format produced by the model editor GUI: 'Upstream-Contact',

    'value_type' => 'string',
    'migrate_from' =>
    'formula' => '$old_maintainer',
    'variables' =>
    'old_maintainer' => '- Maintainer'

    ,
    'type' => 'leaf',
    'description' => '* Syntax: line based list [snip]'
    ,

    7 January 2011

    Alexander Reichle-Schmehl: Release Critical Bug report for Week 01

    The bug webinterface of the Ultimate Debian Database currently knows about the following release critical bugs:
    In Total:613
    Affecting Squeeze:93
    Squeeze only:33
    Remaining to be fixed in Squeeze:60
    Of these 60 bugs, the following tags are set:
    Pending in Squeeze:3
    Patched in Squeeze:13
    Duplicates in Squeeze:13
    Can be fixed in a security Update:1
    Contrib or non-free in Squeeze:2
    Claimed in Squeeze:0
    Delayed in Squeeze:0
    Otherwise fixed in Squeeze:12
    Ignoring all the above (multiple tags possible) 25 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 68 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

    31 December 2010

    Alexander Reichle-Schmehl: Release Critical Bug report for Week 52

    The bug webinterface of the Ultimate Debian Database currently knows about the following release critical bugs:
    In Total:608
    Affecting Squeeze:115
    Squeeze only:37
    Remaining to be fixed in Squeeze:78
    Of these 78 bugs, the following tags are set:
    Pending in Squeeze:3
    Patched in Squeeze:19
    Duplicates in Squeeze:12
    Can be fixed in a security Update:3
    Contrib or non-free in Squeeze:4
    Claimed in Squeeze:0
    Delayed in Squeeze:3
    Otherwise fixed in Squeeze:11
    Ignoring all the above (multiple tags possible) 41 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 85 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

    30 December 2010

    Benjamin Drung: Debian Developer

    Yesterday I became Debian Developer. I already used my new @debian.org mail address for uploading a vlc security fix to unstable and audacious & audacious-plugins 2.4.2-1 to experimental.

    24 December 2010

    Alexander Reichle-Schmehl: Release Critical Bug report for Week 51

    The bug webinterface of the Ultimate Debian Database currently knows about the following release critical bugs:
    In Total:652
    Affecting Squeeze:178
    Squeeze only:54
    Remaining to be fixed in Squeeze:124
    Of these 124 bugs, the following tags are set:
    Pending in Squeeze:6
    Patched in Squeeze:23
    Duplicates in Squeeze:18
    Can be fixed in a security Update:11
    Contrib or non-free in Squeeze:2
    Claimed in Squeeze:1
    Delayed in Squeeze:2
    Otherwise fixed in Squeeze:12
    Ignoring all the above (multiple tags possible) 73 bugs need to be fixed by Debian Contributors to get Debian 6.0 Squeeze released. However, with the view of the Release Managers, 136 need to be dealt with for the release to happen. Please see Interpreting the release critical bug statistics for an explanation of the different numbers.

    23 December 2010

    Matt Zimmerman: Rejoining Debian

    A couple of months ago, Debian project membership voted, after extensive discussion, to implement a fundamental change in the Debian community: to welcome as members people who make a valuable contribution to the project, even if they are contributing something other than source code. This was a tremendous milestone for Debian, and one which made me feel proud to have been a part of the project. Historically, only developers had been eligible for membership, including voting and other formal privileges. Although other kinds of contributions were welcome, this disparity gave the impression that they were less valued than code contributions. It seemed to me at the time that Debian s mission was to package all of the free software in the world, and if one s efforts didn t go directly to improving packages, they just weren t as important. I don t remember when I first installed Debian, but I made my first contributions to the project in 1999, and officially joined as a developer in 2000. After several fun and rewarding years of packaging and development, I started a very demanding day job, and spent more and more of my energy into that, and less and less coding for Debian as a volunteer. However, my job with Canonical involved working with Debian, and that was a primary reason why it was interesting to me. It was an opportunity to introduce a whole new population of people to the things I loved about Debian. The reality, of course, was more complicated. Following the launch in 2004, Ubuntu grew quickly in popularity and scope, diverged from Debian in significant ways, and relations between Debian and Ubuntu became strained. Canonical grew quickly as well, and the combination of a growing community, a growing company and growing user adoption was a challenge for everyone concerned. As a Canonical manager and a Debian developer, I felt the strain as much as anyone. Meanwhile, and I felt more and more alienated from Debian. Debian developers who had been friendly in the past became suspicious of Ubuntu and me and I quickly became an outsider. My code contributions to Debian continued to decline, and I was no longer maintaining any packages. In Debian at the time, that meant that I didn t exist. I saw it as an important part of my job to work with my counterparts in Debian, in a coordinating role, but found this increasingly impractical. In 2007, I received an inquiry from the Debian Account Manager, who had noticed I wasn t actively involved in packaging, and wished to disable my account for security reasons if I wasn t using it. Although I wanted to remain active in the Debian community, I had to agree that it wasn t good security practice for me to hold onto my developer privileges. I relinquished my upload rights, with the option to come back if I resumed my development work, and officially became a nobody: I lost the right to vote, my email address and mailing list subscriptions, and all other official ties with Debian, except for the record of my GPG key in a special emeritus keyring for informational purposes. Last month, Enrico Zini announced instructions for contributors to apply for membership under the new guidelines, which recognize many kinds of contributions, not only code. Today, after a three year hiatus, I am proud to be the first Debian member to be accepted through this new process. I expect to continue to submit the occasional patch, but my primary interest is in healing the rift which still exists between Debian and Ubuntu by contributing in a more personal way. Please feel free to contact me if you d like to work together on this. You can reach me as mdz at either debian.org or ubuntu.com, or on IRC. I would like to thank Stefano Zacchiroli, for proposing the General Resolution which enabled Debian to make this transition, and for all of his other work as Debian Project Leader to help Debian grow and improve. I also appreciate Enrico Zini, Jonathan McDowell and Martin Zobel-Helas for expediently processing me and working through the technical changes needed to implement the resolution correctly. It s good to be back.

    Joachim Breitner: Going to IIT Bombay, Mumbai, India

    Next monday, I will by flying to Mumbai, India, to spend one semester studying computer science at the Indian Institute of Technology Bombay. Slowly, I m getting excited. I will write about this trip here, as I did for my Ghana travel, and upload pictures to my online photo album. If you are in Mumbai and interested in Debian, Haskell, Isabelle, GPG Keysigning or similar stuff, drop me a mail. And if you are at IITB, just come by, I ll be staying in hostel no. 13 (room number not known yet). Namaste!

    18 December 2010

    Felipe Sateler: CDBS -- An introduction

    It seems the current trend is to use short-form dh. Some people have even thought that dh has superseded CDBS. Since I prefer CDBS for my own packaging, I will say that no, CDBS is not being deprecated and in fact has been active. Packaging with CDBS is very simple. I'll try to explain how it works, and how to package with it. This may turn into a blog post series, but I won't promise anything.

    CDBS is a set of makefiles that do several tasks that are common while packaging software, so that you don't have to repeat them over and over on each package. The makefiles are classified into 2 groups: classes and rules. Classes implement the rules required for building and installing software. These are classes because they can and do inherit from others. For example, there is the makefile class, and the autotools, qmake and cmake classes inherit from it, and the gnome and kde (which is for kde 3) classes inherits from the autotools class. Rules implement several other general purpose rules that don't depend on the toolchain used to build the package. For example, there is the debhelper rules file, which takes care of creating the debian package using the usual dh_* commands. There are several rules files which do all sorts of useful stuff, from running license checks to downloading new upstream releases. If this post transforms into a series, we may look into some of them. For now, I'll demonstrate how to use CDBS to package some simple software (only the debian/rules file, of course).

    The first task while running creating debian/rules is determining which build system the software uses. I will use qutecsound package as a guide. So, first things first, we start using CDBS!
    #!/usr/bin/make -f

    # Uncomment this to turn on verbose mode.
    #export DH_VERBOSE=1

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


    Now this would be all that is required if qutecsound where a standard qmake package where nothing needs to be customized. Alas, this is not the case. First, there are some variables that need to be passed to qmake to appropriately configure the build. Also, the projects .pro file is not standard-named. How do we fix this? The CDBS way of overriding this kind of behavior is through the use of variables. Since we are using the qmake class, we will be overriding variables named DEB_QMAKE_*:
    DEB_QMAKE_CONFIG_VAL += build64
    DEB_QMAKE_ARGS = qcs.pro


    We add a configuration value (because CDBS is setting other config values), and we set the extra arguments to qmake.

    Now, there is a problem: the resulting binary is not created with the name we want. How do we change that? We could patch the source to avoid that, but it is far easier to add a rule to the makefile to do that. We will modify the build to rename the file at the end (and then clean it up on clean because the upstream makefile will not spot it):
    build/qutecsound::
    [ -f bin/qutecsound ] mv bin/qutecsound-d bin/qutecsound

    clean::
    rm -f bin/qutecsound


    So what did we just do? We extended the build and clean rules with extra stuff to do. In CDBS each package listed in debian/control gets a build/package rule (and several others at different stages of the build) so that one can add stuff specific to each package (this will be much more useful when dpkg finally learns about build-arch and build-indep).

    For the final touch, we want to do a few more things. First, we want to ensure that we are using QT4's qmake, because the build will fail if QT3's is used. Second, since I created a manpage for the command, I want to install it. Finally, we want to use parallel building when the user has specified it, to build the project faster. How to do that? Again, via variables:
    QMAKE = qmake-qt4
    DEB_BUILD_PARALLEL = 1
    DEB_INSTALL_MANPAGES_qutecsound = debian/qutecsound.1


    CDBS creates several variables for each of the packages listed in debian/control, so we can customize each package build. In our case, this variable is passed to dh_installman from the debhelper rules file (CDBS will invoke the debhelper tools once for each binary package).

    After all this we now have the complete debian/rules of a relatively simple package. How does it look like? Like this:
    #!/usr/bin/make -f

    # Uncomment this to turn on verbose mode.
    #export DH_VERBOSE=1

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

    QMAKE = qmake-qt4
    DEB_QMAKE_CONFIG_VAL += build64
    DEB_QMAKE_ARGS = qcs.pro
    DEB_BUILD_PARALLEL = 1

    DEB_INSTALL_MANPAGES_qutecsound = debian/qutecsound.1

    build/qutecsound::
    [ -f bin/qutecsound ] mv bin/qutecsound-d bin/qutecsound

    clean::
    rm -f bin/qutecsound

    Tags: cdbs, packaging

    Next.

    Previous.