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 88 89 90 91 92 93
|
#!/usr/bin/perl -w
##*****************************************************************************
## make_version.pl
##*****************************************************************************
## Author: Gerd Neugebauer
##=============================================================================
=head1 NAME
make_version.pl - ...
=head1 SYNOPSIS
make_version.pl [-v|--verbose]
make_version.pl [-h|-help]
=head1 DESCRIPTION
=head1 OPTIONS
=head1 AUTHOR
Gerd Neugebauer
=head1 BUGS
=over 4
=item *
...
=back
=cut
use strict;
#------------------------------------------------------------------------------
# Function: usage
# Arguments:
# Returns:
# Description:
#
sub usage
{ use Pod::Text;
Pod::Text->new()->parse_from_filehandle(new FileHandle($0,'r'),\*STDERR);
}
#------------------------------------------------------------------------------
# Variable: $verbose
# Description:
#
my $verbose = 0;
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/\$Id: make_version.pl,v 1.3 2011-11-27 14:25:46 gene Exp $/;
}
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{/usr/share/bibtool}
\\newcommand\\Year{$year}
\\newcommand\\Version{$version}
__EOF__
#------------------------------------------------------------------------------
# Local Variables:
# mode: perl
# End:
|