]> git.pld-linux.org Git - packages/fpc.git/blobdiff - fpc.spec
- works, but.. TODO
[packages/fpc.git] / fpc.spec
index 04ae035f9e3c2ae0e81902c240ceeb8de0527d24..cc5d98a20d755a359a11d6e60e24fc6f5a0e510a 100644 (file)
--- a/fpc.spec
+++ b/fpc.spec
@@ -1,25 +1,32 @@
-# TODO:
-# - allow $PATH exceeding 255 chars
+# TODO: 
+# - documentation
+# - check why it builds all static..
 Summary:       32-bit compiler for the i386 and m68k processors
 Summary(pl):   32 bitowy kompilator dla procesorów i386 i m68k
 Summary(ru):   ó×ÏÂÏÄÎÙÊ ËÏÍÐÉÌÑÔÏÒ Pascal
 Summary(uk):   ÷¦ÌØÎÉÊ ËÏÍЦÌÑÔÏÒ Pascal
 Name:          fpc
-Version:       1.0.10
+Version:       2.0.0
 Release:       0.1
 License:       GPL
 Group:         Development/Languages
 Vendor:                Michael Van Canneyt <michael@tfdec1.fys.kuleuven.ac.be>
-Source0:       ftp://ftp.us.freepascal.org/pub/fpc/dist/source-%{version}/%{name}-%{version}-src.tar.gz
-# Source0-md5: da2ec003500584649cb31288613c33fa
-Source1:       ftp://ftp.us.freepascal.org/pub/fpc/dist/Linux/i386/separate/binary.tar
-# Source1-md5: 62c7ac6c21c44276b5e14bf34265d185
-Source2:       %{name}-sample.cfg
+Source0:       http://switch.dl.sourceforge.net/sourceforge/freepascal/%{name}-%{version}.source.tar.gz
+# Source0-md5: 3f9c64d0146a3631f6963fd7477776d1
+Source1:       http://dl.sourceforge.net/freepascal/fpc-%{version}.i386-linux.tar
+# Source1-md5: 5f0a5fba632a811dcfdafe0ff80476a3
+Source2:       http://dl.sourceforge.net/freepascal/fpc-%{version}.x86_64-linux.tar
+# Source2-md5: 36270de604c6b5ad3af8aaa08143e88f
+Source3:       http://dl.sourceforge.net/freepascal/fpc-%{version}.powerpc-linux.tar
+# Source3-md5: 7019384e09411902e530dfe55d4ff145
+Source4:       http://dl.sourceforge.net/freepascal/%{name}-%{version}.sparc-linux.tar
+# Source4-md5: dd8925ce8ce93309456c3072e6e4d14d
+#Source2:      %{name}-sample.cfg
 URL:           http://www.freepascal.org/
-BuildRequires: bin86
-BuildRequires: zlib-devel
+#BuildRequires:        bin86
+#BuildRequires:        zlib-devel
 Requires:      gcc >= 2.95.2
-ExclusiveArch: %{ix86} m68k
+ExclusiveArch: %{ix86} m68k amd64 ppc sparc
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -71,114 +78,111 @@ Documentation for fpc in PDF format.
 Dokumentacja do fpc w formacie PDF.
 
 %prep
-%setup -q -c -T -a1
-for i in *.tar.gz ; do
+%setup -q -n %{name}
+%ifarch %{ix86}
+tar xf %{SOURCE1}
+%define _bname 386
+%endif
+%ifarch amd64
+tar xf %{SOURCE2}
+%define _bname x64
+%endif
+%ifarch ppc
+tar xf %{SOURCE3}
+%define _bname ppc
+%endif
+%ifarch sparc
+tar xf %{SOURCE4}
+%define _bname sparc
+%endif
+
+tar xf binary.*-linux.tar
+
+mkdir bin
+cd bin
+for i in ../*.tar.gz ; do
        tar xzf $i
 done
-
-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
-
-cd src/%{name}-%{version}
-tar xzf %{SOURCE0}
+ln -sf `pwd`/lib/%{name}/%{version}/ppc* bin
 
 %build
-if [ "%{_build_cpu}" = "m68k" ]; then
-       CPU=M68K
-else
-       CPU=I386
-fi
-
-# 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" ;;
-esac
-
-PP=`pwd`/lib/fpc/%{version}/ppc386
-NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
-NEWFPDOC=`pwd`/utils/fpdoc/fpdoc
-
-# ppc386 binary cuts PATH - sometimes before /usr/bin with needed as and ld
-export PATH="/usr/bin:/bin"
-
-%{__make} -C src/%{name}-%{version} \
+PP=`pwd`/bin/lib/%{name}/%{version}/ppc%{_bname}
+NEWPP=`pwd`/compiler/ppc%{_bname}
+
+%{__make} compiler_cycle \
        OPT="$OPTF -Xs -n" \
-       RELEASE="" \
+       RELEASE="1" \
        BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
        BININSTALLDIR=%{_bindir} \
        PP="$PP" \
        FPC="$PP" \
        compiler_cycle
 
-%{__make} -C src/%{name}-%{version} \
-       OPT="$OPTF -Xs -n" \
-       RELEASE="" \
+%{__make} OPT="$OPTF -Xs -n" \
+       RELEASE="1" \
        BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
        BININSTALLDIR=%{_bindir} \
        PP="$NEWPP" \
        FPC="$NEWPP" \
-       rtl_clean rtl_smart packages_base_smart fcl_smart packages_extra_smart utils_all
+       DATA2INC=`pwd`/utils/data2inc \
+       rtl packages_base_all fcl packages_extra_all utils_all
 
-# %{__make} -C src/%{name}-%{version}/docs pdf FPDOC=${NEWFPDOC}
+#%{__make} -C src/%{name}-%{version}/docs pdf FPDOC=${NEWFPDOC}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_examplesdir}/fpc}
 
-install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/fpc.cfg
-
-# new ppc386 cuts PATH too (how to fix it???)
-export PATH="/usr/bin:/bin"
-
-NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
-%{__make} -C src/%{name}-%{version} \
+NEWPP=`pwd`/compiler/ppc%{_bname}
+FPCMAKE=`pwd`/utils/fpcm/fpcmake
+%{__make} \
+       compiler_install \
+       rtl_install \
+       fcl_install \
+       packages_install \
+       utils_install \
+       PP="$NEWPP" \
+       FPCMAKE="$FPCMAKE" \
        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} \
-       PP="$NEWPP" \
-       compiler_distinstall \
-       rtl_distinstall \
-       packages_distinstall \
-       fcl_distinstall \
-       utils_distinstall \
-       man_install
+       INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
+       CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
+
+ln -sf %{_libdir}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
 
-# %{__make} -C src/%{name}-%{version}/docs pdfinstall DOCINSTALLDIR=$RPM_BUILD_ROOT%{_docdir}
+sh compiler/utils/samplecfg %{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
 
-mv -f src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc
+#%{__make} -C src/%{name}-%{version}/docs pdfinstall DOCINSTALLDIR=$RPM_BUILD_ROOT%{_docdir}
 
-ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386
-ln -sf ppc386 $RPM_BUILD_ROOT%{_bindir}/fpc
+#cp -af src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc
 
-mv -f src/%{name}-%{version}/doc/faq.htm src/%{name}-%{version}/doc/faq.html
+#ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386
+#ln -sf ppc386 $RPM_BUILD_ROOT%{_bindir}/fpc
+
+#cp -af src/%{name}-%{version}/doc/faq.htm src/%{name}-%{version}/doc/faq.html
+
+#ln -sf %{_bindir}/{as,ld} $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}
 
 %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}/fpc.cfg > %{_sysconfdir}/fpc.cfg.new
-sed -e "s#\$1#%{_libdir}/%{name}/%{version}#" %{_sysconfdir}/fpc.cfg.new > %{_sysconfdir}/fpc.cfg
-rm -f %{_sysconfdir}/fpc.cfg.new
+#%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}/fpc.cfg > %{_sysconfdir}/fpc.cfg.new
+#sed -e "s#\$1#%{_libdir}/%{name}/%{version}#" %{_sysconfdir}/fpc.cfg.new > %{_sysconfdir}/fpc.cfg
+#rm -f %{_sysconfdir}/fpc.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
+#%doc src/%{name}-%{version}/doc/{copying*,*.txt}
+#%doc src/%{name}-%{version}/doc/faq.html
 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/fpc.cfg
 %dir %{_libdir}/%{name}
 %dir %{_libdir}/%{name}/%{version}
@@ -186,14 +190,14 @@ rm -f %{_sysconfdir}/fpc.cfg.new
 %{_libdir}/%{name}/%{version}/msg
 %{_libdir}/%{name}/%{version}/units
 %{_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*/*
+#%{_mandir}/man*/*
 
 %files examples
 %defattr(644,root,root,755)
-%{_examplesdir}/fpc
+#%{_examplesdir}/fpc
 
-#%files doc
-#%defattr(644,root,root,755)
-#%doc src/%{name}-%{version}/doc/*.pdf
+%files doc
+%defattr(644,root,root,755)
+#%doc src/%{name}-%{version}/docs/*.pdf
This page took 0.122797 seconds and 4 git commands to generate.