summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1a9354cb2a091c8ea4262b7f3b275fa7c3ed909a (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
63
64
65
66
67
68
69
70
71
72
# Maintainer: Stamby <stamblonnocorporation@hotmail.com>

_pkgname="simple-duplicate-finder"
pkgname="${_pkgname}-git"
pkgver=r203.g93cd923
pkgrel=1
pkgdesc="A program to find and delete duplicates, built on Python and GTK."
arch=('any')
url="https://github.com/moltenib/simple-duplicate-finder"
license=('GPL3')

depends=(
  'python'
  'gtk3'
  'python-gobject'
)
optdepends=(
  'xdg-utils: open files from the UI'
)
makedepends=(
  'git'
  'gettext'   # msgfmt for `make translations`
)

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

source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${srcdir}/${_pkgname}"
  make translations
}

package() {
  cd "${srcdir}/${_pkgname}"

  # App files (keep upstream relative layout working)
  install -d "${pkgdir}/usr/lib/${_pkgname}"
  cp -a src resources "${pkgdir}/usr/lib/${_pkgname}/"

  # Launcher
  install -Dm755 /dev/stdin "${pkgdir}/usr/bin/${_pkgname}" <<'EOF'
#!/bin/bash
exec python3 /usr/lib/simple-duplicate-finder/src/main.pyw "$@"
EOF

  # Desktop entry (patch Exec/Icon so it integrates nicely)
  install -Dm644 "resources/${_pkgname}.desktop" \
    "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

  sed -i \
    -e "s|^Exec=.*|Exec=${_pkgname}|" \
    -e "s|^Icon=.*|Icon=${_pkgname}|" \
    "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

  # Icons (install both names: the patched one + upstream one for safety)
  install -Dm644 "resources/icons/app_icon.png" \
    "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${_pkgname}.png"
  install -Dm644 "resources/icons/app_icon.png" \
    "${pkgdir}/usr/share/icons/hicolor/256x256/apps/app_icon.png"

  # License
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}