main/logcheck: fix documentation installation

Previously, the docs subdirectory was simply copied to usr/share/man.
Fix this by installing the relavent installation directories, and
installing the manual pages as needed. Also, the logcheck.sgml file
is docbook source for logcheck.8; added docbook2mdoc and the build
function to build the logcheck.8 manual page.
This commit is contained in:
John Vogel 2024-06-09 11:23:03 -04:00 committed by Natanael Copa
parent 9364280d3a
commit 1d5b2b756d

View file

@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=logcheck
pkgver=1.4.3
pkgrel=1
pkgrel=3
pkgdesc="Bash scripts used to monitor system log files for anomalies"
# !check: Requires writing to root owned paths but can't run as root
options="!check"
@ -14,6 +14,7 @@ depends="
lockfile-progs
perl
"
makedepends="docbook2mdoc"
install="$pkgname.pre-install"
subpackages="$pkgname-doc"
pkgusers="logcheck"
@ -22,13 +23,20 @@ source="https://deb.debian.org/debian/pool/main/l/logcheck/logcheck_$pkgver.tar.
logcheck.cron.d
"
build() {
docbook2mdoc -W -T mdoc docs/logcheck.sgml > docs/logcheck.8 2>/dev/null || true
}
package() {
make DESTDIR="$pkgdir" install
install -D -m 644 "$srcdir"/logcheck.cron.d "$pkgdir"/etc/logcheck/logcheck.cron.sample
install -d "$pkgdir"/usr/share/man
cp -a "$builddir"/docs/* "$pkgdir"/usr/share/man
install -D -m 644 "$srcdir"/logcheck.cron.d "$pkgdir"/etc/logcheck/logcheck.cron.sample
chown -R $pkgusers "$pkgdir"/etc/logcheck "$pkgdir"/run/lock/logcheck "$pkgdir"/var/lib/logcheck
install -D -m 644 -t "$pkgdir"/usr/share/man/man1 docs/*.1
install -D -m 644 -t "$pkgdir"/usr/share/man/man8 docs/*.8
install -D -m 644 -t "$pkgdir"/usr/share/doc/"$pkgname" docs/README*
}
sha512sums="