wok-current view glibc-base/receipt @ rev 14530

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