aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-02-22 14:33:46 +0100
committerThomas White <taw@physics.org>2022-03-01 15:27:14 +0100
commit4512983699dbb31e7852695b59199d58c945e4b9 (patch)
treefe918ee261121b305b6a63ac75915395c9c4d6fb /scripts
parent3619f7952b1ed46d9cc0b075d1996b4bf5388a0c (diff)
Add scripts/install-indexers
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-indexers93
1 files changed, 93 insertions, 0 deletions
diff --git a/scripts/install-indexers b/scripts/install-indexers
new file mode 100755
index 00000000..553ab14a
--- /dev/null
+++ b/scripts/install-indexers
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+# Set the installation location here
+# Executables will be placed in $CFPREFIX/bin
+CFPREFIX=/usr
+
+# Set the location of syminfo.lib here
+SYMINFO=/usr/share/ccp4/syminfo.lib
+
+if [ x$1 == x--help ]; then
+ echo 'This script downloads and installs Mosflm, DirAx and XDS'
+ echo
+ echo Step 1: $0
+ echo Step 2: $0 'install ' \# perhaps with sudo
+ echo
+ echo ' Installation location:' $CFPREFIX
+ echo 'CCP4 syminfo.lib location:' $SYMINFO
+ echo
+ echo 'Please note the license conditions for each program:'
+ echo ' DirAx: http://www.crystal.chem.uu.nl/distr/dirax/'
+ echo ' Mosflm: https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/'
+ echo ' XDS: https://xds.mr.mpg.de/'
+ exit 0
+fi
+
+if [ ! -f $SYMINFO ]; then
+ echo Cannot find SYMINFO file at $SYMINFO
+ echo -n You need to install libCCP4
+ echo ' (separately, or as part of the CrystFEL installation process)'
+ echo Or, edit the script to set the correct location
+ exit 1
+fi
+
+# Exit immediately if something doesn't work
+set -e
+
+if [ x$1 != xinstall ]; then
+
+ if [ x$USER == xroot ]; then
+ echo Do not run this as root
+ exit 1
+ fi
+
+ echo ' Installation location:' $CFPREFIX
+ echo 'CCP4 syminfo.lib location:' $SYMINFO
+ echo
+
+ mkdir mosflm-tempdir
+ pushd mosflm-tempdir
+ wget -nv https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/ver740/pre-built/mosflm-linux-64-noX11.zip
+ unzip mosflm-linux-64-noX11.zip
+ echo '#!/bin/sh' > mosflm
+ echo "export SYMINFO=$SYMINFO" >> mosflm
+ echo "$CFPREFIX/bin/mosflm.real -n \$@" >> mosflm
+ chmod +x mosflm
+ popd
+
+ mkdir dirax-tempdir
+ pushd dirax-tempdir
+ wget -nv http://www.crystal.chem.uu.nl/distr/dirax/download/dirax1.17-Linux-x86_64-static.tar.Z
+ set +e
+ tar -xZf dirax1.17-Linux-x86_64-static.tar.Z
+ if [ $? != 0 ]; then
+ echo You might need to install package \'ncompress\'
+ exit 1
+ fi
+ set -e
+ mv dirax dirax.real
+ echo "#!/bin/sh" > dirax
+ echo "exec $CFPREFIX/bin/dirax.real \"\$@\"" >> dirax
+ chmod +x dirax
+ popd
+
+ mkdir xds-tempdir
+ pushd xds-tempdir
+ wget -nv https://xds.mr.mpg.de/XDS-INTEL64_Linux_x86_64.tar.gz
+ tar -xzf XDS-INTEL64_Linux_x86_64.tar.gz
+ popd
+
+else
+
+ if [ ! -f mosflm-tempdir/mosflm-linux-64-noX11 ]; then
+ echo Run this script without \'install\' first
+ exit 1
+ fi
+ set -x
+ install -D mosflm-tempdir/mosflm-linux-64-noX11 $CFPREFIX/bin/mosflm.real
+ install mosflm-tempdir/mosflm $CFPREFIX/bin/mosflm
+ install dirax-tempdir/dirax dirax-tempdir/dirax.real $CFPREFIX/bin
+ install --mode=644 dirax-tempdir/dirax.commands $CFPREFIX/bin
+ install xds-tempdir/XDS-INTEL64_Linux_x86_64/xds $CFPREFIX/bin/xds
+
+fi