Friday, 23 March 2007

debianPackaging (for dummies) part one

I'm writing this post because quite recently I've had to deal with some simple debian packaging and it took me a while (2 days) to obtain something out of it. Debian mantainer guide didn't help and googling around neither.

Luckily my beloved colleague helped me in find my way to a debian package.

The problem seemed quite easy: I have N scripts and I wanted just to create a bunch of packages to ease the installation of them.

First thing to do:
mkdir <name-of-package>-<version>
cd <name-of-package>-<version>
mv <all-the-scripts-you-want> .

This will create a debian directory inside your dir and hopefully a <name-of-package>-<version>.orig.tar.gz outside of that (if not don't worry it'll appear).

Now you have two choices:
1) create just one binary package out of your source directory
2) create multiple binary packages

Here is the point where I got puzzled since nowhere is written how debuild takes the informations of what to put where.

Now the Debian Mantainer Guide and many other resources explains you how to use debian/rules, debian/control files but actually they don't explain really what to put there (at least I haven't found where...).

. debian/rules
This is nothing more than a Makefile itself and it's called automatically each time you run debuild.

. debian/control
This lists the package(s) that will be built and theirs characteristics (dependencies over all)

What no-one tells you is that debian directory is the **special** place that HAS to contain your scripts/your binaries in their final-destination-directory path.

Case 1) --single binary--
So if you want scriptA to finish in /usr/share/whatever/scriptA directory once your package is installed, you have to put it somehow in debian/usr/share/whatever/. Pay attention that the script doesn't have to be already there but has to be put there during debuild, i.e. you have to write inside debian/rules the commands to take scriptA from your-source-dir and put it in your-source-dir/debian/usr/share/whatever/

Snippet of debian/rules:
install -m 755 scriptA debian/usr/share/whatever/

Case 2) --mulitple binaries--
Same as Case 1) BUT the script(s) has to be put in debian/usr/share/whatever/name-of-the-package, where name-of-the-package is the name of the binary package that you defined in debian/control

Now go in the source directory and run debuild, if you are lucky everything will go fine.

Tuesday, 20 March 2007


Dopo un pò che stiamo fuori ci siamo disabituati a vedere la televisione. Non a vedere i programmi che ti piacciono, che aspetti, che cerchi, ma a vedere la televisione così, tanto per guardarla. Ovviamente parlo della televisione italiana. Di questo strano animale che collega ogni italiano con il suo vicino di divano e il telecomando.

Fatto sta che questo fine settimana siamo andati nel bel mezzo della foresta finlandese (più o meno qui) e abbiamo trovato un mökki (cottage) con una parabola. Da buoni italiani che si rispettano abbiamo acceso la televisione. Pochi secondi sono bastati per capire che nulla era migliorato.

"Tette, culi, tette, culi, tette, culi..."

Un'orgia indistinta di immagini con un solo comun denominatore. Livello culturale patetico. Contenuti nessuno. Strilli, schiamazzi, gente che si scanna, tanti che parlano senza dire niente, esprimono opinioni senza sapere di cosa si stia parlando... insomma una monnezza.

La cosa triste è che la televisione rispecchia la società e la società è influenzata dalla televisione. Non so di preciso dove è iniziato questo circolo vizioso. Ma di certo allo stato attuale delle cose la situazione è tremenda...

Avevo fatto un pensiero a comprare la parabola, ma sono tornato velocemente sui miei passi.

Resto coi 4 canali finlandesi, capisco poco, ma capisco abbastanza da realizzare che la qualità è nettamente migliore.

After a while that we are abroad we became unused to watch television. Not watching the programs that you like, that you wait, that you look for, but just watching television for the sake of watching it. Of course I'm talking about italian television. About this strange animal that links every italian to his neighbor on the sofa and to the remote.

So we spent this weekend in the middle of the finnish forest (more or less
here) and we found a mökki (cottage) with the satellite dish. Like good italians we turned on the TV. Few seconds were enough to understand that nothing was changed.

"Boobs and butts,
Boobs and butts, Boobs and butts..."

An unclear orgy of images with the same thing in common. Cultural level: pathetic. Contents: nothing. Screams, noises, people that fight, many that speak without saying anything, express opinions without knowing what they are talking about... in conclusion... trash.

The sad thing is that the TV mirrors the society and the society is influenced by the television. I don't know exactly where this vicious circle began. For sure the actual situation is terrible...
I thought to buy the dish, but I changed mind quickly.

I stay with the 4 finnish channels, I don't understand that much, but enough to realize that the quality is definitely higher.