[m-rev.] For review: Compatibility with Debian packaging.

Paul Bone pbone at csse.unimelb.edu.au
Fri Oct 29 16:26:00 AEDT 2010


Compatibility with Debian packaging.

Packaging Mercury for Debian requires creating some patches to make sure that
Mercury can be built under the control of dpkg-buildpackage.  It's recommended
that these patches are pushed upstream (into Mercury) so that everyone can
benefit from them, not just Debian packagers.

Mmake.common.in:
scripts/Mmake.vars.in:
    Install Mercury at $DESTDIR/@prefix@, $DESTDIR helps someone setup Mercury
    to run from @prefix@ while putting it in $DESTDIR.  $DESTDIR/* can easily
    be tared up and then deployed on other systems.

Mmakefile:
Makefile:
    Pass the $DESTDIR variable to make sub-processes.

scripts/Mercury.config.in:
scripts/Mercury.config.bootstrap.in:
    Remove the she-bang line from these scripts since they are not executable.

    This change improves conformance with Debian packaging standards.

Index: Makefile
===================================================================
RCS file: /home/mercury1/repository/mercury/Makefile,v
retrieving revision 1.14
diff -u -p -b -r1.14 Makefile
--- Makefile	9 Jul 2010 07:10:15 -0000	1.14
+++ Makefile	29 Oct 2010 04:58:18 -0000
@@ -34,7 +34,7 @@ libmmc:
 
 .PHONY: install
 install:
-	$(MMAKE) MMAKEFLAGS=$(PARALLEL) install
+	$(MMAKE) MMAKEFLAGS=$(PARALLEL) DESTDIR=$(DESTDIR) install
 
 # `mmake clean' has a different meaning to the usual GNU standard `make clean':
 # it removes the .c files, which makes bootstrapping impossible unless you
Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.97
diff -u -p -b -r1.97 Mmake.common.in
--- Mmake.common.in	10 Oct 2009 10:44:13 -0000	1.97
+++ Mmake.common.in	29 Oct 2010 04:58:18 -0000
@@ -118,8 +118,8 @@ SHARED_LIBS		= @SHARED_LIBS@
 # Set the installation prefix. This is done here as well as
 # in scripts/Mmake.vars to avoid accidentally overwriting an
 # existing installation when using an installed mmake.
-INSTALL_PREFIX		= @prefix@
-FINAL_INSTALL_PREFIX	= @prefix@
+INSTALL_PREFIX		= $(DESTDIR)/@prefix@
+FINAL_INSTALL_PREFIX	= $(DESTDIR)/@prefix@
 
 INSTALLABLE_PREFIX	= @INSTALLABLE_PREFIX@
 
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmakefile,v
retrieving revision 1.138
diff -u -p -b -r1.138 Mmakefile
--- Mmakefile	30 Sep 2010 07:23:30 -0000	1.138
+++ Mmakefile	29 Oct 2010 04:58:18 -0000
@@ -52,11 +52,13 @@ MMAKEFLAGS =
 SUBDIR_MMAKE =	PATH=../scripts:../util:$$PATH \
 		MMAKE_VPATH=. \
 		MMAKE_DIR=../scripts \
+		DESTDIR=$(DESTDIR) \
 		../scripts/mmake $(MMAKEFLAGS)
 
 SUBSUBDIR_MMAKE = PATH=../../scripts:../../util:$$PATH \
 		MMAKE_VPATH=. \
 		MMAKE_DIR=../../scripts \
+		DESTDIR=$(DESTDIR) \
 		../../scripts/mmake $(MMAKEFLAGS)
 
 GENERATED_DOCS = README INSTALL WORK_IN_PROGRESS TODO
Index: scripts/Mercury.config.bootstrap.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mercury.config.bootstrap.in,v
retrieving revision 1.10
diff -u -p -b -r1.10 Mercury.config.bootstrap.in
--- scripts/Mercury.config.bootstrap.in	30 Sep 2010 07:23:34 -0000	1.10
+++ scripts/Mercury.config.bootstrap.in	29 Oct 2010 05:16:41 -0000
@@ -1,4 +1,7 @@
-#! /bin/sh
+#
+# This file has no she-bang line since it isn't intended to be executable,
+# instead it is 'sourced' by other scripts.
+#
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 2003-2004, 2006-2007, 2010 The University of Melbourne.
Index: scripts/Mercury.config.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mercury.config.in,v
retrieving revision 1.25
diff -u -p -b -r1.25 Mercury.config.in
--- scripts/Mercury.config.in	30 Sep 2010 07:23:34 -0000	1.25
+++ scripts/Mercury.config.in	29 Oct 2010 05:16:41 -0000
@@ -1,4 +1,7 @@
-#! /bin/sh
+#
+# This file has no she-bang line since it isn't intended to be executable,
+# instead it is 'sourced' by other scripts.
+#
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 2003-2007, 2010 The University of Melbourne.
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.113
diff -u -p -b -r1.113 Mmake.vars.in
--- scripts/Mmake.vars.in	30 Sep 2010 07:23:34 -0000	1.113
+++ scripts/Mmake.vars.in	29 Oct 2010 04:58:18 -0000
@@ -686,8 +686,8 @@ INSTALL_MKDIR = mkdir -p
 # script (e.g. in the shell scripts mmc, ml, mmake, etc) that will not
 # be updated simply by overriding INSTALL_PREFIX.
 
-INSTALL_PREFIX		= @prefix@
-FINAL_INSTALL_PREFIX	= @prefix@
+INSTALL_PREFIX		= $(DESTDIR)/@prefix@
+FINAL_INSTALL_PREFIX	= $(DESTDIR)/@prefix@
 INSTALL_BINDIR		= $(INSTALL_PREFIX)/bin
 INSTALL_LIBDIR		= $(INSTALL_PREFIX)/lib/mercury
 FINAL_INSTALL_LIBDIR	= $(FINAL_INSTALL_PREFIX)/lib/mercury
@@ -700,7 +700,7 @@ INSTALL_MAN_DIR		= $(INSTALL_PREFIX)/man
 INSTALL_HTML_DIR	= $(INSTALL_PREFIX)/lib/mercury/html
 INSTALL_MDB_DOC_DIR	= $(INSTALL_PREFIX)/lib/mercury/mdb
 INSTALL_ELISP_DIR	= $(INSTALL_PREFIX)/lib/mercury/elisp
-INSTALL_CGI_DIR		= @CGIDIR@
+INSTALL_CGI_DIR		= $(DESTDIR)/@CGIDIR@
 
 # You should not need to override anything below here
 
Index: scripts/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmakefile,v
retrieving revision 1.46
diff -u -p -b -r1.46 Mmakefile
--- scripts/Mmakefile	1 Sep 2009 23:54:38 -0000	1.46
+++ scripts/Mmakefile	29 Oct 2010 04:58:18 -0000
@@ -109,6 +109,7 @@ install: install_mmake install_scripts i
 .PHONY: install_dirs
 install_dirs:
 	[ -d $(INSTALL_BINDIR) ] || mkdir -p $(INSTALL_BINDIR)
+	echo INSTALL_LIBDIR = $(INSTALL_LIBDIR) >> log
 	[ -d $(INSTALL_LIBDIR)/mmake ] || mkdir -p $(INSTALL_LIBDIR)/mmake
 	[ -d $(INSTALL_LIBDIR)/mdb ] || mkdir -p $(INSTALL_LIBDIR)/mdb
 	[ -d $(INSTALL_CONF_DIR) ] || mkdir -p $(INSTALL_CONF_DIR)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20101029/6a6d0190/attachment.sig>


More information about the reviews mailing list