# Contributor: Vitaliy Berdinskikh <[email protected]>
# Contributor: Andrea Agosti <[email protected]>
# Contributor: Viliam Pucik <[email protected]>
# Maintainer: xduugu
pkgname=instantclient-sdk
pkgver=11.2.0.3.0
pkgrel=1
pkgdesc="Additional header files for developing Oracle applications with Instant Client"
arch=('i686' 'x86_64')
url="http://www.oracle.com/technetwork/database/features/instant-client/"
license=('custom:OTN')
depends=(instantclient-basic=$pkgver)
#
# Grab the source from
# i686 : http://www.oracle.com/technetwork/topics/linuxsoft-082809.html
# x86_64: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
# AMD64: http://www.oracle.com/technetwork/topics/linux-amd64-093390.html
#
source=($pkgname-linux-$pkgver.zip LICENSE)
md5sums=('959f2e2f40d6208be52aa9af9aa1d6f8'
'2d62e22e4f2d7e6d220fafde0f692a7d')
sha256sums=('f51b3c91a63f176443a681881fb15281c4487dde637c9c6e5b0703462a330bee'
'f904a30b07ddf7806a33620f93b94c3d315154d26a371ece48695bb3555064a2')

if [[ $CARCH = x86_64 ]]; then
source=($pkgname-linux.x64-$pkgver.zip LICENSE)
md5sums=('b904c00e59960d0cdc842025a0bbfb3f'
'2d62e22e4f2d7e6d220fafde0f692a7d')
sha256sums=('6c7be8e2ad4288eb2e7453ca73a5ead89b6016dc4fd4e10b38bc95bbd2748ece'
'f904a30b07ddf7806a33620f93b94c3d315154d26a371ece48695bb3555064a2')
fi

package() {
local dest=$pkgdir/opt/${pkgname%%-*}

# copy files
local pkgver=${pkgver/./_}
install -d "${dest%/*}" &&
cp -a "$srcdir/${pkgname%%-*}_${pkgver%%.*}" "$dest" || return 1

# fix permissions
cd "$dest/sdk" &&
chmod -R a=r,u+w,a+X * || return 1

install -Dm644 "$srcdir/LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1
}

# vim:set ts=2 sw=2 noet: