]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
man-db: Update to 2.7.1
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Dec 2014 15:08:37 +0000 (16:08 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Dec 2014 15:08:37 +0000 (16:08 +0100)
Resolves a conflict to groff because of zsoelim and
replaces the cron job by a systemd timer event.

man-db/man-db.cron [deleted file]
man-db/man-db.nm
man-db/patches/1151558-switch-man-and-root-in-init-systemd-man-db.conf.patch [new file with mode: 0644]
man-db/systemd/man-db.service [new file with mode: 0644]
man-db/systemd/man-db.timer [new file with mode: 0644]

diff --git a/man-db/man-db.cron b/man-db/man-db.cron
deleted file mode 100644 (file)
index c7d21ad..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /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 f1dfba0fec32f1fc3f02f9ff96816d59f340ce07..a36ea9863e7ecd93ff981056a0055c886ae3d625 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = man-db
-version    = 2.6.3
+version    = 2.7.1
 release    = 1
 
 groups     = Documentation
@@ -28,7 +28,9 @@ build
                gdbm-devel
                groff
                less
-               libpipeline-devel
+               libpipeline-devel >= 1.4.0
+               systemd-devel
+               zlib-devel
        end
 
        configure_options += \
@@ -42,9 +44,8 @@ build
                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
+               # Remove zsoelim man page which is not part of groff
+               rm -vf %{BUILDROOT}%{datadir}/man/man*/zsoelim.*
 
                # Create cache directory.
                mkdir -pv %{BUILDROOT}/var/cache/man
@@ -68,12 +69,23 @@ packages
 
                script posttransin
                        # Update the database right now.
-                       %{sysconfdir}/cron.daily/man-db.cron
+                       rm -rf /var/cache/man/*
+
+                       systemctl -q enable man-db.timer
+                       systemctl start man-db.timer
                end
 
                script posttransup
                        # Update the database right now.
-                       %{sysconfdir}/cron.daily/man-db.cron
+                       rm -rf /var/cache/man/*
+
+                       systemctl -q enable man-db.timer
+                       systemctl start man-db.timer
+               end
+
+               script preun
+                       systemctl stop man-db.timer
+                       systemctl -q disable man-db.timer
                end
        end
 
diff --git a/man-db/patches/1151558-switch-man-and-root-in-init-systemd-man-db.conf.patch b/man-db/patches/1151558-switch-man-and-root-in-init-systemd-man-db.conf.patch
new file mode 100644 (file)
index 0000000..b91e6d0
--- /dev/null
@@ -0,0 +1,19 @@
+From 1d523a44a5ad360c83bff362a625cc68cbe7f296 Mon Sep 17 00:00:00 2001
+From: Jan Chaloupka <jchaloup@redhat.com>
+Date: Wed, 15 Oct 2014 09:46:56 +0200
+Subject: [PATCH] switch man and root in init/systemd/man-db.conf
+
+---
+ init/systemd/man-db.conf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/init/systemd/man-db.conf b/init/systemd/man-db.conf
+index 10b27b4..43dd2ad 100644
+--- a/init/systemd/man-db.conf
++++ b/init/systemd/man-db.conf
+@@ -1 +1 @@
+-d /var/cache/man 2755 man root 1w
++d /var/cache/man 2755 root man 1w
+-- 
+1.9.3
+
diff --git a/man-db/systemd/man-db.service b/man-db/systemd/man-db.service
new file mode 100644 (file)
index 0000000..4adc297
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Update man-db cache
+RequiresMountsFor=/var/cache/man
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/mandb --quiet
+Nice=19
+IOSchedulingClass=best-effort
+IOSchedulingPriority=7
diff --git a/man-db/systemd/man-db.timer b/man-db/systemd/man-db.timer
new file mode 100644 (file)
index 0000000..ce43df1
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Daily man-db cache update
+
+[Timer]
+OnCalendar=daily
+AccuracySec=12h
+Persistent=true
+
+[Install]
+WantedBy=multi-user.target