author wenzelm
Tue, 21 Sep 1999 17:07:28 +0200
changeset 7554 30327f9f6b4a
parent 7488 c49d17fac066
child 7992 6f49fe89bfe1
permissions -rwxr-xr-x
differ: compare actual props only (hyps may changed due to trivial steps involving assumptions);

# $Id$
# makerpm -- make Isabelle rpm packages for Linux/x86 from the distribution.

## global settings


## diagnostics

PRG=$(basename $0)

function usage()
  echo "Usage: $PRG ARCHIVE"
  echo "Make Isabelle rpm packages for Linux/x86 from the distribution archives."
  exit 1

function fail()
  echo "$1" >&2
  exit 2

## process command line

[ $# -gt 1 ] && usage

ARCHIVE="$1"; shift

## main

[ ! -f "$ARCHIVE" ] && fail "Bad archive file $ARCHIVE"
ARCHIVE_DIR=$(cd $(dirname "$ARCHIVE"); echo $PWD)

ISABELLE_NAME=$(basename "$ARCHIVE_BASE" .tar.gz)


# prep

for D in "BUILD$ROOT" RPMS/i386 SOURCES SPECS SRPMS; do mkdir -p "$TMP/$D"; done

tar -xpzf "$ARCHIVE_FULL"
[ -n "$PDF_ARCHIVE_FULL" ] && tar -xpzf "$PDF_ARCHIVE_FULL"

# build

( env BASH_PATH=/bin/bash PERL_PATH=/usr/bin/perl ./configure )
./build -bi $LOGICS
COMPILER=$(./bin/isatool getenv -b ML_IDENTIFIER)
rm -f heaps/${COMPILER}/Pure heaps/${COMPILER}/FOL heaps/${COMPILER}/TLA

# rpm spec

RPMVERSION=$(echo "$ISABELLE_NAME" | perl -w \
  -e '$name = <STDIN>;' \
  -e 'if ($name =~ m/^Isabelle(\d+)$/) {' \
  -e '  $rpmversion = "$1";' \
  -e '} elsif ($name =~ m/^Isabelle(\d+)-(\d+)$/) {' \
  -e '  $rpmversion = "$1p$2";' \
  -e '} elsif ($name =~ m/^Isabelle_(\d+)-(\w+)-(\d+)$/) {' \
  -e '  $rpmversion = "$1$2$3";' \
  -e '} else {' \
  -e '  $rpmversion = "";' \
  -e '};' \
  -e 'print $rpmversion;')

[ -z "$RPMVERSION" ] && fail "Unable to derive package version from $ISABELLE_NAME"

cat >$TMP/SPECS/isabelle.spec <<EOF
Summary:	Isabelle Theorem Proving Environment
Name:		isabelle
Release:	1
Group:		Applications/Math
Copyright:	University of Cambridge Computer Laboratory
Packager:	Markus Wenzel <>
Prefix:		$ROOT
BuildRoot:	$TMP/BUILD


This package contains the full source distribution of Isabelle
together with documentation.  To make it actually run you still need
the SML/NJ 110 compiler and any of the precompiled Isabelle
object-logics (e.g. package isabelle-HOL).

Isabelle is a popular generic theorem proving environment developed at
Cambridge University (Larry Paulson) and TU Munich (Tobias Nipkow).
The system can be viewed from two main perspectives.  On the one hand
it may serve as a generic framework for rapid prototyping of deductive
systems.  On the other hand, major existing logics like Isabelle/HOL
provide a theorem proving environment ready to use for sizable

The Isabelle distribution includes a large body of object logics and
other examples (see also the Isabelle theory library at  Isabelle/HOL
is a version of classical higher-order logic resembling that of the
HOL System.  Isabelle/HOLCF adds Scott's Logic for Computable
Functions (domain theory) to HOL.  Isabelle/FOL provides basic
classical and intuitionistic first-order logic.  It is polymorphic.
Isabelle/ZF offers a formulation of Zermelo-Fraenkel set theory on top
of FOL.

Isabelle/HOL is currently the best developed object logic, including
an extensive library of (concrete) mathematics, and various packages
for advanced definitional concepts (like (co-)inductive sets and
types, well-founded recursion etc.).  The distribution also includes
some large applications, for example correctness proofs of
cryptographic protocols (HOL/Auth) or communication protocols

Isabelle/ZF provides another starting point for applications, with a
slightly less developed library.  Its definitional packages are
similar to those of Isabelle/HOL.  Untyped ZF provides more advanced
constructions for sets than simply-typed HOL.

Logics are not hard-wired into Isabelle, but formulated within
Isabelle's meta logic: Isabelle/Pure.  There are quite a lot of
syntactic and deductive tools available in generic Isabelle.  Isabelle
proof tools provide a high degree of automation.

%package	HOL
Summary:	Isabelle Theorem Proving Environment -- Higher-Order Logic
Group:		Applications/Math
Requires:       isabelle
%description HOL
This package contains a binary image of the HOL object-logic for Isabelle.

%package	HOL-Real
Summary:	Isabelle Theorem Proving Environment -- Higher-Order Logic
Group:		Applications/Math
Requires:       isabelle
%description HOL-Real
This package contains a binary image of the HOL object-logic for Isabelle,
including support for real numbers.

%package	ZF
Summary:	Isabelle Theorem Proving Environment -- Zermelo-Fraenkel set theory
Group:		Applications/Math
Requires:       isabelle
%description ZF
This package contains a binary image of the ZF object-logic for Isabelle.

%package	pdfdocs
Summary:	Isabelle Theorem Proving Environment -- PDF documentation
Group:		Applications/Math
Requires:       isabelle
%description pdfdocs
This package contains the Isabelle documentation in PDF.  Note that
the dvi version is already part of the base package.




\$RPM_INSTALL_PREFIX/$ISABELLE_NAME/bin/isatool install -p $BIN

%post HOL
%post HOL-Real
%post ZF
%post pdfdocs

rm -f $BIN/Isabelle $BIN/isabelle $BIN/isatool

%postun HOL
%postun HOL-Real
%postun ZF
%postun pdfdocs

%files HOL

%files HOL-Real

%files ZF

%files pdfdocs

for F in $(ls -1 doc/*.pdf); do
  echo "$ISABELLE_HOME/$F" >>$TMP/SPECS/isabelle.spec

cat >>$TMP/SPECS/isabelle.spec <<EOF
%dir $ISABELLE_HOME/heaps

for F in $(ls -1 | grep -v heaps | grep -v browser_info | grep -v doc); do
  echo "$ISABELLE_HOME/$F" >>$TMP/SPECS/isabelle.spec

for F in $(ls -1 doc/* | grep -v pdf); do
  echo "$ISABELLE_HOME/$F" >>$TMP/SPECS/isabelle.spec

# invoke rpm

chown -R root:root "$TMP" || chgrp -R isabelle "$TMP"

echo "topdir: $TMP" >"$TMP/rpmrc"
rpm --rcfile "$TMP/rpmrc" -bb "$TMP/SPECS/isabelle.spec"

mkdir -p "$DISTBASE/rpm"
cd "$TMP/RPMS/i386"
cp "isabelle-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle.rpm"
cp "isabelle-HOL-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-HOL.i386.rpm"
cp "isabelle-HOL-Real-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-HOL-Real.i386.rpm"
cp "isabelle-ZF-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-ZF.i386.rpm"
cp "isabelle-pdfdocs-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-pdfdocs.rpm"

# clean up
cd /
rm -rf "$TMP"