summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD26
-rw-r--r--geant4-neutronxsdata.install35
3 files changed, 77 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..a5d563a09db
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = geant4-neutronxsdata
+ pkgdesc = Data files for evaluated neutron cross-sections on natural composition of elements
+ pkgver = 1.4
+ pkgrel = 1
+ url = http://geant4.cern.ch/
+ install = geant4-neutronxsdata.install
+ arch = any
+ license = GPL
+ depends = geant4>=10.0.0
+ source = http://geant4.cern.ch/support/source/G4NEUTRONXS.1.4.tar.gz
+ source = geant4-neutronxsdata.install
+ md5sums = 665a12771267e3b31a08c622ba1238a7
+ md5sums = 1c2baf49b8d69cde060d1538e70717fb
+
+pkgname = geant4-neutronxsdata
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..aa3e22a28d4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,26 @@
+# Maintainer: L.G. Sarmiento (Pico) <Luis.Sarmientop-ala-nuclear.lu.se>
+pkgname=geant4-neutronxsdata
+_dataname="G4NEUTRONXS"
+pkgver=1.4
+pkgrel=1
+pkgdesc="Data files for evaluated neutron cross-sections on natural composition of elements"
+url="http://geant4.cern.ch/"
+arch=('any')
+license=('GPL')
+depends=('geant4>=10.0.0')
+#it cannot be optdepend since we require the geant4.sh file to exist
+#to setup the environment variable
+install="${pkgname}.install"
+source=("http://geant4.cern.ch/support/source/${_dataname}.${pkgver}.tar.gz"
+ "${pkgname}.install")
+md5sums=('665a12771267e3b31a08c622ba1238a7'
+ '1c2baf49b8d69cde060d1538e70717fb')
+
+## Remove this if you want to keep an even smaller package
+## No need to wait for compression when just installing it.
+PKGEXT='.pkg.tar'
+
+package() {
+ install -d ${pkgdir}/usr/share/${pkgname}
+ mv ${srcdir}/${_dataname}${pkgver} ${pkgdir}/usr/share/${pkgname}
+}
diff --git a/geant4-neutronxsdata.install b/geant4-neutronxsdata.install
new file mode 100644
index 00000000000..ce0a32daf2e
--- /dev/null
+++ b/geant4-neutronxsdata.install
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+_varname='G4NEUTRONXSDATA'
+_packagename='geant4-neutronxsdata'
+_foldername='G4NEUTRONXS'
+_dataversion=1.4
+
+_add() {
+ echo "export ${_varname}=/usr/share/${_packagename}/${_foldername}${_dataversion}" >> /etc/profile.d/geant4.sh
+ echo "setenv ${_varname} /usr/share/${_packagename}/${_foldername}${_dataversion}" >> /etc/profile.d/geant4.csh
+}
+
+_remove() {
+ sed -i "/${_varname}/d" /etc/profile.d/geant4.sh
+ sed -i "/${_varname}/d" /etc/profile.d/geant4.csh
+}
+
+pre_install() {
+ _remove
+}
+post_install() {
+ _add
+}
+pre_upgrade() {
+ _remove
+}
+post_upgrade() {
+ _add
+}
+pre_remove() {
+ _remove
+}
+post_remove() {
+ _remove
+}