wok annotate 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 |
rev | line source |
---|---|
pankso@2 | 1 # SliTaz package receipt. |
pankso@2 | 2 |
pankso@2 | 3 PACKAGE="glibc-base" |
pankso@12814 | 4 VERSION="2.14.1" |
pankso@2 | 5 CATEGORY="base-system" |
pankso@4855 | 6 SHORT_DESC="GNU libc minimal libraries and UTF-8 support for SliTaz." |
pankso@2701 | 7 WEB_SITE="http://www.gnu.org/software/libc/" |
pankso@2 | 8 MAINTAINER="pankso@slitaz.org" |
pankso@12820 | 9 WANTED="glibc" |
pankso@12835 | 10 HOST_ARCH="i486 arm x86_64" |
pankso@12804 | 11 |
pankso@12820 | 12 # Locales include by default, other locales are in: glibc-locale |
pankso@12820 | 13 DEFAULT_LOCALE="de_DE en_US en_GB es_ES fr_FR it_IT pt_BR pt_PT ru_RU" |
pankso@12820 | 14 |
pankso@12820 | 15 # Handle multiarch compilation. |
pankso@12804 | 16 case "$ARCH" in |
pankso@12835 | 17 arm|x86_64) VERSION="2.13" WANTED="" ;; |
pankso@12804 | 18 esac |
pankso@2 | 19 |
pankso@2 | 20 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@2 | 21 # |
pankso@2 | 22 # Full glibc is very long to compile (see package glibc for more |
pankso@2 | 23 # informations). You can use the precompiled package available on |
pankso@2 | 24 # SliTaz mirror to build a distro without recompiling glibc. |
pankso@2 | 25 # |
pankso@12881 | 26 |
pankso@12881 | 27 # i18n |
pankso@12881 | 28 get_locales() |
pankso@12881 | 29 { |
pankso@12881 | 30 local path=$1 |
pankso@12881 | 31 for i in $DEFAULT_LOCALE |
pankso@12881 | 32 do |
pankso@12881 | 33 cp $install/$path/i18n/locales/$i $fs/usr/share/i18n/locales |
pankso@12881 | 34 done |
pankso@12881 | 35 } |
pankso@12881 | 36 |
pankso@2 | 37 genpkg_rules() |
pankso@2 | 38 { |
pankso@12881 | 39 # Mkdir's. |
pankso@12881 | 40 for dir in $(cat $stuff/mkdir.list) |
pankso@12881 | 41 do |
pankso@12881 | 42 mkdir -p ${fs}$dir |
pankso@12881 | 43 done |
pankso@12881 | 44 |
pankso@12804 | 45 case "$ARCH" in |
pankso@12835 | 46 arm|x86_64) |
pankso@12804 | 47 # EXPERIMENTAL: Glibc is cross compiled by cross to have a |
pankso@12804 | 48 # toolchain so we can use these files instead of recooking it. |
pankso@12820 | 49 echo "Using cross compiled Glibc..." |
pankso@12804 | 50 install=/usr/cross/$ARCH |
pankso@12881 | 51 |
pankso@12881 | 52 # /usr/{bin,share} /usr/lib/gconv |
pankso@12881 | 53 for file in $(cat $stuff/arm-files.list) |
pankso@12881 | 54 do |
pankso@12881 | 55 cp -a ${install}$file ${fs}/usr/$file |
pankso@12881 | 56 done |
pankso@12881 | 57 |
pankso@12829 | 58 # /lib |
pankso@12881 | 59 for lib in libcrypt libm libc libresolv librt libutil libpthread \ |
pankso@12881 | 60 libnss_* libnsl libanl libdl |
pankso@12804 | 61 do |
pankso@12814 | 62 cp -a $install/lib/${lib}-*.so $fs/lib |
pankso@12814 | 63 cp -a $install/lib/${lib}.so* $fs/lib |
pankso@12804 | 64 done |
pankso@12814 | 65 cp -a $install/lib/ld-*.so* $fs/lib |
pankso@12814 | 66 cp -a $install/lib/libc_nonshared.a $fs/lib |
pankso@12881 | 67 cp -a $install/lib/libpthread_nonshared.a $fs/lib |
pankso@12804 | 68 cp $install/etc/rpc $fs/etc |
pankso@12814 | 69 touch $fs/etc/ld.so.conf |
pankso@12881 | 70 get_locales "share" |
pankso@12814 | 71 # Fix libraries search path |
pankso@12881 | 72 sed -i s"|/usr/cross/$ARCH||"g $fs/lib/libc.so |
pankso@12881 | 73 sed -i s"|/usr/cross/$ARCH||"g $fs/lib/libpthread.so ;; |
pankso@12804 | 74 *) |
pankso@12804 | 75 # Copy all files specified in stuff/files.list. We get the files |
pankso@12804 | 76 # from glibc package. |
pankso@12804 | 77 for file in $(cat $stuff/wanted-files.list) |
pankso@12804 | 78 do |
pankso@12881 | 79 cp -a ${install}$file ${fs}$file |
pankso@12804 | 80 done |
pankso@12881 | 81 get_locales "usr/share" |
pankso@12804 | 82 esac |
pankso@2 | 83 } |
pankso@528 | 84 |
pankso@9715 | 85 # Remove an eventual locale-archive since we use directories. |
pankso@2701 | 86 pre_install() |
pankso@2701 | 87 { |
pankso@12820 | 88 rm -f $root/usr/lib/locale/locale-archive |
pankso@2701 | 89 } |
pankso@12820 | 90 |
pankso@12820 | 91 # Glibc-base is auto-updated in chroot but when cross-compiling we need |
pankso@12820 | 92 # to have /usr/cross/$ARCH search path in libc.so |
pankso@12820 | 93 post_install() |
pankso@12820 | 94 { |
pankso@12835 | 95 # x86_64 |
pankso@12835 | 96 if echo $root | grep -q /usr/cross/x86_64; then |
pankso@12835 | 97 echo "Fixing x86_64: $root/lib/libc.so" |
pankso@12835 | 98 cat > $root/lib/libc.so << EOT |
pankso@12835 | 99 OUTPUT_FORMAT(elf64-x86-64) |
pankso@12835 | 100 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux-x86-64.so.2 ) ) |
pankso@12835 | 101 EOT |
pankso@12835 | 102 fi |
pankso@12835 | 103 # ARM |
pankso@12835 | 104 if echo $root | grep -q /usr/cross/arm; then |
pankso@12835 | 105 echo "Fixing arm: $root/lib/libc.so" |
pankso@12823 | 106 cat > $root/lib/libc.so << EOT |
pankso@12823 | 107 OUTPUT_FORMAT(elf32-littlearm) |
pankso@12823 | 108 GROUP ( $root/lib/libc.so.6 $root/lib/libc_nonshared.a AS_NEEDED ( $root/lib/ld-linux.so.3 ) ) |
pankso@12823 | 109 EOT |
pankso@12881 | 110 cat > $root/lib/libpthread.so << EOT |
pankso@12881 | 111 OUTPUT_FORMAT(elf32-littlearm) |
pankso@12881 | 112 GROUP ( $root/lib/libpthread.so.0 $root/lib/libpthread_nonshared.a ) |
pankso@12881 | 113 EOT |
pankso@12820 | 114 fi |
pankso@12820 | 115 } |