# Maintainer: Hao Long <imlonghao@archlinuxcn.org>

pkgname=safeeyes-git
pkgver=3.5.0.r12.g280f1cb7
pkgrel=2
pkgdesc='A Free and Open Source tool for Linux users to reduce and prevent repetitive strain injury (RSI)'
arch=('any')
url='https://github.com/slgobinath/SafeEyes'
license=('GPL-3.0-or-later')
depends=('libappindicator-gtk3'
  'python-babel'
  'python-dbus'
  'python-gobject'
  'python-psutil'
  'python-setuptools'
  'python-xlib')
makedepends=('git')
optdepends=('alsa-utils: for audible alert plugin'
  'xorg-xprop: for skip fullscreen plugin'
  'xprintidle: for smart pause plugin')
provides=('safeeyes')
conflicts=('safeeyes')
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

prepare() {
  cd $pkgname
  sed -i 's/site.USER_BASE or //' setup.py
}

pkgver() {
  cd $pkgname
  git describe --long --tags | sed 's/^v*//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname
  python setup.py build
}

package() {
  cd $pkgname
  python setup.py install --root=$pkgdir --optimize=1 --skip-build
}
