aboutsummaryrefslogtreecommitdiff
path: root/Perl/CPANising-tkzinc.pl
blob: 10e13d4dc3eedbb3a7ddc1a705a7084e9235caeb (plain)
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
#!/usr/bin/perl

# this script build the tk-zinc-n.mmm.tar.gz file which must then
# be uploaded on the CPAN on ZINCDEV account


# this version must be the same than those in the CVS repository
# in CVS the tag has the following form: cpan_n_mmm
my $version = "3.29401";

chdir ('/tmp');

my $cvstag = 'cpan_' . $version;
$cvstag =~ s/\./_/ ;


my $dirname = "tk-zinc-$version";

system ("rm -rf $dirname $dirname.tar.gz");

my $command = "cvs -d :ext:liszt.pii.ath.cena.fr:/pii/repository export -r $cvstag -d $dirname Tkzinc";
print "cvs: $command\n";
system ($command) ;

chdir ("/tmp/$dirname");

use ExtUtils::MakeMaker;

my $ver =  MM->parse_version("Perl/Zinc.pm");
die "version in $0 and Zinc.pm must be identical" unless $ver == $version ;

## the debian changelog is copied and renamed in the root directory
system ('cp -p debian/changelog Changes');

## the CPANising-tkzinc.pl script is not supposed to be distributed
## neither the sandbox, nor debian or redhat dirs
system ('rm -rf sandbox debian redhat CPANising-tkzinc.pl');

## the following tcl-needed (or python-needed) dirs are deleted:
system ('rm -rf demos library tests');
## warning: we still need the following directory: .../tclconfig .../Python


# removing the .cvsignore files
system ('find . -name .cvsignore | xargs rm -f');

# renaming README.PERL in README
system ('mv  README README.FULL ; mv README.PERL README');


# the following dir and 2 files are dummy configure
# files still needed for building Tk::Zinc for Perl.
# They will soon disapear!
system ('mkdir fake_TCL_libs');
open (TCL , ">fake_TCL_libs/tclConfig.sh");
print TCL <<EOF
# tclConfig.sh --
# This shell script is generated automatically by Tcl's
# configure script.
# It is currently necessary, but not used
# to configure Tk::Zinc for perl.
TCL_SRC_DIR='/fake/directory/not/need/for/ptk/install'
EOF
    ;

close TCL;

open (TK , ">fake_TCL_libs/tkConfig.sh");
print TK <<EOF
# tkConfig.sh --
# This shell script is generated automatically by Tcl's
# configure script.
# It is currently necessary, but not used
# to configure Tk::Zinc for perl.
TK_SRC_DIR='/fake/directory/not/need/for/ptk/install'
EOF
    ;

# end of the hack!

# creating the MANIFEST file
use ExtUtils::Manifest qw( mkmanifest );
$ExtUtils::Manifest::Quiet = 1;
&mkmanifest();

# and finally creating the tar file, ready to upload
chdir ("/tmp");
system ("tar cfz $dirname.tar.gz $dirname");