-
Notifications
You must be signed in to change notification settings - Fork 0
/
package
54 lines (50 loc) · 1.95 KB
/
package
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
pkgnames=(reterm)
pkgdesc="Landscape terminal support for the Remarkable 2 + type cover"
section="admin"
pkgver="$(date +'%Y%m%d.%H%M')-1"
timestamp="$(date -u +%Y-%m-%dT%H:%MZ)"
maintainer="i-am-shodan <[email protected]>"
url=https://github.com/i-am-shodan/ReTerm
license=MIT
source=(src.tar.gz)
sha256sums=(SKIP)
image=dotnet6:latest
makedepends=(build:gawk)
########################################
# This functions come from install-lib:
# https://raw.githubusercontent.com/toltec-dev/toltec/master/scripts/install-lib
########################################
is-active() {
systemctl --quiet is-active "$1" 2> /dev/null
}
########################################
# End of install-lib methods
########################################
build() {
dotnet publish \
-r linux-arm \
--self-contained true \
-p:PublishSingleFile=true \
-p:PublishedTrimmed=true \
-p:PublishReadyToRun=true \
-p:Configuration=Release \
-p:PublishReadyToRunShowWarnings=true \
src/ReTerm/ReTerm.csproj
}
package() {
local pubdir
pubdir="$srcdir"/src/ReTerm/bin/Release/net6.0/linux-arm/publish
install -D -m 755 -t "$pkgdir"/opt/usr/lib/reterm "$pubdir"/ReTerm
install -D -m 755 -T "$pubdir"/ReTerm.sh "$pkgdir"/opt/bin/ReTerm
sed -i 's|/home/root/ReTerm/ReTerm|/opt/usr/lib/reterm/ReTerm|' "$pkgdir"/opt/bin/ReTerm
install -D -m 644 -t "$pkgdir"/opt/etc/draft "$srcdir"/draft/reterm.draft
sed -i 's|/home/root/ReTerm/ReTerm.sh|/opt/bin/ReTerm|' "$pkgdir"/opt/etc/draft/reterm.draft
sed -i 's|killall -9 dotnet|killall ReTerm|' "$pkgdir"/opt/etc/draft/reterm.draft
install -D -m 644 -t "$pkgdir"/opt/etc/draft/icons "$srcdir"/draft/reterm.png
install -D -m 644 -t "$pkgdir"/opt/usr/share/applications "$srcdir"/oxide/ReTerm.oxide
}
configure() {
if is-active "tarnish.service"; then
type update-desktop-database &> /dev/null && update-desktop-database
fi
}