summaryrefslogtreecommitdiff
path: root/kit
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2008-05-30 12:42:47 -0700
committerManoj Srivastava <srivasta@debian.org>2008-05-30 12:42:47 -0700
commitceb3507a8fca872770b3dcd7e5c5b36179ab95b0 (patch)
treeb46b4e25cfff5f4c13a330b8428ceed343e3796c /kit
Import dist_3.5-236.orig.tar.gz
[dgit import orig dist_3.5-236.orig.tar.gz]
Diffstat (limited to 'kit')
-rw-r--r--kit/Jmakefile46
-rwxr-xr-xkit/Makefile.SH266
-rw-r--r--kit/README35
-rwxr-xr-xkit/kitpost.SH237
-rw-r--r--kit/kitpost.man89
-rwxr-xr-xkit/kitsend.SH192
-rw-r--r--kit/kitsend.man42
-rw-r--r--kit/makeSH76
-rw-r--r--kit/makeSH.man46
-rwxr-xr-xkit/makedist.SH460
-rw-r--r--kit/makedist.man147
-rwxr-xr-xkit/manifake.SH51
-rw-r--r--kit/manifake.man46
13 files changed, 1733 insertions, 0 deletions
diff --git a/kit/Jmakefile b/kit/Jmakefile
new file mode 100644
index 0000000..c43db69
--- /dev/null
+++ b/kit/Jmakefile
@@ -0,0 +1,46 @@
+/*
+ * Jmakefile for kit maker
+ */
+
+;# $Id$
+;#
+;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+;#
+;# You may redistribute only under the terms of the Artistic Licence,
+;# as specified in the README file that comes with the distribution.
+;# You may reuse parts of this distribution only within the terms of
+;# that same Artistic Licence; a copy of which may be found at the root
+;# of the source tree for dist 4.0.
+;#
+;# $Log: Jmakefile,v $
+;# Revision 3.0.1.2 1994/04/22 09:35:35 ram
+;# patch23: new kitpost script
+;#
+;# Revision 3.0.1.1 1994/01/24 13:42:21 ram
+;# patch16: added dependency generation stage
+;#
+;# Revision 3.0 1993/08/18 12:04:21 ram
+;# Baseline for dist 3.0 netwide release.
+;#
+
+SCRIPT = makedist manifake kitsend kitpost
+
+ShellScriptTarget($(SCRIPT))
+InstallScript(makeSH,$(SCRIPTDIR))
+InstallManPage(makeSH,$(MANSRC))
+
+SCRIPTSH = \
+|expand f!$(SCRIPT)!
+ !f.SH \
+-expand \\
+
+depend:: local_depend
+local_depend::
+ ($(SED) '/^# DO NOT DELETE/q' Makefile && \
+ grep '^\$$grep' $(SCRIPTSH) | \
+ $(SED) -e "s/^.*' \([^ ]*\) >>[ ]*\([^ ]*\)/\2: \1/" \
+ ) > Makefile.new
+ cp Makefile Makefile.bak
+ cp Makefile.new Makefile
+ $(RM) Makefile.new
+
diff --git a/kit/Makefile.SH b/kit/Makefile.SH
new file mode 100755
index 0000000..6badd31
--- /dev/null
+++ b/kit/Makefile.SH
@@ -0,0 +1,266 @@
+: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5-43]
+: $X-Id: Jmake.tmpl 47 2010-11-28 22:23:13Z rmanfredi $
+
+case $CONFIG in
+'')
+ if test -f config.sh; then TOP=.;
+ elif test -f ../config.sh; then TOP=..;
+ elif test -f ../../config.sh; then TOP=../..;
+ elif test -f ../../../config.sh; then TOP=../../..;
+ elif test -f ../../../../config.sh; then TOP=../../../..;
+ else
+ echo "Can't find config.sh."; exit 1
+ fi
+ . $TOP/config.sh
+ ;;
+esac
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+CURRENT=kit
+DIR=`echo $CURRENT/ | sed -e 's/\.\///g'`
+echo "Extracting ${DIR}Makefile (with variable substitutions)"
+
+INSTALL=`echo $install | sed -e 's,\./i,\$(TOP)/i,'`
+INSTALLDIR=`echo $installdir | sed -e 's,\./i,\$(TOP)/i,'`
+DATE=`date`
+
+$spitshell >Makefile <<!GROK!THIS!
+########################################################################
+# Makefile generated from Makefile.SH on $DATE
+
+SHELL = /bin/sh
+JMAKE = jmake
+TOP = ..
+CURRENT = $CURRENT
+DIR = $DIR
+INSTALL = $INSTALL
+INSTALLDIR = $INSTALLDIR
+
+########################################################################
+# Parameters set by Configure -- edit config.sh if changes are needed
+
+CTAGS = ctags
+JCPPFLAGS = $cppflags
+L = $manext
+MANSRC = $installmansrc
+MV = $mv
+RM = $rm -f
+SCRIPTDIR = $installscript
+SED = $sed
+
+########################################################################
+# Automatically generated parameters -- do not edit
+
+SCRIPTS = \$(SCRIPT)
+
+!GROK!THIS!
+$spitshell >>Makefile <<'!NO!SUBS!'
+########################################################################
+# Jmake rules for building libraries, programs, scripts, and data files
+# $X-Id: Jmake.rules 18 2006-12-27 10:35:09Z rmanfredi $
+
+########################################################################
+# Start of Jmakefile
+
+# $X-Id: Jmakefile 48 2010-11-28 23:05:09Z rmanfredi $
+#
+# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+#
+# You may redistribute only under the terms of the Artistic Licence,
+# as specified in the README file that comes with the distribution.
+# You may reuse parts of this distribution only within the terms of
+# that same Artistic Licence; a copy of which may be found at the root
+# of the source tree for dist 4.0.
+#
+# $X-Log: Jmakefile,v $
+# Revision 3.0.1.2 1994/04/22 09:35:35 ram
+# patch23: new kitpost script
+#
+# Revision 3.0.1.1 1994/01/24 13:42:21 ram
+# patch16: added dependency generation stage
+#
+# Revision 3.0 1993/08/18 12:04:21 ram
+# Baseline for dist 3.0 netwide release.
+#
+
+SCRIPT = makedist manifake kitsend kitpost
+
+all:: $(SCRIPT)
+
+local_realclean::
+ $(RM) $(SCRIPT)
+
+makedist: makedist.SH
+ /bin/sh makedist.SH
+
+manifake: manifake.SH
+ /bin/sh manifake.SH
+
+kitsend: kitsend.SH
+ /bin/sh kitsend.SH
+
+kitpost: kitpost.SH
+ /bin/sh kitpost.SH
+
+
+local_install:: $(SCRIPTS) $(LSCRIPTS)
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(SCRIPTDIR) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(SCRIPTDIR)); \
+ for file in $(SCRIPTS) $(LSCRIPTS); do \
+ (set -x; \
+ $(INSTALL) -c -m 555 $$file $(INSTALL_PREFIX)$(SCRIPTDIR)) || \
+ exit 1; \
+ done
+
+local_deinstall::
+ @for file in $(SCRIPTS) $(LSCRIPTS); do \
+ case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; $(RM) $(INSTALL_PREFIX)$(SCRIPTDIR)/$$file); \
+ done
+
+local_install.man::
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(MANSRC) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(MANSRC)); \
+ for file in $(SCRIPTS); do \
+ if test -f $$file.man; then \
+ (set -x; \
+ $(INSTALL) -c -m 444 $$file.man \
+ $(INSTALL_PREFIX)$(MANSRC)/$$file.$(L)) || \
+ exit 1; \
+ fi; \
+ done
+
+local_deinstall.man::
+ case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ for file in $(SCRIPTS); do \
+ (set -x; $(RM) $(INSTALL_PREFIX)$(MANSRC)/$$file.$(L)); \
+ done
+
+local_install:: makeSH
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(SCRIPTDIR) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(SCRIPTDIR)); \
+ $(INSTALL) -c -m 555 makeSH $(INSTALL_PREFIX)$(SCRIPTDIR)
+
+local_deinstall::
+ $(RM) $(INSTALL_PREFIX)$(SCRIPTDIR)/makeSH
+
+local_install.man:: makeSH.man
+ @case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ (set -x; test -d $(INSTALL_PREFIX)$(MANSRC) || \
+ $(INSTALLDIR) $(INSTALL_PREFIX)$(MANSRC)); \
+ $(INSTALL) -c -m 444 makeSH.man $(INSTALL_PREFIX)$(MANSRC)/makeSH.$(L)
+
+local_deinstall.man::
+ $(RM) $(INSTALL_PREFIX)$(MANSRC)/makeSH.$(L)
+
+SCRIPTSH = \
+ makedist.SH \
+ manifake.SH \
+ kitsend.SH \
+ kitpost.SH
+
+depend:: local_depend
+local_depend::
+ ($(SED) '/^# DO NOT DELETE/q' Makefile && \
+ grep '^\$$grep' $(SCRIPTSH) | \
+ $(SED) -e "s/^.*' \([^ ]*\) >>[ ]*\([^ ]*\)/\2: \1/" \
+ ) > Makefile.new
+ cp Makefile Makefile.bak
+ cp Makefile.new Makefile
+ $(RM) Makefile.new
+
+########################################################################
+# Common rules for all Makefiles -- do not edit
+
+all::
+
+clean: local_clean
+realclean: local_realclean
+clobber: local_clobber
+
+local_clean::
+ if test -f core; then $(RM) core; fi
+ $(RM) *~ *.o
+
+local_realclean:: local_clean
+
+local_clobber:: local_realclean
+ $(RM) Makefile config.sh
+
+install:: local_install
+install.man:: maybe_install.man
+deinstall:: local_deinstall
+deinstall.man:: maybe_deinstall.man
+
+install.man-yes: local_install.man
+install.man-no:
+deinstall.man-yes: local_deinstall.man
+deinstall.man-no:
+
+!NO!SUBS!
+case "$installmansrc" in
+'') man=no;;
+*) man=yes;;
+esac
+$spitshell >>Makefile <<!GROK!THIS!
+maybe_install.man: install.man-$man
+maybe_deinstall.man: deinstall.man-$man
+!GROK!THIS!
+$spitshell >>Makefile <<'!NO!SUBS!'
+
+Makefile.SH: Jmakefile
+ -@if test -f $(TOP)/.package; then \
+ if test -f Makefile.SH; then \
+ echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \
+ $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \
+ fi; \
+ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \
+ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \
+ else touch $@; fi
+
+Makefile: Makefile.SH
+ /bin/sh Makefile.SH
+
+tags::
+ $(CTAGS) -w *.[ch]
+ $(CTAGS) -xw *.[ch] > tags
+
+local_clobber::
+ $(RM) tags
+
+depend::
+
+########################################################################
+# Empty rules for directories with no sub-directories -- do not edit
+
+local_install::
+ @echo "install in $(CURRENT) done."
+
+local_deinstall::
+ @echo "deinstall in $(CURRENT) done."
+
+local_install.man::
+ @echo "install.man in $(CURRENT) done."
+
+local_deinstall.man::
+ @echo "deinstall.man in $(CURRENT) done."
+
+Makefiles::
+
+Makefiles.SH::
+
+########################################################################
+# Dependencies generated by make depend
+# DO NOT DELETE THIS LINE -- make depend relies on it
+
+# Put nothing here or make depend will gobble it up
+.FORCE_DEPEND::
+ @echo "You must run 'make depend' in $(TOP) first."; exit 1
+!NO!SUBS!
+chmod 644 Makefile
+$eunicefix Makefile
+
diff --git a/kit/README b/kit/README
new file mode 100644
index 0000000..a521da2
--- /dev/null
+++ b/kit/README
@@ -0,0 +1,35 @@
+This directory contains a rudimentary kit maker.
+
+N.B.: This must not be confused with the kit package, which is a set of shell
+scripts for sending arbitrary files and directories by mail and unpacking them.
+One could call kit a binary tarmailer. The kit package has been released
+separately from dist (posted on comp.sources.unix in 1991).
+
+Larry Wall said:
+
+ Depending on where you are going to send your kits you might prefer
+ to use Rich $alz's kit maker instead--it makes more robust kits
+ but assumes more about the target system.
+
+I say:
+
+ If you are using RCS 4.3, be sure to use makedist instead of your
+ own shell archiver, unless you do not use $Id, $Header or $Locker
+ markers. Moreover, makedist will take the latest checked in
+ revision intead of the working file, so that you archive a coherent
+ package even if you made some mods since the last patch.
+
+You run makedist in the top level directory of your package and it uses
+the MANIFEST.new file to generate shar scripts of about 50000 bytes each.
+
+Just make sure MANIFEST.new contains everything you want, including any
+Configure, config.h.SH, or patchlevel.h files. A prototype patchlevel.h
+may be found in ../gen/patchlevel.h. See the manpage for more details.
+
+If you do not wish to build up shell archives but an up-to-date copy of
+your source tree, run someting like:
+
+ makedist -c dir
+
+to build an up-to-date source tree in dir, which you can then archive using
+your own shell archiver.
diff --git a/kit/kitpost.SH b/kit/kitpost.SH
new file mode 100755
index 0000000..4a0414f
--- /dev/null
+++ b/kit/kitpost.SH
@@ -0,0 +1,237 @@
+case $CONFIG in
+'')
+ if test -f config.sh; then TOP=.;
+ elif test -f ../config.sh; then TOP=..;
+ elif test -f ../../config.sh; then TOP=../..;
+ elif test -f ../../../config.sh; then TOP=../../..;
+ elif test -f ../../../../config.sh; then TOP=../../../..;
+ else
+ echo "Can't find config.sh."; exit 1
+ fi
+ . $TOP/config.sh
+ ;;
+esac
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting kit/kitpost (with variable substitutions)"
+cat >kitpost <<!GROK!THIS!
+$startperl
+ eval 'exec perl -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+
+# $Id$
+#
+# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+#
+# You may redistribute only under the terms of the Artistic Licence,
+# as specified in the README file that comes with the distribution.
+# You may reuse parts of this distribution only within the terms of
+# that same Artistic Licence; a copy of which may be found at the root
+# of the source tree for dist 4.0.
+#
+# $Log: kitpost.SH,v $
+# Revision 3.0.1.2 1994/10/29 15:48:26 ram
+# patch36: don't use rootid as a variable, it is known by metaconfig
+#
+# Revision 3.0.1.1 1994/05/06 13:54:53 ram
+# patch23: created
+#
+
+\$inews='${inews-/usr/lib/news/inews}';
+\$mailer='$mailer';
+\$orgname='$orgname';
+\$version = '$VERSION';
+\$patchlevel = '$PATCHLEVEL';
+!GROK!THIS!
+
+cat >>kitpost <<'!NO!SUBS!'
+
+$progname = &profile; # Read ~/.dist_profile
+require 'getopts.pl';
+&usage unless $#ARGV >= 0;
+&usage unless &Getopts("hrVm:D:H:");
+
+if ($opt_V) {
+ print STDERR "$progname $version PL$patchlevel\n";
+ exit 0;
+} elsif ($opt_h) {
+ &usage;
+}
+
+$RCSEXT = ',v' unless $RCSEXT;
+if ($inews eq 'inews') {
+ $inews = '/usr/lib/news/inews' if -f '/usr/lib/news/inews';
+}
+
+chdir '..' if -d '../bugs';
+
+&readpackage;
+
+$orgname = &tilda_expand($orgname);
+chop($orgname = `cat $orgname`) if $orgname =~ m|^/|;
+
+if ($opt_r) {
+ $repost = ' (REPOST)';
+}
+
+while ($_ = shift) {
+ if (/^(kit)?[1-9][\d\-]*$/) {
+ s/^kit//;
+ push(@argv,$_);
+ } else {
+ push(@ngroups,$_);
+ }
+}
+$ngroups = join(',',@ngroups) unless $#ngroups < 0;
+$dest = $opt_m;
+&usage unless $ngroups || $dest;
+
+@ARGV = @argv;
+
+if (-f "$package.kit10") {
+ @filelist = <$package.kit[0-9][0-9]>;
+}
+else {
+ @filelist = <$package.kit[0-9]>;
+}
+pop(@filelist) =~ /(\d+)$/ && ($maxnum = $1 + 0);
+
+if ($#ARGV < 0) {
+ $argv = "1-$maxnum";
+ @ARGV = $argv;
+}
+
+$argv = &rangeargs(@ARGV);
+@ARGV = split(' ', $argv);
+
+$argv =~ s/ $//;
+
+if ($#ARGV < 0) {
+ print STDERR "$progname: no kits specified.\n";
+ &usage;
+} else {
+ local($s) = $#ARGV ? 's' : '';
+ print "$progname: posting $package $baserev kit$s $argv to $ngroups...\n"
+ if $ngroups;
+ print "$progname: mailing $package $baserev kit$s $argv to $dest...\n"
+ if $dest;
+}
+
+$desc = "$opt_D, " if $opt_D;
+
+fork && exit;
+
+# Compute a suitable root message ID that all parts will reference, so that
+# threaded news readers will correctly process them.
+# Unfortunately, this works only when all kits are sent.
+($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
+ localtime(time);
+$mon++;
+$rootmid = "$year$mon$mday$hour$min$sec.AA$$";
+$first = $maxnum >= 10 ? "01" : "1";
+$rootmsgid = "<$rootmid.P$first.$maintloc>";
+
+until ($#ARGV < 0) {
+ $kitnum = shift;
+ $kitnum = "0$kitnum" if $kitnum < 10 && $maxnum >= 10;
+ open(FILE, "$package.kit$kitnum") ||
+ die "$progname: can't open $package.kit$kitnum: $!\n";
+ if ($ngroups) {
+ open(INEWS,"|$inews -h") || die "$progname: can't fork $inews: $!\n";
+ }
+ if ($dest) {
+ $opt = '-odq' if $mailer =~ /sendmail/;
+ $dest =~ s/,/ /g;
+ ($to = $dest) =~ s/\s+/, /g;
+ open(MAILER,"|$mailer $opt $dest") ||
+ die "$progname: can't fork $mailer: $!\n";
+ }
+
+ $msg_id = "<$rootmid.P$kitnum.$maintloc>";
+ $msg_id = $rootmsgid if $kitnum == 1;
+ $msg_id .= "\nReferences: $rootmsgid" if $kitnum != 1;
+
+ print INEWS "Newsgroups: $ngroups\n";
+ print MAILER "To: $to\n";
+$head = <<EOH;
+Subject: $package $baserev - ${desc}part$kitnum/$maxnum$repost
+Message-ID: $msg_id
+Organization: $orgname
+
+Submitted-by: $maintname <$maintloc>
+Archive-name: $package-$baserev/part$kitnum
+Environment: UNIX
+
+EOH
+ print INEWS $head;
+ print MAILER $head;
+
+ if ($kitnum == 1 && $opt_H) {
+ open(HEAD, $opt_H) || warn "$progname: can't open $opt_H: $!\n";
+ while (<HEAD>) {
+ print INEWS;
+ print MAILER;
+ }
+ close HEAD;
+ }
+
+ while (<FILE>) {
+ print INEWS;
+ print MAILER;
+ }
+ close FILE;
+ close INEWS;
+ die "$progname: could not post part$kitnum.\n" if $ngroups && $?;
+ close MAILER;
+ die "$progname: could not send part$kitnum.\n" if $dest && $?;
+}
+
+sub usage {
+ print STDERR <<EOM;
+Usage: $progname [-hrV] [-H file] [-D desc] [-m dest1,dest2] [kits] [newsgroups]
+ -h : print this message and exit
+ -m : set-up recipients for (additional) mailing
+ -r : signals a repost
+ -D : specify description string for subject line
+ -H : specify file to be used as header for first part
+ -V : print version number and exit
+EOM
+ exit 1;
+}
+
+sub rangeargs {
+ local($result) = '';
+ local($min,$max,$_);
+ while ($#_ >= 0) {
+ $_ = shift(@_);
+ while (/^\s*\d/) {
+ s/^\s*(\d+)//;
+ $min = $1;
+ if (s/^,//) {
+ $max = $min;
+ }
+ elsif (s/^-(\d*)//) {
+ $max = $1;
+ if ($max == 0 && $maxnum) {
+ $max = $maxnum;
+ }
+ s/^[^,],?//;
+ }
+ else {
+ $max = $min;
+ }
+ for ($i = $min; $i <= $max; ++$i) {
+ $result .= $i . ' ';
+ }
+ }
+ }
+ $result;
+}
+
+!NO!SUBS!
+$grep -v '^;#' ../pl/package.pl >>kitpost
+$grep -v '^;#' ../pl/tilde.pl >>kitpost
+$grep -v '^;#' ../pl/profile.pl >>kitpost
+chmod +x kitpost
+$eunicefix kitpost
diff --git a/kit/kitpost.man b/kit/kitpost.man
new file mode 100644
index 0000000..ec44edd
--- /dev/null
+++ b/kit/kitpost.man
@@ -0,0 +1,89 @@
+''' $Id$
+'''
+''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+'''
+''' You may redistribute only under the terms of the Artistic Licence,
+''' as specified in the README file that comes with the distribution.
+''' You may reuse parts of this distribution only within the terms of
+''' that same Artistic Licence; a copy of which may be found at the root
+''' of the source tree for dist 4.0.
+'''
+''' $Log: kitpost.man,v $
+''' Revision 3.0.1.2 1995/05/12 11:58:09 ram
+''' patch54: updated my e-mail address
+'''
+''' Revision 3.0.1.1 1994/05/06 13:55:01 ram
+''' patch23: created
+'''
+.TH KITSEND 1 ram
+.SH NAME
+kitpost \- posts distribution kits
+.SH SYNOPSIS
+.B kitpost
+[
+.B \-hrV
+] [
+.B -H
+.I file
+] [
+.B -D
+.I desc
+] [
+.B -m
+.I dest1,dest2
+] [
+.I kits
+] [
+.I newsgroups
+]
+.SH DESCRIPTION
+.I Kitpost
+posts distribution kits made by \fImakedist\fR to some (source) newsgroups
+specified on the command line. If you do not specify any kit list, then all the
+kits are sent. Otherwise, only the specified kits will be (re)sent.
+.PP
+A kit list may include ranges, \fI1-10\fR specifying kits 1 through 10,
+and \fI5-\fR meaning kits 5 up to the last one. You may also specify kit
+numbers by separating them with commas or spaces, and even mix with ranges,
+such as: \fI1 3 5-7 9\fR.
+.PP
+.I Kitpost
+ensures correct \fIReferences:\fR lines are inserted in your postings so that
+all parts but the first point to the root article. Threaded newsreaders and
+end-users traditionally appreciate that.
+.SH OPTIONS
+The following options are recognized by \fIkitpost\fR:
+.TP 10
+.B \-h
+Print help message and exit.
+.TP
+\fB\-m\fI dest1,destn\fR
+Sends kits by e-mail to the specified recipients. This option may be used in
+conjunction with newsgroup posting. It is mainly intended for sites where
+direct posting to a moderated newsgroup is not allowed by \fIinews\fR. You may
+thus send your kits to the newsgroup moderator in a form that will ease the
+whole posting process.
+.TP
+.B \-r
+Signals a repost.
+.TP
+\fB\-D\fI description\fR
+Specify a description string that will be added to the subject line. Usually
+a brief sentence (less than, say, 40 characters).
+.TP
+\fB\-H\fI file\fR
+Specify a file to be used as header introduction in the first part of your
+posting. Usually the root README file.
+.TP
+.B \-V
+Print version number and exit.
+.SH BUGS
+Article cross-referencing is properly set-up only when the whole package is
+(re)posted in one batch.
+.PP
+It is not currently possible to set-up the article headers manually or
+better, interactively.
+.SH AUTHOR
+Raphael Manfredi <Raphael.Manfredi@pobox.com>
+.SH "SEE ALSO"
+makedist(1), kitsend(1).
diff --git a/kit/kitsend.SH b/kit/kitsend.SH
new file mode 100755
index 0000000..7293b34
--- /dev/null
+++ b/kit/kitsend.SH
@@ -0,0 +1,192 @@
+case $CONFIG in
+'')
+ if test -f config.sh; then TOP=.;
+ elif test -f ../config.sh; then TOP=..;
+ elif test -f ../../config.sh; then TOP=../..;
+ elif test -f ../../../config.sh; then TOP=../../..;
+ elif test -f ../../../../config.sh; then TOP=../../../..;
+ else
+ echo "Can't find config.sh."; exit 1
+ fi
+ . $TOP/config.sh
+ ;;
+esac
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting kit/kitsend (with variable substitutions)"
+cat >kitsend <<!GROK!THIS!
+$startperl
+ eval 'exec perl -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+
+# $Id$
+#
+# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+#
+# You may redistribute only under the terms of the Artistic Licence,
+# as specified in the README file that comes with the distribution.
+# You may reuse parts of this distribution only within the terms of
+# that same Artistic Licence; a copy of which may be found at the root
+# of the source tree for dist 4.0.
+#
+# Original Author: Harlan Stenn <harlan@mumps.pfcs.com>
+#
+# $Log: kitsend.SH,v $
+# Revision 3.0.1.2 1994/05/06 13:59:57 ram
+# patch23: random code cleanup to follow pat tools style
+# patch23: made configurable from dist profile
+# patch23: now understands -V and -h options
+# patch23: mails now flagged with a bulk precedence
+# patch23: added X-Mailer header and now calls mailer via open()
+#
+# Revision 3.0.1.1 1993/08/19 06:42:15 ram
+# patch1: leading config.sh searching was not aborting properly
+#
+# Revision 3.0 1993/08/18 12:04:25 ram
+# Baseline for dist 3.0 netwide release.
+#
+
+\$orgname='$orgname';
+\$mailer='$mailer';
+\$version = '$VERSION';
+\$patchlevel = '$PATCHLEVEL';
+!GROK!THIS!
+cat >>kitsend <<'!NO!SUBS!'
+
+$progname = &profile; # Read ~/.dist_profile
+require 'getopts.pl';
+&usage unless &Getopts('hV');
+
+if ($opt_V) {
+ print STDERR "$progname $version PL$patchlevel\n";
+ exit 0;
+} elsif ($opt_h) {
+ &usage;
+}
+
+$orgname = &tilda_expand($orgname);
+chop($orgname = `cat $orgname`) if $orgname =~ m|^/|;
+
+&readpackage;
+
+while ($_ = shift) {
+ if (/^(kit)?[1-9][\d,-]*$/) {
+ s/^kit//;
+ push(@argv, $_);
+ }
+ else {
+ push(@dest, $_);
+ }
+}
+$dest = join(' ',@dest);
+&usage unless $dest;
+
+@ARGV = @argv;
+
+if (-f "$package.kit10") {
+ @filelist = <$package.kit[0-9][0-9]>;
+}
+else {
+ @filelist = <$package.kit[0-9]>;
+}
+pop(@filelist) =~ /(\d+)$/ && ($maxnum = $1 + 0);
+
+if ($#ARGV < 0) {
+ $argv = "1-$maxnum";
+ @ARGV = $argv;
+}
+$argv = &rangeargs(@ARGV);
+@ARGV = split(' ', $argv);
+
+$argv =~ s/ $//;
+
+if ($#ARGV < 0) {
+ die "$progname: no kits specified.\n";
+} elsif ($#ARGV) {
+ print "$progname: sending $package $baserev kits $argv to $dest...\n";
+} else {
+ print "$progname: sending $package $baserev kit $argv to $dest...\n";
+}
+
+fork && exit;
+
+$opt = '-odq' if $mailer =~ /sendmail/;
+
+until ($#ARGV < 0) {
+ $kitnum = shift;
+
+ # Provision for broken mailers...
+ @dest = split(' ', $dest);
+ while (@smalldest = splice(@dest, 0, 50)) {
+ $to = join(', ', @smalldest); # Sensible To: for sendmail
+ $smalldest = join(' ', @smalldest);
+
+ open(MAILER, "|$mailer $opt $smalldest") ||
+ die "$progname: can't fork $mailer: $!\n";
+ print MAILER
+"To: $to
+Subject: $package $baserev kit #$kitnum
+Precedence: bulk
+X-Mailer: dist [version $version PL$patchlevel]
+Organization: $orgname
+
+[There are $maxnum kits for $package version $baserev.]
+
+";
+ $kitnum = "0$kitnum" if $kitnum < 10 && $maxnum >= 10;
+ open(FILE,"$package.kit$kitnum") ||
+ die "$progname: can't open $package.kit$kitnum: $!\n";
+ while (<FILE>) {
+ print MAILER;
+ }
+ close FILE;
+ close MAILER;
+ warn "$progname: ERROR mailing of $package.kit$kitnum to $dest\n" if $?;
+ }
+}
+
+sub usage {
+ print STDERR <<EOM;
+Usage: $progname [-hV] [kits] dest
+ -h : print this message and exit
+ -V : print version number and exit
+EOM
+ exit 1;
+}
+
+sub rangeargs {
+ local($result) = '';
+ local($min,$max,$_);
+ while ($#_ >= 0) {
+ $_ = shift(@_);
+ while (/^\s*\d/) {
+ s/^\s*(\d+)//;
+ $min = $1;
+ if (s/^,//) {
+ $max = $min;
+ }
+ elsif (s/^-(\d*)//) {
+ $max = $1;
+ if ($max == 0 && $maxnum) {
+ $max = $maxnum;
+ }
+ s/^[^,],?//;
+ }
+ else {
+ $max = $min;
+ }
+ for ($i = $min; $i <= $max; ++$i) {
+ $result .= $i . ' ';
+ }
+ }
+ }
+ $result;
+}
+
+!NO!SUBS!
+$grep -v '^;#' ../pl/package.pl >>kitsend
+$grep -v '^;#' ../pl/tilde.pl >>kitsend
+$grep -v '^;#' ../pl/profile.pl >>kitsend
+chmod +x kitsend
+$eunicefix kitsend
diff --git a/kit/kitsend.man b/kit/kitsend.man
new file mode 100644
index 0000000..ebe5459
--- /dev/null
+++ b/kit/kitsend.man
@@ -0,0 +1,42 @@
+''' $Id$
+'''
+''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+'''
+''' You may redistribute only under the terms of the Artistic Licence,
+''' as specified in the README file that comes with the distribution.
+''' You may reuse parts of this distribution only within the terms of
+''' that same Artistic Licence; a copy of which may be found at the root
+''' of the source tree for dist 4.0.
+'''
+''' $Log: kitsend.man,v $
+''' Revision 3.0.1.1 1994/05/06 14:00:11 ram
+''' patch23: documented new -V and -h options
+'''
+''' Revision 3.0 1993/08/18 12:04:26 ram
+''' Baseline for dist 3.0 netwide release.
+'''
+.TH KITSEND 1 ram
+.SH NAME
+kitsend \- sends distribution kits
+.SH SYNOPSIS
+.B kitsend
+[
+.B \-hV
+] [ \fIkits\fR ] \fIrecipients\fR
+.SH DESCRIPTION
+.I Kitsend
+sends distribution kits made by \fImakedist\fR to some recipients specified
+on the command line. If you do not specify any kit list, then all the
+kits are sent. Otherwise, only the specified kits will be (re)sent.
+.PP
+A kit list may include ranges, \fI1-10\fR specifying kits 1 through 10,
+and \fI5-\fR meaning kits 5 up to the last one. You may also specify kit
+numbers by separating them with commas or spaces, and even mix with ranges,
+such as: \fI1 3 5-7 9\fR.
+.PP
+The \fB\-h\fR switch will print out the usage and \fB-V\fR will print
+the version number.
+.SH AUTHOR
+Harlan Stenn <harlan@mumps.pfcs.com>
+.SH "SEE ALSO"
+makedist(1), kitpost(1).
diff --git a/kit/makeSH b/kit/makeSH
new file mode 100644
index 0000000..54e7b3e
--- /dev/null
+++ b/kit/makeSH
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# $Id: makeSH,v 3.0.1.1 1993/08/19 06:42:16 ram Exp ram $
+#
+# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+#
+# You may redistribute only under the terms of the Artistic Licence,
+# as specified in the README file that comes with the distribution.
+# You may reuse parts of this distribution only within the terms of
+# that same Artistic Licence; a copy of which may be found at the root
+# of the source tree for dist 4.0.
+#
+# Original Author: Larry Wall <lwall@netlabs.com>
+#
+# $Log: makeSH,v $
+# Revision 3.0.1.1 1993/08/19 06:42:16 ram
+# patch1: leading config.sh searching was not aborting properly
+#
+# Revision 3.0 1993/08/18 12:04:26 ram
+# Baseline for dist 3.0 netwide release.
+#
+
+for file do
+ if test -f $file.SH; then
+ mv $file.SH $file.SH.old
+ echo "makeSH: renaming $file.SH as $file.SH.old."
+ fi
+ base=`basename $file`
+
+ cat >$file.SH <<BLURFL
+case \$CONFIG in
+'')
+ if test -f config.sh; then TOP=.;
+ elif test -f ../config.sh; then TOP=..;
+ elif test -f ../../config.sh; then TOP=../..;
+ elif test -f ../../../config.sh; then TOP=../../..;
+ elif test -f ../../../../config.sh; then TOP=../../../..;
+ else
+ echo "Can't find config.sh."; exit 1
+ fi
+ . \$TOP/config.sh
+ ;;
+esac
+: This forces SH files to create target in same directory as SH file.
+: This is so that make depend always knows where to find SH derivatives.
+case "\$0" in
+*/*) cd \`expr X\$0 : 'X\(.*\)/'\` ;;
+esac
+echo "Extracting $file (with variable substitutions)"
+: This section of the file will have variable substitutions done on it.
+: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
+: Protect any dollar signs and backticks that you do not want interpreted
+: by putting a backslash in front. You may delete these comments.
+\$spitshell >$base <<!GROK!THIS!
+BLURFL
+
+ case `sed q $file` in
+ */bin/sh) echo '$startsh' >>$file.SH ;;
+ esac
+
+ cat >>$file.SH <<BLURFL
+!GROK!THIS!
+
+: In the following dollars and backticks do not need the extra backslash.
+\$spitshell >>$base <<'!NO!SUBS!'
+BLURFL
+
+ sed -e '1{' -e '/#!.*\/bin\/sh$/d' -e '}' $file >>$file.SH
+
+ cat >>$file.SH <<BLURFL
+!NO!SUBS!
+chmod 755 $base
+\$eunicefix $base
+BLURFL
+ chmod 755 $file.SH
+done
diff --git a/kit/makeSH.man b/kit/makeSH.man
new file mode 100644
index 0000000..30f462a
--- /dev/null
+++ b/kit/makeSH.man
@@ -0,0 +1,46 @@
+''' $Id$
+'''
+''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+'''
+''' You may redistribute only under the terms of the Artistic Licence,
+''' as specified in the README file that comes with the distribution.
+''' You may reuse parts of this distribution only within the terms of
+''' that same Artistic Licence; a copy of which may be found at the root
+''' of the source tree for dist 4.0.
+'''
+''' $Log: makeSH.man,v $
+''' Revision 3.0 1993/08/18 12:04:27 ram
+''' Baseline for dist 3.0 netwide release.
+'''
+'''
+.TH MAKESH 1 LOCAL
+.SH NAME
+makeSH \- a .SH script maker
+.SH SYNOPSIS
+.B makeSH
+.I files
+.SH DESCRIPTION
+.I MakeSH
+examines one or more scripts and produces a .SH file that, when run under sh,
+will produce the original script.
+The .SH script so produced has two sections containing code destined for
+the output.
+The first section has variable substitutions performed on it (taking values
+from config.sh), while the second section does not.
+MakeSH does not know which variables you want to have substituted, so it puts
+the whole script into the second section.
+It's up to you to insert any variable substitutions in the first section
+for any values you want from config.sh.
+.PP
+You should run
+.I makeSH
+from within your top-level directory and use the relative path to the file
+as an argument, so that the "Extracting ..." line printed while running
+the produced .SH file later on will give that same path.
+.SH AUTHOR
+Larry Wall <lwall@netlabs.com>
+.SH SEE ALSO
+pat(1), metaconfig(1), makedist(1).
+.SH BUGS
+It could assume that variables from metaconfig's Glossary need to be
+initialized in the first section, but I'm too lazy to make it do that.
diff --git a/kit/makedist.SH b/kit/makedist.SH
new file mode 100755
index 0000000..f40d5c5
--- /dev/null
+++ b/kit/makedist.SH
@@ -0,0 +1,460 @@
+case $CONFIG in
+'')
+ if test -f config.sh; then TOP=.;
+ elif test -f ../config.sh; then TOP=..;
+ elif test -f ../../config.sh; then TOP=../..;
+ elif test -f ../../../config.sh; then TOP=../../..;
+ elif test -f ../../../../config.sh; then TOP=../../../..;
+ else
+ echo "Can't find config.sh."; exit 1
+ fi
+ . $TOP/config.sh
+ ;;
+esac
+echo "Extracting kit/makedist (with variable substitutions)"
+cat >makedist <<!GROK!THIS!
+$startperl
+ eval 'exec perl -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+
+# $Id$
+#
+# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+#
+# You may redistribute only under the terms of the Artistic Licence,
+# as specified in the README file that comes with the distribution.
+# You may reuse parts of this distribution only within the terms of
+# that same Artistic Licence; a copy of which may be found at the root
+# of the source tree for dist 4.0.
+#
+# $Log: makedist.SH,v $
+# Revision 3.0.1.2 1994/01/24 13:58:20 ram
+# patch16: modified call to manifake to trap exceptions manually
+# patch16: removed final sed post-processing to allow 'make depend' target
+# patch16: added ~/.dist_profile awareness
+#
+# Revision 3.0.1.1 1993/08/19 06:42:17 ram
+# patch1: leading config.sh searching was not aborting properly
+#
+# Revision 3.0 1993/08/18 12:04:28 ram
+# Baseline for dist 3.0 netwide release.
+#
+
+\$version = '$VERSION';
+\$patchlevel = '$PATCHLEVEL';
+!GROK!THIS!
+$spitshell >>makedist <<'!NO!SUBS!'
+
+&profile; # Read ~/.dist_profile
+require 'getopts.pl';
+&usage unless &Getopts('c:f:dhvqs:V');
+
+$ENV{'DIST'} = '/dev/null'; # Disable ~/.dist_profile
+
+if ($opt_V) {
+ print STDERR "makedist $version PL$patchlevel\n";
+ exit 0;
+} elsif ($opt_h) {
+ &usage;
+}
+
+$MAXKITSIZE = 50000 unless $MAXKITSIZE = $opt_s;
+$KITOVERHEAD = 1800;
+$FILEOVERHEAD = 90;
+$CHOPSIZE = $MAXKITSIZE - $KITOVERHEAD - $FILEOVERHEAD;
+
+$NEWMANI = 'MANIFEST.new' unless $NEWMANI = $opt_f;
+$MANI = 'MANIFEST' unless $opt_f;
+$PACKLIST = 'PACKLIST';
+$PACKNOTES = 'PACKNOTES';
+
+$tmpdir = "/tmp/MKst$$"; # Where to copy distribution
+$tmpdir = '.' if $opt_q; # Quick mode: no need to copy distribution
+
+&set_sig('aborted'); # Make sure we clean up in case of emergency
+
+&readpackage;
+&get_patchlevel;
+
+eval '&manifake'; # Want to trap possible die and redirect to fatal
+if ($@ ne '') {
+ chop($@);
+ &fatal($@);
+}
+
+if ($opt_c) { # Copy distribution only, no shell archive
+ &distcopy;
+ exit 0;
+}
+
+&distfake;
+&copyright'init($copyright) if -f $copyright;
+
+unlink <$package.kit? $package.kit??>;
+chop($curdir = `pwd`);
+chdir $tmpdir || die "Can't chdir to $tmpdir.\n";
+
+&maniread;
+&kitlists;
+&manimake;
+&kitbuild;
+&cleanup;
+exit 0;
+
+# Physically build the kits
+sub kitbuild {
+ $numkits = $#list;
+ if ($numkits > 9) {
+ $sp = '%02d';
+ } else {
+ $sp = '%d';
+ }
+
+ for ($kitnum = 1; $kitnum <= $numkits; $kitnum++) {
+ $list = $list[$kitnum];
+ $kit = sprintf("$package.kit" . $sp,$kitnum);
+ print "*** Making $kit ***\n";
+ open(KIT,">$curdir/$kit") || do fatal("Can't create $curdir/$kit: $!");
+
+ &kitleader;
+
+ @files = split(' ',$list);
+ reset 'X';
+ for $file (@files) {
+ $_ = $file;
+ while (s|^(.*)/.*$|$1|) {
+ push(@Xdirs,$_) unless $Xseen{$_}++;
+ }
+ }
+ print KIT "mkdir ",join(' ', sort @Xdirs)," 2>/dev/null\n";
+
+ foreach $file (@files) {
+ print "\t",$file,"\n" if $opt_v;
+ print KIT "echo Extracting $file\n";
+ print KIT "sed >$file <<'!STUFFY!FUNK!' -e 's/X//'\n";
+ open(FILE, $file);
+ &copyright'reset; # Reset copyright for new file
+ while (<FILE>) {
+ # Use Lock[e]r as a pattern in case it is applied on ourselves
+ s|Lock[e]r:.*\$|\$|; # Remove locker mark
+ print KIT &copyright'filter($_, 'X');
+ }
+ close FILE;
+ print KIT "!STUFFY!FUNK!\n";
+ -x "$file" && (print KIT "chmod +x $file\n");
+ }
+ &kittrailer;
+ chmod 0755, $kit;
+ }
+}
+
+sub kitlists {
+ for $filename (keys %comment) {
+ next if $filename =~ m|/$|; # Skip directories
+ next if -d $filename; # Better safe than sorry
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat($filename);
+
+ # Make sure file is not larger than the CHOPSIZE limit. If it is,
+ # a split is attempted.
+ if ($size > $CHOPSIZE) {
+ print "Splitting $filename...\n" if $opt_v;
+ $file_comment = $comment{$filename};
+ open(FILE, $filename) || die "Can't open $filename: $!\n";
+ $piece = 'AA';
+ ($dir, $name) = ('.', $filename)
+ unless ($dir, $name) = ($filename =~ m|(.*)/(.*)|);
+ $chopped = $dir . '/' . substr($name, 0, 11);
+ $chopped =~ s|^\./||;
+ &fatal("There is already a split file named $chopped")
+ if defined $Chopped{$chopped};
+ $Chopped{$chopped} = $filename; # Association split <-> real file
+ $size = 0;
+ open(CURPIECE, ">$chopped:$piece") ||
+ &fatal("Can't create $chopped:$piece: $!");
+ while (<FILE>) {
+ if ($size + length($_) > $CHOPSIZE) {
+ close CURPIECE;
+ $size{"$chopped:$piece"} = $size;
+ $comment{"$chopped:$piece"} = "$file_comment (part $piece)";
+ push(@files, "$chopped:$piece");
+ print "\t$chopped:$piece ($size bytes)\n" if $opt_v;
+ $size = 0;
+ $piece++; # AA -> AB, etc...
+ open(CURPIECE, ">$chopped:$piece") ||
+ &fatal("Can't create $chopped:$piece: $!");
+ }
+ print CURPIECE $_;
+ $size += length($_);
+ }
+ close FILE;
+ close CURPIECE;
+ $size{"$chopped:$piece"} = $size;
+ $comment{"$chopped:$piece"} = "$file_comment (part $piece)";
+ push(@files, "$chopped:$piece");
+ print "\t$chopped:$piece ($size bytes)\n" if $opt_v;
+ delete $comment{$filename}; # File split, not in PACKLIST
+ } else {
+ $size += 1000000 if $filename =~ /README/;
+ $size{$filename} = $size;
+ push(@files, "$filename");
+ }
+ }
+
+ # Build a file PACKNOTES to reconstruct split files
+ if (defined %Chopped) {
+ open(PACKNOTES, ">$PACKNOTES") || &fatal("Can't create PACKNOTES: $!");
+ foreach (keys %Chopped) {
+ print PACKNOTES <<EOC;
+echo 'Building $Chopped{$_}...'
+cat $_:[A-Z][A-Z] > $Chopped{$_}
+rm -f $_:[A-Z][A-Z]
+EOC
+ }
+ close PACKNOTES;
+ push(@files, $PACKNOTES);
+ $comment{$PACKNOTES} = 'Script to reconstruct split files';
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat($PACKNOTES);
+ $size{$PACKNOTES} = $size;
+ }
+
+ # Currently, file PACKLIST does not exist, so its size is unknown and
+ # it cannot be correctly put in one archive. Therefore, we take the
+ # size of MANIFEST.new, which will give us a good estimation.
+ push(@files, 'PACKLIST');
+
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat($NEWMANI);
+ $size{$PACKLIST} = $size;
+
+ sub revnum { $size{$a} < $size{$b} ? 1 : $size{$a} > $size{$b} ? -1 : 0; }
+ @files = sort revnum @files;
+
+ for (@files) {
+ $size = $size{$_};
+ $size -= 1000000 if /README/;
+ $i=1;
+ while (($newtot = int($tot[$i] + $size + $size/40 + $FILEOVERHEAD)) >
+ $MAXKITSIZE-$KITOVERHEAD && $tot[$i]) {
+ $i++;
+ }
+ $tot[$i] = $newtot;
+ print "Adding $_ to kit $i giving $newtot bytes\n" if $opt_d;
+ $kit{$_} = $i;
+ $list[$i] .= " $_";
+ }
+}
+
+# Read manifest file and initialize the %comment array.
+sub maniread {
+ do fatal("You don't have a $NEWMANI file. Run manifake")
+ unless -f "$NEWMANI";
+ open(NEWMANI,$NEWMANI) || do fatal("Can't read $NEWMANI: $!");
+ while (<NEWMANI>) {
+ ($key,$val) = split(' ',$_,1) unless ($key,$val) = /^(\S+)\s+(.*)/;
+ $comment{$key} = $val;
+ }
+ close NEWMANI;
+}
+
+# MANIFEST and MANIFEST.new must say the same thing. Create the
+# PACKLIST file (thus avoiding kit numbers in MANIFEST, which causes big
+# patches when only re-ordering occurred). Note that PACKLIST should
+# not appear in MANIFEST.new (the user may remove it).
+sub manimake {
+ # Add built packlist
+ $comment{$PACKLIST} = 'Which files came with which kits';
+
+ open(PACKLIST, ">$PACKLIST") || do fatal("Can't create $PACKLIST: $!");
+ print PACKLIST
+"After all the $package kits are run you should have the following files:
+
+Filename Kit Description
+-------- --- -----------
+";
+ for (sort keys(%comment)) {
+ printf PACKLIST "%-27s %2s %.47s\n", $_, $kit{$_}, $comment{$_};
+ }
+ close PACKLIST;
+}
+
+sub kitleader {
+ local($plevel);
+ $plevel = " at patchlevel $patch_level" if $patch_level ne '';
+ print KIT <<EOH;
+#! /bin/sh
+#
+# This is $package version $baserev$plevel.
+# Make a new directory for the $package sources, cd to it, and run kits 1 up
+# to $numkits through sh. When all $numkits kits have been run, read README.
+#
+echo " "
+cat <<EOM
+This is $package $baserev$plevel, kit $kitnum (of $numkits):
+If this shell archive is complete, the line "End of kit $kitnum (of $numkits)"
+will echo at the end.
+EOM
+export PATH || (echo "Please use sh to unpack this archive." ; kill \$\$)
+EOH
+}
+
+sub kittrailer {
+ $rangelist = '';
+ for ($i = 1; $i <= $numkits; $i++) {
+ $rangelist .= ' ' . $i;
+ }
+ print KIT <<EOM;
+echo \"End of kit $kitnum (of $numkits)\"
+echo \" \"
+cat /dev/null >kit${kitnum}isdone
+run=''
+config=''
+for iskit in$rangelist; do
+ if test -f kit\${iskit}isdone; then
+ run=\"\$run \$iskit\"
+ else
+ todo=\"\$todo \$iskit\"
+ fi
+done
+case \$todo in
+ '')
+ echo \"You have run all your kits.\"
+EOM
+ if (defined %Chopped) { # Some splitting occurred
+ print KIT <<EOM;
+ if test -f $PACKNOTES; then
+ sh $PACKNOTES
+ else
+ echo \"You have to rebuild split files by hand (see $PACKLIST).\"
+ fi
+EOM
+ }
+ if (-f "README" && -f "Configure") {
+ print KIT
+" echo \"Please read README and then type Configure.\"
+ chmod 755 Configure\n";
+ } elsif (-f "README") {
+ print KIT
+" echo \"Please read README first.\"\n";
+ } elsif (-f "Configure") {
+ print KIT
+" echo \"Please run Configure first.\"
+ chmod 755 Configure\n";
+ }
+ print KIT <<EOM;
+ rm -f kit*isdone
+ ;;
+ *) echo \"You have run\$run.\"
+ echo \"You still need to run\$todo.\"
+ ;;
+esac
+: Someone might mail this, so exit before signature...
+exit 0
+EOM
+}
+
+sub get_patchlevel {
+ $patch_level = '';
+ if (-f 'patchlevel.h') {
+ open(PL, 'patchlevel.h');
+ while (<PL>) {
+ /^#define\s+PATCHLEVEL\s+(\w+)/ && ($patch_level = $1);
+ }
+ close PL;
+ }
+}
+
+sub distfake {
+ return if $opt_q;
+ local($sw);
+ $sw = 's' unless $opt_v;
+ mkdir($tmpdir, 0700) || die "Can't create directory $tmpdir.\n";
+ print "Building a copy of distribution in $tmpdir...\n" if $opt_v;
+ system 'perl', '-S', 'patcol', "-a$sw", '-f', $NEWMANI, '-d', $tmpdir;
+ system 'cp', $NEWMANI, "$tmpdir/$NEWMANI"
+ unless -f "$tmpdir/$NEWMANI" && !$opt_f;
+}
+
+sub distcopy {
+ local($sw); # Switch to force patcol to copy checked out files
+ &makedir($opt_c);
+ print "Building a copy of distribution in $opt_c...\n" if $opt_v;
+ $sw = 'c' if $opt_q;
+ $sw .= 's' unless $opt_v;
+ system 'perl', '-S', 'patcol', "-aRC$sw", '-f', $NEWMANI, '-d', $opt_c;
+}
+
+sub distrm {
+ return if $opt_q;
+ print "Removing distribution in $tmpdir...\n" if $opt_v;
+ chdir "/"; # Do not stay in removed directory...
+ system '/bin/rm', '-rf', "$tmpdir";
+}
+
+sub splitrm {
+ foreach $base (keys %Chopped) {
+ print "Removing split files for $base:\n" if $opt_v;
+ $piece = 'AA';
+ while (-f "$base:$piece") {
+ print "\t$base:$piece\n" if $opt_v;
+ unlink "$base:$piece";
+ $piece++; # AA -> AB, etc...
+ }
+ }
+}
+
+sub cleanup {
+ &distrm if -d $tmpdir;
+ if ($opt_q) {
+ &splitrm; # Remove in-place split files
+ unlink $PACKLIST, $PACKNOTES;
+ }
+}
+
+sub fatal {
+ local($reason) = shift(@_);
+ &cleanup;
+ die "$reason\n";
+}
+
+sub set_sig {
+ local($handler) = @_;
+ $SIG{'HUP'} = $handler;
+ $SIG{'INT'} = $handler;
+ $SIG{'QUIT'} = $handler;
+ $SIG{'TERM'} = $handler;
+}
+
+sub aborted {
+ &set_sig('IGNORE');
+ $opt_v = 1; # Force verbose message in distrm
+ &cleanup;
+ print "Aborted.\n";
+ exit 1;
+}
+
+sub usage {
+ print STDERR <<EOM;
+Usage: makedist [-dhqvV] [-c dir] [-s size] [-f manifest]
+ -c : copy files in dir, do not build any shell archive.
+ -d : debug mode.
+ -f : use this file as manifest.
+ -h : print this help message and exits.
+ -q : quick mode: use checked-out files.
+ -s : set maximum pack size.
+ -v : verbose mode.
+ -V : print version number and exits.
+EOM
+ exit 1;
+}
+
+!NO!SUBS!
+$grep -v '^;#' ../pl/package.pl >>makedist
+$grep -v '^;#' ../pl/manifake.pl >>makedist
+$grep -v '^;#' ../pl/copyright.pl >>makedist
+$grep -v '^;#' ../pl/makedir.pl >>makedist
+$grep -v '^;#' ../pl/tilde.pl >>makedist
+$grep -v '^;#' ../pl/profile.pl >>makedist
+chmod +x makedist
+$eunicefix makedist
diff --git a/kit/makedist.man b/kit/makedist.man
new file mode 100644
index 0000000..5c6b09d
--- /dev/null
+++ b/kit/makedist.man
@@ -0,0 +1,147 @@
+.rn '' }`
+''' $Id$
+'''
+''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+'''
+''' You may redistribute only under the terms of the Artistic Licence,
+''' as specified in the README file that comes with the distribution.
+''' You may reuse parts of this distribution only within the terms of
+''' that same Artistic Licence; a copy of which may be found at the root
+''' of the source tree for dist 4.0.
+'''
+''' $Log: makedist.man,v $
+''' Revision 3.0.1.2 1995/05/12 11:58:16 ram
+''' patch54: updated my e-mail address
+'''
+''' Revision 3.0.1.1 1994/05/06 14:00:50 ram
+''' patch23: now mentions kitpost and kitsend
+'''
+''' Revision 3.0 1993/08/18 12:04:31 ram
+''' Baseline for dist 3.0 netwide release.
+'''
+'''
+.de Sh
+.br
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp
+.if t .sp .5v
+.if n .sp
+..
+'''
+''' Set up \*(-- to give an unbreakable dash;
+''' string Tr holds user defined translation string.
+''' Bell System Logo is used as a dummy character.
+'''
+.ie n \{\
+.tr \(*W-\*(Tr
+.ds -- \(*W-
+.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+.ds L" ""
+.ds R" ""
+.ds L' '
+.ds R' '
+'br\}
+.el\{\
+.ds -- \(em\|
+.tr \*(Tr
+.ds L" ``
+.ds R" ''
+.ds L' `
+.ds R' '
+'br\}
+.TH MAKEDIST 1 LOCAL
+.SH NAME
+makedist \- a distribution kit maker
+.SH SYNOPSIS
+.B makedist
+[ \fB\-dhqvV\fR ] [ \fB\-c\fI dir\fR ]
+[ \fB\-s\fI size\fR ] [\fB\-f \fImanifest\fR ]
+.SH DESCRIPTION
+.I Makedist
+is a rather simpleminded shar program that knows how to pack files
+into multiple kits of approximately 50000 bytes each.
+The shar scripts produced assume very little about the target machine;
+there is correspondingly little error checking done compared to other
+shar programs. Alternatively, with the \fB\-c\fR option, you can
+create a directory containing the whole source tree, and then pack it
+up using your own shell archiver.
+.PP
+If you are using the copyright expansion feature (as determined by
+\fIpackinit\fR), then you have to pack your distribution using this
+program to ensure the copyright is correctly set.
+.PP
+In order to run \fImakedist\fR you have to do two things:
+.IP 1) 4
+Create a .package file in the package's top-level directory by running
+\fIpackinit\fR.
+This program will ask you about your package and remember what you tell
+it so that all the \fIdist\fR programs can be smart.
+.IP 2) 4
+Create a MANIFEST.new file in your top-level directory that lists all the
+files in your package.
+The filename should be the first field on each line.
+After some whitespace you can add a comment describing your file (briefly).
+.PP
+After running \fImakedist\fR,
+you will have a set of kits in your top-level directory.
+If your package name is "foo", they will be named foo.kit1, foo.kit2, etc.
+The file created PACKLIST file is automatically added to the distribution and
+tells which files come with which kits.
+If you used the \fB\-c\fR option, you will end-up with a single directory
+instead, containing the whole distribution, ready to be sent to the end-user.
+.PP
+If a file is too large to be packed as-is in one archive, it will be
+automatically split in smaller parts. Only the first 11 characters of the file
+will be kept though, and \fImakedist\fR will abort if two distinct files are
+to be split and have the same 11 first characters in their names. The split
+files will automatically be reconstructed at the end of the archive extraction
+by runnning a script generated in PACKNOTES.
+.PP
+You may then mail your kits via \fIkitsend\fR or post them with \fIkitpost\fR.
+.SH OPTIONS
+The following options are handled by \fImakedist\fR:
+.TP 10
+.B \-c \fIdir\fR
+Tell \fImakedist\fR that the distribution should be copied (mirrored) in
+the specified directory, instead of producing shell archives. Compatible with
+the \fB\-q\fR option.
+.TP
+.B \-d
+Turn on debug mode. Probably not useful.
+.TP
+\fB-f\fI file\fR
+Use \fIfile\fR as manifest. By default, MANIFEST.new is used.
+.TP
+.B \-h
+Print help message and exit.
+.TP
+.B \-q
+Quick production of the kits: the checked-out version of the files is used,
+instead of using the RCS file to actually get the latest checked-in version.
+This will save some considerable time, but you have to be sure the checked-out
+version is up-to-date or you might end up with an inconsistent package.
+.TP
+\fB\-s\fI size\fR
+Set maximum kit size to \fIsize\fR bytes.
+.TP
+.B \-v
+Verbose mode: trace kit building process or tree mirroring.
+.TP
+.B \-V
+Print version number and exit.
+.SH AUTHORS
+Larry Wall <lwall@netlabs.com> (version 2.0)
+.br
+Raphael Manfredi <Raphael.Manfredi@pobox.com>
+.SH FILES
+Creates ./$package.kit* unless \fB\-c\fR option is used.
+.br
+PACKLIST and PACKNOTES are also temporarily created.
+.SH "SEE ALSO"
+kitsend(1), kitpost(1), metaconfig(1), patcol(1)
+.rn }` ''
diff --git a/kit/manifake.SH b/kit/manifake.SH
new file mode 100755
index 0000000..cd31004
--- /dev/null
+++ b/kit/manifake.SH
@@ -0,0 +1,51 @@
+case $CONFIG in
+'')
+ if test -f config.sh; then TOP=.;
+ elif test -f ../config.sh; then TOP=..;
+ elif test -f ../../config.sh; then TOP=../..;
+ elif test -f ../../../config.sh; then TOP=../../..;
+ elif test -f ../../../../config.sh; then TOP=../../../..;
+ else
+ echo "Can't find config.sh."; exit 1
+ fi
+ . $TOP/config.sh
+ ;;
+esac
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting kit/manifake (with variable substitutions)"
+$spitshell >manifake <<!GROK!THIS!
+$startperl
+ eval 'exec perl -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+
+# $Id$
+#
+# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+#
+# You may redistribute only under the terms of the Artistic Licence,
+# as specified in the README file that comes with the distribution.
+# You may reuse parts of this distribution only within the terms of
+# that same Artistic Licence; a copy of which may be found at the root
+# of the source tree for dist 4.0.
+#
+# $Log: manifake.SH,v $
+# Revision 3.0.1.1 1993/08/19 06:42:18 ram
+# patch1: leading config.sh searching was not aborting properly
+#
+# Revision 3.0 1993/08/18 12:04:32 ram
+# Baseline for dist 3.0 netwide release.
+#
+
+!GROK!THIS!
+$spitshell >>manifake <<'!NO!SUBS!'
+$NEWMANI = 'MANIFEST.new';
+$MANI = 'MANIFEST';
+
+&manifake;
+
+!NO!SUBS!
+chmod 755 manifake
+$grep -v '^;#' ../pl/manifake.pl >> manifake
+$eunicefix manifake
diff --git a/kit/manifake.man b/kit/manifake.man
new file mode 100644
index 0000000..8c76ba7
--- /dev/null
+++ b/kit/manifake.man
@@ -0,0 +1,46 @@
+''' $Id$
+'''
+''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+'''
+''' You may redistribute only under the terms of the Artistic Licence,
+''' as specified in the README file that comes with the distribution.
+''' You may reuse parts of this distribution only within the terms of
+''' that same Artistic Licence; a copy of which may be found at the root
+''' of the source tree for dist 4.0.
+'''
+''' $Log: manifake.man,v $
+''' Revision 3.0.1.1 1995/05/12 11:58:21 ram
+''' patch54: updated my e-mail address
+'''
+''' Revision 3.0 1993/08/18 12:04:33 ram
+''' Baseline for dist 3.0 netwide release.
+'''
+.TH MANIFAKE 1 ram
+.SH NAME
+manifake \- creates a MANIFEST.new out of a MANIFEST file
+.SH SYNOPSIS
+.B manifake
+.SH DESCRIPTION
+.I Manifake
+is a real simpleminded program that takes a MANIFEST file, such as one
+produced by a shar program, and creates a MANIFEST.new file ready to be
+used by all the dist programs. What it does is that all archive numbers
+are removed and the optional leading comments up to a dashed-line are
+thrown away.
+.PP
+.I Manifake
+will typically be used when converting an existing package
+to use \fImetaconfig\fR or any other dist utility.
+.SH AUTHOR
+Raphael Manfredi <Raphael.Manfredi@pobox.com>
+.SH FILES
+.PD 0
+.TP 20
+MANIFEST
+Original manifest produced by some shar program
+.TP
+MANIFEST.new
+Faked manifest file, suitable for use by any dist programs.
+.PD
+.SH "SEE ALSO"
+makedist(1), metaconfig(1), pat(1).