Debian Codegraph @

doc/make_version.pl

raw ◀ ▶
1 Debian patch touch this file
1 #!/usr/bin/perl -w
2 ##*****************************************************************************
3 ## make_version.pl
4 ##*****************************************************************************
5 ## Author: Gerd Neugebauer
6 ##=============================================================================
7
8 =head1 NAME
9
10 make_version.pl - Create the content for config.tex
11
12 =head1 SYNOPSIS
13
14 make_version.pl [-v|--verbose]
15
16 make_version.pl [-h|-help]
17
18 =head1 DESCRIPTION
19
20 =head1 OPTIONS
21
22 =head1 AUTHOR
23
24 Gerd Neugebauer
25
26 =back
27
28 =cut
29
30 use strict;
31
32 #------------------------------------------------------------------------------
33 # Function: usage
34 # Arguments: none
35 # Returns: nothing
36 # Description: Print the POD of this file to stderr.
37 #
38 sub usage
39 { use Pod::Text;
40 Pod::Text->new()->parse_from_filehandle(new FileHandle($0,'r'),\*STDERR);
41 }
42
43 #------------------------------------------------------------------------------
44 # Variable: $verbose
45 # Description: Indicator for verbosity
46 #
47 my $verbose = 0;
48
•49 my $LIBDIR = '/usr/share/bibtool';
50
51 use Getopt::Long;
52 GetOptions("h|help" => \&usage,
53 "v|verbose" => \$verbose,
54 );
55
56 my $version = undef;
57 @_ = localtime;
58 my $year = 1900 + $_[5];
59
60 while(<>) {
61 $version = $1 if m/bibtool_version *= *"([0-9.]*)/;
62 $year = $1 if m/bibtool_year *= *"([0-9]*)/;
63 }
64
65 die "*** Missing version\n" if not defined $version;
66
67 print <<__EOF__;
68 %%********************************************************
69 %%
70 %% This file is part of BibTool.
71 %% It is distributed under the GNU General Public License.
72 %% See the file COPYING for details.
73 %%
74 %% (c) 1995-$year Gerd Neugebauer
75 %%
76 %% Net: gene\@gerd-neugebauer.de
77 %%
78 %%********************************************************
79 \\newcommand\\LIBDIR{$LIBDIR}
80 \\newcommand\\Year{$year}
81 \\newcommand\\Version{$version}
82 __EOF__
83
84 #------------------------------------------------------------------------------
85 # Local Variables:
86 # mode: perl
87 # End: