summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3524149aa42c022c0f0b9d5897db784084558c12 (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
# Maintainer: Michael Unterkalmsteiner <miciu AT gmx DOT de>
pkgname=tpkbdctl-git
pkgver=20150819
pkgrel=1
pkgdesc="A tool that can be used to control features of the \"Lenovo ThinkPad USB Keyboard with TrackPoint\""
arch=('i686' 'x86_64')
url="https://github.com/bseibold/tpkbdctl"
license=('GPL2')
depends=('linux>=3.0' 'python')
makedepends=('git' 'python-setuptools')
backup=('etc/default/tpkbdctl')
install=tpkbdctl.install
source=(10-tpkbdctl.rules
	      tpkbdctl.default
        tpkbdctl_runner)
md5sums=('47dc611bbbef728ab5f016afbd3e86b5'
         'cc40b7b7c32ed713aafabc0af385a168'
         '69fd4aafd2a21798f86d98a9eb2d6ecd')

_gitroot=https://github.com/bseibold/tpkbdctl.git
_gitname=tpkbdctl

build() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin
    msg "The local files are updated."
  else
    git clone "$_gitroot" "$_gitname" 
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_gitname-build"
  mkdir "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname" && ls -A | grep -v .git | xargs -d '\n' cp -r -t ../$_gitname-build # do not copy over the .git folder
  cd "$srcdir/$_gitname-build"
}

package() {
  cd "$srcdir/$_gitname-build"
  python setup.py install --root=$pkgdir --optimize=1

  #install udev rule
  install -D -m644 $srcdir/10-tpkbdctl.rules $pkgdir/etc/udev/rules.d/10-tpkbdctl.rules

  #install default configuration file
  install -D -m644 $srcdir/tpkbdctl.default $pkgdir/etc/default/tpkbdctl

  #install runner
  install -D -m744 $srcdir/tpkbdctl_runner $pkgdir/usr/bin/tpkbdctl_runner
}

# vim:set ts=2 sw=2 et: