2008-01-17

DIY: Debian package

I have just completed my first .deb package, that can be installed on Debian and Ubuntu with a couple of clicks, and I need to write down a short note as a reminder for future packetizations.

First of all, create a directory that will have the name of your package, e.g. my-program_1.0_i386, and copy all the binary files you need into it, using their absolute paths as relative paths.

For instance, if the program executable is /usr/bin/pippo, then you will copy this file into my-program_1.0_i386/usr/bin/pippo and you have to repeat this step for all the files (including the ones under /etc and so forth).

Since the package will not include only files but also configuration informations, create a DEBIAN subdir and fill it with the following files:

  • control: is the most important control file, analyzed later
  • conffiles: list of absolute paths of files (one each line) that you are going to install and that have to be considered as configuration files (this is why Synaptic shows two different kind of uninstallations)
  • preinst: executable script executed before copying the files
  • postinst: script executed after file copy
  • prerm: script executed before file removal on uninstall
  • postrm: script executed after file removal

The four executable scripts can be written in the language you prefer, probably they will be bash shell script files.

The control file will then have relative path my-program_1.0_i386/DEBIAN/control and it will be a text file that will include the following informations:

Section: electronics
Priority: optional
Package: my-program
Version: 1.0
Architecture: i386
Installed-Size: 12345
Depends: sed, libncurses4
Maintainer: Fabrizio Fazzino <fabrizio@fazzino.it>
Description: My Program
This is the long description for My Program.
Please indent this description with one blank space at the beginning
of each line and use a full stop alone on a line to leave a break:
.
* Unordered lists are obtained...
* ...by placing an asterisk at the beginning of a line.

The installed size must be reported in KByte (so in the example you must know that the files you are copying are about 12 MBytes).

When you think that everything is OK, just run the command dpkg -b my-program_1.0_i386 from the upper directory and it will create a file named my-program_1.0_i386.deb for you.

Now you are ready to try to install and uninstall it several times from the command line (with dpkg) or from the GUI (with GDebi or Synaptic).

When you're sure that it's OK you can share it with the world, or at least to save it for future installations.


Goodbye Jaguar!

No, I didn't sell my car... I've just updated the operating system on my old Apple iBook Firewire G3 466 MHz Special Edition Graphite from Jaguar (10.2) to Tiger (10.4); it is too ancient to support Leopard (10.5) so this will be its final Mac OS X update.

After the OS installation I've added the following programs that I would definitively recommend to every Mac user:

  • Apple X11 server (from the installation disc)
  • Emacs editor
  • AbiWord word processor
  • KeyNote presentation program I bought time ago
  • OpenOffice.org (X11 version)
  • Firefox browser
  • Cyberduck FTP client (nicest icon on the dock!)
  • Adium instant messenger (supports ICQ and MSN accounts like Pidgin on Linux)
  • GIMP graphics editor
  • VLC media player

2008-01-04

Common subset GCC/Linux

Now that I've printed the two different lists of the architectures supported by the GCC cross-compiler provided by SpeedBlue.org and the targets supported by the mainstream Linux kernel from Kernel.org, I'll try to write the subset of the architectures common to both the lists.



Starting from the GCC list (that is much shorter) and counterchecking on the Linux one, I see that I have to exclude just the HP-PA architecture for which Julien Lemoine does provide a precompiled Debian package but the kernel guys don't.



I will then group the remaining architectures, for which a Linux kernel can be built in minutes on a Debian/Ubuntu IA-32 machine, in 3 different lists.



Non-RISC Architectures:


  • Intel x86 a.k.a. IA-32 (from the i386)
  • Intel 64 a.k.a. AMD64 a.k.a. Intel EM64T
  • Intel/HP IA-64 (actually I like this VLIW/EPIC stuff)
  • IBM S/390 (from the old world of mainframes)
  • Motorola 68000 (the CISC that lost the war against x86)

RISC Architectures that I don't like:


  • Alpha (extinct)
  • ARM (I said in a previous post why I don't like it)

RISC Architectures that I strongly suggest to play with:


  • MIPS
  • SPARC
  • POWER / PowerPC