summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2905d0d0c142892f486ffbea8d2e4c8416dc7016 (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: XZS <d dot f dot fischer at web dot de>
# Contributor: Emanuel Couto <unit73e@gmail.com>
# Contributor: xgdgsc <xgdgsc@gmail.com>
# Contributor: Jesús Jerez <jerezmoreno@gmail.com>
pkgname=eclipse-eclipsecolortheme
pkgver=1.0.0
pkgrel=4
pkgdesc="Eclipse Color Theme"
url="http://www.eclipsecolorthemes.org"
license=("EPL/1.0")
arch=('any')
depends=('eclipse')
makedepends=("unzip" "java-environment")
noextract=("${pkgname}.zip")
source=("${pkgname}.zip::http://eclipse-color-theme.github.io/update/eclipse-color-theme-update-site.zip")
noextract=("${pkgname}.zip")
md5sums=('c0df9d934ec90c983382e266514601c9')

_extract() {
  [[ -d plugins ]] && return
  ( unzip "${pkgname}.zip" > /dev/null || return 0 )
  mv update/* .
  rm -r update
}

prepare() {
  _extract
}

pkgver() {
  _extract
  echo plugins/com.github.eclipsecolortheme_*.jar | grep -Po '(?<=com.github.eclipsecolortheme_)\d+\.\d+\.\d+(?=\.\d{12}\.jar)'
}

package() {
  _dest="${pkgdir}"/usr/lib/eclipse/dropins/${pkgname/eclipse-}/eclipse

  # Features
  find features -type f | while read _feature ; do
    if [[ ${_feature} =~ (.*\.jar$) ]] ; then
      install -dm755 "${_dest}"/${_feature%*.jar}
      cd "${_dest}"/${_feature/.jar}
      jar xf "${srcdir}/${_feature}" || return 1
    else
      install -Dm644 ${_feature} "${_dest}/${_feature}"
    fi
  done

  # Plugins
  find plugins -type f | while read _plugin ; do
    install -Dm644 ${_plugin} "${_dest}/${_plugin}"
  done
}