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