6 pkgdesc="Lund Monte Carlo high-energy physics event generator"
8 url="http://home.thep.lu.se/~torbjorn/Pythia.html"
11 install=(pythia8.install)
12 source=("http://home.thep.lu.se/~torbjorn/pythia8/${pkgname}${pkgver}.tgz")
13 md5sums=("96af2f9e52baee749647b005851b356f")
16 cd "$startdir/src/${pkgname}${pkgver}"
17 #Change some directories
18 mkdir -p include/pythia8
19 mv include/*.h include/pythia8/
20 sed -i -e "s:INCDIR=include:INCDIR=include/pythia8:g" Makefile ||return 1
21 sed -i -e "s:LIBDIR=lib:LIBDIR=lib/pythia8:g" Makefile || return 1
22 sed -i -e "s:LIBDIRARCH=lib/archive:LIBDIRARCH=lib/pythia8/archive:g" Makefile ||return 1
24 ./configure --with-hepmc=/usr/local --with-hepmcversion=2 --lcgplatform=Linux-gcc4 --enable-shared
26 #Change the build parameter
27 sed -i -e "s:-O2:-O3:g" config.mk || return 1
32 SRCDIR=$startdir/src/${pkgname}${pkgver}
35 LIBDIR=${startdir}/pkg/${INSDIR}/lib
36 INCLUDEDIR=${startdir}/pkg/${INSDIR}/include
37 [ -d $INCLUDEDIR ] || mkdir -p $INCLUDEDIR
38 [ -d $LIBDIR ] || mkdir -p $LIBDIR
39 cp -r ${SRCDIR}/lib/* $LIBDIR/ || die "lib install failed"
40 cp -r ${SRCDIR}/include/* $INCLUDEDIR/ || die "headers install failed"
43 DOCDIR=${startdir}/pkg/${INSDIR}/doc/pythia8
44 [ -d $DOCDIR ] || mkdir -p $DOCDIR
46 cp -r ${SRCDIR}/xmldoc $DOCDIR/ || die "xmldoc install failed"
47 cp -r ${SRCDIR}/htmldoc $DOCDIR/ || die "htmldoc install failed"
48 cp -r ${SRCDIR}/phpdoc $DOCDIR/ || die "phpdoc install failed"
51 EXAMPLEDIR=${startdir}/pkg/${INSDIR}/examples/pythia8
52 [ -d $EXAMPLEDIR ] || mkdir -p $EXAMPLEDIR/bin
53 cp -r ${SRCDIR}/examples/* $EXAMPLEDIR/ || die "examples install failed"
55 ###Modify the Makefile in the examples directory####
57 cp $SRCDIR/config.mk ./config.mk.orig
58 sed -i -e "s:-include \.\./config\.mk:-include config\.mk\.orig:" Makefile || return 1
59 sed -i -e "s:\.\.:$INSDIR:g" Makefile || return 1
60 sed -i -e "s:INCDIR=include:INCDIR=include/pythia8:" Makefile ||return 1
61 sed -i -e "s:LIBDIR=lib:LIBDIR=lib/pythia8:" Makefile || return 1
62 sed -i -e "s:LIBDIRARCH=lib/archive:LIBDIRARCH=lib/pythia8/archive:" Makefile ||return 1
63 sed -i -e "s:-o /usr/local:-o .:" Makefile || return 1
66 ###Modify the mainNN.cc files in the examples directory so as the program can find the xmldoc###
70 sed -i -e "s:Pythia pythia\;:Pythia pythia\(\"$INSDIR/doc/pythia8/xmldoc\"\)\;:" $i || echo "Failed"