summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Hardy2016-04-11 21:25:37 +1000
committerJoshua Hardy2016-04-11 21:25:37 +1000
commitda46ed4584c8cbd66d849591caa4ddc0de47a29c (patch)
tree8a84257ed415d6211cb500a06334ce810d6892fe
parent2df2d2a3d0d8125ca1df267384b76ebc92090c6e (diff)
downloadaur-da46ed4584c8cbd66d849591caa4ddc0de47a29c.tar.gz
fixed python file headers
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD14
-rwxr-xr-xeman2-installer129
-rw-r--r--eman2.sh2
4 files changed, 144 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a0ac8e29275..659b726fb25 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -8,8 +8,10 @@ pkgbase = eman2
options = !strip
source = http://ncmi.bcm.edu/ncmi/software/counter_222/software_133/manage_addProduct/NCMI/attendee_factory/eman2.12.linux64.tar.gz
source = eman2.sh
+ source = eman2-installer
md5sums = 2e21b310c957fc3b21f8c6b551b60fdb
md5sums = SKIP
+ md5sums = SKIP
pkgname = eman2
diff --git a/PKGBUILD b/PKGBUILD
index e51fdfd1823..50f466882ad 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,12 +13,22 @@ url="http://blake.bcm.edu/emanwiki/EMAN2"
license=('GPL')
depends=()
source=("http://ncmi.bcm.edu/ncmi/software/counter_222/software_133/manage_addProduct/NCMI/attendee_factory/eman$pkgver.linux64.tar.gz"
-'eman2.sh')
-md5sums=('2e21b310c957fc3b21f8c6b551b60fdb' 'SKIP')
+'eman2.sh' 'eman2-installer')
+md5sums=('2e21b310c957fc3b21f8c6b551b60fdb' 'SKIP' 'SKIP')
options=(!strip)
+prepare () {
+ cd "$srcdir/EMAN2"
+ rm eman2-installer
+ cp ../eman2-installer .
+}
build() {
cd "$srcdir/EMAN2"
+# sed -e 's,export EMAN2DIR=`pwd`,export EMAN2DIR=/opt/eman2,' $srcdir/EMAN2/eman2-installer >
+#$srcdir/EMAN2/eman2-installer.tmp
+# mv $srcdir/EMAN2/eman2-installer.tmp $srcdir/EMAN2/eman2-installer
+# chmod +x eman2-installer
+# EMAN2DIR=pwd
./eman2-installer
}
diff --git a/eman2-installer b/eman2-installer
new file mode 100755
index 00000000000..8254f718122
--- /dev/null
+++ b/eman2-installer
@@ -0,0 +1,129 @@
+#!/bin/bash
+
+# Purpose: Assist to install eman2 binary release.
+# Usage: eman2-installer
+# Date: 9/1/2004, by Liwei Peng
+# Date: 10/25/2007, modified by Grant Tang for EMAN2
+# Date: 1/28/2009, modified by Grant Tang for EMAN2 Pythn2.6
+# Date: 2/12/2009, change back to Python 2.5.4, Grant Tang
+# Date: 9/1/2009, --disable_cache, Grant Tang
+# Date: 6/30/2013, Significant updates by Ian Rees for new build system.
+# Date: 8/01/2013, changed disable_cache to disable_gui
+
+usage()
+{
+ echo "usage: `basename $0` [--disable_gui]"
+ echo " --disable_gui: no GUI"
+ exit 0
+}
+
+setup_shell() {
+ # Setup bashrc or cshrc
+ MYSHELL=`basename ${SHELL}`
+ RCFILE=""
+ if test ${MYSHELL} = "tcsh" || test ${MYSHELL} = "csh"; then
+ RCFILE=".cshrc"
+ setup_csh ${EMAN2DIR}/eman2${RCFILE}
+ elif test ${MYSHELL} = "bash" || test ${MYSHELL} = "sh"; then
+ RCFILE=".bashrc"
+ setup_bash ${EMAN2DIR}/eman2$RCFILE
+ elif test ${MYSHELL} = "zsh"; then
+ RCFILE=".zshrc"
+ setup_bash ${EMAN2DIR}/eman2$RCFILE
+ else
+ echo "Unkown shell. You will need set up your enviroment variables manually."
+ fi
+ if test "X${RCFILE}" != "X"; then
+ echo "Please add the following line to the end of your ${HOME}/${RCFILE} :"
+ echo "source ${EMAN2DIR}/eman2${RCFILE}"
+ fi
+}
+
+setup_csh() {
+ OUT=$1
+ echo "setenv EMAN2DIR ${EMAN2DIR}" > ${OUT}
+ echo 'setenv PATH ${EMAN2DIR}/bin:${EMAN2DIR}/extlib/bin:${PATH}' >> ${OUT}
+ echo 'if ($?PYTHONPATH == 0) then' >> ${OUT}
+ echo ' setenv PYTHONPATH ${EMAN2DIR}/lib:${EMAN2DIR}/bin' >> ${OUT}
+ echo 'else' >> ${OUT}
+ echo ' setenv PYTHONPATH ${EMAN2DIR}/lib:${EMAN2DIR}/bin:${PYTHONPATH}' >> ${OUT}
+ echo 'endif' >> ${OUT}
+ echo 'alias sparx sx.py' >> ${OUT}
+ echo "setenv LC_CTYPE=en_US.utf8"
+ echo "setenv LC_ALL=en_US.utf8"
+}
+
+setup_bash()
+{
+ OUT=$1
+ echo "export EMAN2DIR=${EMAN2DIR}" > ${OUT}
+ echo 'export PATH=${EMAN2DIR}/bin:${EMAN2DIR}/extlib/bin:$PATH' >> ${OUT}
+ echo 'export PYTHONPATH=${EMAN2DIR}/lib:${EMAN2DIR}/bin:${PYTHONPATH}' >> ${OUT}
+ echo 'export LC_CTYPE=en_US.utf8'
+ echo 'export LC_ALL=en_US.utf8'
+ echo 'alias sparx=sx.py' >> ${OUT}
+}
+
+setup_python()
+{
+ EMAN2PYTHON=$1
+ # Update python interpreter
+ find ${EMAN2DIR}/extlib/bin -name "ipython" \
+ -exec sed -i "s%^\#\!.*python.*$%\#\!/opt/eman2/extlib/bin/python%" {} \;
+ find ${EMAN2DIR}/test ${EMAN2DIR}/bin ${EMAN2DIR}/lib ${EMAN2DIR}/examples -name "*.py" \
+ -exec sed -i "s%^\#\!.*python.*$%\#\!/opt/eman2/extlib/bin/python%" {} \;
+ find ${EMAN2DIR}/test ${EMAN2DIR}/bin ${EMAN2DIR}/lib ${EMAN2DIR}/examples -name "*.py" \
+ -exec chmod a+x {} \;
+ # ... and for SPARX
+ # sed -i "s%^\#\!.*python.*$%\#\!${EMAN2PYTHON}%" ${EMAN2DIR}/bin/sparx
+}
+
+disable_cache()
+{
+ cd ${EMAN2DIR}/lib
+ echo "start substituting..."
+ mv global_def.py global_def.py.bak
+ sed -e 's/CACHE_DISABLE = False/CACHE_DISABLE = True/' global_def.py.bak > global_def.py
+ rm -f global_def.py.bak
+ cd ${EMAN2DIR}/bin
+ mv sx_real.py sx_real.py.bak
+ sed -e 's/GUIUSE = True/GUIUSE = False/' sx_real.py.bak > sx_real.py
+ rm -f sx_real.py.bak
+ cd ${EMAN2DIR}
+}
+
+main()
+{
+ # Use the run directory as the EMAN2DIR.
+ export EMAN2DIR=`pwd`
+ export EMAN2PYTHON=${EMAN2DIR}/extlib/bin/python
+
+ # Setup the Python interpreter
+ if [ -f $EMAN2PYTHON ]
+ then
+ setup_python $EMAN2PYTHON
+ fi
+
+ # Setup bashrc or cshrc
+ setup_shell
+
+ # This is for Fedora Linux's SELinux limitation on shared libraries
+ cd ${EMAN2DIR}/lib
+ if [ -x /usr/bin/chcon ]; then
+ chcon -t texrel_shlib_t *.so 2>/dev/null >/dev/null
+ fi
+ cd ${EMAN2DIR}
+
+ # # This is for Pawel's cluster working
+ local value1=$1
+ if [[ "${value1}" = "--disable_gui" ]]; then
+ disable_cache
+ fi
+
+ #for mpi_eman compilation
+ # cd ${EMAN2DIR}/mpi_eman
+ # sed -i 's,/usr/include/python2.6,${EMAN2DIR}/Python/include/python2.7,g' Makefile.*
+}
+
+main $1
+exit 0
diff --git a/eman2.sh b/eman2.sh
index 3ad2f0523e1..a2b8e8eda9f 100644
--- a/eman2.sh
+++ b/eman2.sh
@@ -1,4 +1,4 @@
-source /opt/eman2/eman2.bashrc
+#source /opt/eman2/eman2.bashrc
export EMAN2DIR=/opt/eman2
export PATH=$PATH:${EMAN2DIR}/bin:${EMAN2DIR}/extlib/bin
export PYTHONPATH=${PYTHONPATH}:${EMAN2DIR}/lib:${EMAN2DIR}/bin