summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7a93613c867966d2be6a9ebad15bd98ee35d5cdc (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
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: Ted Alff <twa022 at gmail dot com>
pkgname=touchpad-indicator-git
pkgver=2.2.3.ubuntu20.04.0.r137.86064c7
pkgrel=1
pkgdesc="An indicator for the touchpad"
arch=('any')
url="https://github.com/atareao/Touchpad-Indicator"
license=('GPL-3.0-or-later')
depends=(
  'gtk3'
  'libappindicator-gtk3'
  'libnotify'
  'lsb-release'
  'librsvg'
  'python-xlib'
  'python-pyudev'
  'python-dbus'
  'python-evdev'
  'xorg-xinput'
)
makedepends=('git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${pkgname%-git}::git+https://github.com/atareao/Touchpad-Indicator.git")
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname%-git}"
  printf "%s.r%s.%s" "$(head -n 1 debian/changelog | cut -d'(' -f 2 | cut -d')' -f 1 | \
    sed 's/-/./')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
 }

prepare() {
  cd "${pkgname%-git}"

  # Install locales to correct directory
  find . -type f -exec \
    sed -i -e 's:locale-langpack:locale:g' '{}' \;

  # Create a script to install the translations from the debian rules file
  grep -A 1000 "Create languages directories" debian/rules | \
    grep -B 1000 "End comile languages" | \
    sed "s:\${CURDIR}/debian/touchpad-indicator:\"$pkgdir\":g" > make_translations.sh
  chmod +x make_translations.sh
}

package() {
  cd "${pkgname%-git}"
  while read _in _out ; do
    mkdir -p "$pkgdir/$_out/"
    install -m644 ${_in} "$pkgdir/$_out/"
  done < debian/install
  chmod 755 "$pkgdir/usr/bin/${pkgname%-git}"
  chmod -R 755 \
    "$pkgdir"/{usr/lib/systemd/system-sleep,usr/share/"${pkgname%-git}",etc/pm/sleep.d}
  ./make_translations.sh
}