-
Notifications
You must be signed in to change notification settings - Fork 2
/
mkmacosclidriver.sh
62 lines (56 loc) · 3.26 KB
/
mkmacosclidriver.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# If you have dsdriver.dmg image for MacOS, just run this script
# to get clidriver for macos platform
# Put the dsdriver image name below
read -p "dsdriver.dmg file name: " dmgfile
hdiutil attach $dmgfile
alias sanitizeClidriver='cd clidriver; mv adm/* bin; rm -rf adm; cd bnd; rm -f ddcs400.lst ddcsvm.lst ddcsmvs.lst ddcsvse.lst db2cli.lst; echo "db2ajgrt.bnd+" > db2cli.lst; echo "db2clipk.bnd+" >> db2cli.lst; echo "db2clist.bnd+" >> db2cli.lst; echo "db2cli.bnd" >> db2cli.lst; chmod 444 db2cli.lst; cd ../.. ; rm -f clidriver/lib/*db2o.*'
alias showFiles='ls -l clidriver/lib; ls clidriver/bnd; cat clidriver/bnd/db2cli.lst'
cd /Users/bjha/nodework
rm -rf clidriver_pre ibm_data_server_driver_for_odbc_cli.tar.gz macos64_odbc_cli.tar.gz
mv clidriver clidriver_pre
cp /Volumes/dsdriver/odbc_cli_driver/macos/ibm_data_server_driver_for_odbc_cli.tar.gz .
tar -zxf ibm_data_server_driver_for_odbc_cli.tar.gz
cp -r /Volumes/dsdriver/security64 clidriver
hdiutil detach /Volumes/dsdriver/
sanitizeClidriver
# cp clidriver_pre/lib/libstdc++.6.dylib clidriver/lib
# cp libstdc++.6.dylib clidriver/lib
cd clidriver/lib
rm -f libdb2o.dylib libDB2xml4c.58.dylib libDB2xml4c.dylib
ln -s libDB2xml4c.58.0.dylib libDB2xml4c.58.dylib
ln -s libDB2xml4c.58.0.dylib libDB2xml4c.dylib
chmod 775 *
install_name_tool -change /usr/local/opt/gcc@8/lib/gcc/8/libstdc++.6.dylib /usr/local/lib/gcc/8/libstdc++.6.dylib libdb2.dylib
install_name_tool -change /usr/local/opt/gcc@8/lib/gcc/8/libgcc_s.1.dylib /usr/local/lib/gcc/8/libgcc_s.1.dylib libdb2.dylib
install_name_tool -change /Users/regress1/db2/engn/lib/bldsupp/libDB2xml4c.58.0.dylib @loader_path/libDB2xml4c.58.0.dylib libdb2clixml4c.dylib
install_name_tool -change /usr/local/opt/gcc@8/lib/gcc/8/libstdc++.6.dylib /usr/local/lib/gcc/8/libstdc++.6.dylib libdb2clixml4c.dylib
install_name_tool -id libdb2clixml4c.dylib libdb2clixml4c.dylib
install_name_tool -id libDB2xml4c.58.0.dylib libDB2xml4c.58.0.dylib
install_name_tool -id libdb2.dylib libdb2.dylib
chmod 555 libdb2.dylib libdb2clixml4c.dylib libDB2xml4c.58.0.dylib
cd ../bin
install_name_tool -change ../lib/libdb2.dylib @loader_path/../lib/libdb2.dylib db2cli
install_name_tool -change ../lib/libdb2.dylib @loader_path/../lib/libdb2.dylib db2diag
install_name_tool -change ../lib/libdb2.dylib @loader_path/../lib/libdb2.dylib db2drdat
install_name_tool -change ../lib/libdb2.dylib @loader_path/../lib/libdb2.dylib db2dsdcfgfill
install_name_tool -change ../lib/libdb2.dylib @loader_path/../lib/libdb2.dylib db2level
install_name_tool -change ../lib/libdb2.dylib @loader_path/../lib/libdb2.dylib db2support
install_name_tool -change ../lib/libdb2.dylib @loader_path/../lib/libdb2.dylib db2trc
chmod 755 *
cd ..
chmod 775 license cfg
if [ -e ./db2dump ] ; then
chmod 775 db2dump
echo -n "" > db2dump/db2diag.log
chmod 664 db2dump/db2diag.log
fi
mkdir scripts
cp ../scripts/testconnection.sh scripts
cp ../scripts/setenv.sh scripts
chmod 775 *
chmod 755 scripts/* bnd/* cfg/* license/*
cd ..
tar --preserve-permissions --xattrs -czf macos64_odbc_cli.tar.gz clidriver
rm -f ibm_data_server_driver_for_odbc_cli.tar.gz
showFiles
otool -L clidriver/lib/libdb2.dylib