diff options
author | Kirill Isakov | 2024-08-29 00:23:07 +0500 |
---|---|---|
committer | Kirill Isakov | 2024-08-29 00:23:07 +0500 |
commit | abe113d2a17b8be751b7ed99b6393c24ee58eb15 (patch) | |
tree | 30198a25ef83d0af7676898be6cbc919f4e80bf5 | |
download | aur-abe113d2a17b8be751b7ed99b6393c24ee58eb15.tar.gz |
Initial upload: letmein 4.0.0-1
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | PKGBUILD | 63 | ||||
-rw-r--r-- | letmein.install | 18 | ||||
-rw-r--r-- | path.patch | 13 |
5 files changed, 125 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..a97031cd097c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = letmein + pkgdesc = Authenticating port knocker + pkgver = 4.0.0 + pkgrel = 1 + url = https://github.com/mbuesch/letmein + install = letmein.install + arch = i686 + arch = x86_64 + arch = armv7h + arch = aarch64 + license = Apache-2.0 + license = MIT + makedepends = cargo + depends = glibc + depends = gcc-libs + depends = nftables + backup = etc/letmein.conf + backup = etc/letmeind.conf + source = letmein-4.0.0.tar.gz::https://github.com/mbuesch/letmein/archive/letmein-4.0.0.tar.gz + source = path.patch + sha256sums = 7ca23dfb3c02349ef6b3060e9ec2d592538285ca755318ed5b92dc6a9e2c327c + sha256sums = eabe0c4db61ebe73337d1b17431e17df75cebe0e958c758c302abf05edd611f2 + +pkgname = letmein diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..0c17c61ff9f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +* +!/.SRCINFO +!/.gitignore +!/PKGBUILD +!/letmein.install +!/letmein.sysusers +!/path.patch diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c30253b4d558 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,63 @@ +# Maintainer: tarball <bootctl@gmail.com> + +pkgname=letmein +pkgver=4.0.0 +pkgrel=1 +pkgdesc='Authenticating port knocker' +arch=(i686 x86_64 armv7h aarch64) +url='https://github.com/mbuesch/letmein' +license=(Apache-2.0 MIT) +makedepends=(cargo) +depends=(glibc gcc-libs nftables) +install=$pkgname.install +backup=(etc/letmein.conf etc/letmeind.conf) +source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgname-$pkgver.tar.gz" path.patch) +sha256sums=('7ca23dfb3c02349ef6b3060e9ec2d592538285ca755318ed5b92dc6a9e2c327c' + 'eabe0c4db61ebe73337d1b17431e17df75cebe0e958c758c302abf05edd611f2') + +prepare() { + cd $pkgname-$pkgname-$pkgver + patch -p1 <"$srcdir/path.patch" +} + +build() { + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + + cd $pkgname-$pkgname-$pkgver + cargo build --release --locked +} + +check() { + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + + cd $pkgname-$pkgname-$pkgver + cargo test --locked +} + +package() { + cd $pkgname-$pkgname-$pkgver + + install -Dm755 -t "$pkgdir/usr/bin/" \ + target/release/letmein{,d,fwd} + + install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname/" \ + README.md nftables.conf + + install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" \ + LICENSE-{APACHE,MIT} + + install -Dm644 -t "$pkgdir/etc/" letmein/letmein.conf + install -Dm640 -t "$pkgdir/etc/" letmeind/letmeind.conf + + local _systemd=( + letmeind/letmeind.{service,socket} + letmeinfwd/letmeinfwd.{service,socket} + ) + + sed -i 's:/opt/letmein:/usr:g' "${_systemd[@]}" + + install -Dm644 -t "$pkgdir/usr/lib/systemd/system" \ + "${_systemd[@]}" +} diff --git a/letmein.install b/letmein.install new file mode 100644 index 000000000000..f0be19232f15 --- /dev/null +++ b/letmein.install @@ -0,0 +1,18 @@ +# systemd sysusers get created after post_install is executed, and we need to +# assign the config owner, so let's create the user manually +post_install() { + useradd \ + --system \ + --no-create-home \ + --home /nonexistent \ + --shell /usr/bin/nologin \ + --user-group \ + letmeind + + chown :letmeind /etc/letmeind.conf +} + +post_remove() { + userdel letmeind || : + groupdel letmeind || : +} diff --git a/path.patch b/path.patch new file mode 100644 index 000000000000..7577ea8c7e56 --- /dev/null +++ b/path.patch @@ -0,0 +1,13 @@ +diff --git a/letmein-conf/src/lib.rs b/letmein-conf/src/lib.rs +index ab24e28..87f4846 100644 +--- a/letmein-conf/src/lib.rs ++++ b/letmein-conf/src/lib.rs +@@ -23,7 +23,7 @@ use std::{collections::HashMap, path::Path, time::Duration}; + + /// The default install prefix. + #[cfg(not(target_os = "windows"))] +-pub const INSTALL_PREFIX: &str = "/opt/letmein"; ++pub const INSTALL_PREFIX: &str = "/"; + #[cfg(target_os = "windows")] + pub const INSTALL_PREFIX: &str = ""; + |