wok-next view glibc-base/receipt @ rev 12869
asleap: Clean up.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Thu May 24 21:37:15 2012 +0000 (2012-05-24) |
parents | 98e7fe8d84f0 |
children | 4d4b18813d25 |
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 #
26 genpkg_rules()
27 {
28 case "$ARCH" in
29 arm|x86_64)
30 # EXPERIMENTAL: Glibc is cross compiled by cross to have a
31 # toolchain so we can use these files instead of recooking it.
32 echo "Using cross compiled Glibc..."
33 install=/usr/cross/$ARCH
34 mkdir -p $fs/lib $fs/etc $fs/usr/bin \
35 $fs/usr/lib/gconv $fs/usr/share/i18n/charmaps
36 # /usr/bin
37 for bin in locale localedef
38 do
39 cp $install/bin/$bin $fs/usr/bin
40 done
41 # /lib
42 for lib in libcrypt libm libc libresolv librt libutil libpthread
43 do
44 cp -a $install/lib/${lib}-*.so $fs/lib
45 cp -a $install/lib/${lib}.so* $fs/lib
46 done
47 cp -a $install/lib/ld-*.so* $fs/lib
48 cp -a $install/lib/libnss_*.so* $fs/lib
49 cp -a $install/lib/libc_nonshared.a $fs/lib
50 cp $install/etc/rpc $fs/etc
51 touch $fs/etc/ld.so.conf
52 # i18n
53 cp $install/lib/gconv/UNICODE.so $fs/usr/lib/gconv
54 #cp -a $install/share/i18n/charmaps/UTF-8.gz \
55 #$fs/usr/share/i18n/charmaps
56 # Fix libraries search path
57 sed -i s"|/usr/cross/$ARCH||"g $fs/lib/libc.so ;;
58 *)
59 # Mkdir's.
60 for dir in $(cat $stuff/mkdir.list)
61 do
62 mkdir -p ${fs}$dir
63 done
64 # Copy all files specified in stuff/files.list. We get the files
65 # from glibc package.
66 for file in $(cat $stuff/wanted-files.list)
67 do
68 cp -a ${_pkg}$file ${fs}$file
69 done
70 # i18n
71 for i in $DEFAULT_LOCALE
72 do
73 cp $install/usr/share/i18n/locales/$i \
74 $fs/usr/share/i18n/locales
75 done
76 esac
77 }
79 # Remove an eventual locale-archive since we use directories.
80 pre_install()
81 {
82 rm -f $root/usr/lib/locale/locale-archive
83 }
85 # Glibc-base is auto-updated in chroot but when cross-compiling we need
86 # to have /usr/cross/$ARCH search path in libc.so
87 post_install()
88 {
89 # x86_64
90 if echo $root | grep -q /usr/cross/x86_64; then
91 echo "Fixing x86_64: $root/lib/libc.so"
92 cat > $root/lib/libc.so << EOT
93 OUTPUT_FORMAT(elf64-x86-64)
94 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux-x86-64.so.2 ) )
95 EOT
96 fi
97 # ARM
98 if echo $root | grep -q /usr/cross/arm; then
99 echo "Fixing arm: $root/lib/libc.so"
100 cat > $root/lib/libc.so << EOT
101 OUTPUT_FORMAT(elf32-littlearm)
102 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux.so.3 ) )
103 EOT
104 fi
105 }