Basics of Ubuntu Development – Part 1

Ubuntu Developer Week was on some time back. I hung around for the start where Daniel Holbach who started things off with the “Getting Started with Ubuntu Development” IRC chat. Really good talk (chat) and lot of questions answered too (though I was more of the passive listener tonight). The problem, I felt, was that an IRC chat is very real-time and difficult to use as a reference when you actually get down to working on something. So, I thought it would be a good idea to blog about it. I hope all the descriptions etc are good and right.

If anyone wants to read the chat-logs you can find it here.

So, here goes!

The first page which you can use is the Ubuntu wiki page – UsingDevelopmentReleases. It has tonnes of info and links that you can use during your development time. The first thing you’ll need is an environment to develop in. A place where whatever crap you end up doing isn’t going to damage your happy Ubuntu installation. One of the things you can use is chroot

Installing chroot

Easy thing, this. Run these commands to get the installation done
sudo apt-get install chroot
sudo apt-get install debootstrap

If you haven’t already enabled “Source Code” and “Universe” in SystemSoftware SourcesUbuntu Software you can do that now.

Note: We’ll be dealing with some basic bug-fixes etc first. This is not going to be gnome centric (which is a natural assumption that many will have considering its Ubuntu)

Run the following command :

sudo apt-get install --no-install-recommends bzr-builddeb ubuntu-dev-tools fakeroot build-essential gnupg pbuilder debhelper

This will give you a bunch of tools that are going to be useful, generally (not just in these examples)

bzr-builddeb pulls in bzr, which is the short for Bazaar which we’ll use to get the source-codes for one or two examples.
ubuntu-dev-tools pulls in devscripts which are incredibly helpful at making repetitive packaging tasks easy
fakeroot is needed by debuild (in devscripts) to mimic root privileges when installing files into a package
build-essential pulls in lots of useful very basic build tools like gcc, make, etc
gnupg is used to sign files in our case (uploads in the future)
pbuilder is a build tool that builds source in a sane, clean and minimal environment it sets up itself
debhelper contains scripts that automate lots of the build process in a package

Let’s first set up our gpg key which we use to sign files for upload. More generally it is used to sign and encrypt mails, files or general text. We use it to indicate that WE were the last to touch a file and not somebody else and that ensures that only people who we know about get to upload packages.

If you have no gpg-key yet, run the following command :

gpg --gen-key

When you are doing this, it is completely fine if you stick to the defaults. You don’t have to comment, for example. Enter your name, email address and just stick to the default values for now. It could be that gpg is still sitting there and waiting for more random data to generate your key – that’s expected and fine. Just open another terminal while we carry on, it’ll finish on its own. As said earlier: if you have a gpg key already, skip this step

If you need more information on gpg-keys you can look through the Gnu Privacy Guide which about everything in more detail.

Now we can set-up pbuilder.

Open an editor and edit the file ~/.pbuilderrc (create it if you don’t have it yet) and add the following content to the file:

COMPONENTS=”main universe multiverse restricted”

Save it and once you’re done, run the following command :

sudo pbuilder create

What does pbuilder do?

It builds packages in a clean and minimal environment.
It keeps your system “clean” (so you don’t install millions of build dependencies on your own system).
It makes sure the package builds in a minimal, unmodified environment so you ensure that the package does not just build because you made lots of changes on your system, but the build is reproducable

You can update package lists (later on) with:

sudo pbuilder update

To build packages you run:

sudo pbuilder build package_version.dsc

How does pbuilder work? It first gets the minimal packages for a base system and stores them in a tarball. Whenever you build a package it’ll untar the base tarball, then install whatever your current build requires, build it, then tear it all down again. Luckily it caches the packages.

Something else we can do in the meantime is if you use the bash shell, which is the default, please edit ~/.bashrc. At the end of it, add something like
DEBFULLNAME=”Your Name”
DEBEMAIL=”your.mail.id@provider.com”
Once you’re done editing ~/.bashrc, please run source ~/. bashrc (it’s only needed once)

QUESTION: Should these match the values we put into GPG?
A: Yes

Ok, with this out of the way, the packaging tools will know you by your name and you don’t need to enter it, for example if you do changelog entries, etc.

(aside) General Fundas:

Ubuntu is very special in how it’s produced and how we all work. As you know it comes out every 6 months and that means we have a tight release schedule and everything we do and work on is defined by that schedule. Check this out for the current release schedule for maverick.

In that link, basically, green means: lots is allowed here, red means: almost nothing is allowed here.

In more detail,

– toolchain is uploaded for the new release (gcc, binutils, libc, etc.), so the most basic build tools are there
– new changes that happened in the meantime are synced or merged (more on that later on)
– ubuntu developer summit (uds) happens where features are defined and talked about
– up until debian import freeze we import source changes from debian semi-automatically
– up until feature freeze we get new stuff in, work on features, try to make it all work
– if a feature is not half-way there yet by feature freeze, it will likely get deferred to the next release
– from feature freeze on you can see that lots of freezes are added throughout the weeks and you’ll need more and more freeze exceptions for big changes

The focus is clearly: testing, testing, testing and fixing, fixing, fixing

So How do you get stuff in?
Only people who “we know” get to upload packages directly, as we said before. This means that as a new contributor you will have to work with sponsors who basically review your work and upload it for you. Once you did that a couple of times and they recognise you and your good work, you can apply for ubuntu developer membership and you can ask the people you’ve worked with for comments on your application

It’s not very complicated, you basically set up a wiki page with your contributions, ask for comments and submit for an #IRC meeting of the developer membership board and you’re done. No need to learn a secret handshake, send me money or anything else. It’s contributions and good work that counts.

Now get the source of the hello package and run the command:

apt-get source hello
sudo pbuilder build hello_*.dsc

Now, pbuilder will work as explained earlier.
Note : .dsc has some metadata like checksums and the like. Not important right now.

You can check out the contents of /var/cache/pbuilder/result and it will contain the built hello.deb file.

End of Part 1 – There is no logical end here, but I don’t like very (extra) long posts.

Desktop Search on Ubuntu

I’m amazed that Ubuntu doesn’t have a good default Desktop Search tool. I’ve been using Ubuntu for a while now and the lack of a perfect desktop search is felt very strongly.

The need for such a tool is greater in Linux than in Windows considering you have a greater degree of freedom in configuring obscure files to make the OS perform the way you want it to. From that perspective, it has become quite a pain searching for files of something I had installed a long time ago. Also, I’ve been reading a few research papers of late and I’ve been making some notes in txt. ReFinding something is a nightmare if you can’t remember the filename.

So I started looking into the different desktop search options I had.

Beagle

Beagle is widely considered to be the leading tool for desktop search on Ubuntu. Its written in C# and runs using Mono. It uses Lucene’s C# implementation for indexing and it seems to be good. It was launched with (a bit of) fan-fare back at the 2004 Guadec Conference in Norway. It is quite similar to Apple Searchlight and was, interestingly, announced on the same day as Searchlight. Norway being 6+ hours ahead of the United States, it was technically released earlier!

But Beagle faced performance issues regarding its ‘crawling’ process which was very processor heavy. Users grew irritated with the constant processing involved in keeping a fresh index that many disabled the tool. Some time ago development on the Beagle Project was stopped and so, I believe, did the adoption by new users.

As a product, though, Beagle is quite good. It has a rich feature set and if you ignore the index refresh issues, its quite good at retrieval. It indexes all imaginable file types and has some interesting features, like the support of glob expressions which I haven’t found in other search engines (except Recoll).

Tracker

Tracker is short for Meta Tracker. It is a light and fast desktop search implemented using C. Tracker’s lightness has meant that it doesn’t index the innards of some types of files – pdf, ppt, mailboxes etc. But it is faster and doesn’t eat up processor cycles, so its a more quick and dirty solution. And of course if you can’t find something using it, you can always switch over to good ol’ grep.

Earlier, documentation was very poor on Tracker, but it has improved, I feel.

Google Desktop Search

Google Desktop Search isn’t open source, so it doesn’t get brownie points. But it is quite useful.  It indexes almost all file-types including pdf and ppt. The engineering behind it is good and it doesn’t hog (too much) processor time. If you can get over the fact that Google will get even more of your information, then this is the desktop search tool for you. I prefer to have at least a bit of my own life to myself, so I’m left with very few options.

There are many other tools which I haven’t mentioned here.

Terrier is one which I haven’t tested out in detail yet. I will be looking through the code of this, though, for obvious reasons. It isn’t built with desktop search in mind, but might perform well.

Recoll is one which I haven’t tried out fully yet. It runs with a Xapian back-end of which I know very little of.

What I Use to get Things Done on my Lucid Lynx

After using Linux for a few years now, I am quite convinced there is very little that I can’t do on my Ubuntu that you can do on a Windows system. In many cases I can do things better.

I am going to make a list. This list will be of things that are of use to me. I won’t be entering things just for academic purposes of proving there is a Linux equivalent for something I don’t use.

Use Linux (specifically Ubuntu)
Word Processing Open Office
– There are better options for formatted writing like LaTeX. I’m looking into it.
Presentation Open Office
– Its terribly chunky and not presentable.
Spreadsheets Open Office
– It isn’t great, but it works ok.
Burning CDs I haven’t burnt many Cds thanks to the external harddrives that everyone has these days.
Music Playing Songbird
– As good as, If not better than any windows specific player.
– Its available for windows as well
– Mozilla’s player, so addons aplenty
Video Playing VLC, Movie Player
Mail Client Thunderbird, Evolution.
I like Thunderbird better because its sleeker and mail is better
Virus Protection Absolutely no need
Torrent Download Deluge is the one I use. Vuze isn’t bad either. But nothing is as good as muTorrent. Can run through Wine if need be.

Update: muTorrent for Linux is in developement!
Update: i’ve started using KTorrent

Image viewing & Basic editing F-Spot photo managing is enough
Super image editing GIMP isn’t good enough I hear. But so far I’ve managed to do everything I’ve wanted to with it.
Video editing PiTiVi!
PDF viewer Okular! I feel very comfortable with this one. Lots of nice features and very light and fast.
Note Making BasKet Notes! Haven’t tried out the latest version but its fast becoming as good as any. Support for documents, pictures etc.
IRC Chat Xchat!
Project Planning openProj

What do you use? Is there something that can be added to the list or some potentially better software?

Simple Financial Planning for the Poor

Since I am, now, an earning person – I thought its time to start budgeting and calculating where money is spent. I considered the manual method of keeping a log, but its very tough to check back or do analysis on the total spend in the month passed.

So I started looking for budgeting – or ‘personal finance’ – software that can do the basics well while not overloading me with jargon and overkill. As of now I’m on the Ubuntu OS – so open source and cross platform tools are what I looked for. There was only one which was really all of those things.

Buddi

Buddi’s features include budgeting, tracking accounts, personal finance report, and an envelope budgeting feature called Prepaid Accounts. Free plug-ins can be downloaded to add more features, like a financial dashboard & balance sheet. I haven’t tried all of it out yet.

It runs on any operating system running Sun Java Virtual Machine 1.5, including Windows, Mac OS X 10.4 and Linux.

Here are a few screenshots which I’m plugging from their site for now – since I haven’t used it enough to have any screens to shoot!

You can draw pie charts to show your data

You can draw graphs to compare the spend across the weeks which is very cool for a non-finance guy. Its an easy interface and has a few cool addons as well.

Any opinions about better planners?