-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakepkg.sh
executable file
·72 lines (61 loc) · 1.28 KB
/
makepkg.sh
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
#!/bin/bash -ex
# first arg
version="$1"
rootfs="package/rootfs"
emhttp="$rootfs/usr/local/emhttp/plugins/un.recyclarr"
bin="$rootfs/usr/local/bin"
prepare() {
# delete previous stuff
rm -rf package
# create rootfs
mkdir -p $emhttp $bin
}
download() {
# get latest if dont specify version
if [[ -z "$version" ]]; then
release="latest/download"
else
release="download/v$version"
fi
# download and extract
wget -qO- --show-progress "https://github.com/recyclarr/recyclarr/releases/$release/recyclarr-linux-x64.tar.xz" | tar -xvJ -C $bin
}
frontend_build() {
# assuming you have node, install deps
pnpm install --frozen-lockfile
# build
pnpm build --minify-syntax --minify-whitespace
}
copy() {
# copy emhttp plugin
cp -av source/* $emhttp
# remove frontend sources
rm -rf $emhttp/assets/{entry.js,modules}
}
compress() {
# change workdir to rootfs
cd $rootfs
# create the package
tar --numeric-owner --owner=0 --group=0 -cvJf ../un.recyclarr.txz .
# restore workdir
cd ../../
}
checksum() {
# change workdir to package
cd package
# create md5 file
md5sum un.recyclarr.txz | tee un.recyclarr.txz.md5
# restore workdir
cd ../
}
clean() {
# delete rootfs
rm -rf $rootfs
}
prepare
download
frontend_build
copy
compress
checksum
clean