%global debug_package %{nil}
%global _newlib newlib
Name:           newlib
Version:        3.3.0
Release:        2
Summary:        Newlib is a C library intended for use on embedded systems.

License:        BSD
URL:            https://sourceware.org/newlib/
Source0:        ftp://sourceware.org/pub/newlib/newlib-%{version}.tar.gz

BuildRequires:  make gcc binutils texinfo texinfo-tex

%description

Newlib is a C library intended for use on embedded systems. It is a conglomeration 
of several library parts, all under free software licenses that make them easily 
usable on embedded products. 


%prep
%autosetup


%build
rm -rf build-newlib
mkdir build-newlib
cd build-newlib
export CFLAGS="-O2 -D_FORTIFY_SOURCE=0"
../newlib/configure --prefix=%{_prefix}
make %{?_smp_mflags}
cd ..


%install
rm -rf %{buildroot}
cd build-newlib
make DESTDIR=%{buildroot}%{_prefix}/%{_newlib} install install-info
cd ..


%files
%license COPYING*
%{_prefix}/%{_newlib}%{_prefix}/include/*.h
%{_prefix}/%{_newlib}%{_prefix}/include/sys/*.h
%{_prefix}/%{_newlib}%{_prefix}/include/ssp/*.h
%{_prefix}/%{_newlib}%{_prefix}/include/machine/*.h
%{_prefix}/%{_newlib}%{_prefix}/lib/lib{c,m,g}.a
%doc
%{_prefix}/%{_newlib}%{_prefix}/share/info/dir
%{_prefix}/%{_newlib}%{_prefix}/share/info/libc.info
%{_prefix}/%{_newlib}%{_prefix}/share/info/libc.info-{1,2}
%{_prefix}/%{_newlib}%{_prefix}/share/info/libm.info


%changelog
* Wed Dec 15 2021 jiangxinyu <jiangxinyu@kylinos.cn> - 3.3.0-2
- Remove the release suffix

* Sat Sep 25 2021 Lijinpei <lijinpei@huawei.com>
- Package init