summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2f7a4f2608bb4266c75b7d123bb8b4e7f911519a (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
61
62
# Maintainer:

## links
# https://bitbucket.org/agriggio/art
# https://github.com/agriggio/ART-releases/releases

_pkgname="art-rawconverter"
pkgname="$_pkgname-bin"
pkgver=1.24.1
pkgrel=1
pkgdesc="Raw image converter forked from RawTherapee with ease of use in mind"
url="https://bitbucket.org/agriggio/art"
license=('GPL-3.0-or-later')
arch=('x86_64')

provides=("$_pkgname")
conflicts=("$_pkgname")

options=('!strip' '!debug')

_url="https://github.com/agriggio/ART-releases"
_pkgsrc="ART-$pkgver-linux64"
_pkgext="tar.xz"
source=("$_pkgname-$pkgver.$_pkgext"::"$_url/releases/download/v$pkgver/$_pkgsrc.$_pkgext")
sha256sums=('3a400a52e1990986bcfe49781f8c2f46428d485b568d0071d8a6f58698b6837c')

prepare() {
  cat "$_pkgsrc/share/applications/ART.desktop" \
    | sed 's/Name=ART/Name=ART Raw Converter/' \
    | sed 's/Exec=ART/Exec=art/' \
    | sed "s/Icon=ART/Icon=$_pkgname/" \
      > "$_pkgname.desktop"
}

package() {
  local OPT_PATH="opt/$_pkgname"

  # main files
  install -dm755 "$pkgdir/opt"
  cp --reflink=auto -r "$_pkgsrc" "$pkgdir/$OPT_PATH"

  # symlinks
  install -dm755 "$pkgdir/usr/bin"
  ln -s "/$OPT_PATH/ART" "$pkgdir/usr/bin/art"
  ln -s "/$OPT_PATH/ART-cli" "$pkgdir/usr/bin/art-cli"

  install -dm755 "$pkgdir/usr/share/man/man1"
  ln -s "/$OPT_PATH/share/man/man1/ART.1" "$pkgdir/usr/share/man/man1/art.1"

  # .desktop
  install -Dm644 "$_pkgname.desktop" -t "$pkgdir/usr/share/applications"

  # icons
  local SRC_LOC="$srcdir/$_pkgsrc/share/icons/hicolor"
  local DEST_LOC="$pkgdir/usr/share/icons/hicolor"
  for i in 16 24 48 128 256; do
    install -Dm644 "$SRC_LOC/${i}x${i}/apps/ART.png" "$DEST_LOC/${i}x${i}/apps/$_pkgname.png"
  done

  # fix permissions
  chmod -R u+rwX,go+rX,go-w "$pkgdir"
}