This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[inseparable changes from changes to perl-5.004_01-mt2]
[perl5.git] / Porting / makerel
CommitLineData
08aa1457
PP
1#!/bin/env perl -w
2
3# A first attempt at some automated support for making a perl release.
4# Very basic but functional - if you're on a unix system.
5# You should have at least run preprel before this.
6#
7# No matter how automated this gets, you'll always need to read
8# and re-read pumpkin.pod checking for things to be done at various
9# stages of the process.
10#
11# Tim Bunce, June 1997
12
13use ExtUtils::Manifest qw(fullcheck);
14
15$|=1;
16$relroot = ".."; # XXX make an option
17
18die "Must be in root of the perl source tree.\n"
19 unless -f "./MANIFEST" and -f "patchlevel.h";
20
21$patchlevel_h = `grep '#define ' patchlevel.h`;
22print $patchlevel_h;
23$patchlevel = $1 if $patchlevel_h =~ /PATCHLEVEL\s+(\d+)/;
24$subversion = $1 if $patchlevel_h =~ /SUBVERSION\s+(\d+)/;
25die "Unable to parse patchlevel.h" unless $subversion > 0;
26$vers = sprintf("5.%03d", $patchlevel);
27$vers.= sprintf( "_%02d", $subversion) if $subversion;
28
29$perl = "perl$vers";
30$reldir = "$relroot/$perl";
31
32print "\nMaking a release for $perl in $reldir\n\n";
33
34
35print "Cross-checking the MANIFEST...\n";
36($missfile, $missentry) = fullcheck();
37die "Can't make a release with MANIFEST files missing.\n" if @$missfile;
38die "Can't make a release with files not listed in MANIFEST.\n" if @$missentry;
39print "\n";
40
41
42print "Setting file permissions...\n";
43system("find . -type f -print | xargs chmod -w");
44system("chmod +w configure"); # special case (see pumpkin.pod)
45@exe = qw(
46 Configure
47 configpm
48 configure
49 embed.pl
50 installperl
51 installman
52 keywords.pl
53 myconfig
54 opcode.pl
55 perly.fixer
56 t/TEST
57 t/*/*.t
58 *.SH
59 vms/ext/Stdio/test.pl
60 vms/ext/filespec.t
61 vms/fndvers.com
62 x2p/*.SH
63 Porting/patchls
64 Porting/makerel
65);
66system("chmod +x @exe");
67print "\n";
68
69
70print "Creating $reldir release directory...\n";
71die "$reldir release directory already exists\n" if -e "../$perl";
72die "$reldir.tar.gz release file already exists\n" if -e "../$perl.tar.gz";
73mkdir($reldir, 0755) or die "mkdir $reldir: $!\n";
74print "\n";
75
76
77print "Copying files to release directory...\n";
78# ExtUtils::Manifest maniread does not preserve the order
79$cmd = "awk '{print \$1}' MANIFEST | cpio -pdm $reldir";
80system($cmd) == 0 or die "$cmd failed";
81print "\n";
82
83chdir $relroot or die $!;
84
85print "Creating and compressing the tar file...\n";
86$cmd = "tar cf - $perl | gzip --best > $perl.tar.gz";
87system($cmd) == 0 or die "$cmd failed";
88print "\n";
89
90system("ls -ld $perl*");