fbf956a
# FORCE NOARCH
fbf956a
# This package is noarch intentionally, although it supplies binaries,
fbf956a
# as they're not intended for the build platform, but for ARM.
fbf956a
# The related discussion can be found here:
fbf956a
# https://www.redhat.com/archives/fedora-devel-list/2009-February/msg02261.html
fbf956a
%global _binaries_in_noarch_packages_terminate_build 0
fbf956a
fbf956a
%global target arm-none-eabi
513d8c5
%global pkg_version 3.1.0
fbf956a
fbf956a
Name:           %{target}-newlib
513d8c5
Version:        3.1.0
5fbb2c1
Release:        3%{?dist}
fbf956a
Summary:        C library intended for use on %{target} embedded systems
e526ca8
# For a breakdown of the licensing, see NEWLIB-LICENSING
fbf956a
License:        BSD and MIT and LGPLv2+ and ISC
fbf956a
URL:            http://sourceware.org/newlib/
e526ca8
Source0:        ftp://sourceware.org/pub/newlib/newlib-%{pkg_version}.tar.gz
fbf956a
Source1:        README.fedora
fbf956a
Source2:        NEWLIB-LICENSING
2066f30
Igor Gnatenko d047181
BuildRequires:  gcc
fbf956a
BuildRequires:  %{target}-binutils %{target}-gcc %{target}-gcc-c++ texinfo texinfo-tex
fbf956a
BuildArch:      noarch
fbf956a
fbf956a
%description
fbf956a
Newlib is a C library intended for use on embedded systems. It is a
fbf956a
conglomeration of several library parts, all under free software licenses
fbf956a
that make them easily usable on embedded products.
fbf956a
fbf956a
%prep
e526ca8
%setup -q -n newlib-%{pkg_version}
fbf956a
fbf956a
fbf956a
%build
e526ca8
rm -rf build-{newlib,nano}
e526ca8
mkdir build-{newlib,nano}
e526ca8
e526ca8
pushd build-newlib
e526ca8
beadb60
export CFLAGS_FOR_TARGET="-g -O2 -ffunction-sections -fdata-sections"
e526ca8
../configure \
e526ca8
    --prefix=%{_prefix} \
e526ca8
    --libdir=%{_libdir} \
e526ca8
    --mandir=%{_mandir} \
e526ca8
    --htmldir=%{_docdir}/html \
e526ca8
    --pdfdir=%{_docdir}/pdf \
e526ca8
    --target=%{target} \
dae730d
    --enable-newlib-io-long-long \
dae730d
    --enable-newlib-register-fini \
dae730d
    --enable-newlib-retargetable-locking \
dae730d
    --disable-newlib-supplied-syscalls \
888a399
    --disable-nls \
e526ca8
    --enable-multilib \
e526ca8
    --disable-libssp \
e526ca8
    --with-float=soft
fbf956a
d2d3479
make
fbf956a
e526ca8
popd
e526ca8
pushd build-nano
beadb60
export CFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections"
e526ca8
../configure \
e526ca8
    --prefix=%{_prefix} \
e526ca8
    --libdir=%{_libdir} \
e526ca8
    --mandir=%{_mandir} \
e526ca8
    --target=%{target} \
dae730d
    --disable-newlib-supplied-syscalls    \
dae730d
    --enable-newlib-reent-small           \
dae730d
    --disable-newlib-fvwrite-in-streamio  \
dae730d
    --disable-newlib-fseek-optimization   \
dae730d
    --disable-newlib-wide-orient          \
dae730d
    --enable-newlib-nano-malloc           \
dae730d
    --disable-newlib-unbuf-stream-opt     \
dae730d
    --enable-lite-exit                    \
dae730d
    --enable-newlib-global-atexit         \
dae730d
    --enable-newlib-nano-formatted-io     \
dae730d
    --disable-nls
dae730d
dae730d
make -j
e526ca8
e526ca8
popd
e526ca8
fbf956a
%install
e526ca8
pushd build-newlib
e526ca8
make install DESTDIR=%{buildroot}
e526ca8
popd
e526ca8
pushd build-nano
e526ca8
NANO_ROOT=%{buildroot}/nano
e526ca8
make install DESTDIR=$NANO_ROOT
e526ca8
e526ca8
for i in $(find $NANO_ROOT -regex ".*/lib\(c\|g\|rdimon\)\.a"); do
e526ca8
    file=$(basename $i | sed "s|\.a|_nano\.a|")
e526ca8
    target_path=$(dirname $i | sed "s|$NANO_ROOT||")
513d8c5
    cp $i "%{buildroot}$target_path/$file"
e526ca8
done
513d8c5
mkdir -p %{buildroot}/usr/arm-none-eabi/include/newlib-nano/
513d8c5
cp -p $NANO_ROOT/usr/arm-none-eabi/include/newlib.h %{buildroot}/usr/arm-none-eabi/include/newlib-nano/newlib.h
e526ca8
popd
e526ca8
e526ca8
cp %{SOURCE1} .
e526ca8
cp %{SOURCE2} .
e526ca8
fbf956a
# we don't want these as we are a cross version
fffaca0
rm -rf %{buildroot}%{_infodir}
fbf956a
e526ca8
rm -rf $NANO_ROOT
fbf956a
# despite us being noarch redhat-rpm-config insists on stripping our files
e2c8325
%if %{fedora}0 > 200
e2c8325
%global __os_install_post /usr/lib/rpm/brp-compress
e2c8325
%else
fbf956a
%global __os_install_post /usr/lib/rpm/redhat/brp-compress
e2c8325
%endif
e2c8325
fbf956a
fbf956a
%files
e526ca8
%doc README.fedora
e526ca8
%license NEWLIB-LICENSING COPYING*
fbf956a
%dir %{_prefix}/%{target}
e526ca8
%dir %{_prefix}/%{target}/include/
e526ca8
%{_prefix}/%{target}/include/*
fbf956a
%dir %{_prefix}/%{target}/lib
fbf956a
%{_prefix}/%{target}/lib/*
fbf956a
fbf956a
%changelog
5fbb2c1
* Mon Sep 02 2019 Michal Hlavinka <mhlavink@redhat.com> - 3.1.0-3
5fbb2c1
- rebuild with gcc 9.2.0
5fbb2c1
513d8c5
* Mon Mar 11 2019 Michal Hlavinka <mhlavink@redhat.com> - 3.1.0-2
513d8c5
- add nano version of newlib.h
513d8c5
513d8c5
* Fri Mar 08 2019 Michal Hlavinka <mhlavink@redhat.com> - 3.1.0-0
513d8c5
- updated to 3.1.0
513d8c5
513d8c5
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-5
513d8c5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
513d8c5
fa28f80
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-4
fa28f80
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
fa28f80
49cb90a
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-3
49cb90a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
49cb90a
9c55c75
* Tue Feb 06 2018 Michal Hlavinka <mhlavink@redhat.com> - 3.0.0-2
9c55c75
- updated to 3.0.0
9c55c75
fcc9807
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-3
fcc9807
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
fcc9807
beadb60
* Mon Jul 10 2017 Michal Hlavinka <mhlavink@redhat.com> - 2.5.0-2
beadb60
- make sure -Os flags are used for nano version (#1443512)
beadb60
dae730d
* Fri Jun 23 2017 Michal Hlavinka <mhlavink@redhat.com> - 2.5.0-1
dae730d
- updated to 2.5.0
dae730d
9b4e8a9
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-9
9b4e8a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9b4e8a9
b2ddc64
* Sun Nov 13 2016 Michal Hlavinka <mhlavink@redhat.com> - 2.4.0-8
b2ddc64
- bump release and rebuild
b2ddc64
a34580b
* Thu Jun 30 2016 Michal Hlavinka <mhlavink@redhat.com> - 2.4.0-7
a34580b
- updated to 2.4.0
a34580b
cc0f377
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0_1-7
cc0f377
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
cc0f377
ebbed61
* Wed Sep 02 2015 Michal Hlavinka <mhlavink@redhat.com> - 2.2.0_1-6
ebbed61
- bump release and rebuild
ebbed61
fd46a00
* Wed Sep 02 2015 Michal Hlavinka <mhlavink@redhat.com> - 2.2.0_1-5
fd46a00
- add --enable-newlib-io-long-long configure option
fd46a00
e526ca8
* Mon Aug 31 2015 Michal Hlavinka <mhlavink@redhat.com> - 2.2.0_1-4
e526ca8
- added nano versions of libraries
e526ca8
- cleaned up spec file
e526ca8
- credits: Johnny Robeson
e526ca8
ca51e53
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0_1-3
ca51e53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ca51e53
f31c0e5
* Mon Jun 01 2015 Michal Hlavinka <mhlavink@redhat.com> - 2.2.0_1-2
f31c0e5
- rebuild for gcc 5.1
f31c0e5
d2d3479
* Tue Apr 14 2015 Michal Hlavinka <mhlavink@redhat.com> - 2.2.0_1-1
d2d3479
- newlib updated to 2.2.0_1
d2d3479
e2c8325
* Mon Jun 09 2014 Michal Hlavinka <mhlavink@redhat.com> - 2.1.0-5
e2c8325
- fix FTBFS (#1105970)
e2c8325
5fdcd91
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-4
5fdcd91
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
5fdcd91
2066f30
* Tue Feb 25 2014 Michal Hlavinka <mhlavink@redhat.com> - 2.1.0-3
2066f30
- enable libnosys (#1060567,#1058722)
2066f30
a9f158a
* Tue Jan 14 2014 Michal Hlavinka <mhlavink@redhat.com> - 2.1.0-2
a9f158a
- rebuild with newer arm-none-eabi-gcc
a9f158a
fbf956a
* Wed Jan 08 2014 Michal Hlavinka <mhlavink@redhat.com> - 2.1.0-1
fbf956a
- initial import