X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=fpc.spec;h=8b1c678ecac426cc30850fd489c1ff6472d9fd8b;hb=c91c2c239a9e6d0b6786194c0b1d1f95a1f58582;hp=9e7d7f65acd61eb9def8ee72d0eda6b538a5bc67;hpb=f1b2930eaca92d4dd25acf4f5ea070de4628661f;p=packages%2Ffpc.git diff --git a/fpc.spec b/fpc.spec index 9e7d7f6..8b1c678 100644 --- a/fpc.spec +++ b/fpc.spec @@ -1,21 +1,44 @@ +# TODO: +# - repair ide build +# +# Conditional build: +%bcond_with ide # build with ide +%bcond_without doc # build without doc + Summary: 32-bit compiler for the i386 and m68k processors -Summary(pl): 32 bitowy kompilator dla procesorów i386 i m68k +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: 1.0.4 -Release: 3 +Version: 2.4.4 +Release: 0.1 License: GPL Group: Development/Languages -Vendor: Michael Van Canneyt -Source0: ftp://ftp.freepascal.org/pub/fpc/dist/Linux/%{name}-%{version}.ELF.tar -Source1: %{name}-sample.cfg -Patch0: %{name}-poptasm.patch -Patch1: %{name}-glibc.patch +Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz +# Source0-md5: d069dfd3412bd0d26dcd1b81ac998305 +Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar +# Source1-md5: e761c4866ac4c8fcbe09f657f315ec32 +Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar +# Source2-md5: 058e6cd765026748a2bd24c86f1ecf18 +Source3: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/powerpc-linux/%{name}-%{version}.powerpc-linux.tar +# Source3-md5: cea93e5da48c45da3147236cba75dc76 +Patch0: %{name}-skip-dev-dot.patch +Patch1: %{name}-fpdoc.patch URL: http://www.freepascal.org/ -Requires: gcc >= 2.95.2 -BuildRequires: bin86 -BuildRequires: glibc-static -BuildRequires: zlib-devel -ExclusiveArch: %{ix86} m68k +BuildRequires: binutils-static >= 3:2.17.50 +BuildRequires: gdb-lib +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} +%{?with_doc:BuildRequires: texlive-xetex} +Requires: binutils +Provides: fpc-bootstrap +ExclusiveArch: %{ix86} %{x8664} ppc BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -26,150 +49,229 @@ attained), but it also enhances these languages with elements like function overloading. And, unlike these ancestors, it supports multiple platforms. -%description -l pl -Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k. -Free Pascal zosta³ zaprojektowany by byæ (jak tylko to mo¿liwe) -kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal równie¿ -rozszerza te jêzyki elementami takimi jak prze³adowywanie funkcji. +%description -l pl.UTF-8 +Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k. +Free Pascal został zaprojektowany by być (jak tylko to możliwe) +kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również +rozszerza te języki elementami takimi jak przeciążanie funkcji. + +%description -l ru.UTF-8 +FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и +Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL +(библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib, +mysql, postgres, ibase. + +%description -l uk.UTF-8 +FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та +Delphi. Постачається із RTL (бібліотекою часу виконання), FCL +(бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib, +mysql, postgres, ibase. + +%package src +Summary: Free Pascal Compiler source files +Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal +Group: Development +Requires: %{name} = %{version}-%{release} +Provides: fpcsrc + +%description src +Free Pascal Compiler source files. + +%description src -l pl.UTF-8 +Pliki źródłowe kompilatora Free Pascal. %package examples Summary: Free Pascal Compiler exaple programs -Summary(pl): Przyk³adowe programy do kompilatora Free Pascal +Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal Group: Documentation -Requires: %{name} = %{version} +Requires: %{name} = %{version}-%{release} %description examples Free Pascal Compiler exaple programs. -%description examples -l pl -Przyk³adowe programy do kompilatora Free Pascal. +%description examples -l pl.UTF-8 +Przykładowe programy do kompilatora Free Pascal. %package doc Summary: Free Pascal Compiler documentation -Summary(pl): Dokumentacja do kompilatora Free Pascal +Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal Group: Documentation -Requires: %{name} = %{version} +# doesn't require base %description doc Documentation for fpc in PDF format. -%description doc -l pl +%description doc -l pl.UTF-8 Dokumentacja do fpc w formacie PDF. %prep -%setup -q -c -tar xf sources.tar -tar xf binary.tar +%setup -q -n %{name}build-%{version} +%patch0 -p1 +%patch1 -p1 -for i in *.tar.gz ; do - tar xzf $i -done +%ifarch %{ix86} +tar xf %{SOURCE1} +%define _bver %{version} +%define _bname 386 +%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 -mkdir -p src/%{name}-%{version}/doc -mv doc/%{name}-%{version}/* src/%{name}-%{version}/doc -mkdir -p src/%{name}-%{version}/man && echo ".PHONY: all install installman" > src/%{name}-%{version}/man/Makefile +tar xf binary.*-linux.tar -cd src/%{name}-%{version} -%patch0 -p0 -%patch1 -p0 +mkdir bin +cd bin +for i in ../*.tar.gz ; do + tar xzf $i +done +ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin %build -if [ "%{_build_cpu}" = "m68k" ]; then - CPU=M68K -else - CPU=I386 -fi +# save for fpc-src +install -d fpc-src +cp -af fpcsrc/* fpc-src + +PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname} +NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname} +NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins case "%{_build_cpu}" in - i386) - OPTF="-OG2p1" ;; - i586) - OPTF="-OG2p2" ;; - i686) - OPTF="-Og2p3" ;; - *) - OPTF="-O2" ;; + i386) OPTF="-OG2p1" ;; + i486) OPTF="-OG2p1" ;; + i586) OPTF="-OG2p2" ;; + i686) OPTF="-Og2p3" ;; + athlon) OPTF="-Og2p3" ;; + *) OPTF="-O2" ;; esac -PP=`pwd`/lib/fpc/%{version}/ppc386 -NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386 - -# -O- optimalization to workaround bug in PP compiler in 1.0.4 -%{__make} -C src/%{name}-%{version} \ - OPT="-O- -Xs -n" \ - RELEASE="" \ +%{__make} -C fpcsrc compiler_cycle \ + OPT="$OPTF -Xs -n" \ + RELEASE="1" \ BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \ BININSTALLDIR=%{_bindir} \ PP="$PP" \ FPC="$PP" \ - compiler_cycle + LINKSMART=YES -%{__make} -C src/%{name}-%{version} \ - OPT="$OPTF -Xs -n" \ - RELEASE="" \ +%{__make} -C fpcsrc 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 \ + NODOCS=YES \ + rtl_clean \ + packages_clean \ + utils_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" \ - rtl_all api_all fcl_all packages_all utils_all + FPDOC=$NEWFPDOC \ + DATA2INC=`pwd`/utils/data2inc \ + LINKSMART=YES \ + clean \ + default \ + gdb +%endif +# %{?with_ide:installer_clean} \ +# %{?with_ide:installer_all} + +%if %{with doc} +export save_size=10000 +%{__make} -j1 -C fpcdocs \ + FPDOC=$NEWFPDOC \ + FPC="$NEWPP" \ + pdf +%endif %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_examplesdir}/fpc} - -install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ppc386.cfg +install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc} -# workaround for 1.0.4 -(cd src/fpc-%{version}; ln -s fcl/linux linux) +cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc -NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386 -%{__make} -C src/%{name}-%{version} \ - PREFIXINSTALLDIR=$RPM_BUILD_ROOT%{_prefix} \ +NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname} +FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake +%{__make} -j1 -C fpcsrc \ + compiler_distinstall \ + rtl_distinstall \ + packages_distinstall \ + %{?with_ide:ide_distinstall} \ + utils_distinstall \ PP="$NEWPP" \ - compiler_install \ - rtl_install api_install fcl_install packages_install utils_install + FPCMAKE="$FPCMAKE" \ + SMARTLINK=YES \ + INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \ + INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \ + INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ + INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \ + INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \ + INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \ + INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \ + INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \ + CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc -cp -a man/* $RPM_BUILD_ROOT%{_mandir} -cp -a src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc +%{__make} -j1 -C install/man installman \ + INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} -ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386 -ln -sf ppc386 $RPM_BUILD_ROOT%{_bindir}/fpc +ln -sf %{_libdir}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir} -mv -f src/%{name}-%{version}/doc/faq.htm src/%{name}-%{version}/doc/faq.html +sh fpcsrc/compiler/utils/samplecfg %{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir} %clean rm -rf $RPM_BUILD_ROOT -%post -umask 022 -GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '` -GCCDIR=`dirname $GCCSPEC` -echo "Found libgcc.a in $GCCDIR" -sed -e "s#\$GCCDIR#$GCCDIR#" %{_sysconfdir}/ppc386.cfg > %{_sysconfdir}/ppc386.cfg.new -sed -e "s#\$1#%{_libdir}/%{name}/%{version}#" %{_sysconfdir}/ppc386.cfg.new > %{_sysconfdir}/ppc386.cfg -rm -f %{_sysconfdir}/ppc386.cfg.new - %files %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/* -%doc src/%{name}-%{version}/doc/{copying*,*.txt} -%doc src/%{name}-%{version}/doc/faq.html -%config %verify(not md5 size mtime) %{_sysconfdir}/ppc386.cfg +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/%{version} %dir %{_libdir}/%{name}/lexyacc %{_libdir}/%{name}/%{version}/msg %{_libdir}/%{name}/%{version}/units +%if %{with ide} +%{_libdir}/%{name}/%{version}/ide +%endif %{_libdir}/%{name}/lexyacc/* -%attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc386 +%attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname} %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg %{_mandir}/man*/* +%files src +%defattr(644,root,root,755) +%{_datadir}/fpcsrc + %files examples %defattr(644,root,root,755) -%doc %{_examplesdir}/fpc +%{_examplesdir}/fpc +%if %{with doc} %files doc %defattr(644,root,root,755) -%doc src/%{name}-%{version}/doc/*.pdf +%doc fpcdocs/*.pdf +%endif