[openfoam] 01/04: Add manpage-generator.

Anton Gladky gladk at moszumanska.debian.org
Tue Sep 27 20:19:27 UTC 2016


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

gladk pushed a commit to branch master
in repository openfoam.

commit f1c1964a29ab877eaa5a35226f841213c32d7e3f
Author: Anton Gladky <gladk at debian.org>
Date:   Tue Sep 27 21:58:30 2016 +0200

    Add manpage-generator.
---
 debian/control                                |  1 +
 debian/manpage/gen_man.py                     | 27 +++++++++++++++++++++++++++
 debian/manpage/manpage.1                      | 17 +++++++++++++++++
 debian/manpage/{listBinFiles => manpage_data} |  2 +-
 debian/openfoam.manpages                      |  1 +
 debian/rules                                  |  1 +
 6 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 2d86554..a95d9bb 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,7 @@ Build-Depends: bison,
                libreadline6-dev,
                mpi-default-bin,
                mpi-default-dev,
+               python3-minimal,
                libscotch-dev,
                libboost-system-dev,
                libcgal-dev,
diff --git a/debian/manpage/gen_man.py b/debian/manpage/gen_man.py
new file mode 100755
index 0000000..16d6ee5
--- /dev/null
+++ b/debian/manpage/gen_man.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+import shutil, fileinput, os
+
+folderSrc = './'
+folderDst = './generated/'
+if not os.path.exists(folderDst):
+    os.mkdir(folderDst)
+
+fMan = open(folderSrc + 'manpage_data')
+lMan = fMan.readlines()
+
+
+for m in lMan:
+    packNameSrc = m.split()[0].strip()
+    packNameDst = folderDst + '%s.1'%(packNameSrc)
+    descr = m[len(packNameSrc)+1:].strip()
+    
+    shutil.copyfile(folderSrc + 'manpage.1',packNameDst)
+    with fileinput.FileInput(packNameDst, inplace=True) as fileR:
+        for l in fileR:
+            print(l.replace('%PACKAGE%', packNameSrc), end='')
+    with fileinput.FileInput(packNameDst, inplace=True) as fileR:
+        for l in fileR:
+            print(l.replace('%DESCR%', descr), end='')
+
+
+
diff --git a/debian/manpage/manpage.1 b/debian/manpage/manpage.1
new file mode 100644
index 0000000..37dd3f2
--- /dev/null
+++ b/debian/manpage/manpage.1
@@ -0,0 +1,17 @@
+.TH %PACKAGE% 1
+.SH NAME
+%PACKAGE%
+.SH SYNOPSIS
+.B %PACKAGE%
+.BR
+.SH DESCRIPTION
+.BR %PACKAGE%
+is the part of OpenFOAM - a free, open source CFD software.
+
+.BR %PACKAGE%
+is a %DESCR%
+
+More detailed information can be found on the WEB-site http://openfoam.org
+
+.SH COPYRIGHT
+2011-2016 OpenFOAM Foundation
diff --git a/debian/manpage/listBinFiles b/debian/manpage/manpage_data
similarity index 99%
rename from debian/manpage/listBinFiles
rename to debian/manpage/manpage_data
index 394d97a..2a33c86 100644
--- a/debian/manpage/listBinFiles
+++ b/debian/manpage/manpage_data
@@ -119,7 +119,7 @@ plot3dToFoam Plot3d mesh (ascii/formatted format) converter.
 polyDualMesh Calculate the dual of a polyMesh. Adheres to all the feature and patch edges.
 porousSimpleFoam Steady-state solver for incompressible, turbulent flow with implicit or explicit porosity treatment and support for multiple reference frames (MRF) 
 postChannel Post-processes data from channel flow calculations. 
-postProcess
+postProcess Execute the set of functionObjects specified in the selected dictionary (which defaults to system/controlDict) or on the command-line for the selected set of times on the selected set of fields.
 potentialFoam Potential flow solver which solves for the velocity potential from which the flux-field is obtained and velocity field by reconstructing the flux. 
 potentialFreeSurfaceDyMFoam Incompressible Navier-Stokes solver with inclusion of a wave height field to enable single-phase free-surface approximations. 
 potentialFreeSurfaceFoam Incompressible Navier-Stokes solver with inclusion of a wave height field to enable single-phase free-surface approximations. 
diff --git a/debian/openfoam.manpages b/debian/openfoam.manpages
new file mode 100644
index 0000000..da64b1b
--- /dev/null
+++ b/debian/openfoam.manpages
@@ -0,0 +1 @@
+debian/manpage/generated/*
diff --git a/debian/rules b/debian/rules
index ef7c52b..cbec610 100755
--- a/debian/rules
+++ b/debian/rules
@@ -65,4 +65,5 @@ export LD_LIBRARY_PATH:=$(CURDIR)/platforms/linux64Gcc51/lib/openmpi-system:/usr
 #export WM_PROJECT_USER_DIR=$(CURDIR)
 
 override_dh_auto_build:
+	cd $(CURDIR)/debian/manpage ; python3 gen_man.py
 	PATH=$(PATH):$(CURDIR)/wmake/ ./Allwmake

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/openfoam.git



More information about the debian-science-commits mailing list