Building ROOT Packages on Ubuntu Feisty

I read with satisfaction the fact that Cern’s ROOT physics and data analysis framework has finally been integrated into Debian. I assumed that this would lead to easier installation on Ubuntu and in the future, hopefully, ROOT in the Ubuntu repositories. For a brief and happy period there was a third party repository with up-to-date and semi-official ROOT packages.

My hopes were dashed with the news that the Brookhaven machine hosting the repository lost a hard disk and the Ubuntu repository was down. I frequently need access to ROOT packages, so I just recently built .debs from the lastest stable release (5.16.00). Here’s a guide as to how to make it work:

Install some Debian packaging tools (this might not be definitive):
apt-get install fakeroot devscripts

Install the development prerequisites (some of these might not be needed):
apt-get install libafterimage-dev libxmlrpc-c3-dev libglu1-mesa-dev libpacklib1-dev libkrb5-dev libldap2-dev libmysqlclient15-dev libpq-dev python-dev libqt3-headers libqt3-compat-headers libqt3-mt-dev qt3-dev-tools ruby1.9 ruby1.9-dev ruby1.8-dev libxml2-dev libssl-dev comerr-dev libxpm-dev libfreetype6-dev libpcre3-dev g77 libodbc++-dev libsqlod75-dev libiodbc2-dev libungif4-dev fftw3-dev krb5-user libgsl0-dev debhelper libpqxx-dev libsqldbc75-dev libttf-dev

Download the source package from the main ROOT page.

Unzip the source and change the directory name from ‘root’:
tar -zxf root_v5.16.00.source.tar.gz
mv root root-system-5.16.00

Make the .orig copy for source packages:
cp -r root-system-5.16.00 root-system-5.16.00.orig

Create the 'debian' directory
cd root-5.16.00
./build/package/lib/makedebdir.sh

If necessary, edit the 'CONFOPTIONS' variable in debian/rules (shouldn't be necessary)

Update debian/changelog, insert a new entry with matching version number to the root directory, add your own name and email.
root-system (5.16.00) experimental; urgency=low
* Version number bump


-- Andrew O'Neill Thu, 16 Aug 2007 02:04:02 +0200

Now, some fixes for broken things:

  • For some reason, some of the builtin packages don’t get untarred during the build, this will cause an infinite error loop during build. This will fix it:
  • cd asimage/src/
    tar -zxf libAfterImage.tar.gz

  • Repeat that for unuran/src/unuran-1.0.1-root.tar.gz
  • Repeat for xrootd/src/xrootd-20060928-1600.src.tgz
  • For 5.16.00, there is a bug in the pgsql code that will block compilation. Edit file pgsql/src/TPgSQLServer.cxx and change the variables stmt->conn to stmt->fConn and stmt->res to stmt->fRes. This error has been fixed in the CVS version.

Build It

Get ready for the build
fakeroot debian/rules debian/control

Configure, compile, link and create packages:
dpkg-buildpackage -rfakeroot -nc

The packages

If the build succeeds, you should find the packages in the parent directory of root-system-5.16.00

Notes

Despite requesting disable-builtin-afterimage, the configure script complains that the Ubuntu version of afterimage is too new, so will use the builtin one anyway.

If the build fails and you need to reconfigure and try again without building everything from scratch, you can probably speed things up by doing:
rm config.status
debian/rules config.status

debian/rules build

5 thoughts on “Building ROOT Packages on Ubuntu Feisty

  1. Hi there,

    [who are you? I can not find anything about the author of this blog. I assumed that there would be something in “About”, but there’s nothing]

    The BNL repository is back up. Please go to http://mirror.phy.bnl.gov/debian-root/ubuntu.

    The “official” how-to can be found in build/package/lib/README.

    When changing the version number in “debian/changelog”, please consider using “dch” and make a non-maintainer update. That is your version number should have the form

    X.YY.ZZ-R-S

    The reason why you have to unpack the tar-balls of libAfterImage, xrootd, and unuran, is to make life easier for the Debian security team when making patches. As you say, you should unpack these tar-balls, and remove them afterward. Note, that running the script

    ./build/package/lib/makedebdir.sh -p -n -o

    will do this for you.

    The PostGreSQL bugs have been fixed in patches I’ve recently sent to Fons.

    The use of system libAfterImage is disabled entirely at the moment.

    Please note, that to rebuild the packages from Debian sources, you can do

    $ cat root.list
    deb-src http://mirror.phy.bnl.gov/debian-root unstable main contrib non-free
    EOF
    $ sudo mv root.list /etc/apt/sources.list.d/
    $ gpg –keyserver keyring.debian.org –recv-keys 6620D4F5
    $ gpg –export 6620D4F5 | sudo apt-key add –
    $ sudo apt-get update
    $ sudo apt-get build-dep root-system
    $ apt-get -b source root-system

    Yours,

    Christian (ROOT package maintainer :-)

  2. Excellent tips Christian. Thanks at lot. I didn’t even see the packaging README before – is it referenced in the top-level README?

    My identity is no secret, I just figured no-one would care! My name is Andy O’Neill and I’m a grad student at Columbia working for the HiRes cosmic ray collaboration.

    The repository link above has a small typo. The correct address is http://mirror.phy.bnl.gov/debian-root/ubuntu/

  3. Pingback: Ultra High » Quickfix: libroot-python-dev for Ubuntu Gutsy

  4. Hi,

    Any luck with 5.22 or 5.24? I’ve tried following your instructions for both but got a lot of errors – maybe because ubuntu upgraded to gcc 4.4, but I’m not sure. Any tips on getting them to work?

    Thanks!

  5. I don’t think I tried those versions… and I’m not using ROOT at the moment so I don’t have any advice for you, sorry!

Comments are closed.