newlib/newlib.spec
Funda Wang f40563e0d6 do not remove info/dir by default
(cherry picked from commit 3fa9bdb868b4c5dc9070ebe6d80d37a6c933d0d9)
2025-02-12 21:31:06 +08:00

85 lines
2.1 KiB
RPMSpec

%global debug_package %{nil}
%global _newlib newlib
%global __brp_remove_info_dir %{nil}
Name: newlib
Version: 3.3.0
Release: 6
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
Patch01: Modify-neon-instruction.patch
Patch02: fix-CVE-2024-30949.patch
BuildRequires: make gcc binutils texinfo texinfo-tex
Excludearch: loongarch64
%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 -p1
%build
rm -rf build-newlib
mkdir build-newlib
cd build-newlib
%if "%toolchain" == "clang"
export CFLAGS="-O2 -D_FORTIFY_SOURCE=0 -ffreestanding"
%else
export CFLAGS="-O2 -D_FORTIFY_SOURCE=0"
%endif
../newlib/configure --prefix=%{_prefix}
make %{?_smp_mflags}
cd ..
%install
export AM_UPDATE_INFO_DIR=yes
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 Feb 12 2025 Funda Wang <fundawang@yeah.net> - 3.3.0-6
- do not remove info/dir by default
* Wed Sep 25 2024 changtao <changtao@kylinos.cn> - 3.3.0-5
- fix CVE-2024-30949
* Sat Jun 08 2024 yueyuankun <yueyuankun@kylinos.cn> - 3.3.0-4
- add Excludearch: loongarch64
* Wed Sep 6 2023 renyi <977713017@qq.com> - 3.3.0-3
- Support building this package with clang
* 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