File cross-mips64-file.spec of Package cross-file

%define cross_arch mips64
Name:           cross-%{cross_arch}-file
Version:        5.25
Release:        0
Summary:        Foo
License:        BSD-2-Clause
Group:          foo
Source:         file-%{version}.tar.gz
Source1:        cross-file-rpmlintrc
Patch0:         mmap.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  cross-%{cross_arch}-binutils
BuildRequires:  cross-%{cross_arch}-gcc
BuildRequires:  cross-%{cross_arch}-glibc-devel
Requires:       libmagic1
Provides:       cross-%{cross_arch}-file-devel

%description
Foo

%define gcc_target_arch %{cross_arch}-suse-linux

%define sysroot %{_prefix}/%{gcc_target_arch}/sys-root

%define cross_lib lib
%if "%{cross_arch}" == "mips64"
%define cross_lib lib64
%endif
%define cross_libdir %{_prefix}/%{cross_lib}

%prep
%setup -q -n file-%{version}
%patch0

%build
./configure \
	--host=%{gcc_target_arch} \
	--prefix=%{_prefix} \
	--libdir=%{cross_libdir} \
	--sysconfdir=%{_sysconfdir} \
	--datadir=%{_datadir} \

make %{?_smp_mflags}

%install
export NO_BRP_STRIP_DEBUG=true
export NO_DEBUGINFO_STRIP_DEBUG=true
make %{?_smp_mflags} install \
     DESTDIR=%{buildroot}%{sysroot}
rm -f %{buildroot}%{sysroot}%{cross_libdir}/*.la

%files
%defattr(-,root,root)
%dir %{sysroot}
%dir %{sysroot}%{_prefix}
%{sysroot}%{_prefix}/

%changelog