Merge branch 'master' into 2.3beta-2.5beta
[csql/przemoc.git] / csqlinstall.ksh
blobf9e597e8aaa844e1e511c478d2261c2d0cacab92
1 #!/bin/sh
2 #Should run this command from the project root directory
4 set -e
6 #TODO:validate it is project root by checking some files
7 root_dir=`pwd`
8 install_dir=`grep "prefix =" Makefile|tail -1|awk '{ print $3 }'`
9 echo "installdir is ${install_dir}"
10 #cd src/sql
11 #sed -e "s/getc([ ]*yyin[ ]*)/(*lexInput++)/1" dmllex.cxx >tmp.c
12 #cp tmp.c dmllex.cxx
13 #make
14 #cd ../..
15 if [ -n "$JDK_HOME" ]; then
16 cd src/jdbc
17 ./buildJdbcDriver.ksh
18 mkdir -p ${install_dir}/lib
19 cp CSqlJdbcDriver.jar ${install_dir}/lib
21 cd ${root_dir}
22 make install
24 cp ${root_dir}/src/sql/Statement.h ${install_dir}/include
25 cp ${root_dir}/src/sql/Parser.h ${install_dir}/include
26 cd ${install_dir}/include
28 #rm Allocator.h CatalogTables.h Database.h
29 #rm DatabaseManagerImpl.h
30 #rm Globals.h Index.h Lock.h PredicateImpl.h
31 #rm Process.h SessionImpl.h TableImpl.h Transaction.h UserManagerImpl.h
32 cd ${install_dir}/bin
33 rm csqlreplserver repltable
35 cp ${root_dir}/README ${install_dir}/README
36 cp ${root_dir}/Doxyfile ${install_dir}
37 cp ${root_dir}/COPYING ${install_dir}
38 cp ${root_dir}/AUTHORS ${install_dir}
39 cp ${root_dir}/ChangeLog ${install_dir}
40 cp ${root_dir}/csql.conf ${install_dir}
41 cp ${root_dir}/setupenv.ksh.install ${install_dir}/setupenv.ksh
42 cp -R ${root_dir}/examples ${install_dir}
43 find ${install_dir}/examples -name "CVS" -exec rm -rf {} \; 2>/dev/null
44 rm -rf ${install_dir}/examples/dbapi
45 rm -rf ${install_dir}/lib/*.a
46 rm -rf ${install_dir}/lib/*.la
48 cp -R ${root_dir}/docs ${install_dir}
49 find ${install_dir}/docs -name "CVS" -exec rm -rf {} \; 2>/dev/null
50 cp -R ${root_dir}/demo ${install_dir}
51 find ${install_dir}/demo -name "CVS" -exec rm -rf {} \; 2>/dev/null
52 cd ${root_dir}
53 echo "Build completed Successfully"