diff --git a/ptrcbuild-base/APKBUILD b/ptrcbuild-base/APKBUILD new file mode 100644 index 0000000..dedbbc8 --- /dev/null +++ b/ptrcbuild-base/APKBUILD @@ -0,0 +1,33 @@ +# Maintainer: psykose +pkgname=ptrcbuild-base +pkgver=1 +pkgrel=0 +pkgdesc="Sets up a build environment on install" +url="?" +arch="noarch" +license="ISC" +install="$pkgname.post-install" +source="build.doas.conf" +builddir="$srcdir" +options="!check" + +package() { + depends=" + alpine-sdk + doas + execline + openssl + s6 + s6-networking + s6-portable-utils + nano + vim + " + + install -Dm600 build.doas.conf \ + -t "$pkgdir"/etc/doas.d/ +} + +sha512sums=" +b4fd75245e6c088f87e4931d13ae718ac38538beb9a5a0325f0bd4c5a6b68f765491d026c2806db1eaf3b12b5f586677a80ab4da66ed06244cfd9ea08248831b build.doas.conf +" diff --git a/ptrcbuild-base/build.doas.conf b/ptrcbuild-base/build.doas.conf new file mode 100644 index 0000000..dde2edc --- /dev/null +++ b/ptrcbuild-base/build.doas.conf @@ -0,0 +1 @@ +permit persist :wheel diff --git a/ptrcbuild-base/ptrcbuild-base.post-install b/ptrcbuild-base/ptrcbuild-base.post-install new file mode 100644 index 0000000..bcdd260 --- /dev/null +++ b/ptrcbuild-base/ptrcbuild-base.post-install @@ -0,0 +1,24 @@ +#!/bin/sh + +adduser -D nyan +adduser nyan wheel + +key_location="$(SUDO="" abuild-keygen -in -b 4096 2>&1 | grep Installing | cut -d" " -f3)" +key_location="${key_location/.pub/}" + +password="$(openssl rand -hex 6)" + +echo "nyan:$password" | chpasswd + +mkdir -p /home/nyan/.abuild +echo "PACKAGER_PRIVKEY=/home/nyan/.abuild/nyan.rsa" > /home/nyan/.abuild/abuild.conf + +mv "$key_location" /home/nyan/.abuild/nyan.rsa +mv "$key_location".pub /home/nyan/.abuild/nyan.rsa.pub +cp /home/nyan/.abuild/nyan.rsa.pub /etc/apk/keys + +chown -R nyan:nyan /home/nyan/.abuild + +cat 1>&2 <