Archive for the 'Ubuntu' Category

dpatch – using patch files in Debian packaging

I do a fair bit  of packaging of Debian and Ubuntu packages at work, often having to make tweaks to upstream packages. I used to just hack the upstream source directly, but have now discovered dpatch.

dpatch is a clever addition to the Debian packaging process which allows all your changes to be stored as patch files in the debian/ subfolder in the source package rather than having to modify the upstream source. There are good reasons to do this – You can easily see what you have changed in the source, and therefore can remove the changes easily if the need arises. It also allows upgrading the upstream source more easily as you do not have to patch the code yourself (and only have to do anything if the upstream code has changed too much for patch to figure out where the changes need to go)

http://matrixhasu.altervista.org/index.php?view=use_dpatch is an excellent introduction for dpatch, and certainly got me going.

The basics of dpatch are pretty simple. After installing dpatch on your system, you can start using it in your source package straight away.

I prefer to start with the debian/rules file and add dpatch support first, as dpatch can complain in some of its commands if you have not done this step first. The easiest way to do this is simply to add the following line near the top of debian/rules

include /usr/share/dpatch/dpatch.make

This pulls in several dpatch definitions for make, allowing it to be called easily. Next you have to change the build-stamp and clean definitions in your debian/rules. The basic idea is to tell dpatch to patch files before the build happens, and to remove the patches during the clean. This way you can work with the original package, and dpatch will add your patches automatically during package build.

build-stamp: patch-stamp
...
clean: unpatch

Now dpatch will apply any patches found in debian/patches (though it does need an index of patches to apply). Of course there are other ways to configure dpatch, see man dpatch for details.

Now you want to change your code. The dpatch-edit-patch command will copy your packages source tree to a temporary directory and put you in a new shell. You simply edit the code to make the change you want, then logout of that shell and dpatch will work out what you have changed and save those changes to a patch file.

For a new patch you probably want to use the –add2list flag as it adds your patch to the index of patches to apply. The following is an example of creating a new patch

dpatch-edit-patch --add2list 01_my_patch_name

If you want to go back and make changes to your patch you can just run

dpatch-edit-patch 01_my_patch_name

That is the basics of dpatch. You can apply all patches with dpatch apply-all and remove them all again with dpatch deapply-all and of course dpatch will do this for you when you run dpkg-buildpackage, debian/rules or debuild to build your package.

I recommend using dpatch whenever you need to change the upstream source in a package – being able to easily see what you changed to make that package work is really helpful (and don’t forget to tell upstream your changes where appropriate!)

Ubuntu 9.10 Karmic Koala released

http://www.ubuntu.com/getubuntu/download

If possible, use the Torrent download: http://releases.ubuntu.com/9.10/ubuntu-9.10-desktop-i386.iso.torrent (it should be faster and saves money for all the mirrors)

Ubuntu Global Jam

I recently noticed that 2nd-4th October is Ubuntu Global Jam. There is actually a meetup in Birmingham:

Ubuntu Global Jam – Birmingham (UK) – Source Guru
So, if you’re interested in helping make Ubuntu a better distro, and live in (or can travel to) the Birmingham Area in the UK, then you’re welcome to come along.

The Jam is on the 2nd-4th October, and we’ll be around on all three days….  Last year we had a great time, with refreshments (including beer) provided. Juggling penguins, and one person sleeping underneath the conference room table overnight. Hopefully we’ll also have the live Video Streams up and running again for anyone who can’t make it (or other Ubuntu Jams) to join in with!

However another question also occured – how much interest would there be in the south of England in order to try and organise one closer to home. We don’t really even need an official Ubuntu developer, as there is plenty of instructions and irc can provide access to developers real-time if we need them.

The only thing we need is a venue (I could possibly get use of the IBM site again) and enough people that want to contribute something to Ubuntu. The contribution could be packaging new programs, fixing bugs, raising bugs, improving documents, or translating documents (translation into British English anyone?)

Debian annouces fixed date release cycles

I seem to recall Mark Shuttlework saying in an interview (possibly for Linux Format, possibly somewhere else) that he wanted to work with Debian to get fixed release cycles to help the Debian->Ubuntu porting efforts – It looks like he succeeded in planting the idea! I am looking forward to predictable Debian releases.

The most exciting thing I know of being attempted in the next Debian release (Squeeze) is the multiarch support, which should make running 32 bit apps on a 64 bit OS much better (currently some apps can install if you install the ia32-libs package however others need to be installed in a 32 bit chroot because they have too difficult dependencies to resolve). Redhat adopted another approach where 32 bit is more of a default than 64 bit than on Debian (On Debian a 64 bit install has absolutely no 32 bit support other than the ia32-libs package). Most 32 bit stuff seems to work ok on a 64 bit Redhat box but I don’t know how their approach relates to multiarch. The idea with multiarch is to natively support both 32 and 64 bit packages on the same system (I believe by changing the installer to put 32 bit libs in /lib32/, whereas I believe redhat uses /lib64/ for the 64 bit stuff and /lib/ is still 32 bit only).
I am very interested to see how this pans out as I run a 64 bit desktop at work with lots of 32 bit apps (and gave up on my 64 bit install at home because it was too fiddly for the 32 bit proprietary apps I want to use)

A copy of the Debian announcement is below:

Continue reading ‘Debian annouces fixed date release cycles’

Moving from debian+kde to ubuntu+gnome

I have been using Debian for quite a long time, and it has been my primary OS on my work laptop for about the last 3 years. Recently software suspend (sleep) started having problems where it often did not come back from sleep. For a laptop, this is a big annoyance to me, so I finally decided to try out Ubuntu.

I tried the usual Ubuntu Jaunty Live/install cd, but found that Ubuntu do not consider LVM a core part of Ubuntu and so the installer couldn’t install on my disk without serious reworking. So I grabbed the alternate install cd which is pretty much the old curses Debian installer, which does support LVM. Having backed up /home/ and /etc/ I started down the road installing. Things went very smoothly (short of a scary warning from the installer suggesting it was going to erase my LVM partition but actually doesn’t do anything more than rewrite the same partition table to the disk). In little over an hour I had Jaunty fully installed, and a large number of my work specific apps installed and running, including Lotus Notes and Lotus Symphony which are quite large downloads).

Of course firefox picked up all my custom plugins and current browsing session because I had left /home/ completely intact and reused it. I initially didn’t like the look of gnome and so tried kde briefly before managing to get it crashing regularly (probably one of the compiz 3d effects). I cleared out ~/.kde/ and got it a little more stable, but couldn’t get kde network manager to attempt to connect to my wifi, and wicd didn’t seem to finish connecting properly.

I decided to go back to gnome and try and see if I could get used to it. Customising it was a little interesting, as I like a launcher bar at the bottom and nothing in gnome seemed to be what I was looking for. Eventually I found gnome-do and the theme that has a recently launched bar at the bottom that resembles the osX launcher with icons that expand when you move the mouse over them. The gnome terminal is rubbish, so I am still using the kde konsole for now.

I am starting to get comfortable in gnome, and I think the fonts actually look better, though that could be something extra in Ubuntu or simply a better default setting somewhere that I would have found on a reinstall of Debian too. Gnome feels slightly faster than KDE, though that could be my imagination.

All-in-all I am impressed with the really good finish in Ubuntu Jaunty, and gnome is quite workable now (though I do miss the kde ctrl+alt+esc shortcut key to bring up a kill this window icon, which I have always found useful for when some Java applet tries to kill firefox). The gnome power/battery monitor applet has a rather cool power graph funcion which is interesting, though ultimately nothing more than a toy. I did like the kde4 application tray as you could set a wide panel and tell it ti use two rows to list running applications, which I cannot seem to get gnome to do.

Gnome’s philosophy of almost no options does kind of annoy me though. For a start I want my screensaver to be a random slideshow of photos I have on my computer, but the screensaver uses a hardcoded folder to display from, and doesn’t tell you what this folder is. This may be fine if the system created that folder for you but my system didn’t have it created (probably becaue my install reused an existing homedir) and I had to search for a while to find out that it was ~/Pictures. After that a symlink solved that probelm.

Another niggling issue I have is that under KDE I could configure the compiz effects to do an “expose” style window view – when Imove the mouse to a specified corner, all running applications are presented as nicely arranged tiles for me to select the one I want. Despite installing the compiz configuration package, I cannot seem to find a way to get gnome to do this, which is a shame as I could find that really useful.

It is still a novelty to me to have any 3d effects at all, so I have them all prettty much turned on and am loving it (I initially played with compiz when it first hit Debian Unstable, but the ATI graphics drivers for my T43p were not reliable enough and I had frequent crashes, so ultimately turned it all off again).

My new Ubuntu system is very stable, very flashy and I am really impressed. This is not to say I am going to move all my other machines from Debian to Ubuntu, but next time they are up for a reinstall (probably not until a major hardware upgrade) I will probably consider Ubuntu rather than just installing Debian straight away.