-# TODO:
-# - check why it builds all static..
-# - doesn't build on ppc/sparc :/ hgw why - drop this ?
-# - repair ide build
#
# Conditional build:
-%bcond_with ide # build with ide
+%bcond_without ide # build with ide
%bcond_without doc # build without doc
Summary: 32-bit compiler for the i386 and m68k processors
Summary(ru.UTF-8): Свободный компилятор Pascal
Summary(uk.UTF-8): Вільний компілятор Pascal
Name: fpc
-Version: 2.2.2
-Release: 0.1
-License: GPL
+Version: 3.0.0
+Release: 5
+License: GPL v2+
Group: Development/Languages
-Source0: ftp://ftp.freepascal.org/fpc/dist/source-%{version}/%{name}build-%{version}.tar.gz
-# Source0-md5: ec3d463ec9859da4122e9edfa2ab992d
-Source1: ftp://ftp.freepascal.org/fpc/dist/i386-linux-%{version}/%{name}-%{version}.i386-linux.tar
-# Source1-md5: ee7ddbf3ad50f6c6f237439e3ecd83d6
-Source2: ftp://ftp.freepascal.org/fpc/dist/x86_64-linux-%{version}/%{name}-%{version}.x86_64-linux.tar
-# Source2-md5: 9671bb9f89fd64fd8db4de6c76393c62
-Source3: ftp://ftp.freepascal.org/fpc/dist/powerpc-linux-%{version}/%{name}-%{version}.powerpc-linux.tar
-# Source3-md5: e83013af5e6fd8272c6d26b41234f288
-# no 2.0.4 binary for sparc, 2.0.0 only
-#Source4: ftp://ftp.freepascal.org/fpc/dist/sparc-linux-2.0.0/%{name}-2.0.0.sparc-linux.tar
-#ftp://ftp.freepascal.org/fpc/dist/sparc-linux-2.2.2/deb/fpc_2.2.2-0.tar.gz
-# Source4-md5: dd8925ce8ce93309456c3072e6e4d14d
+Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz
+# Source0-md5: bb7d17ef5c7c007466368262c0779cb7
+Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
+# Source1-md5: 41e0bcb7c11b7edf311142079ba2defa
+Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
+# Source2-md5: db2ae45b0d1846e01b61ba52f03e60b2
Patch0: %{name}-skip-dev-dot.patch
-Patch1: %{name}-makedocs.patch
-Patch2: %{name}-avoid-RE.patch
+Patch1: %{name}-link.patch
+Patch2: %{name}-gdb.patch
+Patch3: fpc-r32374.patch
+Patch4: fpcdocs-r1260.patch
URL: http://www.freepascal.org/
-BuildRequires: binutils-static >= 3:2.17.50
-BuildRequires: gdb-lib
+BuildRequires: binutils-devel >= 3:2.17.50
BuildRequires: gpm-devel
BuildRequires: ncurses-devel
-%{?with_ide:BuildRequires: readline-static}
BuildRequires: rpmbuild(macros) >= 1.213
-%{?with_doc:BuildRequires: tetex-fonts-jknappen}
-%{?with_doc:BuildRequires: tetex-format-pdflatex}
-%{?with_doc:BuildRequires: tetex-makeindex}
-%{?with_doc:BuildRequires: tetex-metafont}
+%if %{with ide}
+BuildRequires: babeltrace-devel
+BuildRequires: expat-devel
+BuildRequires: gdb-lib >= 7.2-7
+BuildRequires: guile-devel
+BuildRequires: python-devel
+BuildRequires: readline-devel
+BuildRequires: libselinux-devel
+BuildRequires: xz-devel
+BuildRequires: zlib-devel
+%endif
+%if %{with doc}
+BuildRequires: tetex-fonts-jknappen
+BuildRequires: tetex-format-pdflatex
+BuildRequires: tetex-makeindex
+BuildRequires: tetex-metafont
+BuildRequires: texlive-xetex
+%endif
Requires: binutils
Provides: fpc-bootstrap
-ExclusiveArch: %{ix86} %{x8664} ppc sparc
+ExclusiveArch: %{ix86} %{x8664}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Summary: Free Pascal Compiler documentation
Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
Group: Documentation
-Requires: %{name} = %{version}-%{release}
+# doesn't require base
%description doc
Documentation for fpc in PDF format.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p0
+%patch4 -p0
%ifarch %{ix86}
tar xf %{SOURCE1}
%define _bver %{version}
%define _bname 386
+%define _barch i386
%endif
%ifarch %{x8664}
tar xf %{SOURCE2}
%define _bver %{version}
%define _bname x64
-%endif
-%ifarch ppc
-tar xf %{SOURCE3}
-%define _bver %{version}
-%define _bname ppc
-%endif
-%ifarch sparc
-tar xf %{SOURCE4}
-%define _bver 2.0.0
-%define _bname sparc
+%define _barch x86_64
%endif
+cd %{name}-%{version}.%{_barch}-linux
tar xf binary.*-linux.tar
+cd ..
mkdir bin
cd bin
-for i in ../*.tar.gz ; do
+for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
tar xzf $i
done
ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
+cd ..
+
+find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
+ xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
-%build
# save for fpc-src
install -d fpc-src
cp -af fpcsrc/* fpc-src
+rm -r fpc-src/{ide,tests}
+
+%if 0%{?debug:1}
+find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
+%endif
+
+%build
+# use ld.bfd
+[ -d our-ld ] || install -d our-ld
+ln -sf %{_bindir}/ld.bfd our-ld/ld
+export PATH=$(pwd)/our-ld:$PATH
PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
-NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
+NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc
+DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc
# DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
case "%{_build_cpu}" in
esac
%{__make} -C fpcsrc compiler_cycle \
- OPT="$OPTF -Xs -n" \
+ OPT="$OPTF %{!?debug:-Xs} -n" \
RELEASE="1" \
BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
BININSTALLDIR=%{_bindir} \
+ DATA2INC="$DATA2INC" \
PP="$PP" \
FPC="$PP" \
LINKSMART=YES
-%{__make} -C fpcsrc OPT="$OPTF -Xs -n" \
+%{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
RELEASE="1" \
BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
BININSTALLDIR=%{_bindir} \
GDBLIBDIR=%{_libdir} \
+ DATA2INC="$DATA2INC" \
PP="$NEWPP" \
FPC="$NEWPP" \
FPDOC=$NEWFPDOC \
- DATA2INC=`pwd`/utils/data2inc \
LINKSMART=YES \
NODOCS=YES \
rtl_clean \
%{?with_ide: ide_clean installer_clean} \
rtl_all \
packages_all \
- utils_all %{?with_ide:installer_all}
-
-# %{?with_ide:IDE=YES} \
-%if %{with ide}
-%{__make} -C fpcsrc/ide OPT="$OPTF -Xs -n" \
- RELEASE="1" \
- BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
- BININSTALLDIR=%{_bindir} \
- GDBLIBDIR=%{_libdir} \
- PP="$NEWPP" \
- FPC="$NEWPP" \
- FPDOC=$NEWFPDOC \
- DATA2INC=`pwd`/utils/data2inc \
- LINKSMART=YES \
- clean \
- default \
- gdb
-%endif
-# %{?with_ide:installer_clean} \
-# %{?with_ide:installer_all}
+ utils_all %{?with_ide:ide_all installer_all}
%if %{with doc}
export save_size=10000
-%{__make} -C fpcdocs \
+%{__make} -j1 -C fpcdocs \
FPDOC=$NEWFPDOC \
FPC="$NEWPP" \
pdf
cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
-FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
-%{__make} -C fpcsrc \
+FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake
+%{__make} -j1 -C fpcsrc \
compiler_distinstall \
rtl_distinstall \
packages_distinstall \
PP="$NEWPP" \
FPCMAKE="$FPCMAKE" \
SMARTLINK=YES \
+ FPCDIR=%{_libdir}/%{name}/%{version} \
INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
-%{__make} -C install/man installman \
+%{__make} -j1 -C install/man installman \
INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
-ln -sf %{_libdir}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
+ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
+
+ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
+
+sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
+%{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
+
+%if "%{_lib}" != "lib"
+%{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name}
+%endif
-sh fpcsrc/compiler/utils/samplecfg %{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
+# Fix examples, make seems to ignore INSTALL_EXAMPLEDIR
+%{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/*
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
+%dir %{_sysconfdir}/fppkg
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/%{version}
%dir %{_libdir}/%{name}/lexyacc
%{_libdir}/%{name}/%{version}/msg
%{_libdir}/%{name}/%{version}/units
+%{_libdir}/%{name}/%{version}/fpmkinst
%if %{with ide}
%{_libdir}/%{name}/%{version}/ide
%endif
%{_libdir}/%{name}/lexyacc/*
+%attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
%attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
%attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
%{_mandir}/man*/*