File cross-sh4-glibc-bootstrap.spec of Package cross-sh4-glibc-bootstrap

#
# spec file for package glibc (Version 2.5)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           cross-sh4-glibc-bootstrap
BuildRequires:  cross-sh4-binutils cross-sh4-kernel-headers cross-sh4-gcc-bootstrap
BuildRequires:  gcc-c++ libstdc++-devel
License:        BSD License and BSD-like, GNU General Public License (GPL)
Summary:        Standard Shared Libraries (from the GNU C Library)
Group:          System/Libraries
Autoreqprov:    off
Version:        2.5
Release:        47
%define snapshot_date 2006101200
Autoprov:       no
Provides:       cross-sh4-glibc-bootstrap
URL:            http://www.gnu.org/software/libc/libc.html
PreReq:         filesystem
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         glibc-%{version}-%{snapshot_date}.tar.bz2
Source1:        glibc-nptl-%{version}-%{snapshot_date}.tar.bz2
Source3:        noversion.tar.bz2
Source4:        manpages.tar.bz2
Source8:        nsswitch.conf
Source9:        nscd.init
Source10:       bindresvport.blacklist
Source11:       ctype_b.c
Source12:       glibc_post_upgrade.c
Source14:       powerpc-cpu.tar.bz2
#
Patch0:         glibc-2.3-SuSE.diff
Patch1:         glibc-2.3.90-noversion.diff
Patch2:         glibc-2.3.90-fnmatch.diff
Patch3:         resolv.dynamic.diff
Patch4:         glibc-2.3.locales.diff.bz2
Patch5:         crypt_blowfish-glibc-2.3.diff
Patch6:         glibc-version.diff
Patch9:         glibc-2.4.90-revert-only-euro.diff
Patch10:        glibc-2.3-regcomp.diff
Patch11:        glibc-2.3.2-revert_tcsetattr.diff
Patch12:        glibc-2.3.1.localedef.diff
Patch14:        glibc-2.3.2.no_archive.diff
Patch15:        glibc-2.3.3-amd64-string.diff
Patch16:        libm-x86-64.diff
Patch17:        glibc-2.3.90-bindresvport.blacklist.diff
Patch18:        glibc-suse-note.diff
Patch19:        glibc-2.4.90-no_NO.diff
Patch20:        glibc-2.3.90-zic.diff
Patch21:        glibc-2.3.90-ld.so-madvise.diff
Patch22:        glibc-2.3.3-amd64-s_ceil.diff
Patch23:        glibc-2.4.90-mdns-resolver.diff
Patch24:        glibc-2.3.3-execstack.diff
Patch25:        glibc-2.4-china.diff
Patch26:        glibc-2.3.4-gb18030-big5hkscs.diff.bz2
Patch27:        glibc-2.4.90-nscd.diff
Patch28:        glibc-2.3.3-nscd-db-path.diff
Patch29:        glibc-2.3.5-nscd-zeronegtimeout.diff
Patch30:        glibc-2.3.90-langpackdir.diff
Patch31:        glibc-nptl-2.4-nofixsyscallnr.diff
Patch32:        crypt_blowfish-1.0.diff
Patch33:        glibc-2.4.90-bdirect.diff
Patch34:        glibc-2.5-ldconfig-old-cache.diff
Patch35:        glibc-2.5-mallopt.diff
Patch36:        timezone.diff
Patch37:        glibc-2.5-strtod.diff
Patch38:        glibc-2.5-nscd-getpwnam.diff
Patch39:        glibc-2.5-personality.diff
Patch40:        glibc-2.5-dladdr.diff
Patch41:        glibc-2.5-makecontext.diff
Patch42:        glibc-2.5-nscd-gc-clientraces.diff
Patch43:        glibc-2.5-ppc-llrintl.diff
Patch44:        glibc-2.5-nptl-forkref.diff
# cross build specific patches
Patch100:       make-install-lib-all.patch
Patch101:       libm-no-z-defs.patch


%define HOST %(echo %{_target_cpu}|sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/")-suse-linux
%define TARGET %(echo %{name}|sed -e "s/cross-\\(.*\\)-glibc-bootstrap/\\1/;s/-/_/g;s/parisc/hppa/;s/i.86/i586/;s/ppc/powerpc/")

%description
The GNU C Library provides the most important standard libraries used
by nearly all programs: the standard C library, the standard math
library, and the POSIX thread library.  A system is not functional
without these libraries.
This is a boostrap version without the programs to build a complete crosscompiler

%prep
%setup -n glibc-2.5 -q -a 1 -a 3 -a 4 -a 14
%patch
# libNoVersion part is only active on ix86
%patch1
%patch2
%patch3
%patch4
%patch6
%patch9
%patch10
%patch11
%patch12
%patch14
%patch15
# strncmp is broken, let's delete it for now this way
rm sysdeps/x86_64/strncmp.S
%patch16 -E
# We have s_sincos.c in patch20, remove duplicate
rm sysdeps/x86_64/fpu/s_sincos.S
%patch17
%patch18
%patch19
%patch20
%patch21
%patch22
%patch23
%patch24
%patch25
%patch26
%patch27
%patch28
%patch29
%patch30
%patch31
%patch32
%patch33
%patch34
%patch35
%patch36
%patch37
%patch38
%patch39
%patch40
%patch41
%patch42
%patch43
%patch44
%patch100
%patch101
%patch5
find . -name configure | xargs touch

%build
echo "#define CONFHOST \"%{_target_cpu}-suse-linux\"" >> version.h
echo "#define CVSDATE \"`date -r ChangeLog +%Y%m%d`\"" >> version.h
mkdir -p build-glibc-bootstrap
cd build-glibc-bootstrap
libc_cv_forced_unwind="yes" \
libc_cv_c_cleanup="yes" \
../configure --build=%{_target_cpu}-suse-linux --host=%{TARGET}-linux \
             --prefix=/usr \
             --disable-profile --without-cvs \
             --with-sysroot=/opt/cross/%{TARGET}-linux/sys-root \
             --disable-sanity-checks
make cross-compiling=yes LD="sh4-linux-ld" RANLIB="sh4-linux-ranlib" lib

%install
HEADERDIR="$RPM_BUILD_ROOT/opt/cross/%{TARGET}-linux/sys-root/usr/include"
cd build-glibc-bootstrap
make install_root=$RPM_BUILD_ROOT/opt/cross/%{TARGET}-linux/sys-root \
        install-lib-all install-headers
# Two headers -- stubs.h and features.h -- aren't installed by install-headers
test -f $HEADERDIR/gnu/stubs.h || touch $HEADERDIR/gnu/stubs.h
test -f $HEADERDIR/features.h || cp ../include/features.h $HEADERDIR/
test -f $HEADERDIR/bits/stdio_lim.h || cp bits/stdio_lim.h $HEADERDIR/bits/
# Fix the .so files in /usr/lib - they point outside the sysroot
for lib in libpthread.so libc.so; do
  sed -i -e 's,/usr/lib/,,g;s,/lib/,,g' $RPM_BUILD_ROOT/opt/cross/%{TARGET}-linux/sys-root/usr/lib/$lib
done


%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/opt/cross/%{TARGET}-linux

%changelog -n cross-sh4-glibc-bootstrap
* Tue May  8 2007 - martin.mohring@5etech.eu
- moved to new upstream version
* Sat Apr 21 2007 - martin.mohring@5etech.eu
- upstream merge with new glibc update
- renamed locally added patches for crossbuild+sh4
* Wed Feb 21 2007 - martin.mohring@5etech.eu
- corrected version.h handling
- fixed configure options
* Tue Feb 20 2007 - martin.mohring@5etech.eu
- upstream merge with new glibc update
- missing installed packages dependencies
* Tue Feb 13 2007 - martin.mohring@5etech.eu
- Initial checkin, specfile derived by openSUSE:Factory/glibc
openSUSE Build Service is sponsored by