summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHec2021-05-15 18:34:24 -0400
committerHec2021-05-15 18:34:24 -0400
commit099096292553f6c910fe9a6093e2a917ffc4ca2f (patch)
tree88e50bb017357d01681d72abcbfea98c06608af6
downloadaur-099096292553f6c910fe9a6093e2a917ffc4ca2f.tar.gz
Create my very first AUR Package
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD34
-rwxr-xr-xcryptsetup28
3 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..59f90dd3e88
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = cryptsetup-void-runit
+ pkgdesc = runit stage1 script for cryptsetup, ripped straight from Void Linux
+ pkgver = 1.0.r355.42ca737
+ pkgrel = 1
+ url = https://voidlinux.org
+ arch = any
+ license = BSD
+ makedepends = git
+ depends = sh
+ depends = awk
+ depends = runit-rc
+ depends = cryptsetup
+ provides = cryptsetup-runit
+ conflicts = cryptsetup-runit
+ source = git+https://github.com/void-linux/void-runit
+ source = cryptsetup
+ sha256sums = SKIP
+ sha256sums = e58cac4e8e8b7de0f71827b4a011337be1869330097d2829f9ea8bbe3568f1cc
+
+pkgname = cryptsetup-void-runit
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..d97e6c274d4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,34 @@
+# Maintainer: Hec <hec@heccraft.com>
+_reponame=void-runit
+pkgname=cryptsetup-void-runit
+pkgver=1.0.r355.42ca737
+pkgrel=1
+pkgdesc="runit stage1 script for cryptsetup, ripped straight from Void Linux"
+arch=('any')
+url="https://voidlinux.org"
+license=('BSD')
+depends=('sh' 'awk' 'runit-rc' 'cryptsetup')
+makedepends=('git')
+provides=('cryptsetup-runit')
+conflicts=('cryptsetup-runit')
+source=("git+https://github.com/void-linux/void-runit"
+ "cryptsetup")
+sha256sums=('SKIP'
+'e58cac4e8e8b7de0f71827b4a011337be1869330097d2829f9ea8bbe3568f1cc'
+)
+
+pkgver() {
+ cd ${_reponame}
+ printf "1.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+package() {
+ mkdir "$pkgdir"/usr/lib/rc/sv.d/ -p
+ mkdir "$pkgdir"/etc/rc/sysinit/ -p
+ mkdir "$pkgdir"/etc/rc/shutdown/ -p
+ mkdir "$pkgdir"/etc/runit -p
+ install -Dm755 $srcdir/cryptsetup "$pkgdir"/usr/lib/rc/sv.d/cryptsetup
+ ln -s /usr/lib/rc/sv.d/cryptsetup "$pkgdir"/etc/rc/sysinit/34-cryptsetup
+ ln -s /usr/lib/rc/sv.d/cryptsetup "$pkgdir"/etc/rc/shutdown/65-cryptsetup
+ install -Dm644 $_reponame/crypt.awk "$pkgdir"/etc/runit/crypt.awk
+}
diff --git a/cryptsetup b/cryptsetup
new file mode 100755
index 00000000000..bb67e3dd05f
--- /dev/null
+++ b/cryptsetup
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# sourcing our current rc.conf requires this to be a bash script
+. /usr/lib/rc/functions
+
+case "$1" in
+ start)
+ if [ -e /etc/crypttab ]; then
+ stat_busy "Activating encrypted devices"
+ awk -f /etc/runit/crypt.awk /etc/crypttab || stat_die cryptsetup
+ fi
+ add_daemon cryptsetup
+ stat_done cryptsetup
+ ;;
+ stop)
+ stat_busy "Stopping encrypted devices"
+ rc=$?
+ read_crypttab do_lock
+ (( rc || $? )) && stat_die
+ rm_daemon cryptsetup
+ stat_done
+ ;;
+
+ *)
+ echo "usage: $0 {start}"
+ exit 1
+ ;;
+esac