Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PKGBUILD-java-maven #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions PKGBUILD-java-maven
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=NAME
pkgver=VERSION
pkgrel=1
pkgdesc='Short description without using the package name itself.'
arch=('any' OR 'x86_64' 'aarch64')
groups=('blackarch' MORE_BLACKARCH_GROUPS_HERE)
url='URL pointing to download section of package'
license=('WHATEVER' OR 'custom:unknown')
depends=('java-runtime')
makedepends=('maven' 'git')
source=("git+https://github.com/foo/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
cd $pkgname

( set -o pipefail
git describe --long --tags --abbrev=7 2>/dev/null |
sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "%s.%s" "$(git rev-list --count HEAD)" \
"$(git rev-parse --short=7 HEAD)"
)
}

build() {
cd $pkgname

mvn clean package -DskipTests
}

package() {
cd $pkgname

install -dm 755 "$pkgdir/usr/bin"

install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md docs/*.md

# Only install license if required according to
# https://wiki.archlinux.org/index.php/PKGBUILD#license
install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

install -Dm 755 "target/$pkgname-$pkgver.jar" "$pkgdir/usr/share/$pkgname/$pkgname-$pkgver.jar"

cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname-$pkgver.jar "\$@"
EOF

chmod +x "$pkgdir/usr/bin/$pkgname"
}