File xtensa-lx106-g++.spec of Package xtensa-lx106-g++

#
# spec file for package xtensa-lx106-g++
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define binutils_version 2.25.1
%define gcc_version      4.8.5
%define gmp_version      6.0.0a
%define mpfr_version     3.1.3
%define gdb_version      7.10
%define isl_version      0.14
%define cloog_version    0.18.4
%define mcp_version      1.0.3
%define newlib_version   2.0.0
%define expat_version    2.1.0
%define ncurses_version  6.0

Name:           xtensa-lx106-g++
Version:        1.20.0
Release:        0
Summary:        Toolchain for lx106
License:        GPL-2.0 and GPL-2.0+ and GPL-3.0+ and LGPL-2.1 and LGPL-3.0+
Group:          Development/Libraries/C and C++
BuildRequires:  crosstool-ng-lx106
BuildRequires:  makeinfo
BuildRequires:  ncurses-devel
BuildRequires:  libexpat-devel
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Source0: %{name}.rpmlintrc
Source1: http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.xz
Source2: http://isl.gforge.inria.fr/isl-%{isl_version}.tar.bz2
Source3: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.xz
Source4: http://www.bastoul.net/cloog/pages/download/cloog-%{cloog_version}.tar.gz
Source5: http://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
Source6: http://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
Source7: http://ftp.gnu.org/gnu/mpc/mpc-%{mcp_version}.tar.gz
Source8: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
Source9: http://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2
Source10: profile.sh.in
Source11: http://downloads.sourceforge.net/project/expat/expat/%{expat_version}/expat-%{expat_version}.tar.gz
Source12: https://ftp.gnu.org/gnu/ncurses/ncurses-%{ncurses_version}.tar.gz

%description
This is the gcc for the lx106 build with crosstool-NG

%prep
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE11} %{SOURCE12} .

%build
ct-ng xtensa-lx106-elf
sed -i '/CT_REMOVE_DOCS/d' .config
sed -i '/CT_INSTALL_DIR/d' .config
sed -i '/CT_PREFIX_DIR/d' .config
sed -i '/CT_LOG_PROGRESS_BAR/d' .config
sed -i '/CT_LOCAL_TARBALLS_DIR/d' .config
echo CT_LOCAL_TARBALLS_DIR="$(pwd)" >> .config
echo CT_FORBID_DOWNLOAD=y >> .config
echo CT_PREFIX_DIR="%{buildroot}/opt/cross/%{name}" >> .config
echo CT_INSTALL_DIR="%{buildroot}/opt/cross/%{name}" >> .config
echo CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE=y >> .config



ct-ng build

%install

mkdir -p %{buildroot}%{_sysconfdir}/profile.d/
sed -e 's#@TOOLCHAIN@#/opt/cross/%{name}/bin#g' %{SOURCE10} > %{buildroot}%{_sysconfdir}/profile.d/%{name}.sh
cd %{buildroot}%{_sysconfdir}/profile.d/
ln -s %{name}.sh %{name}.csh

find %{buildroot}/opt/cross/%{name} -name *.la -exec rm {} \;

# rm /opt/cross/%{name}/build.log.bz2

%fdupes %{buildroot}

%files
%defattr(-,root,root)
%{_sysconfdir}/profile.d/%{name}.sh
%{_sysconfdir}/profile.d/%{name}.csh
/opt/cross/

%changelog
openSUSE Build Service is sponsored by