? modules/fileinput
? modules/ftp/example
? modules/ftpd/examples
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcllib/tcllib/ChangeLog,v
retrieving revision 1.107
diff -u -r1.107 ChangeLog
--- ChangeLog	2002/01/17 17:07:25	1.107
+++ ChangeLog	2002/01/17 18:45:43
@@ -1,8 +1,8 @@
 2002-01-17  Andreas Kupries  <andreas_kupries@users.sourceforge.net>
 
-	* examples/csv/csvdiff: New example for csv module. FR #485717.
+	* Makefile.in (dist): Fixed bug #495976.
 
-2002-01-17  Andreas Kupries  <andreas_kupries@users.sourceforge.net>
+	* examples/csv/csvdiff: New example for csv module. FR #485717.
 
 	* mime: Fixed bug #499242.
 
Index: Makefile.in
===================================================================
RCS file: /cvsroot/tcllib/tcllib/Makefile.in,v
retrieving revision 1.54
diff -u -r1.54 Makefile.in
--- Makefile.in	2002/01/12 00:35:44	1.54
+++ Makefile.in	2002/01/17 18:45:43
@@ -269,28 +269,47 @@
 #   Generated installer for Windows (INSTALL.BAT) and UNIX (install.sh)
 # This all gets archived together (tcllib$(VERSION).zip or 
 # tcllib$(VERSION).tar.gz).
+
+# Changes:
+# - Generate the distributions in the current directory, not the source directory.
+# - Make the structure of the source distribution equal to the
+#   structure of the raw distribution out of CVS, with some files
+#   removed. This makes generation easier.
+#
+# Actions
+# - Remove possible old temp dir and archives
+# - Copy examples and modules into temp dir
+# - Remove meta-data of CVS
+# - Copy a selected number of files into the src distribution
+# - Recopy the manpages and insert man.macros (the big loop)
+# - Generate pkgIndex and installation scripts
+# - Generate the archives and release the temp dir
+
 dist:
-	rm -rf $(srcdir)/tcllib$(VERSION) tcllib$(VERSION).tar.gz tcllib$(VERSION).zip
-	@mkdir $(srcdir)/tcllib$(VERSION)
-	-for j in $(MODULES) ; do \
-	    mkdir $(srcdir)/tcllib$(VERSION)/$$j ; \
-	    cp $(srcdir)/modules/$$j/*.n $(srcdir)/tcllib$(VERSION)/$$j ; \
-	    cp $(srcdir)/modules/$$j/*.txt $(srcdir)/tcllib$(VERSION)/$$j ; \
-	    cp $(srcdir)/modules/$$j/*.xml $(srcdir)/tcllib$(VERSION)/$$j ; \
-	    cp $(srcdir)/modules/$$j/*.html $(srcdir)/tcllib$(VERSION)/$$j ; \
-	    cp $(srcdir)/modules/$$j/*.tcl $(srcdir)/tcllib$(VERSION)/$$j ; \
-	    cp $(srcdir)/modules/$$j/*.test $(srcdir)/tcllib$(VERSION)/$$j ; \
-	    cp $(srcdir)/modules/$$j/tclIndex $(srcdir)/tcllib$(VERSION)/$$j ; \
+	rm -rf tcllib$(VERSION) tcllib$(VERSION).tar.gz tcllib$(VERSION).zip
+	@mkdir tcllib$(VERSION)
+	for j in examples modules ; do \
+	    cp -r $(srcdir)/$$j tcllib$(VERSION) ; \
 	done
-	$(TCLSH_PROG) $(srcdir)/mkIndex.tcl $(srcdir)/tcllib$(VERSION) tcllib $(VERSION) $(MODULES)
-	$(TCLSH_PROG) $(srcdir)/mkInstallScripts.tcl $(srcdir)/tcllib$(VERSION) tcllib $(VERSION) $(MODULES)
-	for j in license.terms README ; do \
-	    cp $(srcdir)/$$j $(srcdir)/tcllib$(VERSION)/$$j ; \
+	find tcllib$(VERSION) -name CVS -prune -exec rm -rf {} \;
+	for j in license.terms README ChangeLog ; do \
+	    cp $(srcdir)/$$j tcllib$(VERSION)/$$j ; \
 	done
-	cd $(srcdir) ; tar cf tcllib$(VERSION).tar tcllib$(VERSION)
-	cd $(srcdir) ; gzip tcllib$(VERSION).tar
-	cd $(srcdir) ; zip -r tcllib$(VERSION).zip tcllib$(VERSION)
-	rm -rf $(srcdir)/tcllib$(VERSION)
+	for j in $(MODULES) ; do \
+	    doc=`ls $(srcdir)/modules/$$j/*.n 2>/dev/null` ; \
+	    if test -n "$$doc" ; then \
+		for i in $$doc ; do \
+		    sed -e '/man\.macros/r $(srcdir)/man.macros' -e '/man\.macros/d' \
+			< $$i > tcllib$(VERSION)/modules/$$j/`basename $$i` ; \
+		done; \
+	    fi ; \
+	done ;
+	$(TCLSH_PROG) $(srcdir)/mkIndex.tcl          tcllib$(VERSION) tcllib $(VERSION) $(MODULES)
+	$(TCLSH_PROG) $(srcdir)/mkInstallScripts.tcl tcllib$(VERSION) tcllib $(VERSION) $(MODULES)
+	tar cf - tcllib$(VERSION) | gzip --best > tcllib$(VERSION).tar.gz
+	zip -r tcllib$(VERSION).zip tcllib$(VERSION)
+	rm -rf tcllib$(VERSION)
+
 
 # Check tcllib and report all modules without documentation and/or testsuite.
 check:
Index: mkInstallScripts.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/mkInstallScripts.tcl,v
retrieving revision 1.7
diff -u -r1.7 mkInstallScripts.tcl
--- mkInstallScripts.tcl	2002/01/11 23:48:24	1.7
+++ mkInstallScripts.tcl	2002/01/17 18:45:43
@@ -19,6 +19,7 @@
 puts $f "set TCLINSTALL=C:\\Progra~1\\Tcl"
 puts $f "mkdir %TCLINSTALL%\\lib\\$package$version"
 puts $f "copy pkgIndex.tcl %TCLINSTALL%\\lib\\$package$version"
+puts $f "cd modules"
 puts $f "for %%f in ($modules) do xcopy .\\%%f\\*.* %TCLINSTALL%\\lib\\$package$version\\%%f /E /S /I /Q /C"
 close $f
 
@@ -32,6 +33,11 @@
 puts $f "if \[ \"\${TCLINSTALL\}x\" = \"x\" \] ; then \\"
 puts $f "   TCLINSTALL=/usr/local"
 puts $f "fi"
+puts $f "here=`pwd`"
+puts $f "cd \$TCLINSTALL"
+puts $f "TCLINSTALL=`pwd`"
+puts $f "cd \$here"
+puts $f "echo Installing $package $version to \$TCLINSTALL"
 puts $f "if \[ ! -d \$TCLINSTALL/lib/$package$version \] ; then \\"
 puts $f "    mkdir -p \$TCLINSTALL/lib/$package$version ; \\"
 puts $f "fi"
@@ -39,6 +45,7 @@
 puts $f "    mkdir -p \$TCLINSTALL/man/mann ; \\"
 puts $f "fi"
 puts $f "cp -f pkgIndex.tcl \$TCLINSTALL/lib/$package$version"
+puts $f "cd modules"
 puts $f "for j in $modules ; do \\"
 puts $f "    if \[ ! -d \$TCLINSTALL/lib/$package$version/\$j \] ; then \\"
 puts $f "        mkdir \$TCLINSTALL/lib/$package$version/\$j ; \\"
@@ -47,7 +54,7 @@
 puts $f "    if \[ -f \$j/tclIndex \] ; then \\"
 puts $f "        cp -f \$j/tclIndex \$TCLINSTALL/lib/$package$version/\$j ; \\"
 puts $f "    fi ; \\"
-puts $f "    cp -f \$j/*.n      \$TCLINSTALL/man/mann ; \\"
+puts $f "    cp -f \$j/*.n      \$TCLINSTALL/man/mann 2> /dev/null ; \\"
 puts $f "done"
 close $f
 switch -exact $::tcl_platform(platform) {
