]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/commitdiff
man-db: Make package more handy.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 7 Jun 2012 20:21:38 +0000 (22:21 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 7 Jun 2012 20:21:38 +0000 (22:21 +0200)
This patch adds a cron job which will index the man pages daily
and executed after the package has been installed.

Also is elinks the new browser (and currently the single on
IPFire is shipping).

man-db/man-db.cron [new file with mode: 0644]
man-db/man-db.nm

diff --git a/man-db/man-db.cron b/man-db/man-db.cron
new file mode 100644 (file)
index 0000000..c7d21ad
--- /dev/null
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+renice +19 -p $$ >/dev/null 2>&1
+ionice -c3 -p $$ >/dev/null 2>&1
+
+LOCKFILE=/var/lock/man-db.lock
+
+# The lockfile is not meant to be perfect, it's just in case the
+# two man-db cron scripts get run close to each other to keep
+# them from stepping on each other's toes.  The worst that will
+# happen is that they will temporarily corrupt the database.
+[ -f $LOCKFILE ] && exit 0
+
+trap "{ rm -f $LOCKFILE ; exit 0; }" EXIT
+touch $LOCKFILE
+
+# Create/update the mandb database.
+mandb -q
+
+exit 0
index 224fe0a23b0a281edde3c01564bafa9632688311..b3920385f94a8495275544440024fc5aa62e5251 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = man-db
 version    = 2.6.1
-release    = 2
+release    = 3
 
 groups     = Documentation
 url        = http://savannah.nongnu.org/projects/man-db
@@ -31,23 +31,22 @@ build
        end
 
        configure_options += \
+               --with-sections="1 1p 8 2 3 3p 4 5 6 7 9 0p n l p o 1x 2x 3x 4x 5x 6x 7x 8x" \
                --disable-setuid \
-               --with-browser=%{bindir}/lynx \
-               --with-col=%{bindir}/col \
-               --with-vgrind=%{bindir}/vgrind \
-               --with-grap=%{bindir}/grap \
-               --disable-rpath
-
-       prepare_cmds
-               sed -i -e '\%\t/usr/man%d' -e '\%\t/usr/local/man%d' \
-                       src/man_db.conf.in
-       end
+               --with-browser=elinks
 
        install_cmds
-               # Move some libs
-               mv -v %{BUILDROOT}%{libdir}/man-db/* %{BUILDROOT}%{libdir}/
-               rm -rf %{BUILDROOTi}%{libdir}/man-db/
+               # Move the libs to /usr/lib, but don't keep the symlinks so nothing
+               # will link against libman and libmandb as they are not stable.
+               mv -v %{BUILDROOT}%{libdir}/man-db/libman{,db}-%{version}.so %{BUILDROOT}%{libdir}
+               rm -rf %{BUILDROOT}%{libdir}/man-db/
 
+               # Create cron job to regularly update the man page database.
+               mkdir -pv %{BUILDROOT}%{sysconfdir}/cron.daily
+               install -v -m 755 %{DIR_SOURCE}/man-db.cron %{BUILDROOT}%{sysconfdir}/cron.daily
+
+               # Create cache directory.
+               mkdir -pv %{BUILDROOT}/var/cache/man
        end
 end
 
@@ -65,6 +64,16 @@ packages
                provides
                        man
                end
+
+               script posttransin
+                       # Update the database right now.
+                       %{sysconfdir}/cron.daily/man-db.cron
+               end
+
+               script posttransup
+                       # Update the database right now.
+                       %{sysconfdir}/cron.daily/man-db.cron
+               end
        end
 
        package %{name}-debuginfo