diff options
Diffstat (limited to 'Perl/export2cpan')
-rwxr-xr-x | Perl/export2cpan | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/Perl/export2cpan b/Perl/export2cpan index 6e385f9..232f42c 100755 --- a/Perl/export2cpan +++ b/Perl/export2cpan @@ -23,6 +23,7 @@ my $ZINC_PREFIX = 'tk-zinc'; my $DEFAULT_SERVER = 'liszt.pii.ath.cena.fr'; my $TMP = '/tmp/forCPAN'; +# computing major, minor and patchlevel from var defined in ../configure.in sub version4cpan { my $configure_in = "../configure.in"; @@ -30,20 +31,17 @@ sub version4cpan { my ($major, $minor, $patchlevel); while (<FD>) { - if ($_ =~ /(MAJOR_VERSION)[ =][0-9]+/) + if (/^MAJOR_VERSION=(\d+)/) { - (undef, $major) = split(/[ =]+/, $_); - chomp $major; + $major = $1; } - elsif ($_ =~ /(MINOR_VERSION)[ =][0-9]+/) + elsif (/^MINOR_VERSION=(\d+)/) { - (undef, $minor) = split(/[ =]+/, $_); - chomp $minor; + $minor = $1; } - elsif ($_ =~ /(PATCHLEVEL)[ =][0-9]+/) + elsif (/^PATCHLEVEL=(\d+)/) { - (undef, $patchlevel) = split(/[ =]+/ ,$_); - chomp $patchlevel; + $patchlevel = $1; } } @@ -52,23 +50,6 @@ sub version4cpan { return "$major.$minor$patchlevel"; } -sub filesubst { - my ($fileIn, $fileOut, $key, $val) = @_; - - open(FDIN, "<$fileIn") or die "Could not open input file $fileIn"; - open(FDOUT, ">$fileOut") or die "Could not open output file $fileOut"; - - while (<FDIN>) { - if (/$key/) { - s/$key/$val/g; - } - print FDOUT $_; - } - - close(FDIN); - close(FDOUT); -} - my $VERSION; my $FROM_CVS = (scalar(@ARGV) != 0); my $DIR_FROM_CVS; @@ -96,8 +77,11 @@ if ($FROM_CVS) { system("rm -rf $TMP"); system ("mkdir $TMP"); chdir("$TMP"); - print "cd $TMP; cvs -d :ext:$server:/pii/repository export -r $cvstag -d $DIR_FROM_CVS Tkzinc\n"; - my $error = system("cd $TMP; cvs -d :ext:$server:/pii/repository export -r $cvstag -d $DIR_FROM_CVS Tkzinc"); + # the following command always fail with cvs 1.11.1p1 !! + # my $command = "cd $TMP; cvs -d $server:/pii/repository export -r $cvstag -d $DIR_FROM_CVS Tkzinc"; + my $command = "cd $TMP; cvs -d /pii/repository export -r $cvstag -d $DIR_FROM_CVS Tkzinc"; + print "$command\n"; + my $error = system($command); die "CVS extraction did not succeed" if $error; chdir("$DIR_FROM_CVS/Perl"); my $EXTRACTED_VERSION = version4cpan; # version gotten from the tagged CVS files @@ -105,9 +89,12 @@ if ($FROM_CVS) { print "Oops! the tag version '$tag_version' does not match the version '$VERSION' in the sources, aborting\n"; exit(1); } + system ("cd $TMP/$DIR_FROM_CVS; ./configure"); } else { $VERSION = version4cpan; + print "cd ..; ./configure\n"; + system ("cd ..; ./configure"); # for creating Zinc.pm and Makefile.pl from xxx.in files } print "VERSION $VERSION\n"; @@ -150,22 +137,15 @@ foreach my $f (@files) { system("$CP $f $EXPORT_DIR/$VERSION_DIR"); } -filesubst('Zinc.pm', "$EXPORT_DIR/$VERSION_DIR/Zinc.pm-new", 'CONF_VERS', $VERSION); -system("$CPonlyIfDifferent $EXPORT_DIR/$VERSION_DIR/Zinc.pm-new $EXPORT_DIR/$VERSION_DIR/Zinc.pm"); -unlink "$EXPORT_DIR/$VERSION_DIR/Zinc.pm-new"; - -filesubst('Makefile.PL', "$EXPORT_DIR/$VERSION_DIR/Makefile.PL-new", 'CONF_VERS', $VERSION); -system("$CPonlyIfDifferent $EXPORT_DIR/$VERSION_DIR/Makefile.PL-new $EXPORT_DIR/$VERSION_DIR/Makefile.PL"); -unlink "$EXPORT_DIR/$VERSION_DIR/Makefile.PL-new"; - +system("$CP Zinc.pm $EXPORT_DIR/$VERSION_DIR"); +system("$CP Makefile.PL $EXPORT_DIR/$VERSION_DIR"); system("$CP ../libtess/*.c $EXPORT_DIR/$VERSION_DIR"); system("$CP ../libtess/*.h $EXPORT_DIR/$VERSION_DIR"); system("$CP ../generic/*.c $EXPORT_DIR/$VERSION_DIR"); system("$CP ../generic/*.h $EXPORT_DIR/$VERSION_DIR"); system("$CP ../win/*.c $EXPORT_DIR/$VERSION_DIR"); -system("$CP ../debian/changelog $EXPORT_DIR/$VERSION_DIR/Changes"); -system("$CP ../debian/copyright $EXPORT_DIR/$VERSION_DIR/COPYRIGHT"); + # # If working for an exported copy, build a tarball in the |