[med-svn] [gmap] 01/03: d/filter.pl: use force of regexs to brush up the output of help2man automagically d/rules: add override for automatic generation of man pages

Alex Mestiashvili malex-guest at moszumanska.debian.org
Tue Jun 2 16:59:51 UTC 2015


This is an automated email from the git hooks/post-receive script.

malex-guest pushed a commit to branch master
in repository gmap.

commit 1e6b441f2b0b90701988d8a4a90a1a275484954c
Author: Alexandre Mestiashvili <alex at biotec.tu-dresden.de>
Date:   Tue Jun 2 18:53:13 2015 +0200

    d/filter.pl: use force of regexs to brush up the output
     of help2man automagically
    d/rules: add override for automatic generation of man pages
---
 debian/filter.pl | 22 ++++++++++++++++++++++
 debian/rules     | 14 +++++++++++++-
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/debian/filter.pl b/debian/filter.pl
new file mode 100755
index 0000000..0edce16
--- /dev/null
+++ b/debian/filter.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+# filter of help2man output
+use strict;
+use warnings;
+
+while ( <STDIN> ) {
+    #multiline regex
+    undef $/;
+    # remove colon from the name
+    $_ =~ s/(^\.SH\sDESCRIPTION\n\.IP\n)(cat)/$2/gmxs;
+#    $_ =~ s/(^\.PP\n)(Input\soptions.*)/.SH OPTIONS\n.SS $2/gmxs;
+#    $_ =~ s/(^\.PP\n)(Computation\soptions.*)/.SS $2/gmxs;
+    $_ =~ s/(^Batch\smode\s\(default\s=\s2\)\n)(Mode.*)/$1\n         $2/gmxs;
+    $_ =~ s/(^\.TP\n)(0)(\n)(see\snote.*)/           $2      $4/gmxs;
+    $_ =~ s/(^\.TP\n)(1)(\n)(see\snote.*)/           $2      $4/gmxs;
+    $_ =~ s/(^\.TP\n)(\(default\))(\n)(2\s{6}see\snote.*)/ $2 $4/gmxs;
+    $_ =~ s/(^3\s{6}see\snote.*)/           $1/gmxs;
+    $_ =~ s/(^4\s{6}see\snote.*)/           $1/gmxs;
+    $_ =~ s/(^5\s{6}expand\s.*)/           $1/gmxs;
+#    $_ =~ s/(^\.TP\n)(Note:?\s.*)/\n$2/gmxs;
+    print $_;
+}
diff --git a/debian/rules b/debian/rules
index 48b02d6..e787923 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,19 +1,31 @@
 #!/usr/bin/make -f
 
 export DH_OPTIONS
-pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
+pkg 	:= $(shell dpkg-parsechangelog --show-field=Source)
+version	:= $(shell dpkg-parsechangelog --show-field=Version)
+mandir  := $(CURDIR)/debian/$(pkg)/usr/share/man/man1
+bindir  := $(CURDIR)/util
+
 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 EXTRA_CONFIGURE_ARGS =
 ifeq ($(DEB_HOST_ARCH), i386)
 EXTRA_CONFIGURE_ARGS += --enable-sse4.1=no --disable-simd
 endif
 
+HELP2MAN = help2man --no-info --help-option="--help" --version-string="$(version)" --no-discard-stderr
+
 %:
 	dh  $@ --with autotools_dev
 
 override_dh_auto_configure:
 	dh_auto_configure -- --enable-shared --with-gmapdb=/var/cache/gmap --bindir=/usr/lib/gmap $(EXTRA_CONFIGURE_ARGS)
 
+override_dh_auto_install:
+	mkdir $(mandir)
+
+	$(HELP2MAN) --name='Genomic Mapping and Alignment Program'\
+	$(bindir)/gmap |debian/filter.pl >$(mandir)/gmap.1;
+
 override_dh_install:
 	dh_install
 	mkdir -p debian/$(pkg)/usr/bin

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/gmap.git



More information about the debian-med-commit mailing list