From 98147eb13c6b7a2053019a8deff9d5ee0963aec6 Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 13 Jul 2003 09:46:48 +0000 Subject: [PATCH] updated deb creation git-svn-id: trunk@4395 - --- tools/install/build_fpcsrc_rpm.sh | 89 ++++++++++++++++--- tools/install/create_fpc_deb.sh | 2 +- .../install/create_fpc_tgz_from_local_dir.sh | 2 +- tools/install/debian_fpcsrc/changelog | 11 ++- tools/install/debian_fpcsrc/control | 14 +-- 5 files changed, 95 insertions(+), 23 deletions(-) diff --git a/tools/install/build_fpcsrc_rpm.sh b/tools/install/build_fpcsrc_rpm.sh index 1e4f27b1d4..9024fdf763 100644 --- a/tools/install/build_fpcsrc_rpm.sh +++ b/tools/install/build_fpcsrc_rpm.sh @@ -7,7 +7,13 @@ set -e #------------------------------------------------------------------------------ # parse parameters #------------------------------------------------------------------------------ -Usage="Usage: $0 " +Usage="Usage: $0 [deb] " + +PkgType=rpm +if [ "x$1" = "xdeb" ]; then + PkgType=deb + shift +fi FPCSourceDir=$1 shift @@ -23,7 +29,6 @@ if [ "x$LazRelease" = "x" ]; then exit -1 fi - #------------------------------------------------------------------------------ # patching #------------------------------------------------------------------------------ @@ -39,21 +44,83 @@ if [ "$CompilerPatch" != "0" ]; then fi FPCTGZ=fpcsrc-$LazVersion-$LazRelease.tgz +CurDir=`pwd` # pack the directory ./create_fpc_tgz_from_local_dir.sh $FPCSourceDir $FPCTGZ -# copy src tgz into rpm building directory -cp $FPCTGZ /usr/src/redhat/SOURCES/ +if [ "$PkgType" = "deb" ]; then + # build fpcsrc rpm -# create spec file -SpecFile=fpcsrc-$LazVersion-$LazRelease.spec -cat fpcsrc.spec | \ - sed -e "s/LAZVERSION/$LazVersion/g" -e "s/LAZRELEASE/$LazRelease/" \ - > $SpecFile + echo building fpcsrc rpm ... -# build rpm -rpmbuild -ba $SpecFile || rpm -ba $SpecFile + # copy src tgz into rpm building directory + cp $FPCTGZ /usr/src/redhat/SOURCES/ + + # create spec file + SpecFile=fpcsrc-$LazVersion-$LazRelease.spec + cat fpcsrc.spec | \ + sed -e "s/LAZVERSION/$LazVersion/g" -e "s/LAZRELEASE/$LazRelease/" \ + > $SpecFile + + # build rpm + rpmbuild -ba $SpecFile || rpm -ba $SpecFile + +else + # build fpcsrc deb + + echo building fpcsrc deb ... + + FPCSrcTmpDir=/tmp/fpcsrc$LazVersion + FPCSrcBuildDir=$FPCSrcTmpDir/fpcsrc_build + FPCSrcDeb=fpcsrc-$LazVersion-$LazRelease.deb + DebianSrcDir=$CurDir/debian_fpcsrc + + echo "Build directory is $FPCSrcBuildDir" + if [ x$FPCSrcBuildDir = x/ ]; then + echo "ERROR: invalid build directory" + exit + fi + rm -rf $FPCSrcBuildDir + + # Unpack fpc source + echo "unpacking $SrcTGZ ..." + mkdir -p $FPCSrcBuildDir/usr/share/ + cd $FPCSrcBuildDir/usr/share/ + tar xzf $CurDir/$SrcTGZ + mv fpc fpcsrc + cd - + + # create control file + echo "copying control file" + mkdir -p $FPCSrcBuildDir/DEBIAN + cat $DebianSrcDir/control | \ + sed -e "s/FPCVERSION/$LazVersion-$LazRelease/g" \ + > $FPCSrcBuildDir/DEBIAN/control + + # copyright and changelog files + echo "copying copyright and changelog files" + mkdir -p $FPCSrcBuildDir/usr/share/doc/fpcsrc + cat $DebianSrcDir/changelog | \ + sed -e "s/FPCVERSION/$LazVersion-$LazRelease/g" \ + > $FPCSrcBuildDir/usr/share/doc/fpcsrc/changelog + cp $DebianSrcDir/{copyright,changelog.Debian} $FPCSrcBuildDir/usr/share/doc/fpcsrc/ + gzip --best $FPCSrcBuildDir/usr/share/doc/fpcsrc/changelog + gzip --best $FPCSrcBuildDir/usr/share/doc/fpcsrc/changelog.Debian + + # fixing permissions + echo "fixing permissions ..." + find $FPCSrcBuildDir -type d | xargs chmod 755 # this is necessary on Debian Woody, don't ask me why + + # creating deb + echo "creating deb ..." + cd $TempDir + fakeroot dpkg-deb --build $FPCSrcBuildDir + mv $FPCSrcBuildDir.deb $FPCSrcDeb + echo "`pwd`/$FPCSrcDeb created." + cd - + +fi # end. diff --git a/tools/install/create_fpc_deb.sh b/tools/install/create_fpc_deb.sh index 605fb3feeb..00cc5c9c8c 100644 --- a/tools/install/create_fpc_deb.sh +++ b/tools/install/create_fpc_deb.sh @@ -135,7 +135,7 @@ gzip --best $FPCSrcBuildDir/usr/share/doc/fpcsrc/changelog.Debian # fixing permissions echo "fixing permissions ..." -find $FPCSrcBuildDir -type d | xargs chmod 755 # this is necessary on Debian Woody, don't ask me why +find $FPCSrcBuildDir -type d | xargs chmod 755 # this is necessary on Debian Woody, don't ask me why # creating deb echo "creating deb ..." diff --git a/tools/install/create_fpc_tgz_from_local_dir.sh b/tools/install/create_fpc_tgz_from_local_dir.sh index d56fd2fd9a..cf7936ddc1 100644 --- a/tools/install/create_fpc_tgz_from_local_dir.sh +++ b/tools/install/create_fpc_tgz_from_local_dir.sh @@ -36,7 +36,7 @@ echo "cleaning up (CVS, ppu, o) ..." cd $TmpDir make distclean -for Ext in ppu ppw ppl o ow rst; do +for Ext in ppu ppw ppl o ow rst cvsignore; do find . -name "*.$Ext" -exec rm -f {} \; done rm -f *.tar.gz diff --git a/tools/install/debian_fpcsrc/changelog b/tools/install/debian_fpcsrc/changelog index 88817caab3..68f6f152f8 100644 --- a/tools/install/debian_fpcsrc/changelog +++ b/tools/install/debian_fpcsrc/changelog @@ -1,7 +1,12 @@ -fpcsrc (FPCVERSION) +fpcsrc (1.0.10) + + * Bugfixes + + -- Mattias Gaertner 07/13/2003 + +fpcsrc (1.0.7) * Started package - -- Mattias Gaertner FPCDATE + -- Mattias Gaertner 05/03/2003 - diff --git a/tools/install/debian_fpcsrc/control b/tools/install/debian_fpcsrc/control index 0e7e3fe947..dc4795903d 100644 --- a/tools/install/debian_fpcsrc/control +++ b/tools/install/debian_fpcsrc/control @@ -5,10 +5,10 @@ Priority: optional Maintainer: Mattias Gaertner Architecture: i386 Description: Free Pascal Sources - The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible - 32bit Pascal Compiler. It comes with fully TP 7.0 compatible - run-time library. - Some extensions are added to the language, like function overloading. - Shared libraries can be linked and created. Basic Delphi support is - already implemented (classes,exceptions,ansistrings). This package - contains the sources for the compiler, the rtl, fcl and packages. + The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit + Pascal Compiler. It comes with fully TP 7.0 compatible run-time library. + Some extensions are added to the language, like function overloading. Shared + libraries can be linked and created. Basic Delphi support is already + implemented (classes,exceptions,ansistrings). This package contains the + sources for the compiler, the rtl, fcl and packages. +