rpm: renamed fpc rpm to fpc-laz and fpc-src to fpc-src-laz

This commit is contained in:
mattias 2024-10-23 17:51:53 +02:00
parent 7eb5874be4
commit 939f0f650d
5 changed files with 30 additions and 246 deletions

View File

@ -26,7 +26,7 @@ fi
Arch=$(rpm --eval "%{_target_cpu}")
# retrieve the version information
echo -n "getting FPC version from local svn ..."
echo -n "getting FPC version from local git ..."
VersionFile="$FPCSourceDir/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'`
@ -35,15 +35,15 @@ CompilerVersionStr="$CompilerVersion.$CompilerRelease.$CompilerPatch"
LazVersion=$CompilerVersionStr
echo " $CompilerVersionStr-$LazRelease"
FPCTGZ=$(rpm/get_rpm_source_dir.sh)/SOURCES/fpc-src-$CompilerVersionStr-$LazRelease.source.tar.gz
FPCTGZ=$(rpm/get_rpm_source_dir.sh)/SOURCES/fpc-src-laz-$CompilerVersionStr-$LazRelease.source.tar.gz
CurDir=`pwd`
# pack the directory
sh create_fpc_tgz_from_local_dir.sh $FPCSourceDir $FPCTGZ
# build fpc-src rpm
# build fpc-src-laz rpm
echo "building fpc-src rpm ..."
echo "building fpc-src-laz rpm ..."
# copy custom rpm scripts
TmpDir=$HOME/tmp
@ -54,14 +54,14 @@ cp do_nothing.sh $TmpDir/do_nothing.sh
chmod a+x $TmpDir/do_nothing.sh
# create spec file
SpecFile=rpm/fpc-src-$LazVersion-$LazRelease.spec
cat rpm/fpc-src.spec | \
SpecFile=rpm/fpc-src-laz-$LazVersion-$LazRelease.spec
cat rpm/fpc-src-laz.spec | \
sed -e "s/LAZVERSION/$LazVersion/g" -e "s/LAZRELEASE/$LazRelease/g" -e "s#LAZSCRIPTDIR#$TmpDir#g" \
> $SpecFile
# build rpm
rpmbuild -ba $SpecFile || rpm -ba $SpecFile
RPMFile=$(./rpm/get_rpm_source_dir.sh)/RPMS/$Arch/fpc-src-$LazVersion-$LazRelease.$Arch.rpm
RPMFile=$(./rpm/get_rpm_source_dir.sh)/RPMS/$Arch/fpc-src-laz-$LazVersion-$LazRelease.$Arch.rpm
echo "The new rpm can be found in $RPMFile"

View File

@ -8,6 +8,8 @@ set -e
#------------------------------------------------------------------------------
Usage="Usage: $0 [nodocs] [notemp] <FPCSrcDir> [release]"
PkgName=fpc-laz
WithDOCS=yes
if [ "x$1" = "xnodocs" ]; then
WithDOCS=no
@ -55,17 +57,17 @@ if [ "$WithTempDir" = "yes" ]; then
if [ -d $TmpDir ]; then
rm -rf $TmpDir
fi
mkdir -p $TmpDir/fpc
mkdir -p $TmpDir/$PkgName
echo "extracting FPC from local git ..."
git -C $FPCSrcDir --work-tree=$TmpDir/fpc restore .
git -C $FPCSrcDir --work-tree=$TmpDir/$PkgName restore .
else
TmpDir=$FPCSrcDir
fi
# retrieve the version information
echo -n "getting FPC version from local svn ..."
VersionFile="$TmpDir/fpc/compiler/version.pas"
echo -n "getting FPC version from local git ..."
VersionFile="$TmpDir/$PkgName/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')
@ -85,16 +87,16 @@ ReplaceScript=replace_in_files.pl
# set version numbers in all Makefiles
echo "set version numbers in all Makefiles ..."
perl replace_in_files.pl -sR -f 'version=\d.\d.\d' -r version=$CompilerVersionStr -m 'Makefile(.fpc)?' $TmpDir/fpc/*
perl replace_in_files.pl -sR -f 'version=\d.\d.\d' -r version=$CompilerVersionStr -m 'Makefile(.fpc)?' $TmpDir/$PkgName/*
# update smart_strip.sh
#ATM: not needed: cp $SmartStripScript $TmpDir/fpc/install/
#ATM: not needed: cp $SmartStripScript $TmpDir/$PkgName/install/
# build fpc rpm
# build fpc-laz rpm
echo "creating spec file ..."
SpecFileTemplate=rpm/fpc.spec.template
SpecFile=rpm/fpc.spec
SpecFileTemplate=rpm/$PkgName.spec.template
SpecFile=rpm/$PkgName.spec
# change spec file
cat $SpecFileTemplate | \
@ -107,7 +109,7 @@ cat $SpecFileTemplate | \
SrcTGZ=$(rpm/get_rpm_source_dir.sh)/SOURCES/fpc-$CompilerVersionStr-$FPCRelease.source.tar.gz
echo "creating $SrcTGZ ..."
tar czf $SrcTGZ -C $TmpDir fpc
tar czf $SrcTGZ -C $TmpDir $PkgName
#----------------------------------------------------------------------------
# compile
@ -117,7 +119,7 @@ if [ "$WithDOCS" = "no" ]; then
fi
rpmbuild --nodeps -ba $SpecFile
echo "The new rpm can be found in $(./rpm/get_rpm_source_dir.sh)/RPMS/$Arch/fpc-$FPCVersion-$FPCRelease.$Arch.rpm"
echo "The new rpm can be found in $(./rpm/get_rpm_source_dir.sh)/RPMS/$Arch/$PkgName-$FPCVersion-$FPCRelease.$Arch.rpm"
# end.

View File

@ -40,7 +40,15 @@ if [ -d $FPCSrcDir/.svn ]; then
echo "extracting FPC from local svn ..."
svn export $FPCSrcDir $TmpDir
else
cp -a $FPCSrcDir $TmpDir
if [ -d $FPCSrcDir/.git ]; then
echo "extracting FPC from local git ..."
mkdir $TmpDir
cp -a $FPCSrcDir/.git $TmpDir/
git -C $TmpDir restore $TmpDir
rm -rf $TmpDir/.git*
else
cp -a $FPCSrcDir $TmpDir
fi
fi
if [ $RenameSmart = "yes" ]; then
@ -57,6 +65,7 @@ cd -
mv $TmpBaseDir/fpc_src.tgz $OutputFile
rm -rf $TmpDir
exit 0
# end.

View File

@ -1,62 +0,0 @@
Name: fpc-src
Version: LAZVERSION
Release: LAZRELEASE
License: LGPL2
Group: Development/Languages
Source: %{name}-%{version}-%{release}.source.tar.gz
Summary: FreePascal sources
Packager: Mattias Gaertner (mattias@freepascal.org)
URL: http://www.freepascal.org/
BuildRoot: %{_tmppath}/%{name}-build%{version}
%global debug_package %{nil}
%define fpcsrcdir %{_datadir}/fpcsrc
%define destdir %{buildroot}%{fpcsrcdir}/%{version}
%define _source_payload w9.bzdio
%define _binary_payload w9.bzdio
# The normal redhat rpm scripts tests every installed file for requirements.
# We install only sources, so we don't need the requirements.
AutoReq: 0
# The normal redhat rpm scripts do not recognize properly, what files to strip
# Hook our own strip command
%define __strip LAZSCRIPTDIR/smart_strip.sh
%description
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. Basic Delphi support is already implemented (classes,
exceptions, ansistrings, RTTI). This package contains the sources for the
commandline compiler and utils. Provided units are the runtime library (RTL),
free component library (FCL), gtk, ncurses, zlib, mysql, postgres, ibase
bindings and many more.
%prep
%setup -c
%build
%install
if [ %{buildroot} != "/" ]; then
rm -rf %{buildroot}
fi
mkdir -p %{destdir}
cp -a fpc/* %{destdir}/
# the palmos libcrt.a archive is making trouble
rm -f %{destdir}/rtl/palmos/libcrt.a
%clean
if [ %{buildroot} != "/" ]; then
rm -rf %{buildroot}
fi
%files
%defattr(-,root,root)
%{fpcsrcdir}
%changelog

View File

@ -1,165 +0,0 @@
Name: fpc
Version: 1.2.3
Release: 1
Summary: Free Pascal Compiler
# Because this rpm is used on different systems, with different names
# of packages/dependencies. Do not add dependencies automatically.
AutoReqProv: no
Group: Development/Languages
License: GPL2 and modified LGPL2
URL: http://www.freepascal.org/
Source: ftp://ftp.freepascal.org/pub/fpc/dist/source-%{version}/%{name}-%{version}-%{release}.source.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: glibc, binutils
BuildRequires: binutils, glibc-devel
%define _source_payload w9.bzdio
%define _binary_payload w9.bzdio
%description
Freepascal is a free 32/64bit Pascal Compiler. It comes with a run-time
library fully compatible with Turbo Pascal 7.0 and nearly Delphi compatible.
Some extensions are added to the language, like function overloading. Shared
libraries can be linked. This package contains commandline compiler and
utils. Provided units are the runtime library (RTL), free component library
(FCL) and bindings for among others gtk1, gtk2, ncurses, zlib, mysql, postgres
and ibase.
%ifarch ppc
%define ppcname ppcppc
%else
%ifarch x86_64
%define ppcname ppcx64
%else
%ifarch amd64
%define ppcname amd64
%else
%define ppcname ppc386
%endif
%endif
%endif
%prep
%setup -q -n %{name}
%build
rm -rf packages/extra/amunits
rm -rf packages/extra/winunits
if [ -z "$STARTPP" ]; then
STARTPP=`which %{ppcname}`
fi
NEWPP=`pwd`/compiler/%{ppcname}
DATA2INC=`pwd`/utils/data2inc
make distclean all FPC=${STARTPP}
# disable the debuginfo package
%define debug_package %{nil}
%define __spec_install_post /usr/lib/rpm/brp-compress
%install
rm -rf %{buildroot}
FPCMAKE=`pwd`/utils/fpcm/fpcmake
if [ -f "$FPCMAKE" ]; then
echo found fpcmake: $FPCMAKE
else
FPCMAKE=`pwd`/utils/fpcm/bin/*-linux/fpcmake
FPCMAKE=`echo $FPCMAKE`
fi
if [ -f "$FPCMAKE" ]; then
echo found fpcmake: $FPCMAKE
else
echo Error: fpcmake not found: $FPCMAKE
exit 1
fi
DATA2INC=`pwd`/utils/data2inc
NEWPP=`pwd`/compiler/%{ppcname}
FPCVERSION=`${NEWPP} -iV`
FPCFULLVERSION=`${NEWPP} -iW`
INSTALLOPTS="FPC=${NEWPP} FPCMAKE=${FPCMAKE} DATA2INC=${DATA2INC} \
INSTALL_PREFIX=%{buildroot}%{_prefix} \
INSTALL_LIBDIR=%{buildroot}%{_libdir} \
INSTALL_BASEDIR=%{buildroot}%{_libdir}/%{name}/${FPCVERSION} \
INSTALL_BINDIR=%{buildroot}%{_bindir}"
make install ${INSTALLOPTS}
%ifarch x86_64
if [ -f %{buildroot}%{_libdir}/../lib/libpas2jslib.so ]; then
mv %{buildroot}%{_libdir}/../lib/libpas2jslib.so %{buildroot}%{_libdir}/libpas2jslib.so
fi
%endif
# create link /usr/bin/ppc*
ln -sf %{_libdir}/%{name}/${FPCVERSION}/%{ppcname} %{buildroot}%{_bindir}/%{ppcname}
# install /usr/bin/fpcmkcfg
install `pwd`/utils/fpcmkcfg/bin/%{_arch}-linux/fpcmkcfg %{buildroot}%{_bindir}/fpcmkcfg
# Workaround:
# newer rpm versions do not allow garbage
rm -rf %{buildroot}%{_libdir}/%{name}/lexyacc
rm -rf %{buildroot}%{_prefix}/lib/%{name}/lexyacc
rm -rf %{buildroot}%{_defaultdocdir}/fpc-libc-*
rm -rf %{buildroot}%{_defaultdocdir}/fpc-symbolic-*
# 2.7.1 ignores the INSTALL_DOC variable and writes some files directly to /usr/share/doc
rm -rf %{buildroot}/usr/share/doc/fpc-*
%clean
rm -rf %{buildroot}
%post
# Create a version independent config
%define fpcversion 1.2.3
%{_libdir}/%{name}/%{fpcversion}/samplecfg %{_libdir}/%{name}/%{fpcversion} > /dev/null
%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_libdir}/%{name}
# since fpc 3.1.1:
%{_libdir}/libpas2jslib.so
%changelog
* Sat May 2 2020 Mattias Gaertner <mattias@freepascal.org> 3.0.4
- commented libpas2jslib.so, added fpcmkcfg
* Sat Nov 10 2018 Mattias Gaertner <mattias@freepascal.org> 3.3.1
- added libpas2jslib.so
* Sat Feb 25 2017 Mattias Gaertner <mattias@freepascal.org> 3.0.2
- 64bit
- removed src and doc
* Thu Jul 28 2005 Joost van der Sluis <joost@cnoc.nl> 2.0.0-1
- Added some requirements
- Added COPYING-info to %%doc
* Tue Jun 28 2005 Joost van der Sluis <joost@cnoc.nl> 2.0.0-0.6
- Only rtl, fcl and packages are added to src-subpackage
- Silenced post-script
- disabled the debuginfo-package
* Sun Jun 5 2005 Joost van der Sluis <joost@cnoc.nl> 2.0.0-0.5
- Added doc-subpackage
- Added src-subpackage
* Fri Jun 3 2005 Joost van der Sluis <joost@cnoc.nl> 2.0.0-0.4
- New fix for lib64 on x86_64
- small patches from Jens Petersen <petersen@redhat.com>
* Thu May 26 2005 Joost van der Sluis <joost@cnoc.nl> 2.0.0-0.3
- replaced 'lib' and 'lib64' by %%{_lib}
* Tue May 24 2005 Joost van der Sluis <joost@cnoc.nl> 2.0.0-0.2
- Fixed for lib64 on x86_64
- Changed summary, description and license
- Removed examples from installation
- Make clean removed from clean-section
- Clean-up
- replaced $RPM_BUILD_ROOT by %%{buildroot}
* Mon May 23 2005 Joost van der Sluis <joost@cnoc.nl> 2.0.0-0.1
- Initial build.