xmltv
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
rmdir $location/share/doc
# Generate Date::Manip docs by filtering perldoc output. The
# use of temp files instead of pipes is so set -e works properly.
#
echo Extracting part of Date::Manip manual page into $location/doc/man/date_formats.txt
echo "This is an extract from the documentation of Perl's Date::Manip module," >>$location/doc/man/date_formats.txt
echo "describing the different format strings that may be used for dates." >>$location/doc/man/date_formats.txt
echo "Bear in mind that depending on your Windows version you will need to" >>$location/doc/man/date_formats.txt
echo "quote the % characters on the command line somehow (see README.win32)." >>$location/doc/man/date_formats.txt
echo "" >>$location/doc/man/date_formats.txt
perldoc -u Date::Manip >$location/doc/man/date_formats.txt.tmp
perl -ne "BEGIN { print qq'\n=pod\n\n' } print if (/^The format options are:/ .. /^=/) and not /^=/" <$location/doc/man/date_formats.txt.tmp >$location/doc/man/date_formats.txt.tmp.1
pod2text <$location/doc/man/date_formats.txt.tmp.1 >>$location/doc/man/date_formats.txt
perl -MExtUtils::Command -e rm_f $location/doc/man/date_formats.txt.tmp*
# Don't use $(INSTALLBIN), it seems to disregard PREFIX passed
# to 'make'.
#
perl -MExtUtils::Command -e rm_rf $location/bin/ $location/lib/ $(INSTMANDIR) $(INSTALLMAN3DIR)
perl -MExtUtils::Command -e cp xmltv.dtd $location
# The following command will not be necessary when the source
# tree was checked out on a DOSish system. It may not even
# work properly when run on a DOSish system - should check.
#
# (Simulation in perl of find | xargs; there's probably a
# better way but I'm too lazy to find it.)
#
perl -MFile::Find -e "find(sub { print qq[\\$$File::Find::name\n] if -f and not /[.]jpg/ }, '$location')" | perl -e 'chomp(@ARGV = (@ARGV, <STDIN>)); exec @ARGV' perl -i -pe 'BEGIN { binmode STDIN } s/\r*\n*$$/\r\n/'
perl -MExtUtils::Command -e mv $location/doc/README* $location
perl -MExtUtils::Command -e mv $location/README.win32 $location/README
@echo
@echo Part of a Windows distribution tree has been made in $location/.
@echo Now copy in the executables!
};
$inherited =~ s/\$location/$location/g or die;
return $inherited;
}
# Extend installbin() to put doc and share under blib/.
sub MY::installbin {
package MY;
my $inherited = shift->SUPER::installbin(@_);
# Add a target for each documentation file.
my %doc_files;
foreach (@::docs) {
$doc_files{$_} = File::Basename::basename($_);
}
my %new_filetypes = (plaindoc => \%doc_files, share => \%share_files);
my %seen_dir;
foreach my $filetype (sort keys %new_filetypes) {
my $uc = uc $filetype;
our %files; local *files = $new_filetypes{$filetype};
foreach my $src (sort keys %files) {
my $inst_pos = $files{$src};
my $extra = '';
# The directory containing this file in blib/ needs to be created.
my @dirs = split m!/!, $inst_pos; pop @dirs;
foreach (0 .. $#dirs) {
my $dir = join('/', @dirs[0 .. $_]);
my $parent = join('/', @dirs[0 .. $_-1]);
next if $seen_dir{$dir}++;
die if (length $parent and not $seen_dir{$parent});
my $parent_exists = "\$(INST_$uc)/$parent/.exists";
$parent_exists =~ tr!/!/!s;
$extra .= <<END
\$(INST_$uc)/$dir/.exists :: \$(PERL_INC)/perl.h $parent_exists
\@\$(MKPATH) \$(INST_$uc)/$dir
\@\$(EQUALIZE_TIMESTAMP) \$(PERL_INC)/perl.h \$(INST_$uc)/$dir/.exists
-\@\$(CHMOD) \$(PERM_RWX) \$(INST_$uc)/$dir
END
;
}
my $dir_exists = "\$(INST_$uc)/" . join('/', @dirs) . '/.exists';
$dir_exists =~ tr!/!/!s;
$extra .= <<END
\$(INST_$uc)/$inst_pos: $src Makefile $dir_exists
\@\$(RM_F) \$(INST_$uc)/$inst_pos
perl -MExtUtils::Command -e cp $src \$(INST_$uc)/$inst_pos
-\@\$(CHMOD) \$(PERM_RW) \$(INST_$uc)/$inst_pos
END
;
$extra =~ s/ {8}/\t/g;
$inherited .= $extra;
}
# These targets need to be added to pure_all, using a new target
# pure_$filetype.
#
$inherited =~ s/^(\s*pure_all\s+::\s.+)/$1 pure_$filetype/m
or die "no pure_all in: $inherited";
$inherited .= "pure_$filetype :: ";
foreach (sort keys %files) {
my $inst_pos = $files{$_};
$inherited .= "\$(INST_$uc)/$inst_pos ";
}
$inherited .= "\n\t\@\$(NOOP)\n";
# And realclean should remove them, by calling realclean_$filetype.
$inherited =~ s/^(\s*realclean\s+::\s.+)/$1 realclean_$filetype/m or die;
$inherited .= "realclean_$filetype ::\n\t\$(RM_F) ";
foreach (sort keys %files) {
my $inst_pos = $files{$_};
$inherited .= "\$(INST_$uc)/$inst_pos ";
}
$inherited .= "\n";
}
return $inherited;
}
# 'make clean' doesn't remove generated files from *.PL (see posting
# to makemaker@perl.org). Fix it.
#
sub MY::clean {
package MY;
my $inherited = shift->SUPER::clean(@_);
( run in 1.633 second using v1.01-cache-2.11-cpan-71847e10f99 )