Rebuilding Kubuntu Packages
Another one of those thing i don't do enough to remember. I could also call this article "Getting the iPod Nano 4G to work on Kubuntu Gutsy"
Overview
This cheat sheet occurred after my wife coerced me into getting her an Ipod. I mean coerced because i didn't know whether i was going to be able to get it to work sans Itunes. I got lucky and her new 16GB iPod Nano 4G worked using amarok 1.4.10 with libgpod.0.6.0. I tested that on a VM running Kubuntu Intrepid. Nice. Unfortunately i'm still running Gutsy and haven't wrapped my head around KDE4 yet. Enough of the rant. Here it goes:
Getting the build tools
sudo apt-get install build-essential fakeroot dpkg-dev
Then create a directory somewhere to build things in and go there.
mkdir debs cd debs
Getting the Source
This one was easy. Since i didn't want to figure out which one i needed, i just added all of the repo paths from intrepid to my /etc/apt/sources.list and temporarily commented out the gutsy ones. Just for reference here are the intrepid paths
deb http://us.archive.ubuntu.com/ubuntu/ intrepid main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid main restricted deb http://us.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted deb http://us.archive.ubuntu.com/ubuntu/ intrepid universe deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid universe deb http://us.archive.ubuntu.com/ubuntu/ intrepid-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid-updates universe deb http://us.archive.ubuntu.com/ubuntu/ intrepid multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid multiverse deb http://us.archive.ubuntu.com/ubuntu/ intrepid-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid-updates multiverse deb http://us.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse deb http://archive.canonical.com/ubuntu intrepid partner deb-src http://archive.canonical.com/ubuntu intrepid partner deb http://security.ubuntu.com/ubuntu intrepid-security main restricted deb-src http://security.ubuntu.com/ubuntu intrepid-security main restricted deb http://security.ubuntu.com/ubuntu intrepid-security universe deb-src http://security.ubuntu.com/ubuntu intrepid-security universe deb http://security.ubuntu.com/ubuntu intrepid-security multiverse deb-src http://security.ubuntu.com/ubuntu intrepid-security multiverse
Then update the repo cache.
apt-get update
On to get libgpod-0.6.0 and the latest dpkg
apt-get source libgpod apt-get source dpkg
Then restore your sources.list to it's original state now before you forget. Followed by another apt-get update. Now get the amarok sources from the gutsy repo.
apt-get source amarok
Getting the build dependencies
These are only for the gutsy versions but it's a decent start
apt-get build-dep dpkg libgpod amarok
Building dpkg
We need to start with dpkg because libgpod requires some help from it for building. We will not install this package. The apt-get was run after it complained about these missing.
apt-get install po4a libtimedate-perl libio-string-perl lzma dpkg-source -x dpkg_1.14.20ubuntu6.dsc cd dpkg-1.14.20ubuntu6/
Edit debian/control and change Build-Depends: po4a (>= 0.33.1) to 0.30.1
dpkg-buildpackage -rfakeroot -b -uc -us
As already indicated, trying to install this is not a good idea and makes apt very upset. So instead i "Borrowed" dpkg-gensymbols and friends real quick to make the libgpod build happy.
sudo ln -s /home/mario/deb/dpkg-1.14.20ubuntu6/debian/dpkg-dev/usr/bin/dpkg-gensymbols /usr/bin/ sudo ln -s /home/mario/deb/dpkg-1.14.20ubuntu6/debian/dpkg-dev/usr/share/perl5/Dpkg /usr/lib/perl/5.8/ sudo ln -s /home/mario/deb/dpkg-1.14.20ubuntu6/debian/dpkg/usr/share/perl5/Dpkg.pm /usr/lib/perl/5.8/ sudo ln -s /home/mario/deb/dpkg-1.14.20ubuntu6/debian/dpkg/usr/share/perl5/Dpkg/Gettext.pm /usr/lib/perl/5.8/Dpkg/
Don't try this at home.
Building libgpod
- Setup the build directory from the deb directory
dpkg-source -x libgpod_0.6.0-5ubuntu2.dsc
- Build the package, after getting some more builds deps
apt-get install libhal-dev libsgutils1-dev python-gobject-dev xsltproc dpatch cd libgpod-0.6.0/
I edited debian/changelog to add my rebuild entry and then built it
dpkg-buildpackage -rfakeroot -uc -us
Now that this has been built it's probably a good idea to undo our dpkg-gensymbols hack.
rm -f /usr/bin/dpkg-gensymbols rm -f /usr/lib/perl/5.8/Dpkg rm -f /usr/lib/perl/5.8/Dpkg.pm
Installing libgpod
Since we don't have a repo set up we install libgpod manually, before proceeding to amarok.
sudo dpkg -i libgpod3-nogtk_0.6.0-5schmut0_i386.deb libgpod-common_0.6.0-5schmut0_i386.deb libgpod-nogtk-dev_0.6.0-5schmut0_i386.deb
Building amarok
From the deb directory
dpkg-source -x amarok_1.4.8-0ubuntu3~gutsy1.dsc cd amarok-1.4.8
I edited the debian/control file to change Build-Depends from libgpod-dev (>= 0.4.2) to libgpod-nogtk-dev (>= 0.6.0). The i added a debian/changelog entry for my rebuild. Then rebuild the package
dpkg-buildpackage -rfakeroot -uc -us
Installing amarok
Since i run xine i also installed the amarok xine package.
sudo dpkg -i amarok-xine_1.4.8-1schmut0~gutsy1_i386.deb amarok_1.4.8-1schmut0~gutsy1_i386.deb
Getting the packages
If you're interested in the packages, but too lazy to build them yourself, you can just download them here:
Just installing the packages
After downloading the above files unzip them:
tar -jxf libgpod-0.6.0-debs.tbz tar -jxf amarok-1.4.8-debs.tbz
Install libgpod
cd libgpod-0.6.0-debs sudo dpkg -i libgpod3-nogtk_0.6.0-5schmut0_i386.deb libgpod-common_0.6.0-5schmut0_i386.deb libgpod-nogtk-dev_0.6.0-5schmut0_i386.deb
You may have to install missing dependencies. In my case libgpod-common wanted libsgutils1 (>= 1.24) so i did
sudo apt-get install libsgutils1
And then reran dpkg -i
Install amarok
To see which packages are currently installed
dpkg -l amarok\* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-===========================-===========================-====================================================================== ii amarok 2:1.4.8-0ubuntu3~gutsy1 versatile and easy to use audio player for KDE un amarok-engine <none> (no description available) ii amarok-xine 2:1.4.8-0ubuntu3~gutsy1 xine engine for the Amarok audio player
Ah ha, amarok and amarok-xine. So we'll reinstall those.
cd ../amarok-1.4.8-debs sudo dpkg -i amarok-xine_1.4.8-1schmut0~gutsy1_i386.deb amarok_1.4.8-1schmut0~gutsy1_i386.deb