summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6a97acba888e12dc70a87a6e1ea614007e76d3ea (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
60
# Maintainer: Benedikt Rumpf <beru@posteo.de>
# Maintainer: Egidio Caprino <egidio.caprino@gmail.com>

pkgname=dataloader
pkgver=54.0.0
pkgrel=1
pkgdesc="An easy to use graphical tool that helps you to get your data into Salesforce objects"
arch=('i686' 'x86_64')
url="https://developer.salesforce.com/page/Data_Loader"
license=("GPL2")
depends=('java-runtime>=11' 'gtk2' 'gtk-update-icon-cache' 'swt')
makedepends=('git' 'maven' 'java-runtime>=11')
install=dataloader.install
source=(dataloader.desktop dataloader.install dataloader.svg dataloader.sh)
source_i686=(git+https://github.com/forcedotcom/dataloader.git)
source_x86_64=(git+https://github.com/forcedotcom/dataloader.git)
md5sums=('b519f96b515793fa80cd820e25d70d68'
         '94f2b99bb9af44899cd4d2ded981fd54'
         '0b9294d4865f364681a79fbbc73dd88a'
         'ebb31a3cebd05829384f1fc1dcdb352e')
md5sums_i686=('SKIP')
md5sums_x86_64=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname"
  git checkout "tags/v$pkgver"
  git submodule init
  git submodule update
  echo "$pkgver"
}

build() {
  cd "$srcdir/$pkgname"
  latest_version="$(archlinux-java status | grep "java-[0-9][0-9]" | sort --reverse | head --lines 1 | sed 's/(.*)//g')"
  sudo archlinux-java set "${latest_version}"
  mvn clean package -D skipTests -D targetOS=linux_x86_64
}

package() {
  mkdir -p "$pkgdir/opt/"
  mkdir -p "$pkgdir/usr/bin"
  mkdir -p "$pkgdir/usr/share/applications"
  mkdir -p "$pkgdir/usr/share/icons/hicolor/48x48/apps"

  swt_jar="$(readlink --canonicalize /usr/share/java/swt.jar)"

  cp -r "$srcdir/$pkgname" "$pkgdir/opt/"
  cp "${srcdir}/dataloader.sh" "${pkgdir}/opt/${pkgname}/"
  cp "$srcdir/dataloader.svg" "$pkgdir/usr/share/icons/hicolor/48x48/apps/dataloader.svg"
  cp "${swt_jar}" "${pkgdir}/opt/${pkgname}/swt.jar"

  chmod +x "${pkgdir}/opt/$pkgname/dataloader.sh"
  chmod g+x "${pkgdir}/opt/${pkgname}/swt.jar"
  chmod o+x "${pkgdir}/opt/${pkgname}/swt.jar"


  ln -s "/opt/$pkgname/dataloader.sh" "$pkgdir/usr/bin/dataloader"

  install -m 644 "$srcdir/dataloader.desktop" "$pkgdir/usr/share/applications/"
}