wok view glibc-base/receipt @ rev 12881

glibc: include locale files in ARM, more lib and improve receipt
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 25 23:24:13 2012 +0200 (2012-05-25)
parents b61c615f20eb
children cb4299f34f9d
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 x86_64"
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|x86_64) 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 #
27 # i18n
28 get_locales()
29 {
30 local path=$1
31 for i in $DEFAULT_LOCALE
32 do
33 cp $install/$path/i18n/locales/$i $fs/usr/share/i18n/locales
34 done
35 }
37 genpkg_rules()
38 {
39 # Mkdir's.
40 for dir in $(cat $stuff/mkdir.list)
41 do
42 mkdir -p ${fs}$dir
43 done
45 case "$ARCH" in
46 arm|x86_64)
47 # EXPERIMENTAL: Glibc is cross compiled by cross to have a
48 # toolchain so we can use these files instead of recooking it.
49 echo "Using cross compiled Glibc..."
50 install=/usr/cross/$ARCH
52 # /usr/{bin,share} /usr/lib/gconv
53 for file in $(cat $stuff/arm-files.list)
54 do
55 cp -a ${install}$file ${fs}/usr/$file
56 done
58 # /lib
59 for lib in libcrypt libm libc libresolv librt libutil libpthread \
60 libnss_* libnsl libanl libdl
61 do
62 cp -a $install/lib/${lib}-*.so $fs/lib
63 cp -a $install/lib/${lib}.so* $fs/lib
64 done
65 cp -a $install/lib/ld-*.so* $fs/lib
66 cp -a $install/lib/libc_nonshared.a $fs/lib
67 cp -a $install/lib/libpthread_nonshared.a $fs/lib
68 cp $install/etc/rpc $fs/etc
69 touch $fs/etc/ld.so.conf
70 get_locales "share"
71 # Fix libraries search path
72 sed -i s"|/usr/cross/$ARCH||"g $fs/lib/libc.so
73 sed -i s"|/usr/cross/$ARCH||"g $fs/lib/libpthread.so ;;
74 *)
75 # Copy all files specified in stuff/files.list. We get the files
76 # from glibc package.
77 for file in $(cat $stuff/wanted-files.list)
78 do
79 cp -a ${install}$file ${fs}$file
80 done
81 get_locales "usr/share"
82 esac
83 }
85 # Remove an eventual locale-archive since we use directories.
86 pre_install()
87 {
88 rm -f $root/usr/lib/locale/locale-archive
89 }
91 # Glibc-base is auto-updated in chroot but when cross-compiling we need
92 # to have /usr/cross/$ARCH search path in libc.so
93 post_install()
94 {
95 # x86_64
96 if echo $root | grep -q /usr/cross/x86_64; then
97 echo "Fixing x86_64: $root/lib/libc.so"
98 cat > $root/lib/libc.so << EOT
99 OUTPUT_FORMAT(elf64-x86-64)
100 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux-x86-64.so.2 ) )
101 EOT
102 fi
103 # ARM
104 if echo $root | grep -q /usr/cross/arm; then
105 echo "Fixing arm: $root/lib/libc.so"
106 cat > $root/lib/libc.so << EOT
107 OUTPUT_FORMAT(elf32-littlearm)
108 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux.so.3 ) )
109 EOT
110 cat > $root/lib/libpthread.so << EOT
111 OUTPUT_FORMAT(elf32-littlearm)
112 GROUP ( $root/lib/libpthread.so.0 $root/lib/libpthread_nonshared.a )
113 EOT
114 fi
115 }