From 40339eafeacae0dee25216f62bf987ce6b623106 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 5 Apr 2003 08:46:39 +0000 Subject: [PATCH] fixed creating lazarus debs git-svn-id: trunk@4015 - --- tools/install/README | 1 + tools/install/create_lazarus_deb.sh | 46 ++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/tools/install/README b/tools/install/README index 9075336d3f..218adc12ed 100644 --- a/tools/install/README +++ b/tools/install/README @@ -86,6 +86,7 @@ Debian: Creating the debian fpc packages: + You need the debhelper, tetex-bin, tetex-extra, awk, dvipdfm, latex2html packages. See install/debian/README.debian for changing /etc/texmf/texmf.cnf. diff --git a/tools/install/create_lazarus_deb.sh b/tools/install/create_lazarus_deb.sh index 5428ba4f93..c754fb7790 100644 --- a/tools/install/create_lazarus_deb.sh +++ b/tools/install/create_lazarus_deb.sh @@ -1,14 +1,37 @@ #!/bin/bash -#set -x + +set -x set -e +# get installed fpc version +FPCDeb=`dpkg -l | grep fp-compiler` +if [ "x$FPCDeb" = "x" ]; then + echo ERROR: fp-compiler deb not installed + exit +fi + +# get date of day +Year=`date +%y` +Month=`date +%m` +Day=`date +%d` + +Date=20$Year$Month$Day +LazVersion=0.8.5.2 +LazRelease=`dpkg -s fp-compiler | grep '^Version' | sed -e 's/Version: //'` +LazRelease=`echo $LazRelease | sed -e 's/-/_/g'` +SrcTGZ=lazarus-$Date.tgz CurDir=`pwd` -TempDir=/tmp/lazarus_temp -LazBuildDir=$TempDir/lazarus_build -LazTGZ=$CurDir/lazarus-0.8.5.tgz -LazDeb=lazarus-0.8.5-2.deb +TmpDir=/tmp/lazarus$LazVersion +LazBuildDir=$TmpDir/lazarus_build +LazDeb=$CurDir/lazarus-$LazVersion-fpc_$LazRelease.deb DebianSrcDir=$CurDir/debian_lazarus LazDestDir=$LazBuildDir/usr/share/lazarus +FPCVersion=`echo $LazRelease | sed -e 's/_.*//'` + +# download lazarus cvs if necessary +if [ ! -f $SrcTGZ ]; then + ./create_lazarus_export_tgz.sh $SrcTGZ +fi echo "Build directory is $LazBuildDir" if [ x$LazBuildDir = x/ ]; then @@ -18,10 +41,10 @@ fi rm -rf $LazBuildDir # Unpack lazarus source -echo "unpacking $LazTGZ ..." +echo "unpacking $SrcTGZ ..." mkdir -p $LazBuildDir/usr/share/ cd $LazBuildDir/usr/share/ -tar xzf $LazTGZ +tar xzf $CurDir/$SrcTGZ find . -name '.cvsignore' -exec rm {} \; cd - @@ -34,7 +57,10 @@ cd - # create control file echo "copying control file" mkdir -p $LazBuildDir/DEBIAN -cp $DebianSrcDir/control $LazBuildDir/DEBIAN/ +cat $DebianSrcDir/control | \ + sed -e "s/FPCVERSION/$FPCVersion/g" \ + -e "s/LAZVERSION/$LazVersion/g" \ + > $LazBuildDir/DEBIAN/control # copyright and changelog files echo "copying copyright and changelog files" @@ -58,10 +84,10 @@ find $LazBuildDir -name '*.sh' -exec chmod a+x {} \; # creating deb echo "creating deb ..." -cd $TempDir +cd $TmpDir fakeroot dpkg-deb --build $LazBuildDir mv $LazBuildDir.deb $LazDeb -echo "`pwd`/$LazDeb created." +echo "$LazDeb created." cd - # end.