summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD40
-rw-r--r--sfsql.patch20
3 files changed, 77 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..082dc1f6bd7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = snowflake-client
+ pkgdesc = Snowflake Database command line and JDBC client
+ pkgver = 2.4
+ pkgrel = 2
+ url = http://www.snowflake.net/
+ arch = i686
+ arch = x86_64
+ license = custom: commercial
+ depends = gcc-libs
+ depends = java-environment
+ depends = bash
+ depends = libtinfo
+ source = sfsql.patch
+ md5sums = 3ab11cead59dab3a869d22f15cdff050
+
+pkgname = snowflake-client
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..277369ae098
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: D. Can Celasun <dcelasun[at]gmail[dot]com>
+
+pkgname=snowflake-client
+pkgver=2.4
+pkgrel=2
+pkgdesc="Snowflake Database command line and JDBC client"
+arch=('i686' 'x86_64')
+url="http://www.snowflake.net/"
+license=('custom: commercial')
+depends=(gcc-libs java-environment bash libtinfo)
+source=(sfsql.patch)
+md5sums=('3ab11cead59dab3a869d22f15cdff050')
+
+_vpkg=snowflake_client.tar.gz
+
+build() {
+ msg "You need a full, licensed copy of the client in order to install it"
+ msg "Searching for ${_vpkg} in dir: \"$startdir\""
+ pkgpath="$startdir"
+ if [[ ! -f "${pkgpath}/${_vpkg}" ]]; then
+ error "Snowflake client package not found, please type absolute path to ${_vpkg} (/home/joe):"
+ read pkgpath
+ if [[ ! -f "${pkgpath}/${_vpkg}" ]]; then
+ error "Unable to find Snowflake client package." && return 1
+ fi
+ fi
+ msg "Found package, unpacking..."
+ tar -xzf "${pkgpath}/${_vpkg}" -C "${srcdir}"
+
+ cd "${srcdir}"
+ patch -Np1 -i "${srcdir}/sfsql.patch"
+}
+
+package() {
+ install -d "${pkgdir}/opt/${pkgname}"
+ install -d "${pkgdir}/usr/bin"
+
+ cp -r "${srcdir}/client/"* "${pkgdir}/opt/${pkgname}" -R
+ ln -s /opt/${pkgname}/sfsql "${pkgdir}"/usr/bin/sfsql
+}
diff --git a/sfsql.patch b/sfsql.patch
new file mode 100644
index 00000000000..7ab04e46980
--- /dev/null
+++ b/sfsql.patch
@@ -0,0 +1,20 @@
+--- a/client/sfsql 2015-04-27 10:51:46.081074936 +0300
++++ b/client/sfsql 2015-04-27 10:51:09.323555791 +0300
+@@ -4,7 +4,7 @@
+ # options are ignored if SF_SQL_CONNECT_URL if set
+
+ #default values for command line options
+-CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
++CLIENT_DIR="/opt/snowflake-client"
+ HENPLUS_DIR="$( cd "${CLIENT_DIR}/henplus" && pwd )"
+
+ Usage()
+@@ -50,7 +50,7 @@
+ FOUND=0
+ for JAVA in "$JAVA1" "$JAVA2"; do
+
+- JAVA_VERSION=$("$JAVA" -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q')
++ JAVA_VERSION=$("$JAVA" -version 2>&1| awk -F\" '/version/ {print $2}' | awk -F '.' '{print $1$2}')
+
+ # if not integer, java not installed
+ if [ "$JAVA_VERSION" -eq "$JAVA_VERSION" ] 2>/dev/null ; then