summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorEgor Kovetskiy2019-04-23 11:57:32 +0300
committerEgor Kovetskiy2019-04-23 11:57:32 +0300
commitc99a00e03f3e6b44f02ec90850c539171ffaa469 (patch)
tree832124b28ff71aa97b3c198469f3978a00a9f49a /PKGBUILD
downloadaur-c99a00e03f3e6b44f02ec90850c539171ffaa469.tar.gz
sync github.com/kovetskiy/pkgbuilds
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD53
1 files changed, 53 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..57dd22ced9c8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,53 @@
+# Maintainer: e.kovetskiy@gmail.com
+# Original author: ebiadsu <ebiadsu@posteo.de>
+
+pkgname=atlassian-plugin-sdk-latest
+_pkgname=atlassian-plugin-sdk
+pkgver=${PKGVER:-autogenerated}
+pkgrel=${PKGREL:-1}
+pkgdesc="Atlassian plugin software developer kit autogenerated version"
+arch=('i686' 'x86_64')
+url="https://marketplace.atlassian.com/plugins/atlassian-plugin-sdk-tgz"
+license=('Apache License 2.0')
+_maven="https://maven.atlassian.com/public/com/atlassian/amps/$_pkgname"
+depends=('java-environment')
+
+pkgver() {
+ if [[ "$PKGVER" ]]; then
+ echo "$PKGVER"
+ return
+ fi
+
+ _url=${_maven}/maven-metadata.xml
+ echo ":: Obtaining latest version from maven-metadata.xml: ${_url}" >&2
+
+ version=$(curl -sL "${_url}" | grep -Po '<latest>\K[^<]+')
+
+ echo "${version}"
+}
+
+package() {
+ cd "${srcdir}"
+ echo ":: Downloading $_maven/$pkgver/$_pkgname-$pkgver.tar.gz" >&2
+ wget "$_maven/$pkgver/$_pkgname-$pkgver.tar.gz"
+ tar xvf "$_pkgname-$pkgver.tar.gz"
+
+ cd "$pkgdir"
+ mkdir -p opt/atlassian/plugin-sdk
+
+ cp -r "$srcdir"/atlassian-plugin-sdk-$pkgver/* opt/atlassian/plugin-sdk
+
+ # remove executable flag from .bat in bin
+ if [[ -n $(find opt/atlassian/plugin-sdk/apache-maven-*/bin/ -type f -name "*.bat") ]]; then
+ chmod -x opt/atlassian/plugin-sdk/apache-maven-*/bin/*.bat
+ fi
+
+ # add executable flag for every user
+ chmod -R +X opt/atlassian/plugin-sdk
+
+ # update PATH
+ mkdir -p etc/profile.d
+ echo 'export PATH=$PATH:/opt/atlassian/plugin-sdk/bin' > etc/profile.d/$_pkgname.sh
+ echo 'setenv PATH ${PATH}:/opt/atlassian/plugin-sdk/bin' > etc/profile.d/$_pkgname.csh
+ chmod +x etc/profile.d/*
+}