]> git.pld-linux.org Git - packages/fpc.git/blobdiff - fpc.spec
- attempt at fixing 64bit arch inconsistency
[packages/fpc.git] / fpc.spec
index 5f2f92254228a7c07f53153b0a138fd8b1b5b334..bde1e286422303ab14d4e4b7c13fc53ed04ae4a1 100644 (file)
--- a/fpc.spec
+++ b/fpc.spec
@@ -1,9 +1,6 @@
-# TODO:
-# - check why it builds all static..
-# - 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
@@ -11,30 +8,45 @@ Summary(pl.UTF-8):   32 bitowy kompilator dla procesorów i386 i m68k
 Summary(ru.UTF-8):     Свободный компилятор Pascal
 Summary(uk.UTF-8):     Вільний компілятор Pascal
 Name:          fpc
-Version:       2.4.0
-Release:       1
-License:       GPL
+Version:       2.6.4
+Release:       2
+License:       GPL v2+
 Group:         Development/Languages
 Source0:       ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz
-# Source0-md5: af49e9a8bb632f361395add30ece8934
+# Source0-md5: 403da132aed194fd841d46c3b33b022a
 Source1:       ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
-# Source1-md5: 5f38071d4bc560425f08905c14c1a68c
+# Source1-md5: 915f799dd58b5429f06a48d4bd84a9c2
 Source2:       ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
-# Source2-md5: 80fc3434f2d2af25af8c5e4dcf98723b
+# Source2-md5: ffc3cae4a72b60efb6873b9ce5c8a0f2
 Source3:       ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/powerpc-linux/%{name}-%{version}.powerpc-linux.tar
-# Source3-md5: 5a25c4d031e3f11d1d214c0d2faf00b5
+# Source3-md5: 28eb428bfaa8a72e49be05ed0efa0081
 Patch0:                %{name}-skip-dev-dot.patch
+Patch1:                %{name}-link.patch
+Patch2:                %{name}-gdb.patch
+Patch3:                %{name}-r22920.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
@@ -106,40 +118,63 @@ Dokumentacja do fpc w formacie PDF.
 %prep
 %setup -q -n %{name}build-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -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
+%define _barch x86_64
 %endif
 %ifarch ppc
 tar xf %{SOURCE3}
 %define _bver %{version}
 %define _bname ppc
+%define _barch powepc
 %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
+DATA2INC=`pwd`/fpcsrc/utils/data2inc
 
 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
 case "%{_build_cpu}" in
@@ -152,23 +187,24 @@ 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 \
@@ -177,30 +213,11 @@ esac
        %{?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
@@ -223,6 +240,7 @@ FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
        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} \
@@ -236,9 +254,20 @@ FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
 %{__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 fpcsrc/compiler/utils/samplecfg %{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
+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}
+
+# I have no idea why some units are installed to /usr/lib - baggins
+%if "%{_lib}" != "lib"
+cd $RPM_BUILD_ROOT/usr/lib/%{name}/%{version}/units
+for d in * ; do
+       %{__mv} $d/* $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/units/$d/
+done
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -247,6 +276,9 @@ 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
@@ -256,6 +288,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_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*/*
This page took 0.065461 seconds and 4 git commands to generate.