Commit | Line | Data |
08aa1457 |
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. |
08aa1457 |
5 | # |
6 | # No matter how automated this gets, you'll always need to read |
7 | # and re-read pumpkin.pod checking for things to be done at various |
8 | # stages of the process. |
9 | # |
10 | # Tim Bunce, June 1997 |
11 | |
12 | use ExtUtils::Manifest qw(fullcheck); |
13 | |
14 | $|=1; |
15 | $relroot = ".."; # XXX make an option |
16 | |
17 | die "Must be in root of the perl source tree.\n" |
18 | unless -f "./MANIFEST" and -f "patchlevel.h"; |
19 | |
20 | $patchlevel_h = `grep '#define ' patchlevel.h`; |
21 | print $patchlevel_h; |
22 | $patchlevel = $1 if $patchlevel_h =~ /PATCHLEVEL\s+(\d+)/; |
23 | $subversion = $1 if $patchlevel_h =~ /SUBVERSION\s+(\d+)/; |
24 | die "Unable to parse patchlevel.h" unless $subversion > 0; |
25 | $vers = sprintf("5.%03d", $patchlevel); |
26 | $vers.= sprintf( "_%02d", $subversion) if $subversion; |
27 | |
28 | $perl = "perl$vers"; |
29 | $reldir = "$relroot/$perl"; |
30 | |
31 | print "\nMaking a release for $perl in $reldir\n\n"; |
32 | |
33 | |
34 | print "Cross-checking the MANIFEST...\n"; |
35 | ($missfile, $missentry) = fullcheck(); |
3e3baf6d |
36 | warn "Can't make a release with MANIFEST files missing.\n" if @$missfile; |
37 | warn "Can't make a release with files not listed in MANIFEST.\n" if @$missentry; |
90248788 |
38 | if ("@$missentry" =~ m/\.orig\b/) { |
39 | # Handy listing of find command and .orig files from patching work. |
40 | # I tend to run 'xargs rm' and copy and paste the file list. |
41 | my $cmd = "find . -name '*.orig' -print"; |
42 | print "$cmd\n"; |
43 | system($cmd); |
44 | } |
3e3baf6d |
45 | die "Aborted.\n" if @$missentry or @$missfile; |
08aa1457 |
46 | print "\n"; |
47 | |
48 | |
49 | print "Setting file permissions...\n"; |
50 | system("find . -type f -print | xargs chmod -w"); |
51 | system("chmod +w configure"); # special case (see pumpkin.pod) |
52 | @exe = qw( |
53 | Configure |
54 | configpm |
55 | configure |
56 | embed.pl |
57 | installperl |
58 | installman |
59 | keywords.pl |
60 | myconfig |
61 | opcode.pl |
62 | perly.fixer |
63 | t/TEST |
64 | t/*/*.t |
65 | *.SH |
66 | vms/ext/Stdio/test.pl |
67 | vms/ext/filespec.t |
68 | vms/fndvers.com |
69 | x2p/*.SH |
70 | Porting/patchls |
71 | Porting/makerel |
72 | ); |
73 | system("chmod +x @exe"); |
74 | print "\n"; |
75 | |
76 | |
77 | print "Creating $reldir release directory...\n"; |
78 | die "$reldir release directory already exists\n" if -e "../$perl"; |
79 | die "$reldir.tar.gz release file already exists\n" if -e "../$perl.tar.gz"; |
80 | mkdir($reldir, 0755) or die "mkdir $reldir: $!\n"; |
81 | print "\n"; |
82 | |
83 | |
84 | print "Copying files to release directory...\n"; |
85 | # ExtUtils::Manifest maniread does not preserve the order |
86 | $cmd = "awk '{print \$1}' MANIFEST | cpio -pdm $reldir"; |
87 | system($cmd) == 0 or die "$cmd failed"; |
88 | print "\n"; |
89 | |
90 | chdir $relroot or die $!; |
91 | |
92 | print "Creating and compressing the tar file...\n"; |
93 | $cmd = "tar cf - $perl | gzip --best > $perl.tar.gz"; |
94 | system($cmd) == 0 or die "$cmd failed"; |
95 | print "\n"; |
96 | |
97 | system("ls -ld $perl*"); |