summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMirko Scholz2018-09-16 11:39:14 +0200
committerMirko Scholz2018-09-16 11:39:14 +0200
commit0d89fe5585d6505ced8a91204d2b3c49dfe77166 (patch)
treeb91e271cb2a35d356e2cc907098beeae789d5a6f
downloadaur-0d89fe5585d6505ced8a91204d2b3c49dfe77166.tar.gz
initial commit
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD71
2 files changed, 88 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5ac38d74de77
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = ccdc-mercury
+ pkgdesc = Crystal Structure Visualisation, Exploration and Analysis Made Easy
+ pkgver = 3.10.3
+ pkgrel = 4
+ url = https://www.ccdc.cam.ac.uk/solutions/csd-system/components/mercury/
+ arch = x86_64
+ license = unknown
+ makedepends = fakechroot
+ depends = glib2
+ depends = opengl-driver
+ depends = libx11
+ options = !strip
+ source = https://downloads.ccdc.cam.ac.uk/Mercury/3.10.3/mercurystandalone-3.10.3-linux-x64-installer.run
+ sha256sums = ca745dca5db7e4310da60266346f1c24709b9dfc87be3114a60c5e15ce802830
+
+pkgname = ccdc-mercury
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a6abd9abd915
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,71 @@
+# Maintainer: Mirko Scholz
+
+pkgname=ccdc-mercury
+pkgver=3.10.3
+pkgrel=4
+pkgdesc="Crystal Structure Visualisation, Exploration and Analysis Made Easy"
+arch=(x86_64)
+url="https://www.ccdc.cam.ac.uk/solutions/csd-system/components/mercury/"
+license=(unknown)
+depends=(glib2 opengl-driver libx11)
+[ "${CARCH}" = "x86_64" ] && depends=("${depends[@]}")
+makedepends=(fakechroot)
+
+_installer="mercurystandalone-${pkgver}-linux-x64-installer.run"
+
+source=("https://downloads.ccdc.cam.ac.uk/Mercury/$pkgver/$_installer")
+
+sha256sums=('ca745dca5db7e4310da60266346f1c24709b9dfc87be3114a60c5e15ce802830')
+
+options=(!strip)
+
+
+prepare()
+{
+ cd $srcdir/
+ chmod +x "$_installer"
+}
+
+package()
+{
+ local _prefix="/opt/Mercury-$pkgver"
+
+ # follows https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=microchip-mplabx-bin
+ mkdir -p "$pkgdir"/{etc,tmp,opt}
+ mkdir -p "$pkgdir"/usr/bin
+ ln -s /usr/bin "$pkgdir"
+ echo "root:x:0:0:root:/root:/bin/bash" > "${pkgdir}/etc/passwd"
+ echo "root:x:0:root" > "${pkgdir}/etc/group"
+ cp --reflink=auto --dereference "$srcdir/$_installer" "$pkgdir/tmp"
+ cat << EOF > "$pkgdir/tmp/install.sh"
+#!/bin/sh
+PATH=/bin
+echo Running Mercury installer...
+"/tmp/$_installer" \
+ --mode unattended \
+ --debuglevel 4 \
+ --materials false \
+ --prefix "$_prefix"
+EOF
+ chmod 0755 "$pkgdir/tmp/install.sh"
+
+ fakechroot chroot "$pkgdir" /tmp/install.sh
+
+ rm -f $pkgdir/$_prefix/autoupdate
+ rm -f $pkgdir/$_prefix/uninstall
+ rm -f $pkgdir/$_prefix/uninstall.dat
+
+ sed -i 's/^check_for_updates *= *1/check_for_updates = 0/' "$pkgdir/$_prefix/update_software.ini"
+ rm -rf "$pkgdir"/{etc,tmp,bin}
+
+ cat << EOF > "$pkgdir/usr/bin/Mercury"
+#!/bin/sh
+exec "$_prefix/bin/mercury" "\$@"
+EOF
+ cat << EOF > "$pkgdir/usr/bin/encifer"
+#!/bin/sh
+exec "$_prefix/bin/encifer" "\$@"
+EOF
+ chmod 0755 "$pkgdir/usr/bin/Mercury" "$pkgdir/usr/bin/encifer"
+
+}