blob: c65616f4a23ec3b2caab1bddad3e67ef59ed69d2 (
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
|
# Maintainer: Bill Durr <billyburly@gmail.com>
# Maintainer: Giovanni Harting
pkgname=zwave-js-ui
pkgver=9.21.1
pkgrel=1
epoch=1
pkgdesc="Full featured Z-Wave Control Panel UI and MQTT gateway"
arch=('any')
url="https://github.com/zwave-js/zwave-js-ui"
license=('MIT')
depends=(nodejs-lts-iron)
replaces=(zwavejs2mqtt)
makedepends=(npm node-gyp)
backup=("etc/zwave-js-ui/app.ts")
install=zwave-js-ui.install
source=("https://github.com/zwave-js/$pkgname/archive/refs/tags/v$pkgver.tar.gz"
"$pkgname.sysusers"
"$pkgname.tmpfiles"
"$pkgname.service"
"$pkgname.install")
b2sums=('1c0f24deb0b93d44798f8ac5b87cd34c4e443095f487f5e2dad2892284be64ab0beebb07735a55b6c1f05af80cbf7c4284b24950afce75be3182b273aac8cc50'
'20fe5b3391e8ef54b7047c082b183e492bea4b6b9dac11ebfa69e98ca6f6889cfde7a55897f6a6a8d91a2753a3a316cde8c4802d4e23a65bf421eeac8a2725fe'
'e2d3de5e1446f5b1f7c97581a0fa66022050993399d23afba63079ba6c690f995708dffca442170da44abc526103143fbecb94e95a9b7d85fcbf37b3fc49db5e'
'8b2c0b4e3659297e311f7f3ae69d337cddfc6dc55a5edc4f39bf8a26bc728cfb7ca5fe56d89e253d17d74646336f53d5cacac5b18cc94f2be8fd29ff900615de'
'81d0797c68818d8444181ff9d81646721d10dc44774e1deb564a172f118e7070236f7fca5cefca9830636f739aec479e3cf0c18b536e8a72eccd88f1444be10f')
build() {
cd "$pkgname-$pkgver"
npm install
npm run build
}
package() {
cd "$pkgname-$pkgver"
# taken from hedgedoc in [community], thanks Mr. van der Waa :)
# removing unneeded files and directories
find node_modules -type f \
\( \
-iname '*Makefile*' -o \
-iname '*.cache' -o \
-iname '*Makefile*' -o \
-iname '*appveyor.yml' -o \
-iname '*.babelrc' -o \
-iname '*.bak' -o \
-iname '*bower.json' -o \
-iname '*.c' -o \
-iname '*.cc' -o \
-iname '*.cpp' -o \
-iname '*.md' -o \
-iname '*.markdown' -o \
-iname '*.rst' -o \
-iname '*.nycrc' -o \
-iname '*.npmignore' -o \
-iname '*.editorconfig' -o \
-iname '*.el' -o \
-iname '*.eslintignore' -o \
-iname '*.eslintrc*' -o \
-iname '*.fimbullinter.yaml' -o \
-iname '*.gitattributes' -o \
-iname '*.gitmodules' -o \
-iname '*.h' -o \
-iname '*.html' -o \
-iname '*.jshintrc' -o \
-iname '*.jscs.json' -o \
-iname '*.log' -o \
-iname '*logo.svg' -o \
-iname '*.nvmrc' -o \
-iname '*.o' -o \
-iname '*package-lock.json' -o \
-iname '*.travis.yml' -o \
-iname '*.prettierrc' -o \
-iname '*.sh' -o \
-iname '*.tags*' -o \
-iname '*.Dockerfile*' -o \
-iname '*.tm_properties' -o \
-iname '*.wotanrc.yaml' -o \
-iname '*tsconfig.json' -o \
-iname '*.py' -o \
-iname '*yarn.lock' \
\) \
-delete
find node_modules -type d \
\( \
-iwholename '*.github' -o \
-iwholename '*.tscache' -o \
-iwholename '*/man' -o \
-iwholename '*/scripts' -o \
-iwholename '*/git-hooks' -o \
-iwholename '*/win32-ia32' -o \
-iwholename '*/win32-x64' -o \
-iwholename '*/__pycache__' -o \
-iwholename '*/darwin-x64' \
\) \
-exec rm -rvf {} +
install -d "$pkgdir"/usr/share/webapps/$pkgname/dist/ "$pkgdir"/etc/$pkgname/ "$pkgdir"/usr/share/webapps/$pkgname/snippets
cp -r {node_modules,server} "$pkgdir"/usr/share/webapps/$pkgname
cp -r api/{bin,lib,app.ts} "$pkgdir"/usr/share/webapps/$pkgname
cp -r dist/* "$pkgdir"/usr/share/webapps/$pkgname/dist/
cp -r snippets/* "$pkgdir"/usr/share/webapps/$pkgname/snippets
cp -r api/config/* "$pkgdir"/etc/$pkgname/
ln -s /etc/$pkgname/ "$pkgdir"/usr/share/webapps/$pkgname/config
ln -s /var/lib/$pkgname "$pkgdir"/usr/share/webapps/$pkgname/store
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
install -Dm644 "${srcdir}"/$pkgname.sysusers "${pkgdir}"/usr/lib/sysusers.d/$pkgname.conf
install -Dm644 "${srcdir}"/$pkgname.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/$pkgname.conf
install -Dm644 "${srcdir}"/$pkgname.service -t "$pkgdir"/usr/lib/systemd/system/
install -Dm644 package.json "$pkgdir"/usr/share/webapps/$pkgname/package.json
}
|