source: scripts/native-scripts/native-coreutils.sh @ 617118d

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 617118d was 617118d, checked in by Jim Gifford <clfs@…>, 18 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100755
File size: 2.2 KB
Line 
1#!/bin/bash
2
3# cross-lfs native coreutils build
4# --------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11#export COREUTILS_VER=5.2.1
12
13cd ${SRC}
14LOG=coreutils-native.log
15
16set_libdirname
17setup_multiarch
18
19unpack_tarball coreutils-${COREUTILS_VER}
20cd ${PKGDIR}
21
22# If we don't want to conform to POSIX 200212L, override
23# NOTE: This is coreutils 5.0 specific, later versions will have
24#       a configure/compile time option
25case ${COREUTILS_VER} in
26   5.1.7 | 5.[2-9]* ) ;;
27   * )   mv lib/posixver.c lib/posixver.c-ORIG
28         sed '/\/\* The POSIX version that utilities should conform to/i\
29#undef _POSIX2_VERSION\
30#define _POSIX2_VERSION 199209L\
31   ' lib/posixver.c-ORIG > lib/posixver.c
32   ;;
33esac
34
35max_log_init Coreutils ${COREUTILS_VER} "native (shared)" ${CONFLOGS} ${LOG}
36#env CFLAGS="-O2 -pipe ${TGT_CFLAGS}" ${extra_env} \
37CC="${CC-gcc} ${ARCH_CFLAGS}" \
38CFLAGS="-O2 -pipe ${TGT_CFLAGS}" DEFAULT_POSIX2_VERSION=199209 \
39./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info \
40   >> ${LOGFILE} 2>&1 &&
41echo " o Configure OK" || barf
42
43min_log_init ${BUILDLOGS} &&
44make ${PMFLAGS} LDFLAGS="-s" \
45   >> ${LOGFILE} 2>&1 &&
46echo " o Build OK" || barf
47
48min_log_init ${TESTLOGS} &&
49echo -e "\n Root Tests \n------------" >> ${LOGFILE} &&
50make check-root \
51   >> ${LOGFILE} 2>&1 &&
52echo " o Root tests OK" || errmsg
53
54echo "plfstest:x:1000:plfstest" >> /etc/group
55
56echo -e "\n User Tests \n------------" >> ${LOGFILE} &&
57su plfstest -c "env RUN_EXPENSIVE_TESTS=yes make check" \
58   >> ${LOGFILE} 2>&1 &&
59echo " o User tests OK" || errmsg
60
61mv /etc/group /etc/Xgroup
62grep -v plfstest /etc/Xgroup > /etc/group
63rm -rf /etc/Xgroup
64chmod 644 /etc/group
65
66min_log_init ${INSTLOGS} &&
67make install \
68   >> ${LOGFILE} 2>&1 &&
69echo " o ALL OK" || barf
70
71# Fileutils binaries
72mv -f /usr/bin/{chgrp,chmod,chown,cp,dd,df,install} /bin
73mv -f /usr/bin/{ln,ls,mkdir,mknod,mv,rm,rmdir,sync} /bin
74# Create /usr/bin/install -> /bin/install symlink
75ln -sf ../../bin/install /usr/bin
76
77# Textutils binaries
78mv -f /usr/bin/{cat,head} /bin
79
80# Sh-utils binaries
81mv -f /usr/bin/{basename,date,echo,false,pwd} /bin
82mv -f /usr/bin/{sleep,stty,su,test,true,uname} /bin
83mv -f /usr/bin/chroot /usr/sbin
84
85# For FHS compliance
86ln -sf test "/bin/["
Note: See TracBrowser for help on using the repository browser.