Browse Source

* samplecfg updated

peter 26 years ago
parent
commit
2cb7686459
4 changed files with 192 additions and 43 deletions
  1. 1 4
      install/debian/fp-compiler.postinst
  2. 4 6
      install/fpc-0.99.12.spec
  3. 150 0
      install/install.sh
  4. 37 33
      install/makepack

+ 1 - 4
install/debian/fp-compiler.postinst

@@ -6,10 +6,7 @@ FPCDIR=/usr/lib/fpc/0.99.12
 ln -sf $FPCDIR/ppc386 /usr/bin/ppc386
 
 # create /etc/ppc386.cfg
-GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
-GCCDIR=`dirname $GCCSPEC`
-
-$FPCDIR/samplecfg $FPCDIR $GCCDIR
+$FPCDIR/samplecfg $FPCDIR
 
 # update ld.so cache
 # ldconfig

+ 4 - 6
install/fpc-0.99.12.spec

@@ -53,12 +53,8 @@ FPCDIR=%{fpcdir}
 # create link
 ln -sf $FPCDIR/ppc386 /usr/bin/ppc386
 
-# create /etc/ppc386.cfg
-GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
-GCCDIR=`dirname $GCCSPEC`
-
-chmod 755 $FPCDIR/samplecfg
-$FPCDIR/samplecfg $FPCDIR $GCCDIR
+# Create config
+$FPCDIR/samplecfg $FPCDIR
 
 # update ld.so cache
 ldconfig
@@ -76,6 +72,8 @@ ldconfig
 /usr/man/man1/ppc386.1
 /usr/man/man1/ptop.1
 /usr/man/man1/ppudump.1
+/usr/man/man1/ppumove.1
+/usr/man/man1/ppdep.1
 /usr/man/man5/ppc386.cfg.5
 /usr/man/man5/ptop.cfg.5
 %{docdir}/demo

+ 150 - 0
install/install.sh

@@ -0,0 +1,150 @@
+#!/bin/sh
+#
+# Free Pascal installation script for Linux.
+# Michael Van Canneyt, 1996-1999
+#
+# Don't edit this file. 
+# Everything can be set when the script is run.
+#
+
+# Release Version
+VERSION=0.99.12
+
+# some useful functions
+# ask displays 1st parameter, and ask new value for variable, whose name is
+# in the second parameter.
+ask ()
+{
+askvar=$2
+eval old=\$$askvar
+eval echo -n \""$1 [$old] : "\" 
+read $askvar
+eval test -z \"\$$askvar\" && eval $askvar=\'$old\'
+}
+# yesno gives 1 on no, 0 on yes $1 gives text to display.
+yesno ()
+{
+  while true; do
+  echo -n "$1 (Y/N) ? "
+  read ans
+  case $ans in
+   y|Y) return 0;;
+   n|N) return 1;;
+  esac
+  done
+}
+
+# Untar files ($3,optional) from  file ($1) to the given directory ($2)
+unztar ()
+{
+ tar -xzf $HERE/$1 --directory $2 $3
+}
+
+# Make all the necessary directories to get $1
+makedirhierarch ()
+{
+  OLDDIR=`pwd`
+  case $1 in
+    /*) cd /;;
+  esac
+  OLDIFS=$IFS;IFS=/;eval set $1; IFS=$OLDIFS
+  for i
+  do
+    test -d $i || mkdir $i || break
+    cd $i ||break
+  done
+  cd $OLDDIR
+}
+
+# check to see if something is in the path
+checkpath ()
+{
+ ARG=$1
+ OLDIFS=$IFS; IFS=":";eval set $PATH;IFS=$OLDIFS
+ for i
+ do
+   if [ $i = $ARG ]; then
+     return 0
+   fi
+ done 
+ return 1
+}
+
+# Here we start the thing.
+
+# Set some defaults.
+LIBDIR=/usr/lib/fpc/$VERSION
+SRCDIR=/usr/src/fpc-$VERSION
+DOCDIR=/usr/doc/fpc-$VERSION
+DEMODIR=$DOCDIR/demo
+
+HERE=`pwd`
+if checkpath /usr/local/bin; then
+   EXECDIR=/usr/local/bin
+else
+   EXECDIR=/usr/bin
+fi
+
+# welcome message.
+clear
+echo "This shell script will attempt to install the Free Pascal Compiler"
+echo "version $VERSION" in the directories of your choice.
+echo 
+
+# Install libraries. Mandatory.
+
+ask "Install libraries in" LIBDIR 
+echo Installing libraries in $LIBDIR ...
+makedirhierarch $LIBDIR
+unztar libs.tar.gz $LIBDIR
+echo Done.
+echo
+
+# Install the program. Mandatory.
+
+ask "Install program in" EXECDIR
+echo Installing program in $EXECDIR ...
+makedirhierarch $EXECDIR
+ln -sf $LIBDIR/ppc386 $EXECDIR/ppc386
+echo Done.
+echo
+
+# Install the sources. Optional.
+if yesno "Install sources"; then
+  ask "Install sources in" SRCDIR
+  echo Installing sources in $SRCDIR ...
+  makedirhierarch $SRCDIR
+  unztar sources.tar.gz $SRCDIR
+  echo Done.
+fi
+echo
+
+# Install the documentation. Optional.
+if yesno "Install documentation"; then
+  ask "Install documentation in" DOCDIR
+  echo Installing documentation in $DOCDIR ...
+  makedirhierarch $DOCDIR
+  unztar docs.tar.gz $DOCDIR
+  echo Done.
+fi
+echo
+
+# Install the demos. Optional.
+if yesno "Install demos"; then
+  ask "Install demos in" DEMODIR
+  echo Installing demos in $DEMODIR ...
+  makedirhierarch $DEMODIR
+  unztar demo.tar.gz $DEMODIR
+  echo Done.
+fi
+echo
+
+# Install /etc/ppc386.cfg, this is done using the samplecfg script
+$LIBDIR/samplecfg $LIBDIR
+
+# The End
+echo
+echo End of installation. 
+echo
+echo Refer to the documentation for more information.
+echo

+ 37 - 33
install/makepack

@@ -1,23 +1,24 @@
 #!/bin/sh
 #
 # Shell script to make a FPK package for Linux
-# Michael Van Canneyt, 1996
+# Michael Van Canneyt, 1996-1999
 #
 
 # Set some environment vars to suit the setup
 
+VERSION=0.99.12
 
-LIBS=/usr/lib/fpc/0.99.8
-#LIBS=/usr/lib/ppc/aout/0.99.5
-SRC=/usr/local/fpk/dist/src
-DOCS=/usr/doc/fpc
-DEMO=/usr/local/fpk/install/demo
-PPUMOVE=`which ppumove`
-DUMPPPU=`which ppudump`
-H2PAS=`which h2pas`
-LIBGCCPATH=/usr/lib/gcc-lib/i486-linux/2.7.2.1
-VERSION=0.99.8
-FPCDIR=fpc-${VERSION}
+FPCDIR=fpc-$VERSION
+LIBS=/usr/lib/fpc/$VERSION
+#LIBS=/usr/lib/fpc/aout/$VERSION
+SRC=/usr/src/fpc-$VERSION
+DOCS=/usr/doc/fpc-$VERSION
+DEMO=$SRC/demo
+PPUMOVE=/usr/bin/ppumove
+PPUDUMP=/usr/bin/ppumove
+H2PAS=/usr/bin/h2pas
+PTOP=/usr/bin/ptop
+PPDEP=/usr/bin/ppdep
 # the following should be ELF or aout
 RELEASE=ELF
 #RELEASE=aout
@@ -25,50 +26,53 @@ echo Using the following params :
 echo
 echo Version is : $VERSION , system : $RELEASE
 echo Libs are in $LIBS
-echo libgcc is in $LIBGCCPATH
 echo Sources are in $SRC
 echo Documentation is in $DOCS
 echo Demos are in $DEMO 
-echo dumpppu is $DUMPPPU
+echo ppudump is $PPUDUMP
 echo ppumove is $PPUMOVE
+echo ptop is $PTOP
 echo h2pas is $H2PAS
+echo ppdep is $PPDEP
 echo
-echo making in directory ${FPCDIR}
+echo making in directory $FPCDIR
 echo
 # do what is necessary...
 # first, make all needed things
-echo Creating directory ${FPCDIR}
-mkdir ${FPCDIR}
+echo Creating directory $FPCDIR
+mkdir $FPCDIR
 echo Making sources package. 
 rm -f `find $SRC -name '.#*'` 
 rm -rf `find $SRC -name CVS -type d` 
-tar -cvzf ${FPCDIR}/sources.tar.gz --exclude CVS -C $SRC rtl docs compiler >sources.list
+tar -cvzf $FPCDIR/sources.tar.gz --exclude CVS -C $SRC base rtl docs compiler utils >sources.list
 echo Making libs package.
 # No gzip, because then we cannot add libgcc.
-tar -cvf ${FPCDIR}/libs.tar -C $LIBS . >libs.list
+tar -cvf $FPCDIR/libs.tar -C $LIBS . >libs.list
 # Add libfpc.so !!
-tar -rvf ${FPCDIR}/libs.tar -C /usr/lib libfpc.so >libs.list
+#tar -rvf $FPCDIR/libs.tar -C /usr/lib libfpc.so >libs.list
 # We have to add libgcc.a to this package. (not everyone has GCC installed !)
-tar -rvf ${FPCDIR}/libs.tar -C $LIBGCCPATH libgcc.a >>libs.list
+#tar -rvf $FPCDIR/libs.tar -C $LIBGCCPATH libgcc.a >>libs.list
 # only now we gzip the libs.tar
-gzip ${FPCDIR}/libs.tar
+gzip $FPCDIR/libs.tar
 echo Making bins package.
-tar -cvf ${FPCDIR}/bins.tar -C `dirname $PPUMOVE` ppumove >bins.list
-tar -rvf ${FPCDIR}/bins.tar -C `dirname $DUMPPPU` ppudump >>bins.list
-tar -rvf ${FPCDIR}/bins.tar -C `dirname $H2PAS` h2pas >>bins.list
-gzip ${FPCDIR}/bins.tar
+tar -cvf $FPCDIR/bins.tar -C `dirname $PPUMOVE` ppumove >bins.list
+tar -rvf $FPCDIR/bins.tar -C `dirname $PPUDUMP` ppudump >>bins.list
+tar -rvf $FPCDIR/bins.tar -C `dirname $H2PAS` h2pas >>bins.list
+tar -rvf $FPCDIR/bins.tar -C `dirname $PTOP` ptop >>bins.list
+tar -rvf $FPCDIR/bins.tar -C `dirname $PPDEP` ppdep >>bins.list
+gzip $FPCDIR/bins.tar
 echo Making docs package.
 rm -f `find $DOCS -name '.#*'` 
-tar -cvzf ${FPCDIR}/docs.tar.gz --exclude CVS -C $DOCS . >docs.list
+tar -cvzf $FPCDIR/docs.tar.gz --exclude CVS -C $DOCS . >docs.list
 echo Making demo package.
-tar -cvzf ${FPCDIR}/demo.tar.gz --exclude CVS -C $DEMO . >demo.list
+tar -cvzf $FPCDIR/demo.tar.gz --exclude CVS -C $DEMO . >demo.list
 echo Copying install files.
-cp install.sh ${FPCDIR}
+cp install.sh $FPCDIR
 # then, pack everything together.
 echo Putting everything together.
-tar -cf fpc-${VERSION}.${RELEASE}.tar ${FPCDIR}
-cp ${FPCDIR}/* /home/ftp/pub/fpc/dist/separate 
-echo Removing directory ${FPCDIR}.
-rm -rf ${FPCDIR}
+tar -cf fpc-$VERSION.$RELEASE.tar $FPCDIR
+#cp $FPCDIR/* /home/ftp/pub/fpc/dist/separate 
+echo Removing directory $FPCDIR.
+rm -rf $FPCDIR
 # that's it.
 echo Done.