blob: 8b243fb3bb6a8b12ee46b2a0cbb21b8e7836aa80 (
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
# Contributor: Maxim Devaev <[email protected]>
# Author: Maxim Devaev <[email protected]>
[ -n "$PIKVM_PLATFORM" ] || PIKVM_PLATFORM="v0-vga v0-hdmi v1-vga v1-hdmi"
[ -n "$PIKVM_BOARD" ] || PIKVM_BOARD="rpi2 rpi3"
pkgname=(kvmd)
for _platform in $PIKVM_PLATFORM; do
for _board in $PIKVM_BOARD; do
pkgname+=(kvmd-platform-$_platform-$_board)
done
done
pkgbase=kvmd
pkgver=0.182
pkgrel=1
pkgdesc="The main Pi-KVM daemon"
url="https://github.com/pi-kvm/kvmd"
license=(GPL)
arch=(any)
depends=(
python
python-yaml
python-aiohttp
python-aiofiles
python-passlib
python-raspberry-gpio
python-pyserial
python-setproctitle
python-systemd
python-dbus
python-pygments
python-pyghmi
psmisc
v4l-utils
nginx-mainline
openssl
raspberrypi-io-access
)
optdepends=(
dkms
tc358743-dkms
)
makedepends=(python-setuptools)
source=("$url/archive/v$pkgver.tar.gz")
md5sums=(SKIP)
build() {
cd "$srcdir"
rm -rf $pkgname-build
cp -r kvmd-$pkgver $pkgname-build
cd $pkgname-build
python setup.py build
}
package_kvmd() {
install=$pkgname.install
cd "$srcdir/$pkgname-build"
python setup.py install --root="$pkgdir"
mkdir -p "$pkgdir/usr/lib/systemd/system"
cp configs/os/systemd/*.service "$pkgdir/usr/lib/systemd/system"
mkdir -p "$pkgdir/usr/lib/tmpfiles.d"
cp configs/os/tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/kvmd.conf"
mkdir -p "$pkgdir/usr/share/kvmd"
cp -r web "$pkgdir/usr/share/kvmd"
cp -r extras "$pkgdir/usr/share/kvmd"
local _cfg_default="$pkgdir/usr/share/kvmd/configs.default"
mkdir -p "$_cfg_default"
cp -r configs/* "$_cfg_default"
rm -rf "$_cfg_default/os/systemd"
find "$pkgdir" -name ".gitignore" -delete
sed -i -e "s/^#PROD//g" "$_cfg_default/nginx/nginx.conf"
find "$_cfg_default" -type f -exec chmod 444 '{}' \;
chmod 400 "$_cfg_default/kvmd"/*passwd
mkdir -p "$pkgdir/etc/kvmd/nginx/ssl"
chmod 750 "$pkgdir/etc/kvmd/nginx/ssl"
for _path in "$_cfg_default/kvmd"/*.yaml; do
ln -sf "/usr/share/kvmd/configs.default/kvmd/`basename $_path`" "$pkgdir/etc/kvmd"
done
rm "$pkgdir/etc/kvmd"/{override.yaml,logging.yaml,auth.yaml,meta.yaml}
cp "$_cfg_default/kvmd"/{override.yaml,logging.yaml,auth.yaml,meta.yaml} "$pkgdir/etc/kvmd"
cp "$_cfg_default/kvmd/"*passwd "$pkgdir/etc/kvmd"
chmod 600 "$pkgdir/etc/kvmd/"*passwd
for _path in "$_cfg_default/nginx"/*.conf; do
ln -sf "/usr/share/kvmd/configs.default/nginx/`basename $_path`" "$pkgdir/etc/kvmd/nginx"
done
}
for _platform in $PIKVM_PLATFORM; do
for _board in $PIKVM_BOARD; do
eval "package_kvmd-platform-$_platform-$_board() {
pkgdesc=\"Pi-KVM platform configs - $_platform for $_board\"
mkdir -p \"\$pkgdir/etc\"/{kvmd,sysctl.d,udev/rules.d,modules-load.d}
local _cfg_default=\"/usr/share/kvmd/configs.default\"
ln -sf \"\$_cfg_default/os/sysctl.conf\" \"\$pkgdir/etc/sysctl.d/99-pikvm.conf\"
ln -sf \"\$_cfg_default/os/udev/$_platform-$_board.rules\" \"\$pkgdir/etc/udev/rules.d/99-pikvm.rules\"
ln -sf \"\$_cfg_default/os/modules-load/$_platform.conf\" \"\$pkgdir/etc/modules-load.d/pikvm.conf\"
ln -sf \"\$_cfg_default/kvmd/main/$_platform.yaml\" \"\$pkgdir/etc/kvmd/main.yaml\"
if [ $_platform == v1-hdmi ]; then
ln -sf \"\$_cfg_default/kvmd/tc358743-edid.hex\" \"\$pkgdir/etc/kvmd/tc358743-edid.hex\"
fi
}"
done
done
|