source: main/trunk/greenstone2/runtime-src/packages/security/CASCADE-MAKE.sh@ 28866

Last change on this file since 28866 was 28866, checked in by ak19, 10 years ago

Replacing owasp-esapi-for-c package and dependencies with the owasp-esapi-for-c++ package and dependencies. Part 2.

  • Property svn:executable set to *
File size: 2.8 KB
Line 
1#!/bin/bash
2
3# Makefile to compile up the OWASP-for-C++ package after first compiling up its dependencies
4# The OWASP-for-C package:
5# http://owasp-esapi-cplusplus.googlecode.com/svn/trunk/doc/html/index.html
6# It depends on cryptopp, boost (depends on zlib, bzip2, cmake, curl), and requires the safeint header file
7
8# unpack everything
9# (svn checkout owasp-for-c++? or commit as a directory to gs?)
10# rename cryptopp-version folder to cryptopp
11# create 'installed' folder
12# compile everything (or at least all the dependencies) into the installed folder, compile owasp,
13# with safeint in -I CFLAGS path
14
15export securitydir=`pwd`
16stored_installdir=$installdir
17export installdir=$securitydir/installed
18
19# Cryptopp, Boost, and the SafeInt header file is needed for OWASP-ESAPI-for-C++
20CRYPTOPP=cryptopp-5.6.2
21
22# Boost is needed for OWASP-ESAPI-for-C++
23ZLIB=zlib-1.2.7
24BZIP2=bzip2-1.0.6
25CMAKE=cmake-2.8.10.2
26CURL=curl-7.30.0
27BOOST=boost_1_52_0
28
29SAFEINT=safeint
30OWASPCPP=gs_owasp-esapi-cpp_03.03.2014
31# http://owasp-esapi-cplusplus.googlecode.com/svn/trunk/doc/html/index.html
32# svn checkout https://owasp-esapi-cplusplus.googlecode.com/svn/trunk/ owasp-esapi-cpp
33
34pkglist="$CRYPTOPP $ZLIB $BZIP2 $CURL $CMAKE $BOOST $SAFEINT $OWASPCPP"
35
36
37# If doing tarclean: then get rid of all the extracted folders and the installed folder
38if [ "x$1" = "xtarclean" ]; then
39 folders="$pkglist $installdir"
40 for folder in $folders; do
41 if [ -d $folder ]; then
42 rm -rf $folder
43 fi
44 done
45 exit
46fi
47
48
49# make the installed folder
50if [ ! -e $installdir ]; then
51 mkdir $installdir
52 mkdir $installdir/include
53fi
54
55# UNPACK
56#ziplist="$CRYPTOPP $boostlist $SAFEINT $OWASPCPP"
57for zip in $pkglist; do
58 if test ! -d "$zip" ; then
59 tar xvzf $zip.tar.gz
60 fi
61done
62
63# Copy across the Safe Integer header file
64cp safeint/SafeInt3.hpp $installdir/include/.
65
66# Make a symbolic link to cryptopp-version-no. that's called cryptopp
67if [ -d "$CRYPTOPP" ] && [ ! -e cryptopp ]; then
68#mv $CRYPTOPP cryptopp
69 ln -s $CRYPTOPP cryptopp
70fi
71
72
73# COMPILE
74# Basically, we run the <package>.sh file in the CASCADE-MAKE folder for each package
75# each package's .sh file will cd into the package's folder (stored in the exported compiledir var)
76# and then run configure, make and install steps as applicable.
77
78# http://stackoverflow.com/questions/546817/iterating-over-two-lists-in-parallel-in-bin-s
79makearray=("CRYPTOPP" "ZLIB" "BZIP2" "CURL" "CMAKE" "BOOST" "SAFEINT" "OWASPCPP")
80pkgarray=($pkglist)
81
82count=${#makearray[@]}
83for i in `seq 1 $count`
84do
85 echo "Compiling ${pkgarray[$i-1]} by running ${makearray[$i-1]}.sh"
86 makefile=${makearray[$i-1]}
87 export compiledir=${pkgarray[$i-1]}
88
89 if [ -e CASCADE-MAKE/$makefile.sh ]; then
90 ./CASCADE-MAKE/$makefile.sh $*
91 fi
92done
93compiledir=
94
95export securitydir=
96export installdir=$stored_installdir
Note: See TracBrowser for help on using the repository browser.