Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > c273e24ca93c9417925d6987cbe7e203 > files > 3

x86-compat-libs-9.0-2mdk.src.rpm

%define name	x86-compat-libs
%define version	9.0
%define release	2mdk

%define flatten	0
%define bilibc	0
%ifarch x86_64
%define prefix	%{nil}
%define libdirs	/lib /usr/lib /usr/X11R6/lib
%define flatten	0
%define bilibc	1
%endif
%ifarch ia64
%define prefix	/emul/ia32-linux
%define	libdirs	/lib
%define flatten	1
%define bilibc	0
%endif

Summary:	Runtime libraries for x86 Mandrake Linux %{version} compatibility
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	GPL/LGPL/X11/MIT
Source0:	x86-compat-libs-%{version}.tar.bz2
Source1:	genx86compat
Group:		System/Libraries
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot
ExclusiveArch:	ia64 x86_64
%ifarch x86_64
# newer glibc are biarch
Conflicts:	glibc < 2.2.5-21mdk
%endif
PreReq:		/sbin/ldconfig

%description
This package includes a number of run-time libraries that are compiled
on Mandrake Linux %{version} for IA-32. This package is required if
you want to run x86 binaries on your IA-64 or X86-64 system.

%prep
%setup -q

%build
# The libraries and the loader are already in the tarball

# x86-64 has working biarch support for generating gcc libraries
%ifarch x86_64
rm -f ./lib/libgcc_s*.so*
rm -f ./usr/lib/libstdc++.so.*
%endif

# x86-64 has working biarch support for generating glibc libraries
%if %{bilibc}
rm -f ./loader/ld-linux*.so*
rm -f ./lib/libBrokenLocale*.so*
rm -f ./lib/lib{c,crypt,dl,m,nsl,nss_*,pthread,resolv,rt,thread_db,util}.so.*
rm -f ./lib/lib{c,crypt,dl,m,nsl,nss_*,pthread,resolv,rt,thread_db,util}-*.so
%endif

%install
rm -rf $RPM_BUILD_ROOT

# Install genx86compat script here so that %doc grabs it
install -m 755 %{SOURCE1} .

# Copy core libraries
for libdir in $(find . -type d -name lib); do
  mkdir -p $RPM_BUILD_ROOT%{prefix}/$libdir
  tar cf - $libdir/* | tar xf - -C $RPM_BUILD_ROOT%{prefix}
%if %{flatten}
  if [ "$libdir" != "./lib" ]; then
    mkdir -p $RPM_BUILD_ROOT%{prefix}/lib
    mv $RPM_BUILD_ROOT%{prefix}/$libdir/* $RPM_BUILD_ROOT%{prefix}/lib
    rmdir $RPM_BUILD_ROOT%{prefix}/$libdir
  fi
%endif
done

# Generate filelist
rm -f files.list
for libdir in $(find $RPM_BUILD_ROOT%{prefix} -type d -name lib); do
  echo "%dir $libdir" >> files.list
  ls $libdir/lib*.so* >> files.list
done
perl -pi -e "s|$RPM_BUILD_ROOT||" files.list

# Install dynamic linker
%if !%{bilibc}
mkdir -p $RPM_BUILD_ROOT/lib
install -m 755 loader/ld-linux.so.2 $RPM_BUILD_ROOT/lib/
%endif

# Don't strip nor create symlinks, everything shall be fine in the tarball
export DONT_STRIP=1
export DONT_SYMLINK_LIBS=1

%clean
rm -rf $RPM_BUILD_ROOT

%post
for libdir in %{libdirs}; do
  libdir="%{prefix}$libdir"
  if ! grep -q "^$libdir\$" /etc/ld.so.conf; then
    case $libdir in
      /lib | /usr/lib )
        # skip default search library dirs
        # NOTE: don't skip since ldconfig doesn't handle biarch
        echo "$libdir" >> /etc/ld.so.conf
        ;;
      * )
        echo "$libdir" >> /etc/ld.so.conf
        ;;
    esac
  fi
done
/sbin/ldconfig

%postun
if [ "$1" = "0" ]; then
  rm -f /etc/ld.so.conf.new
  grep -v "/usr/X11R6/lib" /etc/ld.so.conf > /etc/ld.so.conf.new
  mv -f /etc/ld.so.conf.new /etc/ld.so.conf
fi
/sbin/ldconfig

%files -f files.list
%defattr(-,root,root)
%doc genx86compat
%if !%{bilibc}
/lib/ld-linux*.so*
%endif

%changelog
* Mon Dec  9 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 9.0-2mdk
- glibc/x86-64 is now a biarch package thus obsoleting libc from here

* Wed Sep 25 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 9.0-1mdk
- MDK 9.0 release

* Thu Aug  8 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 9.0-0.20020808.1mdk
- MDK 9.0 snapshot 2002/08/08
- Add libXmuu.so.1

* Mon Jul 22 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 9.0-0.20020721.2mdk
- Fix typos in %%description
- Fix %%post when grepping out system search dirs

* Sun Jul 21 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 9.0-0.20020721.1mdk
- MDK 9.0 snapshot 2002/07/21
- Include genx86compat script
- Remove broken symlinks to libraries
- Remove libnss_ldap, libnss_db, libg++.so.2.7.2
- Add libintl.so.2, liblcms.so.1, libpng12.so.0.1.2.4, libsofttokn3.so

* Tue Oct 30 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 8.1-5mdk
- Add libplc4.so, libplds4.so (mozilla)

* Tue Oct 16 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 8.1-4mdk
- Add libXv, libXxf86dga, libcups (wine)

* Thu Oct 11 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 8.1-3mdk
- Add Provides: libodbc.so, libodbcinst.so (Sun JRE 1.3.1)

* Tue Oct  9 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 8.1-2mdk
- Add libstdc++-libc6.1-1 (netscape)
- Fix libodbcinst (Sun JRE 1.3.1)

* Mon Oct  1 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 8.1-1mdk
- First Mandrake Linux version