summaryrefslogtreecommitdiff
path: root/installman
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1995-05-30 22:59:41 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-05-30 22:59:41 +0000
commit16d20bd98cd29be76029ebf04027a7edd34d817b (patch)
tree9ff5dd75c8b63cfd0da63bc9e4d59f464986bc0e /installman
parent3b35bae3d5913952e779006fe378c78297e23080 (diff)
downloadperl-16d20bd98cd29be76029ebf04027a7edd34d817b.tar.gz
This is my patch patch.1i for perl5.001.
To apply, change to your perl directory, run the commands above, then apply with patch -p1 -N < thispatch. After you apply this patch, I would recommend: rm config.sh sh Configure [whatever options you use] make depend make make test Here are the highlights: All pod documentation now installed, along with corresponding man pages, if possible (Configure allows you to change this). cppstdin no longer points back to the build directory. This necessitated two changes to the test suite: comp/cpp.t is now a front end that punts if cppstdin is not yet available (the old perl4 trick doesn't work for perl5). The op/misc.t test ./perl -P -e 'use POSIX;' has been dropped since I couldn't think of an elegant way to bypass it for systems that need the cppstdin wrapper. Grand autoload patch included (minus the installperl, lib/, and ext/ changes). The lib/ changes are in patch.1g, and the ext/ changes are in patch.1h. Better detection and use of stdio variants, especially on SVR4. Sarathy's consolidated patches (for ties) included. New filter stuff included. Three patches from Larry (gv.c, toke.c, pp_ctl.c) Patch and enjoy, Andy Dougherty doughera@lafcol.lafayette.edu Dept. of Physics Lafayette College Easton, PA 18042 Here's the file-by-file breakdown of what's included: Changes.Conf Document changes in the Configure & build process. Configure Upgrade to metaconfig PL55. Add /opt hierarchy to paths searched for programs. Tye McQueen's updated std stdio testing. Prompting for installation info for perl module pages. Add possible SITELIB to include site-specific include directories. By default this is disabled, but it seemed a neat idea now that the standard perl library is getting so big. Check that the compiler chosen exists and actually supports the options the user specified. Correctly sort multiple shared library version numbers. Use a compile & link test for gconvert(), dlopen(), and dlerror(). Do not include build directory name in cppstdin wrapper. MANIFEST Updated. Makefile.SH Reorganized a bit to support separate install.perl and install.man targets to use the new installman script and to accomodate those who don't want to install the man pages. Organize cleanup of .SH files a little better. No longer automatically make the pod/*.man files. This is done by installman only if requested. Include additional error messages and info for regenerating the automatically maintained header files. Add 'minitest' target. README Updated. README.vms Fix perl5-porters subscription info. config_H Updated. config_h.SH Updated. configpm Embedded pod. configure GNU configure-like front end to metaconfig's Configure. Only supports a few options. doio.c Updated to use new std stdio testing. embed.h Add new symbols for filtering. global.sym see embed.h. gv.c C<sub method;> patch from lwall. hints/README.hints Updated. hints/aux.sh Updated. hints/cxux.sh Updated. hints/epix.sh New file. hints/freebsd.sh Updated. hints/irix_4.sh Updated. hints/irix_5.sh Updated. hints/irix_6.sh Updated. hints/linux.sh Updated. hints/powerunix.sh Updated. installman New file to install pod/*.pod and lib/*.p(m|od) man pages. installperl Move installation of man pages over to installman script. Install pod/*.pod files in $privlib/pod/. Preserve timestamps on .a files. makedepend.SH Now includes . and .. in PATH to explicitly find cppstdin wrapper. opcode.h opcode.pl shmwrite fix. perl.c Changed unofficial patchlevel message. Included optional SITELIB directory. perl.h #include <memory.h> cryptswitch gone/filters added. EUNICE replaced by UNLINK_ALL_VERSIONS. Only matters for VMS. perldoc.SH New file. pod/perl.pod Describe where modpods are. pp_ctl.c sort bug fix from lwall. pp_hot.c csh glob bug fix from tchrist. Sarathy's consolidated "tie" patch for NETaa13753 N 2 trey pp_sys.c Emulate flock with lockf, if possible. Use new std stdio unit. proto.h Filters stuff. prototype for unlnk() is only needed #if UNLINK_ALL_VERSIONS sv.c Sarathy's consolidated "tie" patch for NETaa13753 N 2 trey Sarathy's consolidated patch for nested ties. Use new std stdio unit. t/comp/cpp.aux New file. This only gets called if cppstdin is avaiable. t/comp/cpp.t Calls cpp.aux test only if cppstdin is available. t/op/misc.t Drop perl -P -e 'use POSIX;' test. it couldn't work on systems without the cppstdin wrapper installed, and is usually misleading when it fails anyway. toke.c filter stuff. fix for NETaa13798 from lwall. unixish.h undef UNLINK_ALL_VERSIONS since it's irrelevant for unix. util.c s/EUNICE/UNLINK_ALL_VERSIONS/ for the unlnk() function. vms/config.vms VMS updates from Charles Bailey. std stdio updates to match changes in perl sources. add UNLINK_ALL_VERSIONS constant, but leave it #undef. vms/ext/MM_VMS.pm vms/ext/VMS/stdio/stdio.xs vms/perlvms.pod vms/vms.c VMS updates from Charles Bailey. x2p/Makefile.SH Updated to match man page Configure questions. Slight clean-up on .SH targets. x2p/str.c Use new std stdio unit.
Diffstat (limited to 'installman')
-rw-r--r--installman155
1 files changed, 155 insertions, 0 deletions
diff --git a/installman b/installman
new file mode 100644
index 0000000000..f184fd5b56
--- /dev/null
+++ b/installman
@@ -0,0 +1,155 @@
+#!./perl
+BEGIN { @INC = ('lib') }
+use Config;
+use Getopt::Long;
+use File::Find;
+require Cwd;
+
+umask 022;
+
+$ver = $];
+$release = substr($ver,0,3); # Not used presently.
+$patchlevel = substr($ver,3,2);
+die "Patchlevel of perl ($patchlevel)",
+ "and patchlevel of config.sh ($Config{'PATCHLEVEL'}) don't match\n"
+ if $patchlevel != $Config{'PATCHLEVEL'};
+
+$usage =
+"Usage: installman --man1dir=/usr/wherever --man1ext=1
+ --man3dir=/usr/wherever --man3ext=3
+ --notify --help
+ Defaults are:
+ man1dir = $Config{'installman1dir'};
+ man1ext = $Config{'man1ext'};
+ man3dir = $Config{'installman3dir'};
+ man3ext = $Config{'man3ext'};
+ --notify (or -n) just lists commands that would be executed.\n";
+
+GetOptions( qw( man1dir=s man1ext=s man3dir=s man3ext=s notify help))
+ || die $usage;
+
+# These are written funny to avoid -w typo warnings.
+$man1dir = defined($opt_man1dir) ? $opt_man1dir : $Config{'installman1dir'};
+$man1ext = defined($opt_man1ext) ? $opt_man1ext : $Config{'man1ext'};
+$man3dir = defined($opt_man3dir) ? $opt_man3dir : $Config{'installman3dir'};
+$man3ext = defined($opt_man3ext) ? $opt_man3ext : $Config{'man3ext'};
+
+$notify = defined($opt_notify) ? $opt_notify : 0;
+
+#Sanity checks
+
+-x "./perl" || warn "./perl not found! Have you run make?\n";
+-d $Config{'installprivlib'}
+ || warn "Perl library directory $Config{'installprivlib'} not found.
+ Have you run make install?. (Installing anyway.)\n";
+-x 't/TEST' || warn "WARNING: You've never run 'make test'!!!",
+ " (Installing anyway.)\n";
+
+# Install the main pod pages.
+runpod2man('pod', $man1dir, $man1ext);
+
+# Install the pods for library modules.
+runpod2man('lib', $man3dir, $man3ext);
+
+sub runpod2man {
+ my($poddir, $mandir, $manext) = @_;
+ my($builddir) = Cwd::getcwd();
+
+ if ($mandir eq ' ' or $mandir eq '') {
+ print STDERR "Skipping installation of $poddir man pages.\n";
+ return;
+ }
+
+ chdir $poddir || die "Unable to cd to $poddir directory!\n$!\n";
+
+ # We insist on using the current version of pod2man in case there
+ # are enhancements or changes from previous installed versions.
+ $pod2man = "../pod/pod2man";
+ -x $pod2man || die "Executable $pod2man not found.\n";
+
+ &makedir($mandir);
+ # Make a list of all the .pm and .pod files in the directory. We will
+ # always run pod2man from the lib directory and feed it the full pathname
+ # of the pod. This might be useful for pod2man someday.
+ @modpods = ();
+ find(\&lsmodpods, '.');
+ foreach $mod (@modpods) {
+ $manpage = $mod;
+ # Convert name from File/Basename.pm to File::Basename.3 format,
+ # if necessary.
+ $manpage =~ s#\.p(m|od)$##;
+ $manpage =~ s#/#::#g;
+ $manpage = "${mandir}/${manpage}.${manext}";
+ # Print $release $patchlevel stuff? or should pod2man do that?
+ &cmd("$pod2man $mod > $manpage");
+ }
+ chdir "$builddir" || die "Unable to cd back to $builddir directory!\n$!\n";
+}
+
+sub lsmodpods {
+ my $dir = $File::Find::dir;
+ my $name = $File::Find::name;
+ if (-f $_) {
+ $name =~ s#^\./##;
+ push(@modpods, $name) if ($name =~ /\.p(m|od)$/);
+ }
+}
+
+print STDERR " Installation complete\n";
+
+exit 0;
+
+
+###############################################################################
+# Utility subroutines from installperl
+
+sub cmd {
+ local($cmd) = @_;
+ print STDERR " $cmd\n";
+ unless ($notify) {
+ system $cmd;
+ warn "Command failed!!!\n" if $?;
+ }
+}
+
+sub link {
+ local($from,$to) = @_;
+
+ print STDERR " ln $from $to\n";
+ link($from,$to) || warn "Couldn't link $from to $to: $!\n" unless $notify;
+}
+
+sub chmod {
+ local($mode,$name) = @_;
+
+ printf STDERR " chmod %o %s\n", $mode, $name;
+ chmod($mode,$name) || warn sprintf("Couldn't chmod %o %s: $!\n",$mode,$name)
+ unless $notify;
+}
+
+sub makedir {
+ local($dir) = @_;
+ unless (-d $dir) {
+ local($shortdir) = $dir;
+
+ $shortdir =~ s#(.*)/.*#$1#;
+ &makedir($shortdir);
+
+ print STDERR " mkdir $dir\n";
+ mkdir($dir, 0777) || warn "Couldn't create $dir: $!\n" unless $notify;
+ }
+}
+
+sub samepath {
+ local($p1, $p2) = @_;
+ local($dev1, $ino1, $dev2, $ino2);
+
+ if ($p1 ne $p2) {
+ ($dev1, $ino1) = stat($p1);
+ ($dev2, $ino2) = stat($p2);
+ ($dev1 == $dev2 && $ino1 == $ino2);
+ }
+ else {
+ 1;
+ }
+}