Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > main-src > by-pkgid > 5121573b6e87d95dd878b60adebff5d8 > files > 10

glibc_lsb-2.2.90-4mdk.src.rpm

%define kheaders 2.4.18
%define kheadextra .4mdk

Name        	: glibc_lsb
Version     	: 2.2.90
Release     	: 4mdk
Group       	: System/Library
Summary     	: Standard shared libraries for programs - LSB version.
License   	: LGPL
URL         	: http://www.gnu.org/software/libc/

BuildRoot   	: %{_tmppath}/%{name}-%{version}-root
Provides	: lsb

Source0: ftp://prep.ai.mit.edu/pub/gnu/glibc/glibc-%{version}.tar.bz2
#Source1: ftp://prep.ai.mit.edu/pub/gnu/glibc/glibc-linuxthreads-%{version}.tar.bz2
Source10:       kernel-headers-%{kheaders}%{kheadextra}.tar.bz2
Source11:       make_versionh.sh

Patch: glibc-kernel-2.4.patch.bz2
Patch11: glibc-2.2.4-ldd-rewrite.patch.bz2
Patch12: glibc-2.2.4-hack-includes.patch.bz2

# locales in /usr/share
Patch13:	glibc-2.2-share-locale.patch.bz2

# test expects nl_langinfo(CRNCYSTR) to return NULL
Patch14:	glibc_lsb-fix-nl_langinfo_CRNCYSTR.patch.bz2

# Generated from Kernel RPM.
Patch100:       linux-%{kheaders}-mdk-headers.patch.bz2
Patch101:       kernel-headers-include-%{kheaders}.patch.bz2
Patch102:       kernel-headers_path_max_lsb.patch.bz2

# alternate ld-lsb.so
Patch200:  glibc-LSB.patch.bz2

# patches from SuSE for nice, syslog issue in lsb-run-time tests
Patch201:  glibc-2.2.5.nice2.diff.bz2  
Patch202:  glibc-2.2.5.vfprintf.diff.bz2

%ifarch ia64 sparc64 s390x
Conflicts: kernel < 2.4.0
%define enablekernel 2.4.0
%define enablemask [01].*|2.[0-3]*
%else
%define enablekernel 2.2.5
%ifarch i686
%define enablekernel2 2.4.1
%define enablemask [01].*|2.[0-3]*|2.4.0*
%else
%define enablemask [01].*|2.[0-1]*|2.2.[0-4]|2.2.[0-4][^0-9]*
%endif
%endif

%package devel
Group       	: Programming/Library
Summary     	: Additional libraries required to compile.

Requires    	: %{name} = %{version}, gcc

%package devel-static
Group       	: Programming/Library
Summary     	: Libraries for static linking.

Requires    	: %{name}-devel = %{version}

# drop locales for now (sb)
#%Package localedata
#Group       	: Programming/Library
#Summary     	: Locale data for localized programs.

%description
Contains the standard libraries that are used by almost all programs on
the system, including the most important sets of shared libraries, the 
standard C library and the standard math library. Without these libraries,
a Linux system will not function. This version is built for LSB 
compliance/development and is a supplement to the system glibc.

%description devel
These are the standard header and object files necessary for any program
that uses the standard C libraries, and nearly all programs do. This 
version is built for LSB compliance/development and is a supplement to the 
system glibc.

In addition the package includes a shell wrapper for gcc - lsbcc, that 
will correctly include/link with the lsb libraries and headers.  Use 
either by 'export CC=lsbcc' or by calling it explicitly: 
'lsbcc foo.c -o foo'.

%description devel-static
This package contains static versions of glibc. If you want to ship
statically linked programs, install this package. This version is built 
for LSB compliance/development and is a supplement to the system glibc.

#%description localedata
#Locale data for the internationalization features of the GNU C library.

%prep
%setup -n glibc-%{version} -q -a 10
%ifarch ia64
%patch11 -p1
%endif
%patch12 -p1
%patch13 -p1
%patch14 -p1

%patch200 -p1
%patch201 -p0
%patch202 -p0

# If we are building enablekernel 2.x.y glibc on older kernel,
# we have to make sure no binaries compiled against that glibc
# are ever run
case `uname -r` in
%enablemask)
%patch -p1
;; esac

%ifarch armv4l
rm -rf glibc-compat
%endif

cd kernel-headers/
%patch100 -p1
%patch101 -p1
#%patch102 -p2
%{expand:%(%__cat %{SOURCE11})}
%ifarch %{ix86}
mv asm-i386 asm/
%else
mv asm-%{_target_cpu} asm/
%endif
rm -rf $(echo asm-*|sed 's/asm-generic//')
cd -

find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;

mkdir compile-$RPM_ARCH-linux
cd compile-$RPM_ARCH-linux

%build
rm -rf build-%{_target_cpu}-linux
currentdirectory=${PWD}
mkdir build-%{_target_cpu}-linux ; cd build-%{_target_cpu}-linux
GCC=gcc
%ifarch %{ix86}
BuildFlags="-march=%{_target_cpu} -D__USE_STRING_INLINES -fstrict-aliasing"
%endif
%ifarch alphaev6
BuildFlags="-mcpu=ev6"
%endif
%ifarch sparc
BuildFlags="-fcall-used-g7"
GCC="gcc -m32"
%endif
%ifarch sparcv9
BuildFlags="-mcpu=ultrasparc -fcall-used-g7"
GCC="gcc -m32"
%endif
%ifarch sparc64
BuildFlags="-mcpu=ultrasparc -mvis -fcall-used-g7"
GCC="gcc -m64"
%endif
# Temporarily don't do this on ia64, s390 and ppc
%ifnarch ia64 s390 s390x ppc
BuildFlags="$BuildFlags -freorder-blocks"
%endif
BuildFlags="$BuildFlags -DNDEBUG=1"
EnableKernel="--enable-kernel=%{enablekernel}"
echo "$BuildFlags" > ../BuildFlags
CC="$GCC" CFLAGS="$BuildFlags -g -O3" ../configure --prefix=%{_prefix} \
	--libdir=/lib/lsb --includedir=/usr/include/lsb \
        --enable-add-ons=yes $EnableKernel \
        --with-headers=${currentdirectory}/kernel-headers \
        %{_target_cpu}-mandrake-linux
if [ -x /usr/bin/getconf ] ; then
  numprocs=$(/usr/bin/getconf _NPROCESSORS_ONLN)
  if [ $numprocs -eq 0 ]; then
    numprocs=1
  fi
else
  numprocs=1
fi
make -j$numprocs -r CFLAGS="$BuildFlags -g -O3 " PARALLELMFLAGS=-s

%install
mkdir -p $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/usr/bin
cat << EOF > $RPM_BUILD_ROOT/usr/bin/lsbcc
#!/bin/sh

if [ -z "\$1" ]; then
    echo ""
    echo "Wrapper script for gcc to build LSB compliant apps. Use by:"
    echo "'export CC=lsbcc' and then running 'make' or 'configure' normally," 
    echo "or call explicitly as you would gcc. ie: 'lsbcc foo.c -o foo'"
    echo ""
    exit 1
fi

if [ -z "\$(echo \$* | grep '\-c')" ]; then 
    gcc -L/usr/lib/lsb -Xlinker --dynamic-linker -Xlinker /lib/ld-lsb.so.1 -I/usr/include/lsb \$*
else
    gcc -L/usr/lib/lsb -I/usr/include/lsb \$*
fi
EOF

install -d $RPM_BUILD_ROOT/etc
cat << EOF > $RPM_BUILD_ROOT/etc/ld-lsb.so.conf
/lib/lsb
EOF

chmod +x $RPM_BUILD_ROOT/usr/bin/lsbcc

make -C build-%{_target_cpu}-linux install_root=$RPM_BUILD_ROOT includedir=/usr/include/lsb install </dev/null
#make -C compile-$RPM_ARCH-linux install_root=$RPM_BUILD_ROOT localedata/install-locales

ln -sf ld-%{version}.so $RPM_BUILD_ROOT/lib/lsb/ld-lsb.so.1
ln -sf lsb/ld-%{version}.so $RPM_BUILD_ROOT/lib/ld-lsb.so.1

# special ldconfig
mv $RPM_BUILD_ROOT/sbin/ldconfig $RPM_BUILD_ROOT/sbin/ldconfig-lsb

# comes with ppp-devel
rm -f $RPM_BUILD_ROOT/usr/include/lsb/if_ppp.h
rm -f $RPM_BUILD_ROOT/usr/include/lsb/net/if_ppp.h

touch $RPM_BUILD_ROOT/usr/include/lsb/gnu/stubs.h
touch $RPM_BUILD_ROOT/usr/include/lsb/bits/stdio.h
rm -f $RPM_BUILD_ROOT/usr/include/lsb/rpcsvc/rquota.?

gzip -v9n ChangeLog* || true

echo "/* GNU ld script */" > $RPM_BUILD_ROOT/usr/lib/lsb/libintl.a
cp -p $RPM_BUILD_ROOT/usr/lib/lsb/libintl.{a,so}
echo "GROUP ( libc.a )" >> $RPM_BUILD_ROOT/usr/lib/lsb/libintl.a
echo "GROUP ( libc.so )" >> $RPM_BUILD_ROOT/usr/lib/lsb/libintl.so

%clean
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_DIR/glibc-%{version}

%files
%defattr(-, root, root)
%doc README BUGS CONFORMANCE FAQ NEWS NOTES PROJECTS
/etc/ld-lsb.so.cache
%config(noreplace)/etc/ld-lsb.so.conf
/lib/lsb/ld*
/lib/lsb/lib*
/lib/ld-lsb.so.1
/sbin/ldconfig-lsb

%files devel
%defattr(-, root, root)
%doc ChangeLog*
# don't want to replace system binaries - just lsbcc (sb)
%{_bindir}/lsbcc

/usr/include/*
/usr/lib/lsb/lib*.so*
/usr/lib/lsb/*.o
/usr/lib/lsb/libc_nonshared.a

%files devel-static
%defattr(-, root, root)
# omit libc_nonshared.a
/usr/lib/lsb/?????[^n]*.a
/usr/lib/lsb/?????.a
/usr/lib/lsb/????.a


#%files localedata
#/usr/share/i18n
#/usr/share/locale
#/usr/lib/lsb/gconv
#/usr/lib/lsb/locale

%changelog

* Thu Mar 14 2002 Stew Benedict <sbenedict@mandrakesoft.com> 2.2.90-4mdk
- new kernel headers, glibc patches for nice, syslog fron SuSE
- PATH_MAX patch no longer needed

* Thu Feb 21 2002 Stew Benedict <sbenedict@mandrakesoft.com> 2.2.90-3mdk
- revert to previous CVS - update made LSB results worse

* Wed Feb 20 2002 Stew Benedict <sbenedict@mandrakesoft.com> 2.2.90-2mdk
- new CVS sync, fix locales issue in locating VSX4L psuedo language files
- change return of nl_langinfo(CRNCYSTR) to NULL, when LC_ALL=C

* Fri Feb  8 2002 Stew Benedict <sbenedict@mandrakesoft.com> 2.2.90-1mdk
- update to 2.2.90 from CVS with LSB related patches
- build using modified limits.h in kernel headers with PATH_MAX=4096
 
* Thu Sep 27 2001 Stew Benedict <sbenedict@mandrakesoft.com> 2.2.1-2mdk
- fix broken lsbcc script

* Wed Sep  5 2001 Stew Benedict <sbenedict@mandrakesoft.com> 2.2.1-1mdk
- 1st Mandrake release