summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a77d19154dca8722fecbf30568ca424ed5deeb3b (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
# Maintainer:

: ${_build_man_extra=false}

export -n BROWSER EDITOR VISUAL PAGER TERMINAL_EMULATOR

_pkgname="sensible-utils"
pkgname="$_pkgname-git"
pkgver=0.0.24.r7.gc81fe21
pkgrel=1
pkgdesc="Utilities for sensible alternative selection"
url="https://salsa.debian.org/debian/sensible-utils"
license=('GPL-2.0-or-later')
arch=('any')

depends=(
  'bash'
)
makedepends=(
  'git'
  'po4a'
)
checkdepends=(
  'ed'
  'shellcheck'
)

provides=("$_pkgname=${pkgver%.r*}")
conflicts=(
  "$_pkgname"
  'sensible-browser-git'
  'sensible-editor-git'
  'sensible-pager-git'
  'sensible-terminal-git'
  'sensible-utils-data-git'
)

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --match='debian/*' --exclude='debian/*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$_pkgsrc"
  ./configure --prefix=/usr
  make
}

check() {
  cd "$_pkgsrc"
  make -k check || true
}

package() {
  cd "$_pkgsrc"
  make DESTDIR="$pkgdir/" install

  if [ "${_build_man_extra::1}" != "t" ]; then
    rm -rf "$pkgdir/usr/share/man"/[a-z][a-z]/
  fi
}