updated deb creation

git-svn-id: trunk@4395 -
This commit is contained in:
mattias 2003-07-13 09:46:48 +00:00
parent 19dd73606e
commit 98147eb13c
5 changed files with 95 additions and 23 deletions

View File

@ -7,7 +7,13 @@ set -e
#------------------------------------------------------------------------------
# parse parameters
#------------------------------------------------------------------------------
Usage="Usage: $0 <FPCSrcDir> <release>"
Usage="Usage: $0 [deb] <FPCSrcDir> <release>"
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.

View File

@ -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 ..."

View File

@ -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

View File

@ -1,7 +1,12 @@
fpcsrc (FPCVERSION)
fpcsrc (1.0.10)
* Bugfixes
-- Mattias Gaertner <mattias@cvs.freepascal.org> 07/13/2003
fpcsrc (1.0.7)
* Started package
-- Mattias Gaertner <mattias@cvs.freepascal.org> FPCDATE
-- Mattias Gaertner <mattias@cvs.freepascal.org> 05/03/2003

View File

@ -5,10 +5,10 @@ Priority: optional
Maintainer: Mattias Gaertner <mattias@cvs.freepascal.org>
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.