wok-next view glibc-base/receipt @ rev 17155
tup: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Sep 14 09:47:19 2014 +0200 (2014-09-14) |
parents | f398031ad845 |
children | c963361d3d54 |
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 LICENSE="GPL2"
10 WANTED="glibc"
11 HOST_ARCH="i486 arm x86_64"
13 # Locales include by default, other locales are in: locale-** and glibc-locale
14 DEFAULT_LOCALE="en_US en_GB"
16 # Handle multiarch compilation.
17 case "$ARCH" in
18 arm*|x86_64) VERSION="2.13" WANTED="" ;;
19 esac
21 # Handle multiarch installation.
22 case "$SLITAZ_ARCH" in
23 arm*|x86_64) VERSION="2.13" WANTED="" ;;
24 esac
26 # Rules to gen a SliTaz package suitable for Tazpkg.
27 #
28 # Full glibc is very long to compile (see package glibc for more
29 # informations). You can use the precompiled package available on
30 # SliTaz mirror to build a distro without recompiling glibc.
31 #
33 # i18n
34 get_locales()
35 {
36 local path=$1
37 for i in $DEFAULT_LOCALE
38 do
39 cp $install/$path/i18n/locales/$i $fs/usr/share/i18n/locales
40 done
41 }
43 genpkg_rules()
44 {
45 # Mkdir's.
46 for dir in $(cat $stuff/mkdir.list)
47 do
48 mkdir -p ${fs}$dir
49 done
51 case "$ARCH" in
52 arm*)
53 # Eglibc is cross compiled by cross to have a toolchain so we can
54 # use these files instead of recooking it. ARM use Eglibc
55 echo "Using cross compiled Eglibc..."
56 install=/cross/$ARCH/sysroot
58 # /usr/{bin,share} /usr/lib/gconv
59 for file in $(cat $stuff/arm-files.list)
60 do
61 cp -a ${install}$file ${fs}$file
62 done
64 # libs
65 for lib in libcrypt libm libc libresolv librt libutil libpthread \
66 libnss_* libnsl libanl libdl
67 do
68 cp -a $install/lib/${lib}-*.so $fs/lib
69 cp -a $install/lib/${lib}.so* $fs/lib
70 cp -a $install/usr/lib/${lib}.so $fs/usr/lib
71 done
72 cp -a $install/lib/ld-*.so* $fs/lib
73 cp -a $install/usr/lib/libc_nonshared.a $fs/usr/lib
74 cp -a $install/usr/lib/libpthread_nonshared.a $fs/usr/lib
75 cp $install/etc/rpc $fs/etc
76 touch $fs/etc/ld.so.conf
77 touch $fs/etc/ld.so.cache
78 get_locales "usr/share" ;;
79 x86_64)
80 # EXPERIMENTAL: Glibc is cross compiled by cross to have a
81 # toolchain so we can use these files instead of recooking it.
82 echo "Using cross compiled Glibc..."
83 install=/usr/cross/$ARCH
85 # /usr/{bin,share} /usr/lib/gconv
86 for file in $(cat $stuff/arm-files.list)
87 do
88 cp -a ${install}$file ${fs}/usr/$file
89 done
91 # /lib
92 for lib in libcrypt libm libc libresolv librt libutil libpthread \
93 libnss_* libnsl libanl libdl
94 do
95 cp -a $install/lib/${lib}-*.so $fs/lib
96 cp -a $install/lib/${lib}.so* $fs/lib
97 done
98 cp -a $install/lib/ld-*.so* $fs/lib
99 cp -a $install/lib/libc_nonshared.a $fs/lib
100 cp -a $install/lib/libpthread_nonshared.a $fs/lib
101 cp $install/etc/rpc $fs/etc
102 touch $fs/etc/ld.so.conf
103 get_locales "share"
104 # Fix libraries search path
105 sed -i s"|/usr/cross/$ARCH||"g $fs/lib/libc.so
106 sed -i s"|/usr/cross/$ARCH||"g $fs/lib/libpthread.so ;;
107 *)
108 # Copy all files specified in stuff/files.list. We get the files
109 # from glibc package.
110 for file in $(cat $stuff/wanted-files.list)
111 do
112 cp -a ${install}$file ${fs}$file
113 done
114 get_locales "usr/share"
115 esac
116 }
118 # Remove an eventual locale-archive since we use directories.
119 pre_install()
120 {
121 rm -f $root/usr/lib/locale/locale-archive
122 }
124 # Glibc-base is auto-updated in chroot but when cross-compiling we need
125 # to have /usr/cross/$ARCH search path in libc.so
126 post_install()
127 {
128 # x86_64
129 if echo $root | grep -q /usr/cross/x86_64; then
130 echo "Fixing x86_64: $root/lib/libc.so"
131 cat > $root/lib/libc.so << EOT
132 OUTPUT_FORMAT(elf64-x86-64)
133 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux-x86-64.so.2 ) )
134 EOT
135 fi
136 }