Hi,

On Friday, 14. August 2015 17:46:41 Ryan Tandy wrote:
> On Sun, Aug 09, 2015 at 09:56:03AM +0200, Peter Marschall wrote:
> >++.\" Copyright 2015 The OpenLDAP Foundation All Rights Reserved.
> 
> I assume this is intentional, and is because the content is adapted from
> the existing README?
Yes to both.
My hope is to get the man page upstreamed (see upstream ITS#8205)

> >++.SH SEE ALSO
> >++.BR slapd.conf (5),
> >++.BR ldappasswd (1),
> >++.BR ldap (3),
> 
> Looks like a trailing comma?
You're right: copy&paste artifact from the slapo-lastbind manpage ;-)

English is not my mother tongue, so please feel free to change what you 
consider in need of changing.

> >diff --git a/debian/slapd.manpages b/debian/slapd.manpages
> [...]
> 
> Thinking out loud... I'd be happier if newly added man pages could be
> installed automatically, or at least if we could be notified about
> needing to update the file.
Completely understandable. I am also not happy about that static list of 
manual pages.
I was looking for a syntax in the .manpages file that allows excluding a 
specific file, but in vain.

But I found a solution:  executable debhelper files.
See the attached patch that converts slapd.manpages into a script
which 
- first expands the manpage patterns it feels generally responsible for
- then excludes all the manual pages listed in other slapd-*.manpages files
- finally outputs all the remaining ones
I checked it with my private openldap packaging: it works!

> I tried to use dh_install --fail-missing, but it looks like it doesn't
> (yet) cooperate with dh_installman and others, so files are spuriously
> reported missing (#436240#c15). The solution used for the module itself,
> letting it be installed into slapd and then rm'ing it, is a bit of a
> hack, but does achieve that. On the other hand, the only new slapo-* man
> pages we're likely to get in 2.4 are contrib ones, so maybe this is
> fine.
The attacked patch avoids the need for a hack.

Best
Peter

-- 
Peter Marschall
pe...@adpm.de
>From a196df3cce333248e505f24cc34adefdb618d318 Mon Sep 17 00:00:00 2001
From: Peter Marschall <pe...@adpm.de>
Date: Sat, 15 Aug 2015 13:06:23 +0200
Subject: [PATCH] debian/slapd.manpages: use script to automatically include
 changes

Use an executable slapd.manpages to
- allow contrib module packaes to contain its own manpages
- avoid manual changes when manpages get added/removed upstream
---
 debian/slapd.manpages | 71 +++++++++++++++++++++++++++++++++------------------
 1 file changed, 46 insertions(+), 25 deletions(-)
 mode change 100644 => 100755 debian/slapd.manpages

diff --git a/debian/slapd.manpages b/debian/slapd.manpages
old mode 100644
new mode 100755
index 72cc5c9..25928d1
--- a/debian/slapd.manpages
+++ b/debian/slapd.manpages
@@ -1,25 +1,46 @@
-debian/tmp/usr/share/man/man5/slapd*.5
-debian/tmp/usr/share/man/man5/slapo-accesslog.5
-debian/tmp/usr/share/man/man5/slapo-auditlog.5
-debian/tmp/usr/share/man/man5/slapo-chain.5
-debian/tmp/usr/share/man/man5/slapo-collect.5
-debian/tmp/usr/share/man/man5/slapo-constraint.5
-debian/tmp/usr/share/man/man5/slapo-dds.5
-debian/tmp/usr/share/man/man5/slapo-dyngroup.5
-debian/tmp/usr/share/man/man5/slapo-dynlist.5
-debian/tmp/usr/share/man/man5/slapo-lastbind.5
-debian/tmp/usr/share/man/man5/slapo-memberof.5
-debian/tmp/usr/share/man/man5/slapo-pbind.5
-debian/tmp/usr/share/man/man5/slapo-pcache.5
-debian/tmp/usr/share/man/man5/slapo-ppolicy.5
-debian/tmp/usr/share/man/man5/slapo-refint.5
-debian/tmp/usr/share/man/man5/slapo-retcode.5
-debian/tmp/usr/share/man/man5/slapo-rwm.5
-#debian/tmp/usr/share/man/man5/slapo-smbk5pwd.5
-debian/tmp/usr/share/man/man5/slapo-sock.5
-debian/tmp/usr/share/man/man5/slapo-sssvlv.5
-debian/tmp/usr/share/man/man5/slapo-syncprov.5
-debian/tmp/usr/share/man/man5/slapo-translucent.5
-debian/tmp/usr/share/man/man5/slapo-unique.5
-debian/tmp/usr/share/man/man5/slapo-valsort.5
-debian/tmp/usr/share/man/man8/slap*.8
+#!/usr/bin/perl -w
+
+# Determine "our" manual pages by
+# 1) expanding patterns to determine the eligible man pages
+# 2) removing manual pages covered by related binary packages' .manpage files
+
+# This allows us to automatically detect changes in manual pages provided upstream
+# Note: it may not work if the related packages' .manpage files use wildcards
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+
+# our manual page patterns
+my @patterns = qw(
+	debian/tmp/usr/share/man/man5/slap*.5
+	debian/tmp/usr/share/man/man8/slap*.8
+);
+
+# related packages' .manpage files, whose contents we need to exclude
+my @otherpackages = qw(
+	debian/slapd-*.manpages
+);
+
+
+my @manpages= ();
+my %othermanpages = ();
+
+# expand our manual page patterns = superset of our manual pages
+foreach my $pattern (@patterns) {
+	push @manpages, glob "$pattern";
+}
+
+# expand other packages manual page patterns using Debian::Debhelper::Dh_Lib
+foreach my $files (@otherpackages) {
+	foreach my $file (glob "$files") {
+		map { $othermanpages{$_} = 1 } filearray($file, '.');
+	}
+}
+
+# output man pages not belonging to other packages = our manual pages
+foreach my $manpage (@manpages) {
+	print "$manpage\n"  unless ($othermanpages{$manpage});
+}
+
+# EOF
-- 
2.5.0

Reply via email to