summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2c9235c5c6690ca6b1f775263470f44229afa9f6 (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
# Maintainer: littzhch <2371050115@qq.com>
_pkgname=ustcwakeup
pkgname=$_pkgname-git
pkgver=r27.72c3a12
pkgrel=2
epoch=
pkgdesc="将USTC教务系统中的课程表导出为WakeUp备份文件"
arch=('any')
url="https://github.com/littzhch/ustc-wakeup"
license=('custom:GLWTPL')
groups=()
depends=('python' 'python-requests' 'python-pillow')
makedepends=('git')
checkdepends=()
optdepends=()
provides=("$_pkgname")
conflicts=("$_pkgname")
replaces=()
backup=()
options=()
install=
changelog=
source=("$_pkgname::git+$url.git")
noextract=()
md5sums=('SKIP')
validpgpkeys=()

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

build() {
	cd "$srcdir/$_pkgname"
	python -m py_compile *.py
	echo "#!/bin/sh
python /usr/share/$_pkgname/main.py \"\$@\"
" > ustcwakeup
}

package() {
	cd "$srcdir/$_pkgname"
	install -Dm644 -t "$pkgdir/usr/share/$_pkgname" *.py
	install -Dm644 -t "$pkgdir/usr/share/$_pkgname/__pycache__" __pycache__/*
	install -Dm755 -t "$pkgdir/usr/bin" ustcwakeup
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
}