blob: fad2ffda6c056cde5df83edb56ea33203f51800c (
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
|
pkgname=bitmagnet-git
pkgver=v0.7.7.r1.gaa135e0
pkgrel=1
pkgdesc='A self-hosted BitTorrent indexer, DHT crawler, content classifier and torrent search engine with web UI, GraphQL API and Servarr stack integration.'
arch=('any')
url="https://bitmagnet.io/"
license=("MIT")
depends=('glibc')
makedepends=('git' 'go')
optdepends=("postgresql: database"
"redis: cache"
"prometheus: metrics"
"loki: logs"
"grafana: dashboards"
"pyroscope: profiling")
provides=("bitmagnet=${pkgver}")
backup=("etc/bitmagnet/config.yml")
source=('git+https://github.com/bitmagnet-io/bitmagnet'
'config.yml'
'bitmagnet.service'
'dirs.conf'
'user.conf')
sha256sums=('SKIP'
'20f4a744e7b5f8549a66713bee5fcb65fcee58647370b2107adbc0f0bfc000c9'
'b8fe373d25c857f312cc4a88c4056065a9df39c5a2b3e560fd879723864c5b8f'
'5f80125347060d22175732fa0304df425178ae54282ccf2a3ce9e22a970b60ae'
'6289a984a94570fd25a0330646caabc20e6cb871d1b141d27cc98d6781d6b35a')
pkgver() {
cd "$srcdir/bitmagnet"
git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "$srcdir/bitmagnet"
sed -i 's|\./config\.yml|/etc/bitmagnet/config.yml|' internal/boilerplate/config/configfx/module.go
}
build() {
cd "$srcdir/bitmagnet"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
go build -buildmode=pie -mod=readonly -trimpath -ldflags "-X github.com/bitmagnet-io/bitmagnet/internal/version.GitTag=$pkgver"
}
package() {
cd "$srcdir/bitmagnet"
install -Dm755 -t "$pkgdir/usr/bin" bitmagnet
install -Dm640 -t "$pkgdir/etc/bitmagnet" "$srcdir/config.yml"
install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
install -D -t "$pkgdir/usr/lib/systemd/system/" "$srcdir/bitmagnet.service"
install -D "$srcdir/user.conf" "$pkgdir/usr/lib/sysusers.d/bitmagnet.conf"
install -D "$srcdir/dirs.conf" "$pkgdir/usr/lib/tmpfiles.d/bitmagnet.conf"
mkdir -p "$pkgdir/usr/share/$pkgname" "$pkgdir/usr/share/$pkgname/doc"
cp -R "observability" "$pkgdir/usr/share/$pkgname/"
#cp -R "bitmagnet.io/"* "$pkgdir/usr/share/$pkgname/doc/"
find "$pkgdir/etc/bitmagnet" -type f -exec chmod 640 {} + -o -type d -exec chmod 2750 {} +
}
|