summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoredward-p2024-04-07 13:48:37 +0800
committeredward-p2024-04-07 13:48:37 +0800
commit53e81808792e8d1595ac6b68fc8bedf819ce9b55 (patch)
treed03c72d005e8c2858d810a41d9262d024aa7dbf9
downloadaur-53e81808792e8d1595ac6b68fc8bedf819ce9b55.tar.gz
first commit
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD48
2 files changed, 70 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9f9480347839
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = einat-ebpf-git
+ pkgdesc = eBPF-based Endpoint-Independent NAT
+ pkgver = 0.1.0.r8.g9e6f8e6
+ pkgrel = 1
+ url = https://github.com/EHfive/einat-ebpf
+ arch = x86_64
+ license = GPL-2.0-or-later
+ makedepends = git
+ makedepends = cargo
+ makedepends = clang
+ depends = glibc
+ depends = gcc-libs
+ depends = zlib
+ depends = libelf
+ provides = einat
+ conflicts = einat
+ options = !lto
+ options = !debug
+ source = einat-ebpf::git+https://github.com/EHfive/einat-ebpf.git
+ sha512sums = SKIP
+
+pkgname = einat-ebpf-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..eb00d732b107
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: edward-p <edward at edward-p dot xyz>
+
+pkgname=einat-ebpf-git
+_pkgname=einat-ebpf
+_target=einat
+pkgver=0.1.0.r8.g9e6f8e6
+pkgrel=1
+pkgdesc="eBPF-based Endpoint-Independent NAT"
+arch=('x86_64')
+url="https://github.com/EHfive/einat-ebpf"
+license=('GPL-2.0-or-later')
+depends=('glibc' 'gcc-libs' 'zlib' 'libelf')
+provides=('einat')
+conflicts=('einat')
+makedepends=('git' 'cargo' 'clang')
+source=("$_pkgname::git+https://github.com/EHfive/einat-ebpf.git")
+sha512sums=('SKIP')
+options=(!lto !debug)
+
+pkgver(){
+ cd "$_pkgname"
+ git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "$_pkgname"
+ cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
+}
+
+build() {
+ cd "$_pkgname"
+ cargo build --release --features ipv6 --frozen
+}
+
+check() {
+ cd "$_pkgname"
+ cargo test --frozen
+}
+
+package() {
+ cd "$_pkgname"
+ install -Dm 755 "target/release/$_target" -t "$pkgdir/usr/bin"
+ install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
+ install -Dm 644 config.sample.toml -t "$pkgdir/usr/share/doc/$pkgname"
+}
+
+# vim: ts=2 sw=2 et:
+