File fpc-units.spec of Package fpc-units
#
# spec file for package fpc-units
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# norootforbuild
Name: fpc-units
Summary: Crosscompiling Units for FPC
Version: 2.2.0
Release: 0
Group: Development/Languages
License: GPL and modified LGPL
Url: http://www.freepascal.org/
%ifarch x86_64
Recommends: %name-x86_64 %name-i386
%else
Recommends: %name-i386
%endif
Vendor: openSUSE-Education
Source0: fpcbuild-%{version}.tar.bz2
Source1: libgdb-6.2.1-i386-linux.zip
Source2: libgdb-6.2.1-x86_64-linux.zip
Source3: libgdb-6.2.1-powerpc-linux.zip
Source4: fpc-units-rpmlintrc
Requires: gpm binutils
BuildRequires: fpc ncurses-devel texlive-latex unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Units for crosscompiling with the Free Pascal Compiler.
%ifarch x86_64
%package x86_64
Summary: FPC - units for targetting x86_64
Group: Development/Languages
%description x86_64
Units for crosscompiling to x86_64 - needed for the Free Pascal Compiler.
%endif
%ifarch %ix86
%package i386
Summary: FPC - units for targetting i386
Group: Development/Languages
%description i386
Units for crosscompiling to x86 - needed for the Free Pascal Compiler.
%endif
%define ppcname ppc386
%define smart _smart
%define libgdb 1
%ifarch ppc
%define ppcname ppcppc
%define smart _all
%define libgdb 3
%endif
%ifarch x86_64
%define ppcname ppcx64
%define smart _smart
%define libgdb 2
%endif
%prep
%setup -n fpcbuild-%{version} -a %{libgdb}
%__ln_s $PWD/libgdb fpcsrc/libgdb
%build
pushd "fpcsrc" 1>/dev/null
STARTPP="%{ppcname}"
NEWPP="`pwd`/compiler/%{ppcname}"
NEWFPDOC="`pwd`/utils/fpdoc/fpdoc"
DATA2INC="`pwd`/utils/data2inc"
COMPILEOPTS="-gl"
FPCOMPILEOPTS="-XLAtinfo= "
%__make %{?jobs:-j%{jobs}} "compiler_cycle" FPC="${STARTPP}" OPT="${COMPILEOPTS}"
%__make %{?jobs:-j%{jobs}} "rtl_clean" "rtl%{smart}" FPC="${NEWPP}" OPT="${COMPILEOPTS}"
%__make %{?jobs:-j%{jobs}} "packages_base%{smart}" FPC="${NEWPP}" OPT="${COMPILEOPTS}"
%__make %{?jobs:-j%{jobs}} "packages_fcl%{smart}" FPC="${NEWPP}" OPT="${COMPILEOPTS}"
%__make %{?jobs:-j%{jobs}} "fv%{smart}" FPC="${NEWPP}" OPT="${COMPILEOPTS}"
%__make %{?jobs:-j%{jobs}} "packages_extra%{smart}" FPC="${NEWPP}" OPT="${COMPILEOPTS}"
%__make %{?jobs:-j%{jobs}} "utils_all" FPC="${NEWPP}" DATA2INC="${DATA2INC}" OPT="${COMPILEOPTS}"
popd 1>/dev/null
%install
cd "fpcsrc"
FPCMAKE="`pwd`/utils/fpcm/fpcmake"
NEWPP="`pwd`/compiler/%{ppcname}"
INSTALLOPTS="FPC=${NEWPP} FPCMAKE=${FPCMAKE} \
INSTALL_PREFIX=%{buildroot}%{_prefix} \
INSTALL_LIBDIR=%{buildroot}%{_libdir} \
INSTALL_BASEDIR=%{buildroot}%{_libdir}/fpc/%{version} \
CODPATH=%{buildroot}%{_libdir}/fpc/lexyacc \
INSTALL_DOCDIR=%{buildroot}%{_defaultdocdir}/fpc-%{version} \
INSTALL_BINDIR=%{buildroot}%{_bindir}
INSTALL_EXAMPLEDIR=%{buildroot}%{_defaultdocdir}/fpc-%{version}/examples"
%__make compiler_distinstall ${INSTALLOPTS}
%__make rtl_distinstall ${INSTALLOPTS}
%__make packages_distinstall ${INSTALLOPTS}
%__make fv_distinstall ${INSTALLOPTS}
%__make ide_distinstall ${INSTALLOPTS}
%__make utils_distinstall ${INSTALLOPTS}
cd ..
%__rm -rf "%{buildroot}%{_libdir}/fpc/lexyacc"
%clean
%__rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%doc %_defaultdocdir/fpc-2.2.0
%ifarch x86_64
%files x86_64
%defattr(-,root,root)
%dir %{_libdir}/fpc/%{version}/units/x86_64-linux/
%{_libdir}/fpc/%{version}/units/x86_64-linux/*
%endif
%ifarch %ix86
%files i386
%defattr(-,root,root)
%_bindir/*
%dir %{_libdir}/fpc/%{version}/units/i386-linux/
%config %{_libdir}/fpc/%{version}/samplecfg
%{_libdir}/fpc/%{version}/*
%endif
%changelog