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