mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-30 19:01:25 +02:00
testing/udpt: new aport
This commit is contained in:
parent
9669b70049
commit
c4736f1fad
41
testing/udpt/APKBUILD
Normal file
41
testing/udpt/APKBUILD
Normal file
@ -0,0 +1,41 @@
|
||||
# Contributor: Thomas Kienlen <kommander@laposte.net>
|
||||
# Maintainer: Thomas Kienlen <kommander@laposte.net>
|
||||
pkgname=udpt
|
||||
pkgver=3.1.1
|
||||
pkgrel=0
|
||||
pkgdesc="Lightweight UDP torrent tracker"
|
||||
url="https://github.com/naim94a/udpt"
|
||||
arch="x86_64 armv7 armhf aarch64 x86 ppc64le" # limited by rust/cargo
|
||||
license="MIT"
|
||||
makedepends="cargo"
|
||||
pkgusers="udpt"
|
||||
pkggroups="udpt"
|
||||
install="udpt.pre-install"
|
||||
subpackages="$pkgname-openrc"
|
||||
source="https://github.com/naim94a/udpt/archive/udpt-$pkgver/udpt-$pkgver.tar.gz
|
||||
udpt.initd
|
||||
udpt.conf
|
||||
cargo.toml.patch
|
||||
"
|
||||
builddir="$srcdir/udpt-udpt-$pkgver"
|
||||
|
||||
build() {
|
||||
cargo build --release --locked
|
||||
}
|
||||
|
||||
check() {
|
||||
cargo test --locked --target-dir=target
|
||||
}
|
||||
|
||||
package() {
|
||||
install -D -m 755 target/release/udpt-rs "$pkgdir/usr/bin/udpt"
|
||||
install -D -m 755 "$srcdir/udpt.initd" "$pkgdir/etc/init.d/udpt"
|
||||
install -D -m 660 -o udpt -g udpt "$srcdir/udpt.conf" "$pkgdir/etc/udpt.conf"
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
05a707ec22d0d27ef7ed47eb2144b27c448ae48cc78d7fa9492a81911a7a8759768b079ab71df2a1ae63897241b70712dc0728fe6877481680d53e87536b1ff5 udpt-3.1.1.tar.gz
|
||||
e233e4d76a0ad458579810ebb9d5697604bfebb0f51f218bcd27ceff55d2a86c50bc28b278da6793f6e688492eb962043f1e876852b3d8dcec046bff56abe78b udpt.initd
|
||||
9646e424a2fe4355745241ce84f989453bf75b26bad772d2ba7e72eade6b51d5f8d4b6e3eb671edff3c892a47dda029a3aed93276a3a4f992db13cce57e1521d udpt.conf
|
||||
a154f539a10419fb7f3ff3c47938d15960ef74f41c537c8dbc8435a460b506506c431b1331d4e6b62dd6aaf0b7cf6d7f98fd17b9d49779043a308b6b4152497c cargo.toml.patch
|
||||
"
|
16
testing/udpt/cargo.toml.patch
Normal file
16
testing/udpt/cargo.toml.patch
Normal file
@ -0,0 +1,16 @@
|
||||
Optimize binary size (2.3 MB -> 1.5 MB)
|
||||
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -6,7 +6,10 @@ description = "High performance torrent
|
||||
edition = "2018"
|
||||
|
||||
[profile.release]
|
||||
-lto = "fat"
|
||||
+codegen-units = 1
|
||||
+lto = true
|
||||
+opt-level = "z"
|
||||
+panic = "abort"
|
||||
|
||||
[dependencies]
|
||||
serde = {version = "1.0", features = ["derive"]}
|
13
testing/udpt/udpt.conf
Normal file
13
testing/udpt/udpt.conf
Normal file
@ -0,0 +1,13 @@
|
||||
mode = "dynamic"
|
||||
db_path = "/var/lib/udpt/database.json.bz2"
|
||||
log_level = "info"
|
||||
|
||||
[udp]
|
||||
announce_interval = 120 # Two minutes
|
||||
bind_address = "0.0.0.0:1212"
|
||||
|
||||
# [http]
|
||||
# bind_address = "127.0.0.1:1212"
|
||||
#
|
||||
# [http.access_tokens]
|
||||
# someone = "MyAccessToken"
|
20
testing/udpt/udpt.initd
Normal file
20
testing/udpt/udpt.initd
Normal file
@ -0,0 +1,20 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="UDP bittorrent Tracker"
|
||||
supervisor=supervise-daemon
|
||||
command=/usr/bin/udpt
|
||||
command_args="-c /etc/udpt.conf"
|
||||
command_user="udpt:udpt"
|
||||
output_log=/var/log/$RC_SVCNAME.log
|
||||
stopsig="SIGINT"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner $command_user --mode 0775 \
|
||||
/var/lib/$RC_SVCNAME
|
||||
checkpath --file --owner $command_user --mode 0644 \
|
||||
/var/log/$RC_SVCNAME.log
|
||||
}
|
5
testing/udpt/udpt.pre-install
Executable file
5
testing/udpt/udpt.pre-install
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
addgroup -S udpt 2>/dev/null
|
||||
adduser -S -D -H -h /dev/null -s /sbin/nologin -g udpt udpt 2>/dev/null
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user