summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoracerix2021-12-11 16:33:40 -0500
committeracerix2021-12-11 16:33:40 -0500
commitc8d5f336f501cc0a37d81fc9861abe1a9fb01c28 (patch)
tree4b942142121f895e64e2b243423aed2f51828c3d
downloadaur-c8d5f336f501cc0a37d81fc9861abe1a9fb01c28.tar.gz
Init
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD72
-rw-r--r--aquatic-http.service13
-rw-r--r--aquatic-udp.service13
-rw-r--r--aquatic-ws.service13
-rw-r--r--aquatic.install15
6 files changed, 146 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9fbfb0003477
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = aquatic-udp
+ pkgdesc = A multi-threaded BitTorrent tracker written in Rust.
+ pkgver = r1076.222fac0
+ pkgrel = 1
+ url = https://github.com/greatest-ape/aquatic
+ install = aquatic.install
+ arch = x86_64
+ license = Apache License 2.0
+ makedepends = rustup
+ source = git+https://github.com/greatest-ape/aquatic
+ sha512sums = SKIP
+
+pkgname = aquatic-udp
+ pkgdesc = A multi-threaded BitTorrent tracker written in Rust - UDP daemon.
+
+pkgname = aquatic-http
+ pkgdesc = A multi-threaded BitTorrent tracker written in Rust - HTTPS daemon.
+
+pkgname = aquatic-ws
+ pkgdesc = A multi-threaded BitTorrent tracker written in Rust - WebSocket daemon.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a882473e31bb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,72 @@
+# Maintainer: Dylan Ferris (acerix) <dylan@pow7.com>
+
+_pkgbase=aquatic
+pkgname=(aquatic-udp aquatic-http aquatic-ws)
+pkgver=r1076.222fac0
+pkgrel=1
+pkgdesc="A multi-threaded BitTorrent tracker written in Rust."
+url="https://github.com/greatest-ape/aquatic"
+arch=(x86_64)
+license=("Apache License 2.0")
+makedepends=(rustup)
+source=("git+https://github.com/greatest-ape/aquatic")
+sha512sums=("SKIP")
+install="$_pkgbase.install"
+
+pkgver() {
+ cd $_pkgbase
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ rustup install stable
+ rustup default stable
+}
+
+build() {
+ cd $_pkgbase
+
+ # Enable support for CPU all extensions on current CPU except ~AVX-512.
+ . ./scripts/env-native-cpu-without-avx-512
+
+ # Compile
+ cargo build --release -p aquatic_udp
+ cargo build --release -p aquatic_http
+ cargo build --release -p aquatic_ws # --features "with-glommio" --no-default-features
+
+ # Generate config files
+ ./target/release/aquatic_udp -p > aquatic_udp.toml
+ ./target/release/aquatic_http -p > aquatic_http.toml
+ ./target/release/aquatic_ws -p > aquatic_ws.toml
+}
+
+check() {
+ cd $_pkgbase
+ RUSTC_BOOTSTRAP=1 cargo test --release
+}
+
+package_aquatic-udp() {
+ pkgdesc="A multi-threaded BitTorrent tracker written in Rust - UDP daemon."
+ _binname="aquatic_udp"
+ install -Dm755 $_pkgbase/target/release/$_binname $pkgdir/usr/bin/$pkgname
+ install -Dm644 $_pkgbase/$_binname.toml $pkgdir/etc/$_pkgbase/$pkgname.toml
+ install -Dm644 ../$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
+}
+
+package_aquatic-http() {
+ pkgdesc="A multi-threaded BitTorrent tracker written in Rust - HTTPS daemon."
+ _binname="aquatic_http"
+ install -Dm755 $_pkgbase/target/release/$_binname $pkgdir/usr/bin/$pkgname
+ install -Dm644 $_pkgbase/$_binname.toml $pkgdir/etc/$_pkgbase/$pkgname.toml
+ install -Dm644 ../$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
+}
+
+package_aquatic-ws() {
+ pkgdesc="A multi-threaded BitTorrent tracker written in Rust - WebSocket daemon."
+ _binname="aquatic_ws"
+ install -Dm755 $_pkgbase/target/release/$_binname $pkgdir/usr/bin/$pkgname
+ install -Dm644 $_pkgbase/$_binname.toml $pkgdir/etc/$_pkgbase/$pkgname.toml
+ install -Dm644 ../$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/aquatic-http.service b/aquatic-http.service
new file mode 100644
index 000000000000..1d5d4cc4daf2
--- /dev/null
+++ b/aquatic-http.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=aquatic HTTPS daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/aquatic-http -c /etc/aquatic/aquatic-http.toml
+Type=simple
+User=aquatic
+Group=aquatic
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/aquatic-udp.service b/aquatic-udp.service
new file mode 100644
index 000000000000..8281ffe8a971
--- /dev/null
+++ b/aquatic-udp.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=aquatic UDP daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/aquatic-udp -c /etc/aquatic/aquatic-udp.toml
+Type=simple
+User=aquatic
+Group=aquatic
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/aquatic-ws.service b/aquatic-ws.service
new file mode 100644
index 000000000000..90fc885bd700
--- /dev/null
+++ b/aquatic-ws.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=aquatic WebSocket daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/aquatic-ws -c /etc/aquatic/aquatic-ws.toml
+Type=simple
+User=aquatic
+Group=aquatic
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/aquatic.install b/aquatic.install
new file mode 100644
index 000000000000..0517a8ccd171
--- /dev/null
+++ b/aquatic.install
@@ -0,0 +1,15 @@
+post_install() {
+ getent group aquatic > /dev/null || groupadd -r aquatic
+ getent passwd aquatic > /dev/null || useradd -r -m -d /var/lib/aquatic -g aquatic -s /usr/bin/nologin aquatic
+ usermod -a -G network aquatic
+ mkdir -p /var/lib/aquatic
+ chown -R aquatic:aquatic /var/lib/aquatic
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ getent passwd aquatic > /dev/null && userdel aquatic
+}