summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e716e31df4c05895584462eb8daaedb36521d6b9 (plain)
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
# Maintainer: Bink <B-Interactive@users.noreply.github.com>

pkgname=air-sdk
pkgver=50.2.5.1
pkgrel=1
epoch=1
pkgdesc="A multi-operating system, multi-screen runtime that allows you to leverage your web development skills to build and deploy rich Internet applications to the desktop and mobile devices."
arch=('x86_64' 'i686')
url="https://airsdk.harman.com/"
license=('custom:Harman Connected Services, Inc. (“Harman”) SDK License Agreement')
depends=('jdk11-openjdk')
makedepends=('wget' 'unzip')
source=()
_sha256sum='804e1f2e7cebe5c50580c86ee36aaae57f4631e242dde594ec790fd3a37faac7'
install="$pkgname.install"

package() {
	if [ ! -f "AIRSDK_Linux.zip" ]; then
		echo "Source file needs to be downloaded."
		while true; do
			echo ""
			echo "Harman AIR SDK License Agreement"
			echo "https://airsdk.harman.com/assets/pdfs/HARMAN%20AIR%20SDK%20License%20Agreement.pdf"
			echo ""
			read -p "I accept the terms of the AIR SDK License Agreement [y/n] " yn
			case $yn in
				[Yy]* ) break;;
				[Nn]* ) return 1;;
				* ) echo "Please answer [y]es or [n]o.";;
			esac
		done
		wget "https://airsdk.harman.com/api/versions/$pkgver/sdks/AIRSDK_Linux.zip?license=accepted" -O "AIRSDK_Linux.zip"
	fi

	if echo "$_sha256sum AIRSDK_Linux.zip" | sha256sum -c --status; then
		echo "Source checksum passed"
	else
		echo "Source file failed checksum. Aborting."
		return 1
	fi

	mkdir -p "$pkgdir/opt/$pkgname/$pkgver"
	unzip -d "$pkgdir/opt/$pkgname/$pkgver" "AIRSDK_Linux.zip"
	install -Dm644 "$pkgdir/opt/$pkgname/$pkgver/AIR SDK license.pdf" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.pdf"

	mkdir -p "$pkgdir/etc/profile.d"
	echo "export AIR_HOME=/opt/$pkgname/AIRSDK" > "$pkgdir/etc/profile.d/$pkgname.sh"
	echo "export PATH='${PATH}':'/opt/$pkgname/AIRSDK/bin'" >> "$pkgdir/etc/profile.d/$pkgname.sh"
	echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk" >> "$pkgdir/etc/profile.d/$pkgname.sh"

	cd "$pkgdir/opt/$pkgname"
	ln -s "$pkgver" "AIRSDK"
}