.deb packages for debian and ubuntu [patch]

Hi,

Trying to build ROOT 5.28.00a into .deb packages I faced some problems.
Most of them is described in the following topics.

ROOT v5.28.00 on Ubuntu. Mar 09, 2011
[url]ROOT v5.28.00 on Ubuntu

Have anybody successfully built the Debian packages? Mar 02, 2011
[url]Have anybody successfully built the Debian packages?

Debian package: Unknown package root-plugin-graf2d-gviz Mar 01, 2011
[url]Debian package: Unknown package root-plugin-graf2d-gviz

Compiling root 5.28. 28 Feb 2011
http://root.cern.ch/root/roottalk/roottalk11/0258.html

problem when making debian package - roofit’s hist2workspace, Feb 25, 2011
[url]Problem when making debian package - roofit's hist2workspace

(bug) Root 5.28: Make debian fails on Ubuntu 10.04 (Lucid), Dec 30, 2010
[url](bug) Root 5.28: Make debian fails on Ubuntu 10.04 (Lucid)

Finally I managed to get the set of deb’s for Debian 6.0 squeeze
and Ubuntu 10.10 maverick, i386 arch. I can not guarantee that
all packages are built correctly since there is plenty of warnings.

The main problem was with build dependencies. The scripts attempts
to avoid compiling of some libraries and plugins if the required
-dev packages are not installed. With some of explicit --enable-
options for configure script in debian/rules, it leads to obscure
and hard to track errors. The early manifestation is

fakeroot debian/rules debian/control test: 324: -gt: unexpected operator
due to empty $(PKGLIST) in debian/control target rules (debian/rules
file). It does not stop the build process. The consequences are missing
libraries during linking much later or even problems with building
.deb’s due to incomplete debian/control file. As an example I can
mention --enable-clarens that leads to failure if the following packages
are not installed: libcurl4-gnutls-dev, xmlrpc-c-devel, and libxml2-dev.
I have added an additional test to debian/rules.

Another issue is with ‘make static’. I do not see this target in
README/INSTALL. Is it supported yet? I commented out the related
stuff.

I slightly modified the configure options in build/package/debian/rules.
–enable-g4root does not exist any more. Also I think, system
libglew1.5-dev should be used, so I have added --disable-builtin-glew.
Now this library is added to debian/control.in, but it should be moved
to the appropriate place of makelists.sh.

I have changed #!/bin/sh to #!/bin/bash in makelists.sh.
I have not found the origin of the problem with ‘shift’ command.

The packaging scripts expected olbd for xrootd package. I do not
familiar with xrootd, but there is the following post

[url]Problem in installing pyroot

[quote]Also, the slides you refer to look quite old
(‘olbd’ has been replaced by ‘cmsd’ since several years).[/quote]
I have removed olbd from
build/package/common/root-system-xrootd.install.in
It seems that cmsd should be added instead.

Is there any reason why (CINT) and (MAKECINT) are missed in all-$(MODNAME)
target of cint/cint/Module.mk? I have added them. The issue with renaming
of cintdlls global target have been already fixed in SVN trunk.
I found no gdb-backtrace-script in source tree, so I have removed it from
build/package/common/root-system-common.install.in

Finally, I should say that I have not solve the puzzle with unuran unpacking,
so one have to do this by hand.

The patch with these changes is attached.

A short howto.

  1. Install necessary -dev packages. Ubuntu has some old version of
    ROOT in the universe repository, so

apt-get build-dep root-system
will install most of them. I hope you will be informed about missing libraries
with a meaningful message later. I can anticipate

apt-get install graphviz
If I remember correctly, devscripts package is required as well
(probably --no-install-recommends should be passed to apt-get).

  1. Obtain and unpack root_v5.28.00a.source.tar.gz
  2. Rename the directory

mv -i root root-5.28.00a
4. Apply the patch

cd root-5.28.00a patch -p1 < ../root-5.28.00a_debian.patch
5. Unpack unuran

pushd math/unuran/src/ tar xvfz unuran-1.8.0-root.tar.gz popd
6. Start compilation

make debian
7. In the case of failure due to unmet dependencies, install the requested
packages and repeat the step 6.

Max.

P.S. The list of packages installed by

apt-get build-dep root-system
(ubuntu)

The following NEW packages will be installed:
  cernlib-base cernlib-base-dev cfortran comerr-dev debhelper gettext gfortran
  gfortran-4.4 html2text intltool-debian krb5-config krb5-multidev krb5-user
  libcurl4-gnutls-dev libdrm-dev libexpat1-dev libfftw3-dev libfontconfig1-dev
  libfreetype6-dev libftgl-dev libftgl2 libgcrypt11-dev libgif-dev
  libgl1-mesa-dev libglu1-mesa-dev libgnutls-dev libgpg-error-dev libgsl0-dev
  libgssrpc4 libice-dev libidn11-dev libiodbc2 libiodbc2-dev libjpeg62-dev
  libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libkernlib1-dev
  libkernlib1-gfortran libkms1 libkrb5-dev libldap2-dev libmail-sendmail-perl
  libmysqlclient-dev libpacklib1-dev libpacklib1-gfortran libpcre3-dev
  libpcrecpp0 libpng12-dev libpq-dev libpq5 libpthread-stubs0
  libpthread-stubs0-dev libqt4-declarative libqt4-dev libqt4-opengl
  libqt4-opengl-dev libqt4-sql-sqlite libqtwebkit-dev libsm-dev libssl-dev
  libsys-hostname-long-perl libtasn1-3-dev libtiff4-dev libtiffxx0c2
  libunistring0 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev
  libxft-dev libxinerama-dev libxml2-dev libxmlrpc-c3 libxmlrpc-c3-dev
  libxmlrpc-core-c3 libxmlrpc-core-c3-dev libxpm-dev libxrender-dev
  mesa-common-dev po-debconf python-dev python2.6-dev qt4-designer
  qt4-dev-tools qt4-doc qt4-qmake ruby1.8-dev x11proto-core-dev
  x11proto-input-dev x11proto-kb-dev x11proto-render-dev x11proto-xext-dev
  x11proto-xinerama-dev xtrans-dev zlib1g-dev

root-5.28.00a_debian2.txt (8.85 KB)

Great! I will try it again on Debian Squeeze Linux amd64 tomorrow.

I tried your patch with 5.28.00b and failed while doing “make debian”:

==> lib/libMinuit2.so done
make[2]: Leaving directory `/home/exaos/Downloads/tmp/root-5.28.00b'
make[1]: *** [build-arch-stamp] Error 2
make[1]: Leaving directory `/home/exaos/Downloads/tmp/root-5.28.00b'
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Busy on experiment now. Maybe I will check the error and try again later.

Unfortunately, I have not tried to build 5.28.00b.

The actual error was much more earlier. Probably
fakeroot dpkg-buildpackage -b -nc
will get you a clue. ‘-nc’ means no clean and should be used with care.
Often a clean build required when all errors are fixed.

I just have checked the patch with 5.28.00b.
The build have successfully finished. The only file
that should be updated is debian/changelog
otherwise the debs will be named as 5.28.00a.

Did you unpack unuran? I failed to track why make
refuses to do this itself.

I’ve successfully built 5.28.00b. I’m using the attached script for unattended build of ROOT with Nikulin’s patch.
build.txt (1.77 KB)