File buildroot.spec of Package buildroot-sparc

%define arch sparc
Name:       buildroot
Version:	2016.05
Release:	1
License:	various
Summary:	crosstool for strace
Source0:	%{name}-%{version}.tar.gz
Source1:	buildroot.config
BuildRequires:  gcc-c++ bison flex ncurses-devel python 
BuildRequires:  wget zip unzip gzip patch bzip2 subversion bc rsync
%if 0%{?fedora_version} >= 20
BuildRequires: ncurses

%if 0%{?suse_version} >= 1300
BuildRequires: ncurses-utils

%global __os_install_post %{nil}

BuildArch:      x86_64
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define pkg_root        /opt/buildroot-%{arch}
%define toolchain_path  %{pkg_root}/toolchain
%define images_path     %{pkg_root}/images
%define debug_package %{nil}

crosstool to build strace on different architectures

%package -n buildroot-toolchain-%{arch}
Version:	0
Release:	1
Summary:	Buildroot Crosstools
AutoReqProv:    off

%description -n buildroot-toolchain-%{arch}
Buildroot cross-toolchain.

%package -n buildroot-images-%{arch}
Version:	0
Release:	1
Summary:	Buildroot rootfs images
%if 0%{?fedora_version} >= 20
Requires:   libmpc

%description -n buildroot-images-%{arch}
Buildroot root filesystem images.

%setup -q

cp %{SOURCE1} .config
make oldconfig

export DONT_STRIP=1
export NO_BRP_CHECK_RPATH=true
export NO_BRP_STRIP_DEBUG=true

mkdir -p %{buildroot}%{images_path}
tar -C output/images -c . | tar -C %{buildroot}%{images_path} -xf -

chmod 644 %{buildroot}%{images_path}/*

mkdir -p %{buildroot}%{toolchain_path}
rm -rf output/host/usr/share/{man,info,locale,doc}
tar -C output/host -c . | tar -C %{buildroot}%{toolchain_path} -xf -

chmod 644 %{buildroot}%{toolchain_path}/usr/lib/*.a

rm -rf %{buildroot}

%files -n buildroot-toolchain-%{arch}

%files -n buildroot-images-%{arch}