#!/bin/bash # This script builds debian ROOT packages from the tarball. # A patch is apllied before build. # Usage build.sh root_v5.28.00b.source.tar.gz #Configuration TAR=$1 shift #End of configuration VERSION="$TAR" VERSION=`basename $VERSION .source.tar.gz` VERSION=`echo $VERSION | sed 's/root_v//'` #Nikulin's patch http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=12352#p53363 PATCH=`dirname "$TAR"`root-${VERSION}_debian.patch TARDIR=`dirname "$TAR"` for i in {$TARDIR,/tmp,}root-${VERSION}_debian.patch {$TARDIR,/tmp,}root-5.28.00a_debian2.txt ; do test -f "$i" && PATCH="$i" && break done if \! test -f $PATCH ; then echo No patch in $PATCH fi overwrite() { file=$1 shift name=`basename $file` tmpfile=/tmp/$name cp $file $tmpfile $@ /tmp/$name > $file } cd /tmp || exit 1 TEMP=/tmp/root-$VERSION rm -r /tmp/root $TEMP tar -xf $TAR || exit 2 mv root $TEMP || exit 3 cd $TEMP #diff -u build/package/debian/rules ~/computers/root/rules #cp ~/computers/root/rules build/package/debian/ #Makefile won't unpack unuran for unknown reason pushd math/unuran/src/ tar xvfz unuran-1.8.0-root.tar.gz popd #Apllying Nikulin's patch cp build/package/debian/rules{,.orig} patch -p1 < $PATCH #Mathmore won't compile on my host. Gulevich overwrite build/package/debian/rules grep -v mathmore diff -u build/package/debian/rules{.orig,} #A bug with ftgl dependencies was in my way. Gulevich. #rm -r graf3d/ftgl for i in `seq 1 100` ; do ls /tmp gulevichChange() { cat < Fri, 22 Apr 2011 14:03:00 +0600 EOF cat $@ } overwrite build/package/debian/changelog gulevichChange LANG=C ROOT_SRCDIR=`pwd` nohup make debian & sleep 1 tail -f nohup.out