wok-current view glibc-base/receipt @ rev 12823

glibc-base: improve ARM package
author Christophe Lincoln <pankso@slitaz.org>
date Tue May 22 10:22:47 2012 +0200 (2012-05-22)
parents 521a11df54e7
children 98e7fe8d84f0
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc-base"
4 VERSION="2.14.1"
5 CATEGORY="base-system"
6 SHORT_DESC="GNU libc minimal libraries and UTF-8 support for SliTaz."
7 WEB_SITE="http://www.gnu.org/software/libc/"
8 MAINTAINER="pankso@slitaz.org"
9 WANTED="glibc"
10 HOST_ARCH="i486 arm"
12 # Locales include by default, other locales are in: glibc-locale
13 DEFAULT_LOCALE="de_DE en_US en_GB es_ES fr_FR it_IT pt_BR pt_PT ru_RU"
15 # Handle multiarch compilation.
16 case "$ARCH" in
17 arm) VERSION="2.13" WANTED="" ;;
18 esac
20 # Rules to gen a SliTaz package suitable for Tazpkg.
21 #
22 # Full glibc is very long to compile (see package glibc for more
23 # informations). You can use the precompiled package available on
24 # SliTaz mirror to build a distro without recompiling glibc.
25 #
26 genpkg_rules()
27 {
28 case "$ARCH" in
29 arm)
30 # EXPERIMENTAL: Glibc is cross compiled by cross to have a
31 # toolchain so we can use these files instead of recooking it.
32 # 20120514: Include just minal libs for Busybox so we can create
33 # bootable Qemu image for ARM.
34 echo "Using cross compiled Glibc..."
35 mkdir -p $fs/lib $fs/etc $fs/usr/bin
36 install=/usr/cross/$ARCH
37 for bin in locale localedef
38 do
39 cp $install/bin/$bin $fs/usr/bin
40 done
41 for lib in libcrypt libm libc
42 do
43 cp -a $install/lib/${lib}-*.so $fs/lib
44 cp -a $install/lib/${lib}.so* $fs/lib
45 done
46 cp -a $install/lib/ld-*.so* $fs/lib
47 cp -a $install/lib/libnss_*.so* $fs/lib
48 cp -a $install/lib/libc_nonshared.a $fs/lib
49 cp $install/etc/rpc $fs/etc
50 touch $fs/etc/ld.so.conf
51 ## i18n
52 #mkdir -p $fs/usr/share/i18n/locales
53 #for i in $DEFAULT_LOCALE
54 #do
55 #cp $install/share/i18n/locales/$i \
56 #$fs/usr/share/i18n/locales
57 #done
58 # Fix libraries search path
59 sed -i s'|/usr/cross/arm||'g $fs/lib/libc.so ;;
60 *)
61 # Mkdir's.
62 for dir in $(cat $stuff/mkdir.list)
63 do
64 mkdir -p ${fs}$dir
65 done
66 # Copy all files specified in stuff/files.list. We get the files
67 # from glibc package.
68 for file in $(cat $stuff/wanted-files.list)
69 do
70 cp -a ${_pkg}$file ${fs}$file
71 done
72 # i18n
73 for i in $DEFAULT_LOCALE
74 do
75 cp $install/usr/share/i18n/locales/$i \
76 $fs/usr/share/i18n/locales
77 done
78 esac
79 }
81 # Remove an eventual locale-archive since we use directories.
82 pre_install()
83 {
84 rm -f $root/usr/lib/locale/locale-archive
85 }
87 # Glibc-base is auto-updated in chroot but when cross-compiling we need
88 # to have /usr/cross/$ARCH search path in libc.so
89 post_install()
90 {
91 if echo $root | grep -q /usr/cross; then
92 echo "Fixing: $root/lib/libc.so"
93 cat > $root/lib/libc.so << EOT
94 OUTPUT_FORMAT(elf32-littlearm)
95 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux.so.3 ) )
96 EOT
97 fi
98 }