Skip to content

Instantly share code, notes, and snippets.

@fredericobenevides
Created April 29, 2016 20:01
Show Gist options
  • Save fredericobenevides/f73ef7eb7619e104402d9650281ba8ed to your computer and use it in GitHub Desktop.
Save fredericobenevides/f73ef7eb7619e104402d9650281ba8ed to your computer and use it in GitHub Desktop.
Setup for go-oci8
prefix=/opt/oracle
includedir=${prefix}/instantclient_12_1/sdk/include
libdir=${prefix}/instantclient_12_1
Name: oci8
Description: Oracle Instant Client
Version: 12.1
Cflags: -I${includedir}
Libs: -L${libdir} -lclntsh
#!/bin/sh
sudo apt-get install -y pkg-config
sudo apt-get install -y libaio1
rm -rf instantclient_12_1
unzip instantclient-basic-linux.x64-12.1.0.2.0.zip
unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip
sudo rm -rf /opt/oracle
sudo mkdir -p /opt/oracle
sudo mv instantclient_12_1 /opt/oracle
sudo chown -R `whoami`:`whoami` /opt/oracle
ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so
sudo cp oci8.pc /usr/lib/pkgconfig
grep -q "/opt/oracle/instantclient_12_1" /etc/environment
if [ $? -ne 0 ]; then
echo 'export LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"' | sudo tee --append /etc/environment
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment