Admin/makerpm
changeset 7488 c49d17fac066
parent 7337 3f8eeb0b6d75
child 7992 6f49fe89bfe1
equal deleted inserted replaced
7487:c0f9b956a3e7 7488:c49d17fac066
    20 function usage()
    20 function usage()
    21 {
    21 {
    22   echo
    22   echo
    23   echo "Usage: $PRG ARCHIVE"
    23   echo "Usage: $PRG ARCHIVE"
    24   echo
    24   echo
    25   echo "Make Isabelle rpm packages for Linux/x86 from distribution ARCHIVE."
    25   echo "Make Isabelle rpm packages for Linux/x86 from the distribution archives."
    26   echo
    26   echo
    27   exit 1
    27   exit 1
    28 }
    28 }
    29 
    29 
    30 function fail()
    30 function fail()
    34 }
    34 }
    35 
    35 
    36 
    36 
    37 ## process command line
    37 ## process command line
    38 
    38 
    39 [ $# -ne 1 ] && usage
    39 [ $# -gt 1 ] && usage
    40 
    40 
    41 ARCHIVE="$1"
    41 ARCHIVE="$1"; shift
    42 shift
    42 
    43 
    43 
    44 
    44 
    45 ## main
    45 ## main
    46 
    46 
    47 [ ! -f "$ARCHIVE" ] && fail "Bad archive file $ARCHIVE"
    47 [ ! -f "$ARCHIVE" ] && fail "Bad archive file $ARCHIVE"
    48 ARCHIVE_BASE=$(basename "$ARCHIVE")
    48 ARCHIVE_BASE=$(basename "$ARCHIVE")
    49 ARCHIVE_FULL=$(cd $(dirname "$ARCHIVE"); echo $PWD)/$ARCHIVE_BASE
    49 ARCHIVE_DIR=$(cd $(dirname "$ARCHIVE"); echo $PWD)
       
    50 ARCHIVE_FULL=$ARCHIVE_DIR/$ARCHIVE_BASE
    50 
    51 
    51 ISABELLE_NAME=$(basename "$ARCHIVE_BASE" .tar.gz)
    52 ISABELLE_NAME=$(basename "$ARCHIVE_BASE" .tar.gz)
    52 ISABELLE_HOME="$ROOT/$ISABELLE_NAME"
    53 ISABELLE_HOME="$ROOT/$ISABELLE_NAME"
    53 
    54 
       
    55 PDF_ARCHIVE_FULL="$ARCHIVE_DIR/${ISABELLE_NAME}_pdf.tar.gz"
       
    56 [ ! -f "$PDF_ARCHIVE_FULL" ] && PDF_ARCHIVE_FULL=""
       
    57 
    54 
    58 
    55 # prep
    59 # prep
    56 
    60 
    57 TMP="/tmp/isabelle-makerpm$$"
    61 TMP="/tmp/isabelle-makerpm$$"
    58 for D in "BUILD$ROOT" RPMS/i386 SOURCES SPECS SRPMS; do mkdir -p "$TMP/$D"; done
    62 for D in "BUILD$ROOT" RPMS/i386 SOURCES SPECS SRPMS; do mkdir -p "$TMP/$D"; done
    59 
    63 
    60 cd "$TMP/BUILD$ROOT"
    64 cd "$TMP/BUILD$ROOT"
    61 tar -xpzf "$ARCHIVE_FULL"
    65 tar -xpzf "$ARCHIVE_FULL"
       
    66 [ -n "$PDF_ARCHIVE_FULL" ] && tar -xpzf "$PDF_ARCHIVE_FULL"
    62 
    67 
    63 
    68 
    64 # build
    69 # build
    65 
    70 
    66 cd "$TMP/BUILD$ROOT/$ISABELLE_NAME"
    71 cd "$TMP/BUILD$ROOT/$ISABELLE_NAME"
    67 ( PATH=/bin:$PATH; BASH_PATH=/bin/bash PERL_PATH=/usr/bin/perl ./configure )
    72 ( env BASH_PATH=/bin/bash PERL_PATH=/usr/bin/perl ./configure )
    68 ./build -bi $LOGICS
    73 ./build -bi $LOGICS
    69 COMPILER=$(./bin/isatool getenv -b ML_IDENTIFIER)
    74 COMPILER=$(./bin/isatool getenv -b ML_IDENTIFIER)
    70 rm -f heaps/${COMPILER}/Pure heaps/${COMPILER}/FOL heaps/${COMPILER}/TLA
    75 rm -f heaps/${COMPILER}/Pure heaps/${COMPILER}/FOL heaps/${COMPILER}/TLA
    71 
    76 
    72 
    77 
   141 Logics are not hard-wired into Isabelle, but formulated within
   146 Logics are not hard-wired into Isabelle, but formulated within
   142 Isabelle's meta logic: Isabelle/Pure.  There are quite a lot of
   147 Isabelle's meta logic: Isabelle/Pure.  There are quite a lot of
   143 syntactic and deductive tools available in generic Isabelle.  Isabelle
   148 syntactic and deductive tools available in generic Isabelle.  Isabelle
   144 proof tools provide a high degree of automation.
   149 proof tools provide a high degree of automation.
   145 
   150 
   146 
       
   147 %package	HOL
   151 %package	HOL
   148 Summary:	Isabelle Theorem Proving Environment -- Higher-Order Logic
   152 Summary:	Isabelle Theorem Proving Environment -- Higher-Order Logic
   149 Group:		Applications/Math
   153 Group:		Applications/Math
   150 Requires:       isabelle
   154 Requires:       isabelle
   151 %description HOL
   155 %description HOL
   152 This package contains a binary image of the HOL object-logic for Isabelle.
   156 This package contains a binary image of the HOL object-logic for Isabelle.
   153 
       
   154 
   157 
   155 %package	HOL-Real
   158 %package	HOL-Real
   156 Summary:	Isabelle Theorem Proving Environment -- Higher-Order Logic
   159 Summary:	Isabelle Theorem Proving Environment -- Higher-Order Logic
   157 Group:		Applications/Math
   160 Group:		Applications/Math
   158 Requires:       isabelle
   161 Requires:       isabelle
   159 %description HOL-Real
   162 %description HOL-Real
   160 This package contains a binary image of the HOL object-logic for Isabelle,
   163 This package contains a binary image of the HOL object-logic for Isabelle,
   161 including support for real numbers.
   164 including support for real numbers.
   162 
   165 
   163 
       
   164 %package	ZF
   166 %package	ZF
   165 Summary:	Isabelle Theorem Proving Environment -- Zermelo-Fraenkel set theory
   167 Summary:	Isabelle Theorem Proving Environment -- Zermelo-Fraenkel set theory
   166 Group:		Applications/Math
   168 Group:		Applications/Math
   167 Requires:       isabelle
   169 Requires:       isabelle
   168 %description ZF
   170 %description ZF
   169 This package contains a binary image of the ZF object-logic for Isabelle.
   171 This package contains a binary image of the ZF object-logic for Isabelle.
       
   172 
       
   173 %package	pdfdocs
       
   174 Summary:	Isabelle Theorem Proving Environment -- PDF documentation
       
   175 Group:		Applications/Math
       
   176 Requires:       isabelle
       
   177 %description pdfdocs
       
   178 This package contains the Isabelle documentation in PDF.  Note that
       
   179 the dvi version is already part of the base package.
   170 
   180 
   171 
   181 
   172 %prep
   182 %prep
   173 
   183 
   174 %build
   184 %build
   179 \$RPM_INSTALL_PREFIX/$ISABELLE_NAME/bin/isatool install -p $BIN
   189 \$RPM_INSTALL_PREFIX/$ISABELLE_NAME/bin/isatool install -p $BIN
   180 
   190 
   181 %post HOL
   191 %post HOL
   182 %post HOL-Real
   192 %post HOL-Real
   183 %post ZF
   193 %post ZF
       
   194 %post pdfdocs
   184 
   195 
   185 %postun
   196 %postun
   186 rm -f $BIN/Isabelle $BIN/isabelle $BIN/isatool
   197 rm -f $BIN/Isabelle $BIN/isabelle $BIN/isatool
   187 
   198 
   188 %postun HOL
   199 %postun HOL
   189 %postun HOL-Real
   200 %postun HOL-Real
   190 %postun ZF
   201 %postun ZF
       
   202 %postun pdfdocs
   191 
   203 
   192 
   204 
   193 %files HOL
   205 %files HOL
   194 $ISABELLE_HOME/heaps/${COMPILER}/HOL
   206 $ISABELLE_HOME/heaps/${COMPILER}/HOL
   195 
   207 
   197 $ISABELLE_HOME/heaps/${COMPILER}/HOL-Real
   209 $ISABELLE_HOME/heaps/${COMPILER}/HOL-Real
   198 
   210 
   199 %files ZF
   211 %files ZF
   200 $ISABELLE_HOME/heaps/${COMPILER}/ZF
   212 $ISABELLE_HOME/heaps/${COMPILER}/ZF
   201 
   213 
       
   214 %files pdfdocs
       
   215 EOF
       
   216 
       
   217 for F in $(ls -1 doc/*.pdf); do
       
   218   echo "$ISABELLE_HOME/$F" >>$TMP/SPECS/isabelle.spec
       
   219 done
       
   220 
       
   221 
       
   222 cat >>$TMP/SPECS/isabelle.spec <<EOF
   202 %files
   223 %files
   203 %dir $ISABELLE_HOME
   224 %dir $ISABELLE_HOME
       
   225 %dir $ISABELLE_HOME/doc
   204 %dir $ISABELLE_HOME/heaps
   226 %dir $ISABELLE_HOME/heaps
   205 %dir $ISABELLE_HOME/heaps/${COMPILER}
   227 %dir $ISABELLE_HOME/heaps/${COMPILER}
   206 EOF
   228 EOF
   207 
   229 
   208 for F in $(ls -1 | grep -v heaps | grep -v browser_info)
   230 for F in $(ls -1 | grep -v heaps | grep -v browser_info | grep -v doc); do
   209 do
   231   echo "$ISABELLE_HOME/$F" >>$TMP/SPECS/isabelle.spec
       
   232 done
       
   233 
       
   234 for F in $(ls -1 doc/* | grep -v pdf); do
   210   echo "$ISABELLE_HOME/$F" >>$TMP/SPECS/isabelle.spec
   235   echo "$ISABELLE_HOME/$F" >>$TMP/SPECS/isabelle.spec
   211 done
   236 done
   212 
   237 
   213 
   238 
   214 # invoke rpm
   239 # invoke rpm
   222 cd "$TMP/RPMS/i386"
   247 cd "$TMP/RPMS/i386"
   223 cp "isabelle-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle.rpm"
   248 cp "isabelle-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle.rpm"
   224 cp "isabelle-HOL-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-HOL.i386.rpm"
   249 cp "isabelle-HOL-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-HOL.i386.rpm"
   225 cp "isabelle-HOL-Real-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-HOL-Real.i386.rpm"
   250 cp "isabelle-HOL-Real-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-HOL-Real.i386.rpm"
   226 cp "isabelle-ZF-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-ZF.i386.rpm"
   251 cp "isabelle-ZF-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-ZF.i386.rpm"
       
   252 cp "isabelle-pdfdocs-$RPMVERSION-1.i386.rpm" "$DISTBASE/rpm/isabelle-pdfdocs.rpm"
   227 
   253 
   228 # clean up
   254 # clean up
   229 cd /
   255 cd /
   230 rm -rf "$TMP"
   256 rm -rf "$TMP"