#!/bin/bash
#
# create all manpages to avoid building them
# on each buildd
#
# install package before usage!

TOOLSHELP2MAN="zpipe"
for tool in $TOOLSHELP2MAN; do 
  echo "process $tool"
  /usr/bin/help2man -N -n"tool from openCaster suite" -S"automatically made for Debian" --no-discard-stderr $tool > man/$tool.1
done

# sec2ts
TOOLSCALL="tsnullshaper ts2pes esaudio2pes tsororts eitsecfilter mpe2sec tstdt txt2pes tscbrmuxer tsudpsend tspcrrestamp vbv esvideompeg2info pes2txt tsstamp tsccc tspcrstamp pes2es tsmodder ts2sec tstcpsend tsoutputswitch tstimedwrite tsmask pesaudio2ts esaudioinfo tstimeout m2ts2ts tsfixcc tsudpreceive dsmcc-receive eitsecmapper tspidmapper tsdoubleoutput tsnullfiller tsorts tsprinter pesdata2ts i13942ts esvideompeg2pes ts2m2ts tspcrmeasure pesinfo pesvideo2ts tsfilter tsinputswitch tsloop tstcpreceive tsvbr2cbr tsdiscont eitsecactualtoanother"
for tool in $TOOLSCALL; do 
  echo "process $tool"
  echo ".\\\" DO NOT MODIFY THIS FILE!  It was automatically generated " > man/$tool.1
  echo ".TH $tool \"1\" \"August 2013\" \"automatically made for Debian\" \"User Commands\" ">> man/$tool.1
  echo ".SH NAME" >> man/$tool.1
  echo "$tool \- tool from openCaster suite" >> man/$tool.1
  echo ".SH DESCRIPTION" >> man/$tool.1
  $tool &>> man/$tool.1
done

TOOLSCALL="mod2sec oc-update file2mod"
for tool in $TOOLSCALL; do 
  echo "process $tool"
  echo ".\\\" DO NOT MODIFY THIS FILE!  It was automatically generated " > man/$tool.1
  echo ".TH $tool \"1\" \"August 2013\" \"automatically made for Debian\" \"User Commands\" ">> man/$tool.1
  echo ".SH NAME" >> man/$tool.1
  echo "$tool \- tool from openCaster suite" >> man/$tool.1
  echo ".SH DESCRIPTION" >> man/$tool.1
  $tool -? &>> man/$tool.1
done

