added check for install_dir
[csql.git] / csqlinstall.ksh
blob393e0bc0319baa00ea5e72126a6ae008660f6c99
1 #!/bin/sh
2 #Should run this command from the project root directory
4 #TODO:validate it is project root by checking some files
5 root_dir=`pwd`
6 install_dir=`grep "prefix =" Makefile|tail -1|awk '{ print $3 }'`
8 if [ -z "$install_dir" ]
9 then
10 echo "install_dir is not set properly."
11 exit 1
14 echo "installdir is ${install_dir}"
15 #cd src/sql
16 #sed -e "s/getc([ ]*yyin[ ]*)/(*lexInput++)/1" dmllex.cxx >tmp.c
17 #cp tmp.c dmllex.cxx
18 #make
19 #cd ../..
20 cd src/jdbc
21 ./buildJdbcDriver.ksh
22 mkdir -p ${install_dir}/lib
23 cp CSqlJdbcDriver.jar ${install_dir}/lib
24 cd ${root_dir}
25 make install
27 #Any new libraries needs to be added here
28 cd ${install_dir}/lib
29 mv libcsql libcsql.so
30 mv libcsqlsql libcsqlsql.so
31 mv libcsqljdbc libcsqljdbc.so
32 mv libcsqlnw libcsqlnw.so
33 mv libcsqlsqllog libcsqlsqllog.so
34 mv libcsqlodbc libcsqlodbc.so
35 mv libcsqlodbcadapter libcsqlodbcadapter.so
36 mv libcsqlgw libcsqlgw.so
37 mv libcacheload libcacheload.so
38 mv libcsqlsqlnw libcsqlsqlnw.so
39 ln -s libcsqlgw.so libcsqlgw
40 ln -s libcsqlodbcadapter.so libcsqlodbcadapter
41 ln -s libcsqlodbc.so libcsqlodbc
42 ln -s libcsqlsqllog.so libcsqlsqllog
43 ln -s libcsqlnw.so libcsqlnw
44 ln -s libcsqljdbc.so libcsqljdbc
45 ln -s libcsqlsql.so libcsqlsql
46 ln -s libcsql.so libcsql
47 ln -s libcacheload.so libcacheload
48 ln -s libcsqlsqlnw.so libcsqlsqlnw
50 cp ${root_dir}/README ${install_dir}/README
51 cp ${root_dir}/COPYING ${install_dir}
52 cp ${root_dir}/AUTHORS ${install_dir}
53 cp ${root_dir}/ChangeLog ${install_dir}
54 cp ${root_dir}/csql.conf ${install_dir}
55 cp ${root_dir}/setupenv.ksh.install ${install_dir}/setupenv.ksh
56 cp -R ${root_dir}/examples ${install_dir}
57 find ${install_dir}/examples -name "CVS" -exec rm -rf {} \; 2>/dev/null
58 rm -rf ${install_dir}/examples/dbapi
59 rm -rf ${install_dir}/lib/*.a
60 rm -rf ${install_dir}/lib/*.la
62 cp -R ${root_dir}/docs ${install_dir}
63 find ${install_dir}/docs -name "CVS" -exec rm -rf {} \; 2>/dev/null
64 cp -R ${root_dir}/demo ${install_dir}
65 find ${install_dir}/demo -name "CVS" -exec rm -rf {} \; 2>/dev/null
66 cd ${root_dir}
67 echo "Build completed Successfully"