Monday, August 29, 2011

Installing awn on LMDE XFCE without adding crazy gnome dependencies

sudo apt-get install libdesktop-agnostic0 libdesktop-agnostic-vfs-gio libdesktop-agnostic-fdo-glib libdesktop-agnostic-cfg-gconf gconf2 libnotify4

now, download this package:
http://packages.debian.org/wheezy/libawn1

and
sudo dpkg -i libawn1_0.4.1~bzr830-1_amd64.deb

(modify for your arch, of course)

now download this package:
http://packages.debian.org/wheezy/all/avant-window-navigator-data/download

and sudo dpkg -i for the downloaded file.

Now, you should be able to download the actual avant-window-manager package from here:
http://packages.debian.org/wheezy/avant-window-navigator

and run dpkg like so:
sudo dpkg  --ignore-missing gnome-applets --ignore-missing gnome-applets-data --ignore-missing gnome-control-center --ignore-missing gnome-panel --ignore-missing gnome-panel-data --ignore-missing gnome-session --ignore-missing nautilus --ignore-missing nautilus-data -i avant-window-navigator_0.4.1~bzr830-1_amd64.deb

Again, modified for your arch.

Now you have awn installed, but you're still not going to have very many applets... if you search through the repos, you will be able to install some of the applets without gnome dependencies, but many of them *depend* on gnome-applets.  Not to worry, we can install that without proper gnome as well.

First we need gnome-applets-data, which does not require any extra gnome nastiness.
sudo apt-get install gnome-applets-data

Then download this package:
http://packages.debian.org/squeeze/gnome-applets

now run:
sudo dpkg --ignore-depends gnome-control-center --ignore-depends gnome-panel --ignore-depends gnome-panel-data --ignore-depends gnome-session --ignore-depends nautilus --ignore-depends nautilus-data -i gnome-applets_2.30.0-3_amd64.deb

As usual, modifying for your archicture.  I found that installing the additional awn applet packages was slightly problematic and kept breaking things because gnome-applets keeps wanting to pull in gnome-panel.  If you see this breakage, run:

sudo aptitude -f install

Allow it to uninstall gnome-applets and then re-run the install cmd above.  Ultimately I had to download and install awn-applets-c-core with dpkg.

Now, not *everything* works.  A few of the applets crash, but the vast majority of things work just as they do in gnome, but without pulling in and running gnome-session and nautilus which really screw with the xfce user experience.  I will update this as I continue to debug some og the problems, but I'm happy to have a decent dock under xfce!

Friday, August 19, 2011

dpkg notes

Search for what package a file came from: dpkg -S
Show installed version of a package: dpkg-query -l

Patching and rebuilding debian packages

So i've been doing some bug fixes for packages in the linux mint debian edition and its been alot of fun. However, since they have kind of a small team and it takes awhile for patches to hit the distro, i thought it might be fun and helpful to roll my own .deb packages for people to "try at your own risk" until official packages are released.

So, for my own point of reference and as a quick reference to anyone who cares, here's a simple tutorial. You'll need normal debian buildtools and something called quilt that helps manage patches. Lets assume you've fixed your bug and made a diff against the original file and all that good stuff. I keep directories like so to keep track of what i'm working on, so you'll see them referenced:

~/bin (for binaries or ready-to-use scripts)
~/src (for debian source packages and in progress scripts)
~/diffs (for patches)

normally to get a debian source package, you would run something like:

voytek@voytek ~/src $ apt-get source package-name

in whatever directory you want to have the new source directory created. I'm working on the mintBackup tool which they don't have a debian source package for in the repos, so I'm pulling it directly from git:

voytek@voytek ~/src $ git clone git://github.com/linuxmint/mintbackup.git


Simple procedures for working with quilt come from this tutorial, however before you start using quilt for debian packages, you'll want to make sure you have a ~/.quiltrc file that at least has this line:

QUILT_PATCHES=debian/patches

This makes sure you're putting the patches where debian expects them. The tutorial tells us:

"quilt works in the source tree. There's no copying large trees around. There's also no need to always keep the source tree clean of unapplied changes just to be able to extract a diff with SVN.

To achieve this, however, quilt needs to know which files are contained in each patch. The workflow is as follows:

  1. you tell quilt that you start working on a given patch
  2. you work on that patch
  3. you tell quilt that you're done"
So I move into the mintbackup src directory and I run:

voytek@voytek ~/src/mintbackup $ quilt new python-apt-api-changes.patch

You can name the patch anything you want, but I'm choosing to name mine descriptively. Next you would want to edit and/or patch the file, but first you have to tell quilt what file you're editing. To do this, you just run:

voytek@voytek ~/src/mintbackup $ quilt edit usr/lib/linuxmint/mintBackup/mintBackup.py

Now, this will open the file you've specified in whatever you have set as your $EDITOR. You could make your changes here, but I like to be organized and I tend to make mistakes when I don't have a way to test things nicely, so I'm going to use the patch I already made. So, I close my editor and quilt responds with:

File usr/lib/linuxmint/mintBackup/mintBackup.py added to patch python-apt-api-changes.patch

Good times!

The patch I'm using was originally created from my copy of the modified script in ~/bin applied to the unmodified version on my system, like so:

voytek@voytek ~ $ diff /usr/lib/linuxmint/mintBackup/mintBackup.py bin/mintBackup.py > diffs/mintBackup.py.diff

And to apply it, I will simply run:

voytek@voytek ~/src/mintbackup $ patch usr/lib/linuxmint/mintBackup/mintBackup.py ~/diffs/mintBackup.py.diff

Now we have to tell quilt that we're finished, which will output the following (cmd included):

voytek@voytek ~/src/mintbackup $ quilt refresh python-apt-api-changes.patch
Refreshed patch python-apt-api-changes.patch

Great, so our modified source is ready to be built into a package! This can be done from the root of the source tree by running:

voytek@voytek ~/src/mintbackup $ debuild -us -uc

Assuming we did everything correctly, this should create .deb packages for our modified sources in the parent directory. Thankfully, since the package I'm working on today doesn't have any compiled binaries, I also get a mintbackup_2.0.8_all.deb package which can install on any architecture.

mintbackup

voytek@voytek ~/src $ git clone git://github.com/linuxmint/mintbackup.git
Cloning into mintbackup...
remote: Counting objects: 1343, done.
remote: Compressing objects: 100% (461/461), done.
remote: Total 1343 (delta 571), reused 1322 (delta 551)
Receiving objects: 100% (1343/1343), 335.08 KiB | 202 KiB/s, done.
Resolving deltas: 100% (571/571), done.