diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2014-02-26 16:48:01 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2014-02-26 16:48:01 +0100 |
commit | faae49c640ee2d308d40bc5867d6ecbd80ac0fc1 (patch) | |
tree | d49a49f6c8142a1762a339a99396421a127cc146 /debian/truecrypt_help_to_troff.pl | |
download | truecrypt-faae49c640ee2d308d40bc5867d6ecbd80ac0fc1.tar.gz truecrypt-faae49c640ee2d308d40bc5867d6ecbd80ac0fc1.tar.bz2 truecrypt-faae49c640ee2d308d40bc5867d6ecbd80ac0fc1.zip |
initial packaging based on http://www.unchartedbackwaters.co.uk/pyblosxom/static/truecrypt_debian_packaging
Diffstat (limited to 'debian/truecrypt_help_to_troff.pl')
-rwxr-xr-x | debian/truecrypt_help_to_troff.pl | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/truecrypt_help_to_troff.pl b/debian/truecrypt_help_to_troff.pl new file mode 100755 index 0000000..79e5ce0 --- /dev/null +++ b/debian/truecrypt_help_to_troff.pl @@ -0,0 +1,63 @@ +#!/usr/bin/perl -w +use strict; + +open(OUT, ">&STDOUT") or die "Couldn't dup STDOUT: $!"; +open(IN, "<&STDIN" ) or die "Couldn't dup STDIN : $!"; + +print OUT ".TH TRUECRYPT 1\n"; +print OUT ".SH NAME\n"; +print OUT "truecrypt \\- create and mount TrueCrypt encrypted volumes\n"; + +my $section = ""; + +while(my $line = <IN>) +{ + if ($line =~ m/^([a-z_]+):$/i) + { + $section= lc($1); + } + + my $out = $line; + + if ($line =~ m/^[a-z_]+:$/i) + { + $line =~ s/://; + $line = ".SH " . $line; + + $out = uc($line); + } + elsif ($section eq "synopsis") + { + $line =~ s/([A-Z_]+)/\\fI$1\\fP/g; + $out = $line."\n"; + } + elsif ($section eq "examples") + { + if ($line =~ m/^.*:$/) + { + $out = ".PP\n.B $line"; + } + elsif ($line =~ m/.+/) + { + $out = ".nf\n$line.fi\n"; + } + } + elsif ($line =~ m/^-/) + { + $out = ".TP\n.B ".$line; + } + + # In general, the hyphen-minus is meant to be a minus. + $out =~ s/-/\\-/g; + print OUT $out +} + +print OUT ".SH COPYRIGHT\n"; +print OUT "TrueCrypt is \\(co 2012 TrueCrypt Developers Association. All rights reserved.\n"; + +print OUT ".PP\nThis manual page was automatically generated from the output of \\fBtruecrypt \\-\\-help\\fP\n"; +print OUT "as part of unofficial TrueCrypt Debian packaging from\n"; +print OUT "\\fIhttp://www.unchartedbackwaters.co.uk/pyblosxom/static/truecrypt_debian_packaging\\fP.\n"; + +close(IN); +close(OUT); |