*** empty log message ***
[csql.git] / csqlinstall.ksh
blob148ca8d4e5a6e2bacfb415570f179f09c89e5389
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 }'`
7 if [ -z "$install_dir" ]
8 then
9 echo "install_dir is not set properly."
10 exit 1
13 echo "installdir is ${install_dir}"
14 cd src/jdbc
15 ./buildJdbcDriver.ksh
16 mkdir -p ${install_dir}/lib
17 cp CSqlJdbcDriver.jar ${install_dir}/lib
18 cd ${root_dir}
20 rm ${install_dir}/lib/*.la
21 rm ${install_dir}/lib/*.a
23 mkdir -p ${install_dir}/sample
24 cp ${root_dir}/setupenv.ksh.install ${install_dir}/setupenv.ksh
25 cp ${root_dir}/csql.conf ${install_dir}/sample
26 cp ${root_dir}/cachetable.sql ${install_dir}/sample
27 cp ${root_dir}/odbc.ini ${install_dir}/sample
28 cp ${root_dir}/trigger.sql ${install_dir}/sample
29 cp ${root_dir}/trigger.psql ${install_dir}/sample
31 cp -R ${root_dir}/README ${install_dir}
32 cp -R ${root_dir}/COPYING ${install_dir}
33 cp -R ${root_dir}/AUTHORS ${install_dir}
34 cp -R ${root_dir}/ChangeLog ${install_dir}
37 cp -R ${root_dir}/examples ${install_dir}
38 find ${install_dir}/examples -name "CVS" -exec rm -rf {} \; 2>/dev/null
40 cp -R ${root_dir}/demo ${install_dir}
41 find ${install_dir}/demo -name "CVS" -exec rm -rf {} \; 2>/dev/null
43 cp -R ${root_dir}/docs ${install_dir}
44 find ${install_dir}/docs -name "CVS" -exec rm -rf {} \; 2>/dev/null
46 cp -R ${root_dir}/scripts ${install_dir}
47 find ${install_dir}/scripts -name "CVS" -exec rm -rf {} \; 2>/dev/null
49 cd ${root_dir}
50 echo "Build completed Successfully"