summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fdd9bd2cefa1b635f8e8c237f1f398ae680f147f (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
# Maintainer: Johannes Wienke <languitar@semipol.de>

pkgname=autosuspend
pkgver=7.2.0
pkgrel=2
pkgdesc="A daemon to suspend and wake up a system based on configurable checks"
arch=(any)
url="https://github.com/languitar/autosuspend"
license=('GPL-2.0-only')
depends=('python' 'python-psutil' 'python-portalocker')
optdepends=('python-dbus: logind session discovery and system timer checks'
  'python-mpd2: MPD playing status check'
  'python-requests: network-based checks'
  'python-lxml: XPath check'
  'python-dbus: logind-based checks'
  'python-icalendar: iCalendar checks'
  'python-dateutil: iCalendar checks'
  'python-tzlocal: iCalendar checks'
  'python-requests-file: file:// URL support'
  'python-jsonpath-ng: JSONPath checks'
  'iputils: ping check'
  'xprintidle: X server idle time check')
makedepends=('python-setuptools'
  'python-pytest-runner'
  'python-recommonmark'
  'python-sphinx'
  'python-sphinx-furo'
  'python-sphinx-issues'
  'python-sphinxcontrib-plantuml'
  'python-sphinx-autodoc-typehints')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/languitar/autosuspend/archive/v${pkgver}.tar.gz")
sha256sums=('de804e9b9f4b4a6251fa4869d05458e284d95bedd3581592f6714ac3fa846afc')
backup=('etc/autosuspend.conf'
  'etc/autosuspend-logging.conf')

build() {
  cd "$pkgname-${pkgver}"
  python -m build --wheel --no-isolation
  export PYTHONPATH=$(pwd)/src
  sphinx-build -a -b html doc/source/ doc/build/html
  sphinx-build -a -b man doc/source/ doc/build/man
  rm -rf doc/build/html/.doctrees
}

package() {
  cd "$pkgname-${pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl
  # setuptools install_data is a nightmare, and cannot be made to respect the
  # filesystem hierarchy. Do things manually instead.
  mv "$pkgdir/usr/etc" "$pkgdir"

  # # man pages
  mkdir -p "${pkgdir}/usr/share/man/man1"
  cp doc/build/man/autosuspend.1 "${pkgdir}/usr/share/man/man1"
  mkdir -p "${pkgdir}/usr/share/man/man5"
  cp doc/build/man/autosuspend.conf.5 "${pkgdir}/usr/share/man/man5"

  # # HTML help
  mkdir -p "${pkgdir}/usr/share/doc"
  cp -R doc/build/html "${pkgdir}/usr/share/doc/${pkgname}"
}