From 4ec437ae8f33649384ae043948f7295bfb9045d9 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Mon, 6 Sep 2021 03:55:19 -0600 Subject: main/doas: move example config to /usr/share/doc/doas --- main/doas/APKBUILD | 10 ++++++---- main/doas/doas.post-install | 8 +++++++- main/doas/doas.post-upgrade | 8 +++++++- main/doas/manpage-example-path.patch | 16 ++++++++++++++++ 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 main/doas/manpage-example-path.patch diff --git a/main/doas/APKBUILD b/main/doas/APKBUILD index 01678f6534d..9b5f49fc77b 100644 --- a/main/doas/APKBUILD +++ b/main/doas/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Drew DeVault pkgname=doas pkgver=6.8.1 -pkgrel=5 +pkgrel=6 pkgdesc="OpenBSD's temporary privilege escalation tool" url="https://github.com/Duncaen/OpenDoas" arch="all" @@ -10,7 +10,8 @@ makedepends="bison" subpackages="$pkgname-doc" install="$pkgname.post-install $pkgname.post-upgrade" source="$pkgname-$pkgver.tar.gz::https://github.com/Duncaen/OpenDoas/archive/v$pkgver.tar.gz - configuration-directory.patch" + configuration-directory.patch + manpage-example-path.patch" builddir="$srcdir/OpenDoas-$pkgver" options="$options suid" @@ -34,8 +35,8 @@ check() { package() { make install DESTDIR="$pkgdir" - install -d "$pkgdir"/etc/examples - cat > "$pkgdir"/etc/examples/doas.conf <<-EOF + install -d "$pkgdir"/usr/share/doc/$pkgname + cat > "$pkgdir"/usr/share/doc/$pkgname/doas.conf.example <<-EOF # see doas.conf(5) for configuration details # Uncomment to allow group "wheel" to become root @@ -46,4 +47,5 @@ package() { sha512sums=" d96fe1cdd70e9211de9996ad05bcf7a127facd02af48f7ab2561869d9d16708f1b61722c6e6b9fe15a62e9ef501e09b1ba444b7b43a066f1895e543ebc9402e7 doas-6.8.1.tar.gz 79218c2798e67e6345818c357e651e09ef558d6cbcc5566e9e4816e8f4e73e4f737710caf617c211e89902ae7ef21cd520d3fc4d829550d40e1bd3b13befd0dc configuration-directory.patch +60efd196595bda2c4f036cd0080a8825a85fedcc7524c917304b342373863213b3c557b4336f1dab760f167fd8cc2a59b2e744d8a47ff8a8acebbe74b1328f4f manpage-example-path.patch " diff --git a/main/doas/doas.post-install b/main/doas/doas.post-install index 9faef4d302d..46518437c2e 100755 --- a/main/doas/doas.post-install +++ b/main/doas/doas.post-install @@ -10,12 +10,18 @@ cat << _EOF_ >/etc/doas.d/doas.conf _EOF_ [ -e /etc/doas.conf ] && cat /etc/doas.conf >> /etc/doas.d/doas.conf -[ -e /etc/doas.conf ] || cat /etc/examples/doas.conf >> /etc/doas.d/doas.conf +[ -e /etc/doas.conf ] || cat << _EOF_ >> /etc/doas.d/doas.conf +# Please see /usr/share/doc/doas/doas.conf.example in the doas-doc +# package for configuration examples. +_EOF_ # install compatibility symlink rm -f /etc/doas.conf ln -sf /etc/doas.d/doas.conf /etc/doas.conf +# chmod 600 +chmod 600 /etc/doas.d/doas.conf + cat << _EOF_ >&2 * Your configuration in /etc/doas.conf was migrated to * /etc/doas.d/doas.conf and a symlink was installed in its diff --git a/main/doas/doas.post-upgrade b/main/doas/doas.post-upgrade index 9faef4d302d..46518437c2e 100755 --- a/main/doas/doas.post-upgrade +++ b/main/doas/doas.post-upgrade @@ -10,12 +10,18 @@ cat << _EOF_ >/etc/doas.d/doas.conf _EOF_ [ -e /etc/doas.conf ] && cat /etc/doas.conf >> /etc/doas.d/doas.conf -[ -e /etc/doas.conf ] || cat /etc/examples/doas.conf >> /etc/doas.d/doas.conf +[ -e /etc/doas.conf ] || cat << _EOF_ >> /etc/doas.d/doas.conf +# Please see /usr/share/doc/doas/doas.conf.example in the doas-doc +# package for configuration examples. +_EOF_ # install compatibility symlink rm -f /etc/doas.conf ln -sf /etc/doas.d/doas.conf /etc/doas.conf +# chmod 600 +chmod 600 /etc/doas.d/doas.conf + cat << _EOF_ >&2 * Your configuration in /etc/doas.conf was migrated to * /etc/doas.d/doas.conf and a symlink was installed in its diff --git a/main/doas/manpage-example-path.patch b/main/doas/manpage-example-path.patch new file mode 100644 index 00000000000..31048c70d6f --- /dev/null +++ b/main/doas/manpage-example-path.patch @@ -0,0 +1,16 @@ +--- OpenDoas-6.8.1.orig/doas.conf.5 ++++ OpenDoas-6.8.1/doas.conf.5 +@@ -114,11 +114,11 @@ + it is not considered a keyword. + .El + .Sh FILES +-.Bl -tag -width /etc/examples/doas.conf -compact ++.Bl -tag -width /usr/share/doc/doas/doas.conf.example -compact + .It Pa /etc/doas.conf + .Xr doas 1 + configuration file. +-.It Pa /etc/examples/doas.conf ++.It Pa /usr/share/doc/doas/doas.conf.example + Example configuration file. + .El + .Sh EXAMPLES -- cgit v1.2.3