source: main/trunk/greenstone2/makegs2.sh@ 32003

Last change on this file since 32003 was 32003, checked in by ak19, 7 years ago

GS2 compile script will now grab imagemagick if passed in imagemagick as the 2nd parameter

  • Property svn:executable set to *
File size: 3.0 KB
Line 
1#!/bin/bash
2
3# run as: ./makegs2.sh
4# or ./makegs2.sh gnome-lib to compile GS2 using gnome-lib
5# which checks out gnome-lib src from svn if needed and if possible
6
7docheckout=$1
8getimagick=$2
9gsdlhome=`pwd`
10echo "**** GSDLHOME: $gsdlhome"
11
12bitness=`uname -m`
13# if we're 64 bit, add -fPIC to CFLAGS. Check if bitness contains substring "64"
14if [[ $bitness == *"64"* ]]; then
15 export CFLAGS="-fPIC $CFLAGS"
16 echo "64 bit unix system, incl -fPIC in CFLAGS so it is now: $CFLAGS"
17fi
18
19# Compile by chaining the commands with && so it stops at that stage after an error
20cd $gsdlhome
21if [ "x$docheckout" = "xgnome-lib" ]; then
22 ./configure --enable-gnome-lib-ext --enable-apache-httpd \
23 && make \
24 && make install
25else
26 ./configure --enable-apache-httpd \
27 && make \
28 && make install
29fi
30
31status=$?
32echo "****************************************"
33if [ $status = 0 ] ; then
34 # 5. Message to warn user that the env of this x-term uses gnome-lib
35 # and GUIs may not work from this console
36 if [ "x$docheckout" = "xgnome-lib" ]; then
37 echo "*** The environment for this console has been set to compile Greenstone with gnome-lib."
38 echo "*** As a result, graphical applications may not work well."
39 echo "*** In such a case, open a new console."
40 else
41 echo "Finished compiling Greenstone2. (Compiled without gnome-lib)"
42 fi
43else
44 echo "@@@ Error compiling up Greenstone. Return status: $status"
45fi
46if [[ $bitness == *"64"* ]]; then
47 echo ""
48 echo "This unix is 64 bit. So added -fPIC to CFLAGS, which is now: $CFLAGS"
49fi
50echo "****************************************"
51
52
53imgpkg=
54if [ "x$getimagick" = "ximagemagick" ]; then
55 os=`uname`
56
57 if [ "x$os" = "xDarwin" ]; then
58 # by default, resort to the Mac Leopard (10.5, kernel 12.6.0)'s imagemagick binary
59 imgpkg=http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz
60
61 kernelVersion=`uname -r`
62 # El Capitan is MacOS version 10.11 but its kernelVersion is 15.6.0
63 if [ "x$kernelVersion" = "x15.6.0" ]; then
64 echo "Getting imagemagick built for El Capitan"
65 imgpkg=http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.11.tar.gz
66 else
67 echo "Getting imagemagick built on Mac Leopard"
68 fi
69
70 pushd ext
71 curl $imgpkg > imagemagick.tar.gz
72 tar -xvzf imagemagick.tar.gz
73 mv imagemagick/darwin ../bin/darwin/imagemagick
74 popd
75
76 else
77 # linux
78 pushd ext
79 if [[ $bitness == *"64"* ]]; then
80 echo "Getting 64 bit imagemagick precompiled binary"
81 wget http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-linux-x64.tar.gz
82 tar -xvzf imagemagick-linux-x64.tar.gz
83 else
84 echo "Getting 32 bit imagemagick precompiled binary"
85 wget http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-linux.tar.gz
86 tar -xvzf imagemagick-linux.tar.gz
87 fi
88
89 mv imagemagick/linux ../bin/linux/imagemagick
90 popd
91 fi
92
93fi
Note: See TracBrowser for help on using the repository browser.