From 28b5bbf3fee0627993658e096eadab71c2779912 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Apr 2011 10:53:36 +0000 Subject: Tue Apr 12 10:53:36 UTC 2011 --- testing/man-db/PKGBUILD | 57 ++++++++++++++++++++++++++++++++++++++++ testing/man-db/convert-mans | 11 ++++++++ testing/man-db/man-db.cron.daily | 39 +++++++++++++++++++++++++++ testing/man-db/man-db.install | 18 +++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 testing/man-db/PKGBUILD create mode 100644 testing/man-db/convert-mans create mode 100755 testing/man-db/man-db.cron.daily create mode 100644 testing/man-db/man-db.install (limited to 'testing/man-db') diff --git a/testing/man-db/PKGBUILD b/testing/man-db/PKGBUILD new file mode 100644 index 000000000..f3f681169 --- /dev/null +++ b/testing/man-db/PKGBUILD @@ -0,0 +1,57 @@ +# $Id: PKGBUILD 119509 2011-04-11 20:08:00Z andyrtr $ +# Maintainer: Andreas Radke +# Contributor: Sergej Pupykin + +pkgname=man-db +pkgver=2.6.0.1 +pkgrel=1 +pkgdesc="A utility for reading man pages" +arch=('i686' 'x86_64') +url="http://www.nongnu.org/man-db/" +license=('GPL' 'LGPL') +groups=('base') +depends=( 'bash' 'gdbm' 'zlib' 'groff' 'libpipeline') +optdepends=('less' 'gzip') +backup=('etc/man_db.conf' + 'etc/cron.daily/man-db') +conflicts=('man') +provides=('man') +replaces=('man') +install=${pkgname}.install +source=(http://savannah.nongnu.org/download/man-db/$pkgname-$pkgver.tar.gz + #http://launchpad.net/man-db/main/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz + convert-mans man-db.cron.daily) +md5sums=('664519fbee417dc4934f94caf6627fc3' + '2b7662a7d5b33fe91f9f3e034361a2f6' + 'd30c39ae47560304471b5461719e0f03') +options=('!libtool') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + + ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \ + --with-db=gdbm --disable-setuid --enable-mandirs=GNU \ + --with-sections="1 n l 8 3 0 2 5 4 9 6 7" + make +} + +check() { + cd ${srcdir}/${pkgname}-${pkgver} + make check +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + make DESTDIR=${pkgdir} install + + # part of groff pkg + rm -f ${pkgdir}/usr/bin/zsoelim + + # script from LFS to convert manpages, see + # http://www.linuxfromscratch.org/lfs/view/6.4/chapter06/man-db.html + install -D -m755 ${srcdir}/convert-mans ${pkgdir}/usr/bin/convert-mans + + #install whatis cron script + install -D -m744 ${srcdir}/man-db.cron.daily ${pkgdir}/etc/cron.daily/man-db +} + diff --git a/testing/man-db/convert-mans b/testing/man-db/convert-mans new file mode 100644 index 000000000..58a0224b0 --- /dev/null +++ b/testing/man-db/convert-mans @@ -0,0 +1,11 @@ +#!/bin/sh -e +FROM="$1" +TO="$2" +shift ; shift +while [ $# -gt 0 ] +do + FILE="$1" + shift + iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv + mv .tmp.iconv "$FILE" +done diff --git a/testing/man-db/man-db.cron.daily b/testing/man-db/man-db.cron.daily new file mode 100755 index 000000000..53e66e1e9 --- /dev/null +++ b/testing/man-db/man-db.cron.daily @@ -0,0 +1,39 @@ +#!/bin/sh + +# nicenesses range from -20 (most favorable scheduling) to 19 (least favorable) +NICE=19 + +# 0 for none, 1 for real time, 2 for best-effort, 3 for idle +IONICE_CLASS=2 + +# 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest +IONICE_PRIORITY=7 + +UPDATEMANDB="/usr/bin/mandb --quiet" + +# Update the "whatis" database +#/usr/sbin/makewhatis -u -w + +# taken from Debian +# man-db cron daily +set -e + +if ! [ -d /var/cache/man ]; then + # Recover from deletion, per FHS. + mkdir -p /var/cache/man + chmod 755 /var/cache/man +fi + +# regenerate man database + +if [ -x /usr/bin/nice ]; then + UPDATEMANDB="/usr/bin/nice -n ${NICE:-19} ${UPDATEMANDB}" +fi + +if [ -x /usr/bin/ionice ]; then + UPDATEMANDB="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${UPDATEMANDB}" +fi + +${UPDATEMANDB} + +exit 0 diff --git a/testing/man-db/man-db.install b/testing/man-db/man-db.install new file mode 100644 index 000000000..6a0f36b67 --- /dev/null +++ b/testing/man-db/man-db.install @@ -0,0 +1,18 @@ +post_install() { + echo "it's recommended to create an initial" + echo "database running as root:" + echo "\"/usr/bin/mandb --quiet\"" +} + +post_upgrade() { + if [ "`vercmp $2 2.5.3-2`" -lt 0 ]; then + echo "systemuser \"man\" is no more required" + echo "run \"userdel man\". please also" + echo "chown root:root /var/cache/man" + fi +} + +post_remove() { + rm -rf /var/cache/man +} + -- cgit v1.2.3-54-g00ecf