wok view glibc/receipt @ rev 25735
Remove iptraf: replaced by iptraf-ng
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Aug 23 09:39:49 2024 +0000 (2 months ago) |
parents | 324b3fa82b76 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.14.1"
5 CATEGORY="meta"
6 SHORT_DESC="The GNU C libraries. This package is used to compile the libc."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.gnu.org/software/libc/"
11 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
13 DEPENDS="glibc-base glibc-locale glibc-dev"
14 BUILD_DEPENDS="linux-api-headers autoconf bash advancecomp"
16 # Genpkg order for tazwok.
17 COOK_OPT="genpkg=glibc-base:glib-locale:glibc-dev"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://ftp.gnu.org/gnu/$PACKAGE/ 2>/dev/null | \
23 sed '/href="glibc-[0-9]/!d;/tar/!d;s|.*>glibc-||;s|.tar.*||' | \
24 sort -Vr | sed q
25 }
27 # Rules to compile & install the temporary toolchain.
28 cook_tmp_toolchain()
29 {
30 cd $src
32 # Glibc Bug Fixes Patch from LFS
33 patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
34 # Glibc Bug Sort Relocatable Objects Patch
35 patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
36 # Fix a bug that prevents Glibc from building with GCC-4.6.2
37 patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
38 # GHOST
39 patch -Np1 -i $stuff/glibc-2.14.1-CVE-2015-0235.patch
41 # Build in a separate directory.
42 mkdir ../glibc-build && cd ../glibc-build
44 # glibc no longer support i386, so use -march=i486 for better compatibility.
45 # If i686 ???
46 unset CFLAGS CXXFLAGS
47 case $ARCH in
48 i386|i486)
49 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
50 *)
51 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
52 esac
54 { $src/configure \
55 --host=$HOST_SYSTEM \
56 --build=$($src/scripts/config.guess) \
57 --disable-profile --enable-add-ons \
58 --enable-kernel=2.6.30 --with-headers=/tools/include \
59 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
60 make -j1 &&
61 make -j1 install
62 } || return 1
64 # Link compiler to this new glibc.
65 SPECS=`dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name)`/specs
66 $HOST_SYSTEM-gcc -dumpspecs | sed \
67 -e 's@/lib\(64\)\?/ld@/tools&@g' \
68 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
69 unset SPECS
70 }
72 # Rules to configure and make the package.
73 compile_rules()
74 {
75 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
76 # default to build package will not ensure package work with Busybox awk
77 # and so should NOT be use to cook.
78 if [ -x /usr/bin/cook ]; then
79 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
80 fi
82 # Make 4.x support...
83 sed -i 's/3\.79/4.* | &/' configure*
84 # Fixes and patches from LFS, Redhat
85 sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
86 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
88 # Glibc misc Bug Fixes
89 patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
91 # Glibc Bug Sort Relocatable Objects Patch
92 #patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
94 # Fix a bug that prevents Glibc from building with GCC-4.6.2
95 patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
97 # Revert commit causing issues with crappy DNS servers
98 patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
100 # re-export RPC interface until libtirpc is ready as a replacement
101 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (only fedora branch...)
102 patch -Np1 -i $stuff/glibc-2.14-reexport-rpc-interface.patch
103 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (only fedora branch...)
104 patch -Np1 -i $stuff/glibc-2.14-reinstall-nis-rpc-headers.patch
105 # GHOST
106 patch -Np1 -i $stuff/glibc-2.14.1-CVE-2015-0235.patch
108 # Update for binutils 2.29, see https://sourceware.org/bugzilla/show_bug.cgi?id=21661
109 sed -i 's|obstack_compat;|obstack_compat __attribute__ ((nocommon));|' malloc/obstack.c
111 # Fix a stack imbalance that occurs under some conditions:
112 sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
113 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
114 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
116 # Glibc needs ld.so.conf in the install destdir.
117 mkdir -p $WOK/$PACKAGE/install/etc
118 touch $WOK/$PACKAGE/install/etc/ld.so.conf
119 mkdir ../glibc-build && cd ../glibc-build
121 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
122 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
123 # "The higher the VERSION number is, the less compatibility code is
124 # added, and the faster the code gets."
125 unset CFLAGS CXXFLAGS
126 case "$ARCH" in
127 i386|i486)
128 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
129 *)
130 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
131 esac
132 { $src/configure \
133 --disable-profile \
134 --enable-add-ons \
135 --enable-kernel=2.6.30 \
136 --libexecdir=/usr/lib/glibc \
137 --build=$HOST_SYSTEM \
138 --host=$HOST_SYSTEM \
139 --target=$BUILD_SYSTEM &&
140 make -j1 && make install_root=$DESTDIR install
141 } || return 1
142 for i in $DESTDIR/usr/share/i18n/charmaps/*.gz ; do
143 advdef -z4 $i
144 done
146 # If temporary toolchain was previously used, switch to regular toolchain.
147 [ -d /tools ] || return
148 mv /tools/bin/ld /tools/bin/ld-old
149 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
150 mv /tools/bin/ld-new /tools/bin/ld
151 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
152 gcc -dumpspecs | sed -e 's@/tools@@g' \
153 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
154 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
155 `dirname $(gcc --print-libgcc-file-name)`/specs
156 }
158 # Rules to gen a SliTaz package suitable for Tazpkg.
159 genpkg_rules()
160 {
161 LOCALE=""
162 mkdir -p $fs/var
164 # Remove build directory.
165 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
166 rm -rf $WOK/$PACKAGE/$PACKAGE-build
168 # check install
169 ls $install/lib/
170 }