summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0c8ef4edf2e068b09795e8f056c2b00666988506 (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
54
55
56
57
58
59
# Maintainer: Dan McCurry <dan.mc at protonmail dot com>
# Contributer: Nikola Milinković <nikmil@gmail.com>
# Submitter: Stefan Husmann <stefan-husmann@t-online.de>

# If an unsupported java environment is set using archlinux-java,
# uncomment/edit the appropriate line in /usr/bin/jabref after
# installation.

pkgname=jabref-git
pkgver=2.9.2.r7414.gef7f8248b
epoch=1
pkgrel=1
pkgdesc="GUI frontend for BibTeX, written in Java -- built from git"
arch=('any')
url="https://www.jabref.org"
license=('MIT')
depends=('java-environment>=8')
makedepends=('git' 'java-environment=8' 'java-openjfx')
optdepends=('gsettings-desktop-schemas: For web search support')
provides=('jabref')
conflicts=('jabref')
source=("${pkgname%-git}::git+https://github.com/JabRef/jabref.git"
	"${pkgname%-git}.desktop"
	"${pkgname%-git}.sh")
md5sums=('SKIP'
         '5f76feb6b2f66a2ea8b52bca999a934f'
         '0b052f22c614f89f9ce854fdd1e5a3c8')

pkgver() {
  cd ${srcdir}/${pkgname%-git}
  git describe --long | sed 's/^v_//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/${pkgname%-git}"
  PATH=/usr/lib/jvm/java-8-openjdk/jre/bin/:$PATH
  
  ./gradlew releaseJar
}

package() {
  cd "${srcdir}/${pkgname%-git}"

  _release=$(sed -n 's/.*version = \"\(.*-dev\)\"/\1/p' build.gradle)

  find "${srcdir}/${pkgname%-git}/build/releases" \
	  -iname "JabRef-${_release}.jar" \
	  -exec install -Dm644 {} ${pkgdir}/usr/share/java/jabref/JabRef.jar \;

  install -Dm755 $srcdir/jabref.sh ${pkgdir}/usr/bin/jabref

  install -Dm644 $srcdir/jabref.desktop \
    ${pkgdir}/usr/share/applications/jabref.desktop

  install -Dm644 "build/resources/main/icons/${pkgname%-git}.svg" \
    "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.svg"

  install -Dm644 LICENSE.md ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}