[AD] Unix-specific distributions

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi folks

The attached patch includes a script `misc/mkunixdists.sh',
which is passed the name of an Allegro .zip archive.  It produces
a corresponding .tar.gz archive, after running `fixunix.sh', and
then removes various chunks of the distribution and patches
`makefile.in', and creates another .tar.gz archive for end
users.

All that's in this archive is just enough to build the library
and install it and the headers.  I was considering whether we
should provide the setup program (though this makes the makefile
patching in the script a little deeper) and some of the tools
which distributors might be using in their makefiles (e.g. I've
used `dat').  I decided not to, though, since distributors can
happily supply binary datafiles.  Including the setup program,
however, may be wise.

You can either leave it as a separate script, or call it from
the end of `zipup.sh' -- or merge it with zipup if you want to.

I'm in the process of tweaking Gorka's spec file to produce RPMs
of this, which self-compile and nuke the build tree when they've
installed themselves.

George

diff -urN allegro-3.9.28-1/makefile.in allegro-3.9.28-2/makefile.in
--- allegro-3.9.28-1/makefile.in	Mon Nov 22 02:31:32 1999
+++ allegro-3.9.28-2/makefile.in	Fri Dec  3 00:51:08 1999
@@ -2,6 +2,9 @@
 #  Rules for building the Allegro library on Unix. This file is processed
 #  by the configure script, to produce the real makefile the does the work.
 
+INSTALL_TARGETS = full-install
+DEFAULT_TARGETS = all
+
 srcdir = @srcdir@
 builddir = .
 
@@ -85,7 +88,7 @@
 PLUGIN_LIB = @PLUGIN_LIB@
 obj_unix_plugins_h = $(OBJDIR)/plugins.h
 
-default: all
+default: $(DEFAULT_TARGETS)
 
 .SUFFIXES:
 makefile: $(srcdir)/makefile.in config.status
@@ -229,7 +232,11 @@
 maintainer-clean: veryclean
 	rm -fv configure
 
-install: install-lib install-headers install-programs
+mini-install: install-lib
+	@echo "Your end-user version of Allegro is now installed.  You may"
+	@echo "now delete the build tree if you wish."
+
+full-install: install-lib install-headers install-programs
 	 @echo "Run make install-man if you wish to install the man pages"
 	 @echo "Run make install-info if you wish to install the info documentation"
 	 @echo "Alternatively you may run make install-gzipped-info to conserve space" 
diff -urN allegro-3.9.28-1/misc/mkunixdists.sh allegro-3.9.28-2/misc/mkunixdists.sh
--- allegro-3.9.28-1/misc/mkunixdists.sh	Thu Jan  1 01:00:00 1970
+++ allegro-3.9.28-2/misc/mkunixdists.sh	Fri Dec  3 00:51:24 1999
@@ -0,0 +1,104 @@
+#!/bin/sh
+
+################################################################
+# mkunixdists.sh -- shell script to generate Unix distributions
+#
+# Usage: mkunixdists.sh <archive>[.zip] [tmpdir]
+#
+# This generates all the Unix-specific distributions.  The
+# existing ZIP format is fine on Unix too, but we'll generate
+# here a .tar.gz in Unix format (no `fixunix.sh' necessary) and
+# also an end-user distribution which just creates and installs
+# the library, without examples, documentation, etc.  I suppose
+# there's a danger that people will download this as a cut-down
+# development version, but if we shoot those people then this
+# problem will be solved.  This script might need a lot of disk
+# space, but no more than the existing zipup.sh needs. :)
+
+
+
+################################################################
+# First process the arguments
+
+if [ $# -lt 1 -o $# -gt 2 ]; then
+	echo "Usage: mkunixdists.sh <archive>[.zip] [tmpdir]"
+	exit 1
+fi
+
+# If we got `.zip', remove it
+basename=$(echo "$1" | sed -e 's/\.zip$//')
+
+# Sort out `dir', adding a trailing `/' if necessary
+if [ $# -gt 1 ]; then
+	dir=$(echo "$2" | sed -e 's/\([^/]\)$/\0\//').tmp
+else
+	dir=.tmp
+fi
+
+
+
+################################################################
+# Helpers
+
+error() { echo "Error occured, aborting" ; exit 1 }
+
+mktargz() {
+	echo "Creating $1.tar"
+	(cd $dir && tar -cf - allegro) > $1.tar || error
+	echo "gzipping to $1.tar.gz"
+	gzip $1.tar || error
+}
+
+
+################################################################
+# Unzip the archive and run fixunix.sh
+
+mkdir $dir || error
+
+echo "Unzipping $basename.zip to $dir"
+	unzip -q $basename.zip -d $dir || error
+
+echo "Running \`fixunix.sh\'"
+	(cd $dir/allegro && . fixunix.sh) || error
+
+################################################################
+# Create the developers' archive
+
+mktargz $basename
+
+
+################################################################
+# Hack'n'slash
+
+echo "Stripping to form end-user distribution"
+(cd $dir/allegro && {
+	(cd src && rm -rf beos dos win)
+	(cd obj && rm -rf beos djgpp mingw32 msvc rsxnt watcom)
+	(cd lib && rm -rf beos djgpp mingw32 msvc rsxnt watcom)
+	(cd include && {
+		rm -f be* win*
+		(cd allegro && rm -f *beos.h *dos.h *win.h *vc.h *wat.h *becfg.h *djgpp.h *mngw32.h *rsx* *scanex.h *watcom.h)
+	})
+	(cd misc && rm -f cmplog.pl findtext.sh fixpatch.sh fixver.sh zipup.sh)
+	rm -rf demo docs examples setup tests tools wintests
+	rm -f AUTHORS CHANGES THANKS *.txt fix* indent* readme.* allegro.mft
+	rm -f makefile.all makefile.be makefile.dj makefile.mgw makefile.rsx makefile.vc makefile.wat
+	{	# Tweak makefile.in
+		cp makefile.in makefile.old &&
+		cat makefile.old |
+		sed -e "s/INSTALL_TARGETS = .*/INSTALL_TARGETS = mini-install/" |
+		sed -e "s/DEFAULT_TARGETS = .*/DEFAULT_TARGETS = lib/" |
+		cat > makefile.in &&
+		rm -f makefile.old
+	}
+})
+
+mktargz $basename-enduser
+
+
+################################################################
+# All done!
+
+rm -rf $dir
+echo "All done!"
+


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/