updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / geant4-deb / PKGBUILD
blob717932e010027ea9a3d9aab8d95d141a632bf08e
1 # Maintainer: Yngve Inntjore Levinsen <yngve.inntjore.levinsen@cern.ch>
4 pkgname=geant4-deb
5 _pkgname=geant4
6 pkgver=4.9.4.p02.1
7 _pkgver=4.9.4.p02-1
8 pkgrel=1
9 _clhepver=2.1.0.1
10 _sover=7
12 # geant4 must be linked against a specific clhep version!
13 conflicts=('geant4')
14 provides=('geant4')
15 pkgdesc=""
17 makedepends=('deb2targz' 'tar')
18 optdepends=('gnuplot: Plotting functionality' 'root: Analytical framework' 'dawn: Tool to display geometry' 'gv: Postscript viewer' 'cernlib: PAW support and/or g3tog4 support?')
19 depends=('libx11' 'libxcb' 'glibc' 'zlib' 'libgl' 'libxaw' 'lesstif' 'libxmu' 'xerces-c-2' "clhep==${_clhepver}")
20 arch=('x86_64' 'i686')
21 license=('http://geant4.web.cern.ch/geant4/license/')
22 url="http://cern.ch/geant4"
23 if [ "${CARCH}" = "x86_64" ]; then
24     md5sums=('14298e7e873f13b00a44d254808d5483'
25              '6bf986f99c03e9fb25bffb017c0f7f5e'
26              '27b554584c05cfe9392db6f5cdad3ad2'
27              'c2a8b43101f72398e8b252c5f84dfb62'
28              '8c7db86cd12fb4024ec661fb40404402'
29              '76c667fbbdb69167221831fb4f603a50'
30              'db9c22c4904b5152f495f3e6a96c9123'
31              '6f15e44025a59a8288c9b3c401562bf9'
32              '32a27a3e6685c56a6331bc8ec14f023e'
33              'da86ae4e93946c6f033e2b0a9d763678'
34              '7e14ea893368ea48a1ee9b7e37fa9846')
35     _carch=amd64
36     source=(
37       ${_pkgname}-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}_${_pkgver}_all.deb"
38       ${_pkgname}-common-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}-common_${_pkgver}_all.deb"
39       ${_pkgname}-headers-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}-headers_${_pkgver}_all.deb"
40       ${_pkgname}-examples-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}-examples_${_pkgver}_all.deb"
41       lib${_pkgname}-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-4.9-${_sover}_${_pkgver}_${_carch}.deb"
42       lib${_pkgname}-dev-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-dev_${_pkgver}_${_carch}.deb"
43       lib${_pkgname}-plists-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-plists-4.9-${_sover}_${_pkgver}_${_carch}.deb"
44       lib${_pkgname}-plists-dev-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-plists-dev_${_pkgver}_${_carch}.deb"
45       libg4opengl-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/libg4opengl-4.9-${_sover}_${_pkgver}_${_carch}.deb"
46       libg4opengl-dev-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/libg4opengl-dev_${_pkgver}_${_carch}.deb"
47       install-geant4-data.conf
48     )
49 elif [ "${CARCH}" = "i686" ]
50 then
51     pkgver=4.9.3.p01.1
52     _pkgver=4.9.3.p01-1
53     pkgrel=1
54     _sover=6
55     
56     # geant4 must be linked against a specific clhep version!
57     _clhepver=2.0.4.7
58     _clhepdebver=2.0.4.7-1
59     conflicts=('clhep' 'geant4')
60     provides=("clhep=${_clhepver}" 'geant4')
61     md5sums=('e75559767a2853a9b5d78a01e650411e'
62              '9b6c7eb7c6d61ce44078da05d5ace990'
63              '4630912b84ef7a4e20e687511ca877e9'
64              '9b282b6eb96fc8b12b30addc5d085d89'
65              '6bdf49f56dcc422f3057e43e10d1149f'
66              'd6ebbccee4d1c038763403e38e3c1d15'
67              '8dd578596d47289b62483b4b24607056'
68              '82411866587d7a2a38af7fb8b1428444'
69              '4053d3b997e4c39ff4c18e664819ab2a'
70              'b4fdbdd4ee29d997122557b39a5fec2b'
71              '768704ab6bdb407e6249485b98881b26'
72              'a62a7bb8f06ef8d0052ddc9bca40abbf'
73              '7e14ea893368ea48a1ee9b7e37fa9846')
74      _carch=i386
75     source=(
76       ${_pkgname}-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}_${_pkgver}_all.deb"
77       ${_pkgname}-common-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}-common_${_pkgver}_all.deb"
78       ${_pkgname}-headers-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}-headers_${_pkgver}_all.deb"
79       ${_pkgname}-examples-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/${_pkgname}-examples_${_pkgver}_all.deb"
80       lib${_pkgname}-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-4.9-${_sover}_${_pkgver}_${_carch}.deb"
81       lib${_pkgname}-dev-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-dev_${_pkgver}_${_carch}.deb"
82       lib${_pkgname}-plists-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-plists-4.9-${_sover}_${_pkgver}_${_carch}.deb"
83       lib${_pkgname}-plists-dev-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/lib${_pkgname}-plists-dev_${_pkgver}_${_carch}.deb"
84       libg4opengl-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/libg4opengl-4.9-${_sover}_${_pkgver}_${_carch}.deb"
85       libg4opengl-dev-$pkgver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/g/${_pkgname}/libg4opengl-dev_${_pkgver}_${_carch}.deb"
86     # Use this if the clhep version in aur is not the same as required for geant4:
87        clhep-$_clhepver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/c/clhep2/clhep2_${_clhepdebver}_${_carch}.deb"
88        clhep-dev-$_clhepver.deb::"http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/pool/hep/c/clhep2/clhep2-dev_${_clhepdebver}_${_carch}.deb"
89        install-geant4-data.conf
90     )
94 build() {
95    install -d ${pkgdir}/usr/share/licenses/${pkgname}
96    
97    deb2targz geant4-$pkgver.deb > /dev/null
98    deb2targz geant4-common-$pkgver.deb > /dev/null
99    deb2targz geant4-headers-$pkgver.deb > /dev/null
100    deb2targz geant4-examples-$pkgver.deb > /dev/null
101    deb2targz libgeant4-$pkgver.deb > /dev/null
102    deb2targz libgeant4-dev-$pkgver.deb > /dev/null
103    deb2targz libgeant4-plists-$pkgver.deb > /dev/null
104    deb2targz libgeant4-plists-dev-$pkgver.deb > /dev/null
105    deb2targz libg4opengl-$pkgver.deb > /dev/null
106    deb2targz libg4opengl-dev-$pkgver.deb > /dev/null
107    deb2targz libg4opengl-$pkgver.deb > /dev/null
108    deb2targz libg4opengl-dev-$pkgver.deb > /dev/null
109    tar -xzf geant4-$pkgver.tar.gz
110    tar -xzf geant4-common-$pkgver.tar.gz
111    tar -xzf geant4-headers-$pkgver.tar.gz
112    tar -xzf geant4-examples-$pkgver.tar.gz
113    tar -xzf libgeant4-$pkgver.tar.gz
114    tar -xzf libgeant4-dev-$pkgver.tar.gz
115    tar -xzf libgeant4-plists-$pkgver.tar.gz
116    tar -xzf libgeant4-plists-dev-$pkgver.tar.gz
117    tar -xzf libg4opengl-$pkgver.tar.gz
118    tar -xzf libg4opengl-dev-$pkgver.tar.gz
120    if [ "$CARCH" == "i686" ]
121    then
122        #adding clhep:
123        msg "Adding CLHEP ${CARCH}"
124        deb2targz clhep-$_clhepver.deb
125        deb2targz clhep-dev-$_clhepver.deb
126        tar -xzf clhep-$_clhepver.tar.gz
127        tar -xzf clhep-dev-$_clhepver.tar.gz
128    fi
130    cp -r usr/ ${pkgdir}/
131    cp -r etc/ ${pkgdir}/
132    install -D -m644 usr/share/doc/geant4/copyright ${pkgdir}/usr/share/licenses/${pkgname}/
133    if [ "$CARCH" == "i686" ] # already updated in x86_64 package
134    then
135         msg "Updating datafiles versions"
136         rm ${pkgdir}/etc/install-geant4-data.conf
137         install -D -m644 install-geant4-data.conf ${pkgdir}/etc/install-geant4-data.conf
138    fi
139   }
141 post_install() {
142   msg "This install of Geant4 does not set up the environment variables."
143   msg "Instead, it has installed three scripts, g4make, g4run, and g4env"
144   msg "In order to compile a Geant4 project, use the command 'g4make'"
145   msg "In order to run a Geant4 project, use 'g4run <executable>'"
146   msg "In order to view your current environment setting, use 'g4run g4env'"