for review: debian scripts

Tyson Dowd trd at cs.mu.OZ.AU
Thu Feb 4 15:25:12 AEDT 1999


The following diff is the scripts and information files that are
used for building Debian binary packages.  I use

	dpkg-buildpackage -rfakeroot -mtrd at cs.mu.oz.au

to build the Mercury binary packages.  This does the whole
deal, including pgp signing (which you probably don't need to do
just to build .debs locally).  Please note that the files in
this directory should be updated for each release.

Fergus has asked that these files be committed so that others can
build Debian packages for new releases.  (It would probably be a
good idea to create a rpm directory for building rpms as well).

Note that I have built a .deb file for mercury-0.8.1 and uploaded
it to the Debian ftp sites already (e.g.
/mnt/monash/distributions/debian/dists/potato/main/binary-i386/devel/mercury_0.8.1-1.deb on hydra).


Estimated hours taken: 10

debian/*: 
	Debian specific package building information.

--- mercury-0.8.1.orig/debian/changelog
+++ mercury-0.8.1/debian/changelog
@@ -0,0 +1,82 @@
+mercury (0.8.1-1) unstable; urgency=low
+
+  * New upstream version.
+  * Fix handling of egcs.
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Mon,  1 Feb 1999 22:39:53 +1100
+
+mercury (0.8-3) unstable; urgency=low
+
+  * Fix PATH so that programs in /usr/local are not found during
+    configuration. 
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Sun, 27 Dec 1998 02:13:18 +1100
+
+mercury (0.8-2) unstable; urgency=low
+
+  * Fixed configuration to handle assemblers that don't do
+    full preprocessing.
+  * Added patch required for compiling with egcs-1.1.
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Wed, 23 Dec 1998 04:20:46 -0600
+
+mercury (0.8-1) unstable; urgency=low
+
+  * New upstream version.
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Wed, 18 Nov 1998 18:21:46 +1100
+
+mercury (0.7.3-3) frozen unstable; urgency=low
+
+  * Put into frozen distribution.
+  * Remove some bash-isms from security fix.
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Tue, 31 Mar 1998 14:06:14 +1000
+
+mercury (0.7.3-2) unstable; urgency=low
+
+  * Fix security problems with files in /tmp (Fixes #19801).
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Sun, 22 Mar 1998 00:07:29 +1100
+
+mercury (0.7.3-1) unstable; urgency=low
+
+  * New upstream version.
+  * Remove outdated information in `README.debian' with regard to the
+    name of compiler.
+  * Update the copyright information.
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Fri, 14 Nov 1997 22:21:50 +1000
+
+mercury (0.7-1) unstable; urgency=low
+
+  * Changed maintainer from Milan Zamazal <pdm at fi.muni.cz> to 
+    Tyson Dowd <trd at cs.mu.oz.au>.
+  * New upstream version.
+  * Fixed installation of shared libraries so that hardcoded
+    paths for -rpath are set correctly, and so shared libraries
+    work.
+  * Installed new manpages for Mercury, and some extra README
+    files (README.Linux has useful information for Linux users).
+
+ -- Tyson Dowd <trd at cs.mu.oz.au>  Sun, 7 Sep 1997 15:10:06 +1000
+
+mercury (0.6.2-2) unstable; urgency=low
+
+  * Compiled with libc6.
+  * Corrected ftp path in the `copyright' file.
+  * Info on source compiling in `README.debian'.
+  * More descriptive short description string.
+
+ -- Milan Zamazal <pdm at fi.muni.cz>  Mon, 30 Jun 1997 10:26:02 +0200
+
+mercury (0.6.2-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Milan Zamazal <pdm at fi.muni.cz>  Tue, 4 Mar 1997 16:01:10 +0100
+
+Local variables:
+mode: debian-changelog
+add-log-mailing-address: "trd at cs.mu.oz.au"
+End:
--- mercury-0.8.1.orig/debian/README.debian
+++ mercury-0.8.1/debian/README.debian
@@ -0,0 +1,19 @@
+mercury for DEBIAN
+------------------
+
+This is Mercury compiler packaged for Debian.
+
+Some remarks on compiling the source package:
+Mercury is written in Mercury.  It is shipped with C sources and after
+compiling them it is recompiled (C sources are recreated).  Original sources
+may be lost after first compilation, so the source package has to be unpacked
+from scratch if you want to build the binary package again.
+
+Milan Zamazal <pdm at fi.muni.cz>, Sat, 8 Mar 1997 17:20:05 +0100
+
+Extra information about Mercury for Linux is available in the
+README.Linux file.  This is particularly important if you are interested
+in using shared libraries with Mercury.
+
+Tyson Dowd <trd at cs.mu.oz.au>, Fri, 14 Nov 1997 22:20:25 +1000
+
--- mercury-0.8.1.orig/debian/control
+++ mercury-0.8.1/debian/control
@@ -0,0 +1,19 @@
+Source: mercury
+Section: devel
+Priority: optional
+Maintainer: Tyson Dowd <trd at cs.mu.oz.au>
+Standards-Version: 2.4.1
+
+Package: mercury
+Architecture: any
+Depends: ${shlibs:Depends}
+Recommends: gcc
+Description: New logic/functional programming language
+ Mercury is a new logic/functional programming language, which combines
+ the clarity and expressiveness of declarative programming with advanced
+ static analysis and error detection features.  Its highly optimized
+ execution algorithm delivers efficiency far in excess of existing logic
+ programming systems, and close to conventional programming
+ systems. Mercury addresses the problems of large-scale program
+ development, allowing modularity, separate compilation, and numerous
+ optimization/time trade-offs.
--- mercury-0.8.1.orig/debian/copyright
+++ mercury-0.8.1/debian/copyright
@@ -0,0 +1,62 @@
+
+
+This package was first debianized by Milan Zamazal <pdm at fi.muni.cz> on
+Tue, 4 Mar 1997 16:01:10 +0100.
+
+Subsequent debianizations have been performed by Tyson Dowd
+<trd at cs.mu.oz.au>.
+
+The sources for this package were obtained from the Mercury CVS archive,
+but are the same sources as
+ftp://turiel.cs.mu.oz.au/pub/mercury/mercury-0.8.1-compiler.tar.gz
+The only difference is that the tar file contains pre-compiled .c files
+to make bootstrapping easier.
+
+This means if you want to recompile this package, you need to have
+a working Mercury compiler already installed (not to mention a working
+C compiler and other tools).  This can be done by installing the
+Debian binary package, or installing the compiler from the tar file
+shown above.
+
+Copyright:
+
+	The Mercury implementation is free software, but it is Copyright
+	(C) 1994-1996 The University of Melbourne.  It is distributed
+	under the terms of the GNU General Public License.  The Mercury
+	library and runtime (the files in the library and runtime
+	subdirectories) are distributed under the terms of the GNU
+	Library General Public License.  (If those licencing
+	arrangements are not satisfactory, please contact us!  We are
+	willing to offer alternative arrangements, if the need should
+	arise.)
+
+	THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
+	EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+
+The subdirectory `boehm_gc' contains a conservative garbage collector
+distributed by Hans Boehm:
+
+	Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
+	Copyright (c) 1991-1995 by Xerox Corporation.  All rights reserved.
+
+	THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
+	EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+
+	Permission is hereby granted to use or copy this program for any
+	purpose, provided the above notices are retained on all copies.
+	Permission to modify the code and to distribute modified code is
+	granted, provided the above notices are retained, and a notice
+	that the code was modified is included with the above copyright
+	notice.
+
+The program `texi2html' in the doc directory (contained only in source package)
+is copyright by CERN and is distributed under the GNU General Public
+License version 2:
+
+	This program is the intellectual property of the European
+	Laboratory for Particle Physics (known as CERN).  No guarantee
+	whatsoever is provided by CERN.  No liability whatsoever is
+	accepted for any loss or damage of any kind resulting from any
+	defect or inaccuracy in this information or code.
+
+A few files (config.guess, config.sub) are derived from code that is
--- mercury-0.8.1.orig/debian/dirs
+++ mercury-0.8.1/debian/dirs
@@ -0,0 +1,5 @@
+usr/bin
+usr/info
+usr/doc/mercury
+usr/lib
+usr/man/man1
--- mercury-0.8.1.orig/debian/postinst
+++ mercury-0.8.1/debian/postinst
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+install-info --quiet --section "Development" "Development" \
+             --description="The Mercury User's Guide." /usr/info/mercury.info
--- mercury-0.8.1.orig/debian/postrm
+++ mercury-0.8.1/debian/postrm
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+install-info --quiet --remove /usr/info/mercury.info
--- mercury-0.8.1.orig/debian/rules
+++ mercury-0.8.1/debian/rules
@@ -0,0 +1,103 @@
+#!/usr/bin/make -f
+# Sample debian.rules file - for GNU Hello (1.3).
+# Copyright 1994,1995 by Ian Jackson.
+# I hereby give you perpetual unlimited permission to copy,
+# modify and relicense this file, provided that you do not remove
+# my name from the file itself.  (I assert my moral right of
+# paternity under the Copyright, Designs and Patents Act 1988.)
+# This file may have to be extensively modified
+
+package=mercury
+
+MERCURY_DOCS = 	BUGS HISTORY LIMITATIONS NEWS README RELEASE_NOTES \
+		README.Linux WORK_IN_PROGRESS
+MERCURY_MANS =	doc/c2init.1 doc/mmc.1 doc/mgnuc.1 doc/ml.1 doc/msc.1 \
+		doc/mprof.1 
+DEBIAN_DOCS =	debian/README.debian debian/copyright 
+
+# To build, configure as if we are going to install in /usr,
+# then build the compiler. 
+build:
+	$(checkdir)
+	autoconf
+	PATH="/usr/bin:/bin" ./configure --prefix=/usr
+	make
+	touch build
+
+clean:
+	$(checkdir)
+	-rm -f build
+	autoconf
+	./configure
+	-mmake realclean
+	-rm -f config.status config.cache config.log configure.log
+	-rm -f runtime/mercury_conf.h boehm_gc/mercury_boehm_gc_conf.h
+	-rm -f Mmake.common
+	-rm -f configure
+	-rm -f `find . -name "*~"`
+	-rm -rf debian/tmp debian/files* core debian/substvars
+
+binary-indep: checkroot build
+	$(checkdir)
+# There are no architecture-independent files to be uploaded
+# generated by this package.  If there were any they would be
+# made here.
+# XXX This isn't entirely true - all the .int files (and such)
+# are architecture independent. But that's not really worth worrying
+# about.
+
+# To build the binary package, we install into ./debian/tmp/usr
+# However, we have configured as if we are going to install into
+# /usr, so we need to convince the "make install" target to
+# install elsewhere.
+# We override INSTALL_PREFIX to tell it to install to ./debian/tmp/usr.
+# Hardcoded paths should be depending on FINAL_INSTALL_PREFIX instead,
+# which we leave configured for /usr.
+binary-arch: checkroot build
+	$(checkdir)
+	-rm -rf debian/tmp
+	install -d debian/tmp
+	cd debian/tmp;install -d `cat ../dirs`
+	make install INSTALL_PREFIX=`pwd`/debian/tmp/usr ;\
+	cp boehm_gc/README debian/tmp/usr/doc/mercury/README.boehm_gc
+# According to debian policy, samples go in examples
+	cp -r samples debian/tmp/usr/doc/mercury/examples
+# install the various information files into /usr/doc
+	install -m 644 $(MERCURY_DOCS) $(DEBIAN_DOCS) debian/tmp/usr/doc/mercury
+	install -m 644 debian/changelog \
+		debian/tmp/usr/doc/mercury/changelog.Debian
+# install the manpages
+	install -m 644 $(MERCURY_MANS) debian/tmp/usr/man/man1/
+# compress manpages, info pages, and html
+	gzip -9 `find debian/tmp/usr/man -type f 2>/dev/null`
+	gzip -9 `find debian/tmp/usr/info -type f`
+	gzip -9 `find debian/tmp/usr/doc -type f -size +4k ! -name "*.htm*"`
+# strip all executables
+	strip `find debian/tmp -type f -perm +111 | xargs file | fgrep ELF | sed 's/^\([^:]*\):.*$$/\1/'`
+# create DEBIAN directory
+	install -d debian/tmp/DEBIAN
+# install necessary scrips into debian directory
+	install -m 755 debian/postinst debian/postrm debian/tmp/DEBIAN/
+	dpkg-shlibdeps `find debian/tmp -type f -perm +111 | xargs file | fgrep ELF | sed 's/^\([^:]*\):.*$$/\1/'`
+	md5sum `find debian/tmp/* -type f ! -regex "debian/tmp/DEBIAN/.*"` >debian/tmp/DEBIAN/checksums
+	dpkg-gencontrol
+	chown -R root.root debian/tmp
+	chmod -R go=rX debian/tmp
+	dpkg --build debian/tmp ..
+
+define checkdir
+	test -f debian/rules
+endef
+
+# Below here is fairly generic really
+
+binary: binary-indep binary-arch
+
+source diff:
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+checkroot:
+	$(checkdir)
+	test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot

-- 
The quantum sort: 
	while (!sorted) { do_nothing(); }
Tyson Dowd   <tyson at tyse.net>   http://tyse.net/



More information about the developers mailing list