blob: 1b4303ee7d737554fb751840e82dc6464a740a11 (
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# Maintainer: dreieck
_pkgname=paperlike-go
pkgname="${_pkgname}-git"
pkgver=r11.20210421.ad107f1
pkgrel=2
pkgdesc="CLI tool to control a Dasung Paperlike HD* (2019) screen."
arch=(
x86_64
i686
)
url="https://github.com/leoluk/paperlike-go"
license=('APACHE')
depends=()
makedepends=(
'git'
'go'
)
optdepends=()
provides=(
"${_pkgname}=${pkgver}"
"paperlike-cli=${pkgver}"
"paperlike-cli-git=${pkgver}"
)
conflicts=(
"${_pkgname}"
"paperlike-cli"
"paperlike-git"
)
source=(
"${_pkgname}::git+https://github.com/leoluk/paperlike-go.git"
)
sha256sums=(
'SKIP'
)
pkgver() {
GOPATH="${srcdir}/golang"
export GOPATH
cd "${srcdir}/${_pkgname}"
_rev="$(git rev-list HEAD --count)"
_date="$(git log -1 --format=%cd --date=format:%Y%m%d)"
_hash="$(git rev-parse --short HEAD)"
printf '%s' "r${_rev}.${_date}.${_hash}"
}
prepare() {
GOPATH="${srcdir}/golang"
export GOPATH
mkdir -p "${srcdir}/${_pkgname}/build"
cd "${srcdir}/${_pkgname}/build"
go get ../...
}
build() {
GOPATH="${srcdir}/golang"
export GOPATH
cd "${srcdir}/${_pkgname}"
printf '%s\n' "${url}" > "upstream.url"
go build -v -o build ./cmd/...
}
package() {
GOPATH="${srcdir}/golang"
export GOPATH
cd "${srcdir}/${_pkgname}"
install -D -v -m755 build/paperlike-cli "${pkgdir}/usr/bin/paperlike-cli"
install -D -v -m755 build/fuzz "${pkgdir}/usr/bin/paperlike-fuzz"
install -D -v -m755 build/sendraw "${pkgdir}/usr/bin/paperlike-sendraw"
for _docfile in upstream.url README.md notes.txt; do
install -D -v -m644 "${_docfile}" "${pkgdir}/usr/share/doc/${_pkgname}/${_docfile}"
done
install -D -v -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
ln -svr "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" "${pkgdir}/usr/share/doc/${_pkgname}/LICENSE"
}
|