# A RPM packaging of ROOT and Pythia Summary: ROOT for ALICE DAQ Name: root Version: RPM_VERSION Release: 1 License: ROOT Distribution: CERN / PH - AID URL: http://cern.ch/alice-daq Source: %{name}-%{version}.src.tar.gz Group: Applications/Alice Prefix: /opt BuildRoot: %{_tmppath}/%{name}-root # Automatic dependencies AutoReqProv: no BuildRequires: libxml2-devel, libXpm-devel, libXft-devel Provides: root-RPM_VERSION NoSource: 0 # Here is defined the installation root directory %define pkgname %{name}-%{version} %define destdir %{prefix}/%{name}-%{version} # to have debug symbols %define debug_package %{nil} %define __os_install_post %{nil} %description ROOT RPM_VERSION %prep %build echo "asdf" cd ${RPM_BUILD_DIR} rm -rf root root_clone echo "`date` - ROOT GIT_VERSION - svn checkout" git clone http://root.cern.ch/git/root.git root_clone mkdir root cd root_clone git archive tags/GIT_VERSION | tar -xv -C ../root cd ../root # First we need pythia wget ftp://root.cern.ch/root/pythia6.tar.gz tar zxvf pythia6.tar.gz cd pythia6 export PYTHIA6=$PWD ./makePythia6.linuxx8664 cd .. # configure (cmake) # Note that we install in the source folder as we want to package the sources and the libraries export ALIEN_ROOT=/opt/alien export ROOTSYS=${RPM_BUILD_DIR}/root mkdir temp cd temp cmake \ -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \ -Dafs=ON \ -Dgdml=ON \ -Dglobus=ON \ -Dminuit2=ON \ -Dmonalisa=OFF \ -Dqt=ON \ -Dqtgsi=ON \ -Droofit=ON \ -Dsoversion=ON \ -Dtable=ON \ -Dunuran=ON \ -Dbuiltin_freetype=ON \ -DCMAKE_INSTALL_PREFIX=${RPM_BUILD_DIR}/root \ -Dpythia6=ON \ -DPYTHIA6_LIBRARY=${PYTHIA6}/libPythia6.so \ .. # Build make -j4 make install %install # Remove install dir if existing [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{destdir} # Remove the build dir of root plus a few useless things rm -rf ${RPM_BUILD_DIR}/root/temp rm -rf ${RPM_BUILD_DIR}/win* rm -rf ${RPM_BUILD_DIR}/graf2d/win32gdk/gdk/lib/* rm -rf ${RPM_BUILD_DIR}/net/xrootd/src/xrootd/pthreads-win32/lib/* # Copy the root directory cp -rf ${RPM_BUILD_DIR}/root/* ${RPM_BUILD_ROOT}/%{destdir} %files %defattr (-,root,root) %{destdir} %pre %clean # Remove source files rm -rf $RPM_BUILD_DIR/%{pkgname} # remove installed files rm -rf $RPM_BUILD_ROOT %post # Create link when installing or upgrading rm -f /opt/root ln -sf %{destdir} /opt/root echo /opt/root/lib > /etc/ld.so.conf.d/root-x86_64.conf /sbin/ldconfig %postun # Clean up if not in upgrade mode if [ "$1" = "0" ]; then rm /etc/ld.so.conf.d/root-x86_64.conf /sbin/ldconfig rm /opt/root fi