summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVi0L02016-01-20 14:25:18 +0100
committerVi0L02016-01-20 14:25:18 +0100
commit0b66c86380278f3e25264cf5c0c6d32b01fd78aa (patch)
tree885bf43eb4f41ae90ae46fb66ca868f7c02532fd
parent4262b024817d76832806653b16af047589354673 (diff)
downloadaur-0b66c86380278f3e25264cf5c0c6d32b01fd78aa.tar.gz
adding sdk downloading execution
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD49
2 files changed, 42 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fadbbc3b8c20..14e5a9906356 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -9,15 +9,14 @@ pkgbase = amdapp-sdk
makedepends = perl
makedepends = llvm
makedepends = apache-ant
+ makedepends = wget
options = staticlibs
options = libtool
options = !strip
options = !upx
- source = http://developer.amd.com/wordpress/media/files/AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2
source = amd.icd
source = amdapp-sdk.sh
source = amdapp-sdk.conf
- sha256sums = 27a6145a73910d2320fd017159cf72f16601c375c2b304644c31566f45cc26a6
sha256sums = 77cb18c5a588e02c73c2406e1057461b6c030b97534154aa3163cbfb9b7e97b7
sha256sums = dffe3d16ae07fafe6571c37f97f73e694891a7ea7888fc7f0a5d0e42b997e50f
sha256sums = c871a5044dd19e710b9ff058faa4e40f9b825b27d3928d535bc452116dba3b95
diff --git a/PKGBUILD b/PKGBUILD
index e3e6a166432b..45a25dc5375a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,13 +1,9 @@
-# !!! NOTE !!!
-# Please download AMD-APP-SDKInstaller-v3.0.130.135-GA-linux<your_bits_here>.tar.bz2 from
-# http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/
-# and paste it next to this PKGBUILD
-
# Maintainer: Vi0L0 <vi0l093@gmail.com>
# Previous Maintainer: Michael Krause <mk-arch@spline.de>
# Contributor: kralyk
# Contributor: pfdm
# Contributor: caust1c
+# Contributor: kralyk (download execution)
# PKGEXT=".tar.gz" # time to pack this pkg into tar.xz is long, unfortunatelly yaourt got problems when ext is different than .pkg.tar.xz - V
@@ -21,7 +17,7 @@ url="http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-paralle
license=("custom")
options=('staticlibs' 'libtool' '!strip' '!upx')
groups=('amdapp')
-makedepends=('perl' 'llvm' 'apache-ant')
+makedepends=('perl' 'llvm' 'apache-ant' 'wget')
_dirname='AMD-APP-SDKInstaller-v3.0.130.135-GA-linux'
_scriptname='AMD-APP-SDK-v3.0.130.135-GA-linux'
@@ -43,24 +39,61 @@ _scriptname='AMD-APP-SDK-v3.0.130.135-GA-linux'
#Sources
source=(
# "http://developer.amd.com/wordpress/media/files/AMD-APP-SDK-linux-v2.9-1.599.381-GA-${_tarbits}.tar.bz2"
- "http://developer.amd.com/wordpress/media/files/${_dirname}${_bits}.tar.bz2"
+# "http://developer.amd.com/wordpress/media/files/${_dirname}${_bits}.tar.bz2"
'amd.icd'
'amdapp-sdk.sh'
'amdapp-sdk.conf')
#sha256sums
-sha256sums=($_hash
+sha256sums=(
'77cb18c5a588e02c73c2406e1057461b6c030b97534154aa3163cbfb9b7e97b7'
'dffe3d16ae07fafe6571c37f97f73e694891a7ea7888fc7f0a5d0e42b997e50f'
'c871a5044dd19e710b9ff058faa4e40f9b825b27d3928d535bc452116dba3b95')
+_agr_url='http://developer.amd.com/amd-license-agreement-appsdk/'
+_tarball="${_dirname}${_bits}.tar.bz2"
_subdir="${_dirname}${_bits}"
#Install path
_ipath='opt/AMDAPP/SDK'
+_wget()
+{
+ wget -c -t 3 --waitretry=3 -O - $@
+}
prepare() {
+
+ warning "Installing this package means that you have red, understood and ACCEPTED"
+ warning "the license agreement posted at http://developer.amd.com/amd-license-agreement-appsdk/"
+ warning ""
+ warning "will sleep 5 sec to make sure you red it :P"
+ sleep 5
+ warning "Download will take not much time and echo some random letters, prepare yourself"
+
+ if [ ! -e ${_tarball} ]; then
+ fbase=$(echo -n $_tarball | base64)
+
+ echo -n '[nonce1] '
+ _wget -nv "$url" > 'nonce1'
+ nonce1=$(sed -n -e "/${fbase}/s/.*_nonce\" value=\"\([[:alnum:]]*\)\".*/\1/p;" 'nonce1')
+ post_id=$(sed -n -e "/post_id/s/.*value=\"\([[:alnum:]]*\)\".*/\1/p;" 'nonce1' | head -n 1)
+
+ echo -n '[nonce2] '
+ postdata1="amd_developer_central_downloads_page_nonce=${nonce1}&_wp_http_referer=%2Ftools-and-sdks%2Fopencl-zone%2Famd-accelerated-parallel-processing-app-sdk%2F&f=${fbase/=/%3D}&post_id=${post_id}"
+ nonce2=$(_wget -nv --post-data "${postdata1}" "${_agr_url}" | sed -n -e "/${fbase}/s/.*_nonce\" value=\"\([[:alnum:]]*\)\".*/\1/p;")
+
+ echo -n '[tarball] '
+ postdata2="amd_developer_central_nonce=${nonce2}&_wp_http_referer=%2Famd-license-agreement-appsdk%2F&f=${fbase/=/%3D}"
+ _wget --post-data "${postdata2}" "${_agr_url}" -O "${_tarball}"
+ fi
+
+ msg "Validating ${_tarball} files with sha256sum ..."
+ echo "${_hash} ${_tarball}" | sha256sum -c || exit 1
+
+ msg "Extracting ${_tarball} ..."
+ bsdtar -jxf "${_tarball}"
+
cd ${srcdir}
# tar xf ${_subdir}.tgz
# cd ${_subdir}