diff options
author | mia <mia@mia.jetzt> | 2024-06-08 22:56:05 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-06-08 22:56:05 -0700 |
commit | 8cf813ff033bbc98a7dd40db6ac11e2e35c7e997 (patch) | |
tree | a451059194cbd4ba90993ebdaced4749448ec4df /packages/dissociate | |
download | asylum-8cf813ff033bbc98a7dd40db6ac11e2e35c7e997.tar.gz asylum-8cf813ff033bbc98a7dd40db6ac11e2e35c7e997.zip |
initial commit
Diffstat (limited to 'packages/dissociate')
-rw-r--r-- | packages/dissociate/.gitignore | 1 | ||||
-rw-r--r-- | packages/dissociate/PKGBUILD | 31 | ||||
-rw-r--r-- | packages/dissociate/dissociate.hook | 9 | ||||
-rw-r--r-- | packages/dissociate/dissociate.service | 11 | ||||
-rw-r--r-- | packages/dissociate/dissociate.sysusers | 1 | ||||
-rw-r--r-- | packages/dissociate/dissociate.tmpfiles | 2 |
6 files changed, 55 insertions, 0 deletions
diff --git a/packages/dissociate/.gitignore b/packages/dissociate/.gitignore new file mode 100644 index 0000000..e422045 --- /dev/null +++ b/packages/dissociate/.gitignore @@ -0,0 +1 @@ +/dissociate-*.tar* diff --git a/packages/dissociate/PKGBUILD b/packages/dissociate/PKGBUILD new file mode 100644 index 0000000..f4ed01a --- /dev/null +++ b/packages/dissociate/PKGBUILD @@ -0,0 +1,31 @@ +pkgname=dissociate +pkgver=0.4.0 +pkgrel=1 +pkgdesc="simple authentication server" +arch=(any) +url="https://git.mia.jetzt/dissociate" +makedepends=(cargo) +source=("$url/snapshot/dissociate-$pkgver.tar.gz" $pkgname.service $pkgname.sysusers $pkgname.tmpfiles $pkgname.hook) +sha256sums=(SKIP SKIP SKIP SKIP SKIP) + +prepare() { + export RUSTUP_TOOLCHAIN=stable + cd $pkgname-$pkgver + echo '[workspace]' >> Cargo.toml + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" +} + +build() { + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + cd $pkgname-$pkgver + cargo build --frozen --release --all-features +} + +package() { + install -Dm0755 -t "$pkgdir/usr/bin/" "$srcdir/$pkgname-$pkgver/target/release/$pkgname" + install -Dm0644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service" + install -Dm0644 "$srcdir/$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" + install -Dm0644 "$srcdir/$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" + install -Dm0644 "$srcdir/$pkgname.hook" "$pkgdir/usr/share/libalpm/hooks/$pkgname.hook" +} diff --git a/packages/dissociate/dissociate.hook b/packages/dissociate/dissociate.hook new file mode 100644 index 0000000..2d0c7a7 --- /dev/null +++ b/packages/dissociate/dissociate.hook @@ -0,0 +1,9 @@ +[Trigger] +Type = Package +Operation = Upgrade +Target = dissociate + +[Action] +Description = Restarting dissociate daemon... +When = PostTransaction +Exec = /bin/bash -c '/usr/bin/systemctl is-active dissociate.service -q && /usr/bin/systemctl restart dissociate.service || /usr/bin/true' diff --git a/packages/dissociate/dissociate.service b/packages/dissociate/dissociate.service new file mode 100644 index 0000000..180bfb3 --- /dev/null +++ b/packages/dissociate/dissociate.service @@ -0,0 +1,11 @@ +[Unit] +Description=dissociate server + +[Service] +Type=simple +User=dissociate +Group=dissociate +ExecStart=/usr/bin/dissociate serve /etc/dissociate/config.toml + +[Install] +WantedBy=multi-user.target diff --git a/packages/dissociate/dissociate.sysusers b/packages/dissociate/dissociate.sysusers new file mode 100644 index 0000000..5b5e836 --- /dev/null +++ b/packages/dissociate/dissociate.sysusers @@ -0,0 +1 @@ +u dissociate - "dissociate server user" diff --git a/packages/dissociate/dissociate.tmpfiles b/packages/dissociate/dissociate.tmpfiles new file mode 100644 index 0000000..2be0fef --- /dev/null +++ b/packages/dissociate/dissociate.tmpfiles @@ -0,0 +1,2 @@ +d /etc/dissociate 750 dissociate dissociate - +d /var/lib/dissociate 750 dissociate dissociate - |