blob: 4f798bb4d1da3ec18b19176ab0a3cca072718e0b (
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
|
# Maintainer: Julien Virey <julien.virey@gmail.com>
pkgname=profilarr
pkgver=2.0.9
pkgrel=1
pkgdesc="Configuration Management Platform for Radarr/Sonarr"
arch=('x86_64')
url="https://github.com/Dictionarry-Hub/profilarr"
license=('AGPL-3.0-only')
depends=(sqlite)
makedepends=(deno)
backup=(etc/profilarr/profilarr.env)
source=(
"$pkgname-$pkgver.tar.gz::${url}/archive/refs/tags/v$pkgver.tar.gz"
profilarr.env
profilarr.service
profilarr.sysusers
profilarr.tmpfiles
)
sha256sums=('2ff07ce99a5803b060a4c7db25110ff0883417b284fcd76e37a517b404ef486a'
'78e0fc2bb22b9d68a45451eb1c5fba394c0bb90e20d3a11e215dddd3a6463976'
'7129166a5a4d5b08d830c9556252eaf7f05d0a4f31b0da708d8d4bccfea78d2d'
'111c8a11133470edb6b155a5e42aec7d904176e7f633d8f1922f1b1b57daade2'
'5e9ccf541c980e1a0742a2cf3e36338ac02430a742a7a3c4bc209a5136c9e577')
build() {
cd "$pkgname-$pkgver"
export APP_BASE_PATH=build/dist/build
export VITE_CHANNEL=stable
export VITE_PLATFORM=linux-amd64
export PROFILARR_VERSION=$pkgver
export PROFILARR_COMMIT=unknown
export PROFILARR_BUILT_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
# Use system libsqlite3
export DENO_SQLITE_PATH=/usr/lib/libsqlite3.so
export DENO_DIR="$srcdir/deno-cache"
deno install --node-modules-dir
cat > src/lib/shared/build.ts <<EOF
export type Channel = 'stable' | 'develop' | 'dev';
export interface BuildInfo {
readonly version: string;
readonly channel: Channel;
readonly commit: string | null;
readonly builtAt: string | null;
}
export const build: BuildInfo = {
version: '${PROFILARR_VERSION}',
channel: '${VITE_CHANNEL}',
commit: '${PROFILARR_COMMIT}',
builtAt: '${PROFILARR_BUILT_AT}'
};
EOF
#deno task build
deno run -A npm:vite build
deno eval "import { hash } from '@felix/bcrypt'; await hash('profilarr')"
deno compile \
--no-check \
--allow-net \
--allow-read \
--allow-write \
--allow-env \
--allow-ffi \
--allow-run \
--allow-sys \
--target x86_64-unknown-linux-gnu \
--output dist/build/profilarr \
dist/build/mod.ts
}
package() {
# Systemd
install -Dm644 "$pkgname.env" "$pkgdir/etc/$pkgname/$pkgname.env"
install -Dm755 "$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
install -Dm644 "$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
install -Dm644 "$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
# App
cd "$pkgname-$pkgver"
install -dm755 "$pkgdir/usr/share/webapps/profilarr"
cp -r dist/build/{static,server.js,$pkgname} "$pkgdir/usr/share/webapps/profilarr/"
install -dm755 "$pkgdir/usr/share/webapps/profilarr/deno-cache"
cp -r "$srcdir/deno-cache/plug" "$pkgdir/usr/share/webapps/profilarr/deno-cache/plug"
}
|