fixed fpc-src rpm

git-svn-id: trunk@9856 -
This commit is contained in:
mattias 2006-09-09 21:58:49 +00:00
parent 570589a725
commit bee79f87dd
3 changed files with 19 additions and 81 deletions

2
.gitattributes vendored
View File

@ -2657,7 +2657,6 @@ tools/install/debian_fpc/copyright svneol=native#text/plain
tools/install/debian_fpc/postinst svneol=native#text/plain
tools/install/do_nothing.sh svneol=native#text/plain
tools/install/file_filter.sh svneol=native#text/plain
tools/install/fpc-src.spec svneol=native#text/plain
tools/install/get_lazarus_version.sh svneol=native#text/plain
tools/install/macosx/fpc-release.packproj.template svneol=native#text/plain
tools/install/macosx/fpc.packproj.template svneol=native#text/plain
@ -2671,6 +2670,7 @@ tools/install/macosx/makelazsnapshot.sh svneol=native#text/plain
tools/install/replace_in_files.pl -text svneol=native#application/x-perl
tools/install/rpm/create_gtk1_links.sh svneol=native#text/plain
tools/install/rpm/create_nonroot_rpmmacros.sh svneol=native#text/plain
tools/install/rpm/fpc-src.spec svneol=native#text/plain
tools/install/rpm/fpc.spec.template svneol=native#text/plain
tools/install/rpm/fpc_crosswin32.spec.template svneol=native#text/plain
tools/install/rpm/get_rpm_source_dir.sh svneol=native#text/plain

View File

@ -7,13 +7,7 @@ set -e
#------------------------------------------------------------------------------
# parse parameters
#------------------------------------------------------------------------------
Usage="Usage: $0 [deb] <FPCSrcDir> [release]"
PkgType=rpm
if [ "x$1" = "xdeb" ]; then
PkgType=deb
shift
fi
Usage="Usage: $0 <FPCSrcDir> [release]"
FPCSourceDir=$1
if [ "x$FPCSourceDir" = "x" ]; then
@ -49,82 +43,26 @@ CurDir=`pwd`
# pack the directory
sh create_fpc_tgz_from_local_dir.sh $FPCSourceDir $FPCTGZ
if [ "$PkgType" = "deb" ]; then
# build fpc-src deb
# build fpc-src rpm
echo building fpc-src deb ...
echo "building fpc-src rpm ..."
FPCSrcTmpDir=/tmp/fpc-src$LazVersion
FPCSrcBuildDir=$FPCSrcTmpDir/fpc-src_build
FPCSrcDeb=fpc-src-$LazVersion-$LazRelease.deb
DebianSrcDir=$CurDir/debian_fpc-src
# create spec file
SpecFile=rpm/fpc-src-$LazVersion-$LazRelease.spec
cat rpm/fpc-src.spec | \
sed -e "s/LAZVERSION/$LazVersion/g" -e "s/LAZRELEASE/$LazRelease/" \
> $SpecFile
# copy custom rpm scripts
cp smart_strip.sh /tmp/smart_strip.sh
chmod a+x /tmp/smart_strip.sh
cp do_nothing.sh /tmp/do_nothing.sh
chmod a+x /tmp/do_nothing.sh
echo "Build directory is $FPCSrcBuildDir"
if [ x$FPCSrcBuildDir = x/ ]; then
echo "ERROR: invalid build directory"
exit
fi
rm -rf $FPCSrcBuildDir
# build rpm
rpmbuild -ba $SpecFile || rpm -ba $SpecFile
# Unpack fpc source
echo "unpacking $SrcTGZ ..."
mkdir -p $FPCSrcBuildDir/usr/share/
cd $FPCSrcBuildDir/usr/share/
tar xzf $CurDir/$FPCTGZ
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/fpc-src
cat $DebianSrcDir/changelog | \
sed -e "s/FPCVERSION/$LazVersion-$LazRelease/g" \
> $FPCSrcBuildDir/usr/share/doc/fpc-src/changelog
cp $DebianSrcDir/{copyright,changelog.Debian} $FPCSrcBuildDir/usr/share/doc/fpc-src/
gzip --best $FPCSrcBuildDir/usr/share/doc/fpc-src/changelog
gzip --best $FPCSrcBuildDir/usr/share/doc/fpc-src/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 -
else
# build fpc-src rpm
echo "building fpc-src rpm ..."
# create spec file
SpecFile=rpm/fpc-src-$LazVersion-$LazRelease.spec
cat fpc-src.spec | \
sed -e "s/LAZVERSION/$LazVersion/g" -e "s/LAZRELEASE/$LazRelease/" \
> $SpecFile
# copy custom rpm scripts
cp smart_strip.sh /tmp/smart_strip.sh
chmod a+x /tmp/smart_strip.sh
cp do_nothing.sh /tmp/do_nothing.sh
chmod a+x /tmp/do_nothing.sh
# build rpm
rpmbuild -ba $SpecFile || rpm -ba $SpecFile
echo "The new rpm can be found in $(./rpm/get_rpm_source_dir.sh)/RPMS/i386/fpc-src-$LazVersion-$LazRelease.i386.rpm"
fi
echo "The new rpm can be found in $(./rpm/get_rpm_source_dir.sh)/RPMS/i386/fpc-src-$LazVersion-$LazRelease.i386.rpm"
# end.

View File

@ -1,7 +1,7 @@
Name: fpc-src
Version: LAZVERSION
Release: LAZRELEASE
Copyright: LGPL2
License: LGPL2
Group: Development/Languages
Source: %{name}-%{version}-%{release}.source.tar.gz
Summary: FreePascal sources