summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4d1088942bf98e52996b32a56708d5fb4c4dfeee (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
# Maintainer: malacology
# Maintainer: Chih-Hsuan Yen <yan12125@gmail.com>
# Maintainer: lilydjwg <lilydjwg@gmail.com>

_pkgname=lilac
pkgname=$_pkgname-git
pkgver=r1047.9bbc121
pkgrel=1
pkgdesc='The build bot for archlinuxcn'
arch=(any)
url='https://github.com/archlinuxcn/lilac'
license=(GPL3)
depends=(python git devtools nvchecker gnupg pid_children fakeroot bubblewrap pacman-contrib
         python-requests python-lxml python-yaml python-tomli python-tomli-w pyalpm
         python-structlog python-prctl)
makedepends=(python-setuptools-scm)
optdepends=(
  'smtp-forwarder: for sending error reports'
  'python-sqlalchemy: for recording build results in a database'
)
checkdepends=(python-pytest)
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=('git+https://github.com/archlinuxcn/lilac.git')
sha256sums=('SKIP')

pkgver() {
  cd $_pkgname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

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

check() {
  cd $_pkgname
  pytest
}

package() {
  cd $_pkgname
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
  install -Dm644 config.toml.sample scripts/dbsetup.sql -t "$pkgdir"/usr/share/doc/lilac
  install -Dm755 scripts/cleanup-dblck "$pkgdir"/usr/bin/cleanup-dblck
  install -Dm644 scripts/cleanup-dblck.service "$pkgdir"/usr/lib/systemd/system/cleanup-dblck.service
}