snapshot rpm build script: added support for using full fpc version number in file name (2.2.2rc1)

git-svn-id: trunk@15371 -
This commit is contained in:
vincents 2008-06-09 21:50:03 +00:00
parent 9da100f931
commit c80ec36fb2
4 changed files with 30 additions and 4 deletions

1
.gitattributes vendored
View File

@ -3708,6 +3708,7 @@ tools/install/freebsd_ports/distinfo svneol=native#text/plain
tools/install/freebsd_ports/files/patch-Makefile svneol=native#text/plain
tools/install/freebsd_ports/files/patch-components-printers-unix_udlgselectprinter.pp svneol=native#text/plain
tools/install/freebsd_ports/pkg-descr svneol=native#text/plain
tools/install/get_fpc_full_version.sh svneol=native#text/plain
tools/install/get_lazarus_version.sh svneol=native#text/plain
tools/install/get_svn_revision_number.sh svneol=native#text/plain
tools/install/linux/editoroptions.xml svneol=native#text/plain

View File

@ -91,3 +91,4 @@ cat $SpecFileTemplate | \
rpmbuild --target $ARCH -ba $SpecFile --nodeps
export FpcFullVersion=$LazVersion

View File

@ -6,7 +6,7 @@ set -e
#------------------------------------------------------------------------------
# parse parameters
#------------------------------------------------------------------------------
Usage="Usage: $0 <LazarusSrcDir>"
Usage="Usage: $0 <LazarusSrcDir> <FPCFullVersion>"
LazSrcDir=$1
shift
@ -25,12 +25,21 @@ if [ ! -d $LazSrcDir/.svn ]; then
exit -1
fi
FpcFullVersion=$1
shift
if [ "x$FpcFullVersion" = "x" ]; then
echo $Usage
exit -1
fi
Date=`date +%Y%m%d`
# get fpc snapshot rpm
RPMDIR=$(rpm/get_rpm_source_dir.sh)
ARCH=`rpm --eval "%{_arch}"`
LIB=`rpm --eval "%{_lib}"`
FPCRPM=$RPMDIR/RPMS/$ARCH/fpc-2.2.0-$Date.$ARCH.rpm
FPCRPM=$RPMDIR/RPMS/$ARCH/fpc-$FpcFullVersion-$Date.$ARCH.rpm
if [ ! -f $FPCRPM ]; then
echo ERROR: fpc rpm $FPCRPM not available
exit
@ -45,6 +54,7 @@ mkdir -p $TmpFPCDir
cd $TmpFPCDir
rpm2cpio $FPCRPM | cpio -id
FPCVersion=`usr/bin/fpc -iV`
FPCFullVersion=`usr/bin/fpc -iW`
usr/$LIB/fpc/$FPCVersion/samplecfg $TmpFPCDir/usr/$LIB/fpc/$FPCVersion .
FPCCfg=$TmpFPCDir/fpc.cfg
export FPCCfg
@ -80,8 +90,8 @@ SpecFile=$RPMDIR/SPECS/lazarus-$LazVersion-$Date.spec
cat rpm/lazarus.spec.template | \
sed -e "s/LAZVERSION/$LazVersion/g" \
-e "s/LAZRELEASE/$Date/g" \
-e "s/FPCVERSION/$FPCVersion/g" \
-e "s/FPCSRCVERSION/$FPCVersion/g" \
-e "s/FPCVERSION/$FPCFullVersion/g" \
-e "s/FPCSRCVERSION/$FPCFullVersion/g" \
> $SpecFile
# build rpm

View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# retrieve the version information
VersionFile="$1/compiler/version.pas"
CompilerVersion=`cat $VersionFile | grep ' *version_nr *=.*;' | sed -e 's/[^0-9]//g'`
CompilerRelease=`cat $VersionFile | grep ' *release_nr *=.*;' | sed -e 's/[^0-9]//g'`
CompilerPatch=`cat $VersionFile | grep ' *patch_nr *=.*;' | sed -e 's/[^0-9]//g'`
CompilerMinorPatch=`cat $VersionFile | grep ' *minorpatch *=.*;' | sed -e 's/.*minorpatch.*= *//g' -e "s/'//g" -e 's/;//g'`
CompilerVersionStr="$CompilerVersion.$CompilerRelease.$CompilerPatch"
LazVersion="$CompilerVersion.$CompilerRelease.$CompilerPatch$CompilerMinorPatch"
echo $LazVersion
# end.