[med-svn] [fastaq] 01/01: Added custom script to convert man pages directly form python usage

Jorge Soares jssoares-guest at moszumanska.debian.org
Tue Oct 14 16:12:56 UTC 2014


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

jssoares-guest pushed a commit to branch master
in repository fastaq.

commit 113f2c42baefbcb7bd0fe86945f1bc05d2b9cd4f
Author: Jorge Soares <j.s.soares at gmail.com>
Date:   Tue Oct 14 17:12:42 2014 +0100

    Added custom script to convert man pages directly form python usage
---
 debian/control                |  8 ++-----
 debian/fastaq.manpages        |  1 +
 debian/rules                  |  2 +-
 debian/usage_to_man           | 51 +++++++++++++++++++++++++++++++++++++++++++
 debian/watch                  |  3 +--
 man/fastaq_trim_Ns_at_end.txt | 51 -------------------------------------------
 6 files changed, 56 insertions(+), 60 deletions(-)

diff --git a/debian/control b/debian/control
index 2a3d03f..9fdda39 100644
--- a/debian/control
+++ b/debian/control
@@ -9,14 +9,10 @@ Build-Depends: debhelper (>= 9),
 	       python3-numpy,
 	       python3-nose,
 	       samtools,
-               libxml2-utils,
-	       docbook,
-               docbook-xsl,
-	       xsltproc,
-	       asciidoc
+	       help2man
 Standards-Version: 3.9.5
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-med/fastaq.git
-Homepage: https://github.com/js21/Fastaq
+Homepage: https://github.com/sanger-pathogens/Fastaq
 
 Package: fastaq
 Architecture: any
diff --git a/debian/fastaq.manpages b/debian/fastaq.manpages
new file mode 100644
index 0000000..d2c65e3
--- /dev/null
+++ b/debian/fastaq.manpages
@@ -0,0 +1 @@
+debian/man/*
\ No newline at end of file
diff --git a/debian/rules b/debian/rules
index 0dbc9bd..a89085c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -20,6 +20,6 @@ override_dh_auto_clean:
 
 override_dh_installman:
 	mkdir -p $(mandir)
-	for textfile in $(sourcedir)/*.txt; do a2x --no-xmllint -f manpage $$textfile; done
+	usage_to_man
 	mv $(sourcedir)/*.1 $(mandir)
 	dh_installman --
\ No newline at end of file
diff --git a/debian/usage_to_man b/debian/usage_to_man
new file mode 100755
index 0000000..481fd5c
--- /dev/null
+++ b/debian/usage_to_man
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+#Converts the Fastaq python scripts usage into man pages
+#The man pages are placed in the man folder of the main Fastaq directory  
+
+source='../scripts'
+destination='../man'
+
+for i in $source/fastaq_*; do
+    j=$(echo $i | sed "s/$source\///");
+    out_file=$destination/$j.1
+    help2man -m $j -n $j --no-discard-stderr $i |
+    grep -v $j': error: too few arguments' |
+    sed "s/usage://gi" > $out_file;
+done
+
+
+
+for file in $destination/*.1; do
+
+    out_file=$(echo $file | sed 's/\.1/\.2/');
+    filename=$(echo $file | sed "s/\($destination\/*\)\([a-zA-Z_0-9]* *\)\.1/\2/")
+    while read line
+    do
+	echo $line |
+	sed "s/\-\s\($filename *\)/\1/" |
+	sed "s/\(.TH *\)\([a-zA-Z_0-9]* *\)\(\"[0-9\"]* *\)\(\"[a-zA-Z0-9_ ]*\" *\)\(\"[a-zA-Z0-9_\<\>\/ ]*\" *\)\(\"[a-zA-Z0-9_]*\" *\)/\1 \2 \6 \3/" |
+	sed "s/\(The\sfull\sdocumentation\sfor*\)/$filename -h will display the original python documentation/" |
+	sed "s/^\.B//" |
+	sed "s/^is\smaintained\sas\sa\sTexinfo\smanual.\sIf\sthe//" |
+	sed "s/^\.B//" |
+	sed "s/\sinfo//" |
+	sed "s/^and//" |
+	sed "s/^programs\sare\sproperly\sinstalled\sat\syour\ssite\,\sthe\scommand//" |
+	sed "s/\(.IP\r*\)//" |
+	sed "s/^should\sgive\syou\saccess\sto\sthe\scomplete\smanual\.//"
+
+    done < $file > $out_file
+cat <<EOF >> $out_file
+.SH "AUTHOR"
+.sp
+$filename was originally written by Martin Hunt (mh12 at sanger\&.ac\&.uk)
+.SH "COPYING"
+.sp
+Wellcome Trust Sanger Institute Copyright \(co 2013 Wellcome Trust Sanger Institute This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version\&.
+EOF
+
+    mv $out_file $file
+
+
+done
diff --git a/debian/watch b/debian/watch
index 2762d35..46c1516 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,4 +1,3 @@
 version=3
-https://github.com/js21/Fastaq/releases .*/archive/(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz)
-#https://github.com/sanger-pathogens/fastaq/releases .*/archive/(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz)
+https://github.com/sanger-pathogens/fastaq/releases .*/archive/v(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz)
 
diff --git a/man/fastaq_trim_Ns_at_end.txt b/man/fastaq_trim_Ns_at_end.txt
deleted file mode 100644
index 927ce56..0000000
--- a/man/fastaq_trim_Ns_at_end.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-FASTAQ_TRIM_Ns_AT_ENDDOC(1)
-===========================
-:doctype: manpage
-
-
-NAME
-----
-fastaq_trim_Ns_at_end - Trims any Ns off each sequence in a fasta/q file
-
-SYNOPSIS
---------
-fastaq_trim_Ns_at_end [fasta/q in] [fasta/q out]
-
-DESCRIPTION
------------
-Trims any Ns off each sequence in a fasta/q file. Does nothing to gaps in the middle, just trims the ends
-
-OPTIONS
--------
-
-positional arguments:
-
-*infile*::
-		Name of input fasta/q file
-*outfile*::
-		Name of output fasta/q file
-
-optional arguments
-
-*-h, --help*::
-		Show this help message
-
-EXAMPLES
---------
-fastaq_trim_Ns_at_end foo.fa trimmed_ns_foo.fa
-
-fastaq_trim_Ns_at_end foo.fq trimmed_ns_foo.fq
-
-fastaq_trim_Ns_at_end foo.fa.gz trimmed_ns_foo.fa.gz
-
-fastaq_trim_Ns_at_end foo.fq.gz trimmed_ns_foo.fq.gz
-
-AUTHOR
-------
-fastaq_trim_Ns_at_end was originally written by Martin Hunt (mh12 at sanger.ac.uk)
-
-COPYING
--------
-Wellcome Trust Sanger Institute Copyright (C) 2013 Wellcome Trust Sanger Institute
-This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
-

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



More information about the debian-med-commit mailing list