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