Browse code

Remove build tools step, use default rpm dbpath during make iso

Vinay Kulkarni authored on 2015/06/26 09:35:07
Showing 9 changed files
... ...
@@ -29,34 +29,34 @@ else
29 29
 PHOTON_PUBLISH_RPMS := publish-rpms
30 30
 endif
31 31
 
32
-.PHONY : all iso clean toolchain toolchain-minimal photon-build-machine photon-vagrant-build photon-vagrant-local \
32
+.PHONY : all iso clean photon-build-machine photon-vagrant-build photon-vagrant-local \
33 33
 check check-bison check-g++ check-gawk check-createrepo check-vagrant check-packer check-packer-ovf-plugin check-package-list \
34 34
 clean-install clean-chroot
35 35
 
36 36
 all: iso
37 37
 
38
-iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES) $(PHOTON_TOOLCHAIN_MINIMAL)
38
+iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES)
39 39
 	@echo "Building Photon ISO..."
40 40
 	@cd $(PHOTON_INSTALLER_DIR) && \
41
-    $(PHOTON_INSTALLER) -i $(PHOTON_STAGE)/photon.iso \
42
-                        -w $(PHOTON_STAGE)/photon_iso \
43
-                        -l $(PHOTON_STAGE)/LOGS \
44
-                        -r $(PHOTON_STAGE)/RPMS \
45
-                        -p $(PHOTON_INSTALLER_PACKAGE_LIST) \
46
-                        -f > \
47
-        $(PHOTON_LOGS_DIR)/installer.log 2>&1
41
+        $(PHOTON_INSTALLER) -i $(PHOTON_STAGE)/photon.iso \
42
+                -w $(PHOTON_STAGE)/photon_iso \
43
+                -l $(PHOTON_STAGE)/LOGS \
44
+                -r $(PHOTON_STAGE)/RPMS \
45
+                -p $(PHOTON_INSTALLER_PACKAGE_LIST) \
46
+                -f > \
47
+                $(PHOTON_LOGS_DIR)/installer.log 2>&1
48 48
 
49 49
 packages: check $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES)
50 50
 	@echo "Building all RPMS..."
51 51
 	@cd $(PHOTON_PKG_BUILDER_DIR) && \
52
-    $(PHOTON_PACKAGE_BUILDER) -o full \
53
-                              -s $(PHOTON_SPECS_DIR) \
54
-                              -r $(PHOTON_RPMS_DIR) \
55
-                              -x $(PHOTON_SRCS_DIR) \
56
-                              -b $(PHOTON_CHROOT_PATH) \
57
-                              -l $(PHOTON_LOGS_DIR) \
58
-                              -p $(PHOTON_PUBLISH_RPMS_DIR) \
59
-                              -j $(PHOTON_PACKAGE_LIST)
52
+        $(PHOTON_PACKAGE_BUILDER) -o full \
53
+                -s $(PHOTON_SPECS_DIR) \
54
+                -r $(PHOTON_RPMS_DIR) \
55
+                -x $(PHOTON_SRCS_DIR) \
56
+                -b $(PHOTON_CHROOT_PATH) \
57
+                -l $(PHOTON_LOGS_DIR) \
58
+                -p $(PHOTON_PUBLISH_RPMS_DIR) \
59
+                -j $(PHOTON_PACKAGE_LIST)
60 60
 
61 61
 packages-cached:
62 62
 	@echo "Using cached RPMS..."
... ...
@@ -86,47 +86,6 @@ publish-rpms-cached:
86 86
 	@$(MKDIR) -p $(PHOTON_PUBLISH_RPMS_DIR) && \
87 87
 	 $(CP) -rf $(PHOTON_PUBLISH_RPMS_PATH)/* $(PHOTON_PUBLISH_RPMS_DIR)/
88 88
 
89
-toolchain-minimal : $(PHOTON_TOOLCHAIN_MINIMAL)
90
-
91
-$(PHOTON_TOOLCHAIN_MIN_LIST): ;
92
-
93
-$(PHOTON_TOOLCHAIN_MINIMAL) : $(PHOTON_TOOLCHAIN) $(PHOTON_TOOLCHAIN_MIN_LIST)
94
-	echo "Building minimal toolchain..."
95
-	@$(RMDIR) $(PHOTON_TOOLS_DIR) && \
96
-	cd $(PHOTON_STAGE) && \
97
-	$(TAR) xvf $(PHOTON_TOOLCHAIN) > $(PHOTON_LOGS_DIR)/toolchain-minimal.log 2>&1 && \
98
-    $(TAR) cvfz \
99
-           $@ \
100
-           -T $(PHOTON_TOOLCHAIN_MIN_LIST) >> \
101
-              $(PHOTON_LOGS_DIR)/toolchain-minimal.log 2>&1 && \
102
-	$(RMDIR) $(PHOTON_TOOLS_DIR)
103
-
104
-toolchain : $(PHOTON_TOOLCHAIN)
105
-
106
-ifdef PHOTON_CACHE_PATH
107
-
108
-$(PHOTON_TOOLCHAIN): check $(PHOTON_STAGE)
109
-	@echo "Using cached toolchain..."
110
-	@$(RM) -f $(PHOTON_TOOLCHAIN) && \
111
-	 $(CP) -f $(PHOTON_CACHE_PATH)/tools-build.tar $(PHOTON_TOOLCHAIN)
112
-
113
-else
114
-
115
-$(PHOTON_TOOLCHAIN): $(PHOTON_STAGE) $(PHOTON_SOURCES)
116
-	@if [ -a $(PHOTON_TOOLCHAIN) ] ; then \
117
-		echo "Using already built toolchain"; \
118
-	else \
119
-		echo "Building toolchain..."; \
120
-		cd $(PHOTON_TOOLCHAIN_DIR) && \
121
-				$(PHOTON_TOOLCHAIN_BUILDER) \
122
-					$(PHOTON_SRCS_DIR) \
123
-					$(PHOTON_SPECS_DIR) \
124
-					$(PHOTON_LOGS_DIR) \
125
-					$(PHOTON_STAGE) ;\
126
-	fi
127
-
128
-endif
129
-
130 89
 $(PHOTON_STAGE):
131 90
 	@echo "Creating staging folder..."
132 91
 	$(MKDIR) -p $(PHOTON_STAGE)
... ...
@@ -214,9 +214,6 @@ class Installer(object):
214 214
         if ('type' in self.install_config and (self.install_config['type'] in ['micro', 'minimal'])) or self.install_config['iso_system']:
215 215
             rpm_params = rpm_params + ' --excludedocs '
216 216
 
217
-        if not self.iso_installer:
218
-            rpm_params = rpm_params + ' --dbpath ' + self.photon_root + '/var/lib/rpm '
219
-
220 217
         process = subprocess.Popen([self.install_package_command, '-w', self.photon_root, package_name, rpm_params],  stdout=self.output)
221 218
 
222 219
         return process.wait()
... ...
@@ -95,7 +95,7 @@ createrepo --database ${WORKINGDIR}/RPMS
95 95
 rm -rf ${BUILDROOT}/LOGS
96 96
 
97 97
 #Remove our rpm database as it fills up the ramdisk
98
-rm -rf ${BUILDROOT}/var/lib/rpm
98
+rm -rf ${BUILDROOT}/home/*
99 99
 # TODO: mbassiouny, Find a clean way to do that
100 100
 for i in `ls ${BUILDROOT}/usr/share/`; do
101 101
 	if [ $i != 'terminfo' -a $i != 'cracklib' -a $i != 'grub' ]; then
... ...
@@ -19,13 +19,6 @@ SRCROOT := $(realpath $(SRCROOT))
19 19
 MAKEROOT := $(realpath $(MAKEROOT))
20 20
 
21 21
 PHOTON_STAGE?=$(SRCROOT)/stage
22
-PHOTON_TOOLS_DIR=$(PHOTON_STAGE)/tools
23
-PHOTON_TOOLCHAIN_DIR=$(SRCROOT)/support/toolchain
24
-PHOTON_TOOLCHAIN=$(PHOTON_STAGE)/tools-build.tar
25
-PHOTON_TOOLCHAIN_MINIMAL=$(PHOTON_STAGE)/tools.tar.gz
26
-PHOTON_TOOLCHAIN_MIN_LIST=$(PHOTON_TOOLCHAIN_DIR)/tools-minimal.list
27
-PHOTON_TOOLCHAIN_BUILDER=$(PHOTON_TOOLCHAIN_DIR)/mk-tools.sh
28
-PHOTON_TOOLS_MAKE=$(PHOTON_TOOLS_DIR)/bin/make
29 22
 PHOTON_LOGS_DIR=$(PHOTON_STAGE)/LOGS
30 23
 PHOTON_RPMS_DIR=$(PHOTON_STAGE)/RPMS
31 24
 PHOTON_SPECS_DIR?=$(SRCROOT)/SPECS
... ...
@@ -20,9 +20,6 @@ class constants(object):
20 20
     listCoreToolChainRPMPackages=["linux-api-headers", "glibc","glibc-devel",  "zlib","zlib-devel",  "file",
21 21
         "binutils","binutils-devel",  "gmp","gmp-devel", "mpfr", "mpfr-devel", "mpc",
22 22
         "libgcc","libgcc-devel","libstdc++","libstdc++-devel","libgomp","libgomp-devel","gcc",
23
-        "pkg-config","bash", "glibc","glibc-devel", "zlib","zlib-devel", "file",
24
-        "binutils","binutils-devel",  "gmp","gmp-devel", "mpfr", "mpfr-devel", "mpc",
25
-        "libgcc","libgcc-devel","libstdc++","libstdc++-devel","libgomp","libgomp-devel","gcc",
26 23
         "pkg-config","bash"]
27 24
     
28 25
     listToolChainRPMPkgsToInstall=["linux-api-headers", "glibc","glibc-devel",  "zlib","zlib-devel",  "file",
29 26
deleted file mode 100755
... ...
@@ -1,6 +0,0 @@
1
-#	Editable variables follow
2
-BUILDDIR=/mnt/photonroot			# where to build toolchain
3
-MKFLAGS="-j $(getconf _NPROCESSORS_ONLN)"	# how many processors on this host
4
-LOGFILE="$(date +%Y-%m-%d).log"			# this is where we log the build to 
5
-BUILD_TGT=$(uname -m)-photon-linux-gnu
6
-
7 1
deleted file mode 100755
... ...
@@ -1,56 +0,0 @@
1
-die() {	local _red="\\033[1;31m"
2
-	local _normal="\\033[0;39m"
3
-	[ -n "$*" ] && printf "${_red}$*${_normal}\n"
4
-	exit 1
5
-}
6
-msg() {
7
-	printf "%s\n" "${1}"
8
-}
9
-msg_line() {
10
-	printf "%s" "${1}"
11
-}
12
-msg_failure() {
13
-	local _red="\\033[1;31m"
14
-	local _normal="\\033[0;39m"
15
-	printf "${_red}%s${_normal}\n" "FAILURE"
16
-	exit 2
17
-}
18
-msg_success() {
19
-	local _green="\\033[1;32m"
20
-	local _normal="\\033[0;39m"
21
-	printf "${_green}%s${_normal}\n" "SUCCESS"
22
-	return 0
23
-}
24
-build() {
25
-	# $1 = message 
26
-	# $2 = command
27
-	# $3 = log file
28
-	local _start=$(date +%s)
29
-	local _msg="${1}"
30
-	local _cmd="${2}"
31
-	local _logfile="${3}"
32
-	if [ "/dev/null" == "${_logfile}" ]; then
33
-		msg_line "${_msg}: "
34
-		eval ${_cmd} >> ${_logfile} 2>&1 && msg_success || msg_failure 
35
-	else
36
-		msg_line "${_msg}: "
37
-		printf "\n%s\n\n" "###       ${_msg}       ###" >> ${_logfile} 2>&1
38
-		eval ${_cmd} >> ${_logfile} 2>&1 && msg_success || msg_failure 
39
-		fi
40
-
41
-	local _end=$(date +%s)
42
-	local _elapsed=$((_end-_start))
43
-	echo "Elapsed time: ${_elapsed} seconds" >> ${_logfile} 2>&1
44
-	return 0
45
-}
46
-unpack() {	# $1 = directory
47
-	# $2 = source package name I'll find the suffix thank you
48
-	local _dir=${1%%/BUILD*} # remove BUILD from path
49
-	local i=${2}
50
-	local p=$(echo ${_dir}/SOURCES/${i}*.tar.*)
51
-	[ -e ${p} ] || p=$(echo ${_dir}/SOURCES/${i}*.gz)
52
-	msg_line "	Unpacking: ${i}: "
53
-	[ -e ${p} ] || die " File not found: FAILURE"
54
-	tar xf ${p} && msg_success || msg_failure
55
-	return 0
56
-}
57 1
\ No newline at end of file
58 2
deleted file mode 100755
... ...
@@ -1,976 +0,0 @@
1
-#!/bin/bash
2
-#################################################
3
-#	Title:	mk-tools			#
4
-#        Date:	2015-01-14			#
5
-#     Version:	1.0				#
6
-#      Author:	dthaluru@vmware.com     	#
7
-#     Options:					#
8
-#################################################
9
-set -o errexit		# exit if error...insurance ;)
10
-set -o nounset		# exit if variable not initalized
11
-set +h			# disable hashall
12
-source config.inc
13
-source function.inc
14
-KERNEL_VERSION=$(head -n 1 kernel-version.txt)
15
-PRGNAME=${0##*/}	# script name minus the path
16
-
17
-if [ $# -lt 3 ]; then
18
-   echo "Usage: $PRGNAME <source_path> <log_path> <dest path>"
19
-   exit 1
20
-fi
21
-
22
-SOURCE_PATH=$1
23
-SPECS_PATH=$2
24
-LOG_PATH=$3
25
-DESTDIR=$4
26
-LOGFILE=${LOG_PATH}/"${PRGNAME}-${LOGFILE}"	#	set log file name
27
-[ ${EUID} -eq 0 ]	|| die "${PRGNAME}: Need to be root user: FAILURE"
28
-[ -z ${BUILDDIR} ]		&& die "${PRGNAME}: Build path: not set"
29
-[ -z ${BUILD_TGT} ]     && die "${PRGNAME}: Environment not set: FAILURE"
30
-> ${LOGFILE}		#	clear/initialize logfile
31
-
32
-[ -d ${BUILDDIR} ]	        || build "Creating directory: ${BUILDDIR}" "install -vdm 755 ${BUILDDIR}" "${LOGFILE}"
33
-[ -d ${BUILDDIR} ]		&& build "Clean directory: ${BUILDDIR}" "rm -rf ${BUILDDIR}/* " "${LOGFILE}"
34
-[ -d ${BUILDDIR} ]		|| build "Setting directory permissions: ${BUILDDIR}" "chmod 755 ${BUILDDIR}" "${LOGFILE}"
35
-[ -d /tools ]			&& build "Removing directory: /tools" "rm -rf /tools " "${LOGFILE}"
36
-[ -h /tools ]			&& build "Removing existing symlink: /tools" "rm /tools " "${LOGFILE}"
37
-[ -d ${BUILDDIR}/tools ]	|| build "Creating directory: ${BUILDDIR}/tools" "install -vdm 755 ${BUILDDIR}/tools" "${LOGFILE}"
38
-build "Symlink: ${BUILDDIR}/tools to /tools" "ln -vs ${BUILDDIR}/tools /" "${LOGFILE}"
39
-
40
-PATH=/tools/bin:/bin:/usr/bin
41
-msg "Install build system: "
42
-build "	Installing directories" "install -vdm 755 ${BUILDDIR}/{BUILD,SOURCES,PATCHES,LOGS,SCRIPTS}" "${LOGFILE}"
43
-build "	Copying files" "cp -var ${SOURCE_PATH} ${BUILDDIR}/" "${LOGFILE}"
44
-build "	Copying files" "find -L ${SPECS_PATH} -name ""*.patch"" -exec cp ""{}"" ${BUILDDIR}/PATCHES \;" "${LOGFILE}"
45
-build "	Copying files" "cp -var SCRIPTS ${BUILDDIR}/" "${LOGFILE}"
46
-cd ${BUILDDIR}
47
-
48
-build-binutils1() {
49
-	local	_pkgname="binutils"
50
-	local	_pkgver="2.25"
51
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
52
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
53
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
54
-	> ${_logfile}
55
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
56
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
57
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
58
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
59
-	build "	Create work directory" "install -vdm 755 ../build" ${_logfile}
60
-	build "	Change directory: ../build" "pushd ../build" ${_logfile}
61
-	build "	Configure" "../${_pkgname}-${_pkgver}/configure --prefix=/tools --with-sysroot=${BUILDDIR} --with-lib-path=/tools/lib --target=${BUILD_TGT} --disable-nls --disable-werror" ${_logfile}
62
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
63
-	[ "x86_64" == $(uname -m) ] && build "		Create symlink for amd64" "install -vdm 755 /tools/lib;ln -vfs lib /tools/lib64" ${_logfile}
64
-	build "	Install" "make install" ${_logfile}
65
-	build "	Restore directory" "popd " /dev/null
66
-	build "	Restore directory" "popd " /dev/null
67
-	build "	Restore directory" "popd " /dev/null
68
-	>  ${_complete}
69
-	return 0
70
-}
71
-
72
-build-gcc1() {
73
-	local	_pkgname="gcc"
74
-	local	_pkgver="4.8.2"
75
-	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
76
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
77
-	local	_pwd=${PWD}/BUILD
78
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
79
-	> ${_logfile}
80
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
81
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
82
-	build "	Create work directory" "install -vdm 755 build" ${_logfile}
83
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
84
-	unpack "${PWD}" "mpfr-3.1.2"
85
-	unpack "${PWD}" "gmp-5.1.3"
86
-	unpack "${PWD}" "mpc-1.0.2"
87
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
88
-	build "	Symlinking gmp" " ln -vs ../gmp-5.1.3  gmp" ${_logfile}
89
-	build "	Symlinking mpc" " ln -vs ../mpc-1.0.2  mpc" ${_logfile}
90
-	build "	Symlinking mpfr" "ln -vs ../mpfr-3.1.2 mpfr" ${_logfile}
91
-	build "	Fixing headers" 'for file in $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h); do cp -uv $file{,.orig};sed -e "s@/lib\(64\)\?\(32\)\?/ld@/tools&@g" -e "s@/usr@/tools@g" $file.orig > $file;printf "\n%s\n%s\n%s\n%s\n\n" "#undef STANDARD_STARTFILE_PREFIX_1" "#undef STANDARD_STARTFILE_PREFIX_2" "#define STANDARD_STARTFILE_PREFIX_1 \"/tools/lib/\"" "#define STANDARD_STARTFILE_PREFIX_2 \"\" ">> $file;touch $file.orig;done' ${_logfile}
92
-	build "	sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure" "sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure" ${_logfile}
93
-	build "	Change directory: ../build" "pushd ../build" ${_logfile}
94
-	build "	Configure" "../${_pkgname}-${_pkgver}/configure --target=${BUILD_TGT} --prefix=/tools --with-sysroot=${BUILDDIR} --with-newlib --without-headers --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libitm --disable-libmudflap --disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libstdc++-v3 --enable-languages=c,c++ --with-mpfr-include=${_pwd}/${_pkgname}-${_pkgver}/mpfr/src --with-mpfr-lib=${_pwd}/build/mpfr/src/.libs" ${_logfile}
95
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
96
-	build "	Install" "make install" ${_logfile}
97
-	build "	Symlinking libgcc_eh.a" 'ln -vs libgcc.a $(${BUILD_TGT}-gcc -print-libgcc-file-name | sed "s/libgcc/&_eh/")' ${_logfile}
98
-	build "	Restore directory" "popd " /dev/null
99
-	build "	Restore directory" "popd " /dev/null
100
-	build "	Restore directory" "popd " /dev/null
101
-	>  ${_complete}
102
-	return 0
103
-}
104
-build-linux-api-headers() {
105
-	local	_pkgname="linux"
106
-	local	_pkgver=${KERNEL_VERSION}
107
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
108
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
109
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
110
-	> ${_logfile}
111
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
112
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
113
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
114
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
115
-	build "	make mrproper" "make mrproper" ${_logfile}
116
-	build "	make headers_check" "make headers_check" ${_logfile}
117
-	build "	make INSTALL_HDR_PATH=dest headers_install" "make INSTALL_HDR_PATH=dest headers_install" ${_logfile}
118
-	build "	cp -rv dest/include/* /tools/include" "cp -rv dest/include/* /tools/include" ${_logfile}
119
-	build "	Restore directory" "popd " /dev/null
120
-	build "	Restore directory" "popd " /dev/null
121
-	>  ${_complete}
122
-	return 0
123
-}
124
-build-glibc() {
125
-	local	_pkgname="glibc"
126
-	local	_pkgver="2.21"
127
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
128
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
129
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
130
-	> ${_logfile}
131
-	[ ! -r /usr/include/rpc/types.h ] && build "	Copying rpc headers to host system" \
132
-		"su -c 'mkdir -pv /usr/include/rpc' && su -c 'cp -v sunrpc/rpc/*.h /usr/include/rpc'"  ${_logfile}
133
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
134
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
135
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
136
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
137
-	build "	Create work directory" "install -vdm 755 ../build" ${_logfile}
138
-	build "	Change directory: ../build" "pushd ../build" ${_logfile}
139
-	build "	Configure" "../${_pkgname}-${_pkgver}/configure --prefix=/tools --host=${BUILD_TGT} --build=$(../${_pkgname}-${_pkgver}/scripts/config.guess) --disable-profile --enable-kernel=2.6.32 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_ctors_header=yes libc_cv_c_cleanup=yes" ${_logfile}
140
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
141
-	build "	Install" "make install" ${_logfile}
142
-	build "	Restore directory" "popd " /dev/null
143
-	build "	Restore directory" "popd " /dev/null
144
-	build "	Restore directory" "popd " /dev/null
145
-	msg_line "       Checking glibc for sanity: "
146
-	echo 'main(){}' > dummy.c
147
-	${BUILD_TGT}-gcc dummy.c
148
-	retval=$(readelf -l a.out | grep ': /tools')
149
-	rm dummy.c a.out
150
-	retval=${retval##*: }	# strip [Requesting program interpreter: 
151
-	retval=${retval%]}	# strip ]
152
-	case "${retval}" in
153
-		"/tools/lib/ld-linux.so.2")		msg_success ;;
154
-		"/tools/lib64/ld-linux-x86-64.so.2")	msg_success ;;
155
-		*)					msg_line "       Glibc is insane: "msg_failure ;;
156
-	esac
157
-	>  ${_complete}
158
-	return 0
159
-}
160
-build-libstdc++() {
161
-	local	_pkgname="gcc"
162
-	local	_pkgver="4.8.2"
163
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
164
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
165
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
166
-	> ${_logfile}
167
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
168
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
169
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
170
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
171
-	build "	Create work directory" "install -vdm 755 ../build" ${_logfile}
172
-	build "	Change directory: ../build" "pushd ../build" ${_logfile}
173
-	build "	Configure" "../${_pkgname}-${_pkgver}/libstdc++-v3/configure --host=${BUILD_TGT} --prefix=/tools --disable-multilib --disable-shared --disable-nls --disable-libstdcxx-threads --disable-libstdcxx-pch --with-gxx-include-dir=/tools/${BUILD_TGT}/include/c++/${_pkgver}" ${_logfile}
174
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
175
-	build "	Install" "make install" ${_logfile}
176
-	build "	Restore directory" "popd " /dev/null
177
-	build "	Restore directory" "popd " /dev/null
178
-	build "	Restore directory" "popd " /dev/null
179
-	>  ${_complete}
180
-	return 0
181
-}
182
-build-binutils2() {
183
-	local	_pkgname="binutils"
184
-	local	_pkgver="2.25"
185
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
186
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
187
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
188
-	> ${_logfile}
189
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
190
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
191
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
192
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
193
-	build "	Create work directory" "install -vdm 755 ../build" ${_logfile}
194
-	build "	Change directory: ../build" "pushd ../build" ${_logfile}
195
-	build "	Configure" "CC=${BUILD_TGT}-gcc AR=${BUILD_TGT}-ar RANLIB=${BUILD_TGT}-ranlib ../${_pkgname}-${_pkgver}/configure --prefix=/tools --disable-nls --with-lib-path=/tools/lib --with-sysroot" ${_logfile}
196
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
197
-	build "	Install" "make install" ${_logfile}
198
-	build "	make -C ld clean" "make -C ld clean" ${_logfile}
199
-	build "	make -C ld LIB_PATH=/usr/lib:/lib" "make -C ld LIB_PATH=/usr/lib:/lib" ${_logfile}
200
-	build "	cp -v ld/ld-new /tools/bin" "cp -v ld/ld-new /tools/bin" ${_logfile}
201
-	build "	Restore directory" "popd " /dev/nullPWD
202
-	build "	Restore directory" "popd " /dev/null
203
-	build "	Restore directory" "popd " /dev/null
204
-	>  ${_complete}
205
-	return 0
206
-}
207
-build-gcc2() {
208
-	local	_pkgname="gcc"
209
-	local	_pkgver="4.8.2"
210
-	local	_pwd=${PWD}/BUILD
211
-	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
212
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
213
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
214
-	> ${_logfile}
215
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
216
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
217
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
218
-	unpack "${PWD}" "mpfr-3.1.2"
219
-	unpack "${PWD}" "gmp-5.1.3"
220
-	unpack "${PWD}" "mpc-1.0.2"
221
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
222
-	build "	Symlinking gmp" " ln -vs ../gmp-5.1.3  gmp" ${_logfile}
223
-	build "	Symlinking mpc" " ln -vs ../mpc-1.0.2  mpc" ${_logfile}
224
-	build "	Symlinking mpfr" "ln -vs ../mpfr-3.1.2 mpfr" ${_logfile}
225
-	build "	Fixing limits.h" 'cat gcc/limitx.h gcc/glimits.h gcc/limity.h > $(dirname $( ${BUILD_TGT}-gcc -print-libgcc-file-name))/include-fixed/limits.h' ${_logfile}
226
-	[ "x86_64" == $(uname -m) ] || build "	Adding -fomit-frame-pointer to CFLAGS" 'sed -i "s/^T_CFLAGS =$/& -fomit-frame-pointer/" gcc/Makefile.in' ${_logfile}
227
-	build "	Fixing headers" 'for file in $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h); do cp -uv $file{,.orig};sed -e "s@/lib\(64\)\?\(32\)\?/ld@/tools&@g" -e "s@/usr@/tools@g" $file.orig > $file;printf "\n%s\n%s\n%s\n%s\n\n" "#undef STANDARD_STARTFILE_PREFIX_1" "#undef STANDARD_STARTFILE_PREFIX_2" "#define STANDARD_STARTFILE_PREFIX_1 \"/tools/lib/\"" "#define STANDARD_STARTFILE_PREFIX_2 \"\" ">> $file;touch $file.orig;done' ${_logfile}
228
-	build "	Create work directory" "install -vdm 755 ../build" ${_logfile}
229
-	build "	Change directory: ../build" "pushd ../build" ${_logfile}
230
-	build "	Configure" "CC=${BUILD_TGT}-gcc CXX=${BUILD_TGT}-g++ AR=${BUILD_TGT}-ar RANLIB=${BUILD_TGT}-ranlib ../${_pkgname}-${_pkgver}/configure --prefix=/tools --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --with-mpfr-include=${_pwd}/${_pkgname}-${_pkgver}/mpfr/src --with-mpfr-lib=${_pwd}/build/mpfr/src/.libs" ${_logfile}
231
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
232
-	build "	Install" "make install" ${_logfile}
233
-	build "	ln -sv gcc /tools/bin/cc" "ln -sv gcc /tools/bin/cc" ${_logfile}
234
-	build "	Restore directory" "popd " /dev/null
235
-	build "	Restore directory" "popd " /dev/null
236
-	build "	Restore directory" "popd " /dev/null
237
-	msg_line "       Checking glibc for sanity: "
238
-	echo 'main(){}' > dummy.c
239
-	${BUILD_TGT}-gcc dummy.c
240
-	retval=$(readelf -l a.out | grep ': /tools')
241
-	rm dummy.c a.out
242
-	retval=${retval##*: }	# strip [Requesting program interpreter: 
243
-	retval=${retval%]}	# strip ]
244
-	case "${retval}" in
245
-		"/tools/lib/ld-linux.so.2")	     msg_success ;;
246
-		"/tools/lib64/ld-linux-x86-64.so.2") msg_success ;;
247
-		*)					msg_line "       GCC is insane: "msg_failure ;;
248
-	esac
249
-	>  ${_complete}
250
-	return 0
251
-}
252
-build-tcl() {
253
-	local	_pkgname="tcl"
254
-	local	_pkgver="8.6.1"
255
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
256
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
257
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
258
-	> ${_logfile}
259
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
260
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
261
-	unpack "${PWD}" "${_pkgname}${_pkgver}-src"
262
-	build "	Change directory: ${_pkgname}${_pkgver}/unix" "pushd ${_pkgname}${_pkgver}/unix" ${_logfile}
263
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
264
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
265
-	build "	Install" "make install" ${_logfile}
266
-	build "	Installing Headers" "make install-private-headers" ${_logfile}
267
-	build "	chmod -v u+w /tools/lib/libtcl8.6.so" "chmod -v u+w /tools/lib/libtcl8.6.so" ${_logfile}
268
-	build "	ln -sv tclsh8.6 /tools/bin/tclsh" " ln -sv tclsh8.6 /tools/bin/tclsh" ${_logfile}
269
-	build "	Restore directory" "popd " /dev/null
270
-	build "	Restore directory" "popd " /dev/null
271
-	>  ${_complete}
272
-	return 0
273
-}
274
-build-expect() {
275
-	local	_pkgname="expect"
276
-	local	_pkgver="5.45"
277
-	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
278
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
279
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
280
-	> ${_logfile}
281
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
282
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
283
-	unpack "${PWD}" "${_pkgname}${_pkgver}"
284
-	build "	Change directory: ${_pkgname}${_pkgver}" "pushd ${_pkgname}${_pkgver}" ${_logfile}
285
-	build "	cp -v configure{,.orig}" "cp -v configure{,.orig}" ${_logfile}
286
-	build "	sed 's:/usr/local/bin:/bin:' configure.orig > configure" "sed 's:/usr/local/bin:/bin:' configure.orig > configure" ${_logfile}
287
-	build "	Configure" "./configure --prefix=/tools --with-tcl=/tools/lib --with-tclinclude=/tools/include" ${_logfile}
288
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
289
-	build "	Install" 'make SCRIPTS="" install' ${_logfile}
290
-	build "	Restore directory" "popd " /dev/null
291
-	build "	Restore directory" "popd " /dev/null
292
-	>  ${_complete}
293
-	return 0
294
-}
295
-build-dejagnu() {
296
-	local	_pkgname="dejagnu"
297
-	local	_pkgver="1.5.1"
298
-	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
299
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
300
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
301
-	> ${_logfile}
302
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
303
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
304
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
305
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
306
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
307
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
308
-	build "	Install" "make install" ${_logfile}
309
-	build "	Restore directory" "popd " /dev/null
310
-	build "	Restore directory" "popd " /dev/null
311
-	>  ${_complete}
312
-	return 0
313
-}
314
-build-check() {
315
-	local	_pkgname="check"
316
-	local	_pkgver="0.9.14"
317
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
318
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
319
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
320
-	> ${_logfile}
321
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
322
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
323
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
324
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
325
-	build "	Configure" "PKG_CONFIG= ./configure --prefix=/tools" ${_logfile}
326
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
327
-	build "	Install" "make install" ${_logfile}
328
-	build "	Restore directory" "popd " /dev/null
329
-	build "	Restore directory" "popd " /dev/null
330
-	>  ${_complete}
331
-	return 0
332
-}
333
-build-ncurses() {
334
-	local	_pkgname="ncurses"
335
-	local	_pkgver="5.9"
336
-	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
337
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
338
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
339
-	> ${_logfile}
340
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
341
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
342
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
343
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
344
-	build "	Configure" "./configure --prefix=/tools --with-shared --without-debug --without-ada --enable-widec --enable-overwrite" ${_logfile}
345
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
346
-	build "	Install" "make install" ${_logfile}
347
-	build "	Restore directory" "popd " /dev/null
348
-	build "	Restore directory" "popd " /dev/null
349
-	>  ${_complete}
350
-	return 0
351
-}
352
-build-bash() {
353
-	local	_pkgname="bash"
354
-	local	_pkgver="4.3"
355
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
356
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
357
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
358
-	> ${_logfile}
359
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
360
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
361
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
362
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
363
-	build "	Patch" "patch -Np1 -i ../../PATCHES/bash-4.3-upstream_fixes-7.patch" ${_logfile}
364
-	build "	Configure" "./configure --prefix=/tools --without-bash-malloc" ${_logfile}
365
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
366
-	build "	Install" "make install" ${_logfile}
367
-	build "	ln -sv bash /tools/bin/sh" "ln -sv bash /tools/bin/sh" ${_logfile}
368
-	build "	Restore directory" "popd " /dev/null
369
-	build "	Restore directory" "popd " /dev/null
370
-	>  ${_complete}
371
-	return 0
372
-}
373
-build-bzip2() {
374
-local	_pkgname="bzip2"
375
-	local	_pkgver="1.0.6"
376
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
377
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
378
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
379
-	> ${_logfile}
380
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
381
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
382
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
383
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
384
-	build "	Make" "make ${MKFLAGS} CFLAGS='-fPIC -O2 -g -pipe'" ${_logfile}
385
-	build "	Install" "make  PREFIX=/tools install" ${_logfile}
386
-	build "	Restore directory" "popd " /dev/null
387
-	build "	Restore directory" "popd " /dev/null
388
-	>  ${_complete}
389
-	return 0
390
-}
391
-build-coreutils() {
392
-	local	_pkgname="coreutils"
393
-	local	_pkgver="8.22"
394
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
395
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
396
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
397
-	> ${_logfile}
398
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
399
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
400
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
401
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
402
-	build "	Configure" "FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/tools --enable-install-program=hostname " ${_logfile}
403
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
404
-	build "	Install" "make install" ${_logfile}
405
-	build "	Restore directory" "popd " /dev/null
406
-	build "	Restore directory" "popd " /dev/null
407
-	>  ${_complete}
408
-	return 0
409
-}
410
-build-diffutils() {
411
-	local	_pkgname="diffutils"
412
-	local	_pkgver="3.3"
413
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
414
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
415
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
416
-	> ${_logfile}
417
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
418
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
419
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
420
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
421
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
422
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
423
-	build "	Install" "make install" ${_logfile}
424
-	build "	Restore directory" "popd " /dev/null
425
-	build "	Restore directory" "popd " /dev/null
426
-	>  ${_complete}
427
-	return 0
428
-}
429
-build-file() {
430
-	local	_pkgname="file"
431
-	local	_pkgver="5.22"
432
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
433
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
434
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
435
-	> ${_logfile}
436
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
437
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
438
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
439
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
440
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
441
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
442
-	build "	Install" "make install" ${_logfile}
443
-	build "	Restore directory" "popd " /dev/null
444
-	build "	Restore directory" "popd " /dev/null
445
-	>  ${_complete}
446
-	return 0
447
-}
448
-build-findutils() {
449
-	local	_pkgname="findutils"
450
-	local	_pkgver="4.4.2"
451
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
452
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
453
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
454
-	> ${_logfile}
455
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
456
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
457
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
458
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
459
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
460
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
461
-	build "	Install" "make install" ${_logfile}
462
-	build "	Restore directory" "popd " /dev/null
463
-	build "	Restore directory" "popd " /dev/null
464
-	>  ${_complete}
465
-	return 0
466
-}
467
-build-gawk() {
468
-	local	_pkgname="gawk"
469
-	local	_pkgver="4.1.0"
470
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
471
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
472
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
473
-	> ${_logfile}
474
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
475
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
476
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
477
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
478
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
479
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
480
-	build "	Install" "make install" ${_logfile}
481
-	build "	Restore directory" "popd " /dev/null
482
-	build "	Restore directory" "popd " /dev/null
483
-	>  ${_complete}
484
-	return 0
485
-}
486
-build-gettext() {
487
-	local	_pkgname="gettext"
488
-	local	_pkgver="0.18.3.2"
489
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
490
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
491
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
492
-	> ${_logfile}
493
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
494
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
495
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
496
-	build "	Change directory: ${_pkgname}-${_pkgver}/gettext-tools" "pushd ${_pkgname}-${_pkgver}/gettext-tools" ${_logfile}
497
-	build "	Configure" "EMACS="no" ./configure --prefix=/tools --disable-shared" ${_logfile}
498
-	build "	make -C gnulib-lib" "make -C gnulib-lib" ${_logfile}
499
-	build "	make -C src msgfmt" "make -C src msgfmt" ${_logfile}
500
-	build "	make -C src msgmerge" "make -C src msgmerge" ${_logfile}
501
-	build "	make -C src xgettext" "make -C src xgettext" ${_logfile}
502
-	build "	cp -v src/{msgfmt,msgmerge,xgettext} /tools/bin" "cp -v src/{msgfmt,msgmerge,xgettext} /tools/bin" ${_logfile}
503
-	build "	Restore directory" "popd " /dev/null
504
-	build "	Restore directory" "popd " /dev/null
505
-	>  ${_complete}
506
-	return 0
507
-}
508
-build-grep() {
509
-	local	_pkgname="grep"
510
-	local	_pkgver="2.21"
511
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
512
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
513
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
514
-	> ${_logfile}
515
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
516
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
517
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
518
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
519
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
520
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
521
-	build "	Install" "make install" ${_logfile}
522
-	build "	Restore directory" "popd " /dev/null
523
-	build "	Restore directory" "popd " /dev/null
524
-	>  ${_complete}
525
-	return 0
526
-}
527
-build-gzip() {
528
-	local	_pkgname="gzip"
529
-	local	_pkgver="1.6"
530
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
531
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
532
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
533
-	> ${_logfile}
534
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
535
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
536
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
537
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
538
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
539
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
540
-	build "	Install" "make install" ${_logfile}
541
-	build "	Restore directory" "popd " /dev/null
542
-	build "	Restore directory" "popd " /dev/null
543
-	>  ${_complete}
544
-	return 0
545
-}
546
-build-m4() {
547
-	local	_pkgname="m4"
548
-	local	_pkgver="1.4.17"
549
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
550
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
551
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
552
-	> ${_logfile}
553
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
554
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
555
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
556
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
557
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
558
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
559
-	build "	Install" "make install" ${_logfile}
560
-	build "	Restore directory" "popd " /dev/null
561
-	build "	Restore directory" "popd " /dev/null
562
-	>  ${_complete}
563
-	return 0
564
-}
565
-build-make() {
566
-	local	_pkgname="make"
567
-	local	_pkgver="4.0"
568
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
569
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
570
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
571
-	> ${_logfile}
572
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
573
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
574
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
575
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
576
-	build "	Configure" "./configure --prefix=/tools --without-guile" ${_logfile}
577
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
578
-	build "	Install" "make install" ${_logfile}
579
-	build "	Restore directory" "popd " /dev/null
580
-	build "	Restore directory" "popd " /dev/null
581
-	>  ${_complete}
582
-	return 0
583
-}
584
-build-patch() {
585
-	local	_pkgname="patch"
586
-	local	_pkgver="2.7.1"
587
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
588
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
589
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
590
-	> ${_logfile}
591
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
592
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
593
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
594
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
595
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
596
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
597
-	build "	Install" "make install" ${_logfile}
598
-	build "	Restore directory" "popd " /dev/null
599
-	build "	Restore directory" "popd " /dev/null
600
-	>  ${_complete}
601
-	return 0
602
-}
603
-build-perl() {
604
-	local	_pkgname="perl"
605
-	local	_pkgver="5.18.2"
606
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
607
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
608
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
609
-	> ${_logfile}
610
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
611
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
612
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
613
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
614
-	build "	Patch" "patch -Np1 -i ../../PATCHES/perl-5.18.2-libc-1.patch" ${_logfile}
615
-	build "	Configure" "sh Configure -des -Dprefix=/tools" ${_logfile}
616
-	build "	Make" "make ${MKFLAGS}" ${_logfile} 
617
-	build "	cp -v perl cpan/podlators/pod2man /tools/bin" "cp -v perl cpan/podlators/pod2man /tools/bin" ${_logfile}
618
-	build "	mkdir -pv /tools/lib/perl5/5.18.2" "mkdir -pv /tools/lib/perl5/5.18.2" ${_logfile}
619
-	build "	cp -Rv lib/* /tools/lib/perl5/5.18.2" "cp -Rv lib/* /tools/lib/perl5/5.18.2" ${_logfile}
620
-	build "	Restore directory" "popd " /dev/null
621
-	build "	Restore directory" "popd " /dev/null
622
-	>  ${_complete}
623
-	return 0
624
-}
625
-build-sed() {
626
-	local	_pkgname="sed"
627
-	local	_pkgver="4.2.2"
628
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
629
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
630
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
631
-	> ${_logfile}
632
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
633
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
634
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
635
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
636
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
637
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
638
-	build "	Install" "make install" ${_logfile}
639
-	build "	Restore directory" "popd " /dev/null
640
-	build "	Restore directory" "popd " /dev/null
641
-	>  ${_complete}
642
-	return 0
643
-}
644
-build-tar() {
645
-	local	_pkgname="tar"
646
-	local	_pkgver="1.27.1"
647
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
648
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
649
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
650
-	> ${_logfile}
651
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
652
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
653
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
654
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
655
-	build "	Configure" "FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/tools" ${_logfile}
656
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
657
-	build "	Install" "make install" ${_logfile}
658
-	build "	Restore directory" "popd " /dev/null
659
-	build "	Restore directory" "popd " /dev/null
660
-	>  ${_complete}
661
-	return 0
662
-}
663
-build-texinfo() {
664
-	local	_pkgname="texinfo"
665
-	local	_pkgver="5.2"
666
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
667
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
668
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
669
-	> ${_logfile}
670
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
671
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
672
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
673
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
674
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
675
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
676
-	build "	Install" "make install" ${_logfile}
677
-	build "	Restore directory" "popd " /dev/null
678
-	build "	Restore directory" "popd " /dev/null
679
-	>  ${_complete}
680
-	return 0
681
-}
682
-build-util-linux() {
683
-	local	_pkgname="util-linux"
684
-	local	_pkgver="2.24.1"
685
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
686
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
687
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
688
-	> ${_logfile}
689
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
690
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
691
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
692
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
693
-	build "	Configure" "./configure --prefix=/tools --disable-makeinstall-chown --without-systemdsystemunitdir PKG_CONFIG=''" ${_logfile}
694
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
695
-	build "	Install" "make install" ${_logfile}
696
-	build "	Restore directory" "popd " /dev/null
697
-	build "	Restore directory" "popd " /dev/null
698
-	>  ${_complete}
699
-	return 0
700
-}
701
-build-xz() {
702
-	local	_pkgname="xz"
703
-	local	_pkgver="5.0.5"
704
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
705
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
706
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
707
-	> ${_logfile}
708
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
709
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
710
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
711
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
712
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
713
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
714
-	build "	Install" "make install" ${_logfile}
715
-	build "	Restore directory" "popd " /dev/null
716
-	build "	Restore directory" "popd " /dev/null
717
-	>  ${_complete}
718
-	return 0
719
-}
720
-strip-ToolChain() {
721
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
722
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
723
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
724
-	> ${_logfile}
725
-	build 'strip --strip-debug /tools/lib/*' 'strip --strip-debug /tools/lib/* || true' ${_logfile}
726
-	build '/usr/bin/strip --strip-unneeded /tools/{,s}bin/*' '/usr/bin/strip --strip-unneeded /tools/{,s}bin/* || true' ${_logfile}
727
-	build 'rm -rf /tools/{,share}/{info,man,doc}' 'rm -rf /tools/{,share}/{info,man,doc}' ${_logfile}
728
-	>  ${_complete}
729
-	return 0
730
-}
731
-change-ownership() {
732
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
733
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
734
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
735
-	> ${_logfile}
736
-	build "	chown -R root:root $BUILD/tools" "su -c 'chown -R root:root /tools'" ${_logfile}
737
-	>  ${_complete}
738
-	return 0
739
-}
740
-#
741
-#	Add rpm to tool chain
742
-#
743
-build-zlib() {
744
-	local	_pkgname="zlib"
745
-	local	_pkgver="1.2.8"
746
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
747
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
748
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
749
-	> ${_logfile}
750
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
751
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
752
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
753
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
754
-	build "	Configure" "./configure --prefix=/tools" ${_logfile}
755
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
756
-	build "	Install" "make install" ${_logfile}
757
-	build "	Restore directory" "popd " /dev/null
758
-	build "	Restore directory" "popd " /dev/null
759
-	>  ${_complete}
760
-	return 0
761
-}
762
-build-nspr() {
763
-	local _pkgname="nspr"
764
-	local _pkgver="4.10.3"
765
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
766
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
767
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
768
-	> ${_logfile}
769
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
770
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
771
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
772
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
773
-	cd nspr
774
-	sed -ri 's#^(RELEASE_BINS =).*#\1#' pr/src/misc/Makefile.in  || die "${FUNCNAME}: sed: FAILURE"
775
-	sed -i 's#$(LIBRARY) ##' config/rules.mk  || die "${FUNCNAME}: sed: FAILURE"
776
-	build "	Configure" "PKG_CONFIG_PATH="/tools/lib/pkgconfig" ./configure --prefix=/tools --with-mozilla --with-pthreads $([ "$(uname -m)" = "x86_64" ] && echo --enable-64bit)" ${_logfile}
777
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
778
-	build "	Install" "make install" ${_logfile}
779
-	build "	Restore directory" "popd " /dev/null
780
-	build "	Restore directory" "popd " /dev/null
781
-	>  ${_complete}
782
-	return 0
783
-}
784
-build-nss() {
785
-	local _pkgname="nss"
786
-	local _pkgver="3.15.4"
787
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
788
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
789
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
790
-	> ${_logfile}
791
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
792
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
793
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
794
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
795
-	build "	Patch" "patch -Np1 -i ../../PATCHES/nss-3.15.4-standalone-1.patch" ${_logfile}
796
-	cd nss
797
-	build "	Make" "make BUILD_OPT=1 NSPR_INCLUDE_DIR=/tools/include/nspr USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz $([ "$(uname -m)" = "x86_64" ] && echo USE_64=1) -j1" ${_logfile}
798
-	cd ../dist
799
-	build "	install -vdm 755 /tools/bin" "install -vdm 755 /tools/bin" ${_logfile}
800
-	build "	install -vdm 755 /tools/lib/pkgconfig" "install -vdm 755 /tools/lib/pkgconfig" ${_logfile}
801
-	build "	install -vdm 755 /tools/include" "install -vdm 755 /tools/include" ${_logfile}
802
-	build "	install -v -m755 Linux*/lib/*.so /tools/lib" "install -v -m755 Linux*/lib/*.so /tools/lib" ${_logfile}
803
-	build "	install -v -m644 Linux*/lib/{*.chk,libcrmf.a} /tools/lib" "install -v -m644 Linux*/lib/{*.chk,libcrmf.a} /tools/lib" ${_logfile}
804
-	build "	cp -v -RL {public,private}/nss/* /tools/include" "cp -v -RL {public,private}/nss/* /tools/include" ${_logfile}
805
-	build "	install -v -m755 Linux*/bin/{certutil,nss-config,pk12util} /tools/bin" "install -v -m755 Linux*/bin/{certutil,nss-config,pk12util} /tools/bin" ${_logfile}
806
-	build "	install -v -m644 Linux*/lib/pkgconfig/nss.pc  /tools/lib/pkgconfig" "install -v -m644 Linux*/lib/pkgconfig/nss.pc  /tools/lib/pkgconfig" ${_logfile}
807
-	build "	sed -i 's|usr|tools|' /tools/lib/pkgconfig/nss.pc" "sed -i 's|usr|tools|' /tools/lib/pkgconfig/nss.pc" ${_logfile}
808
-	build "	Restore directory" "popd " /dev/null
809
-	build "	Restore directory" "popd " /dev/null
810
-	>  ${_complete}
811
-	return 0
812
-}
813
-build-popt() {
814
-	local _pkgname="popt"
815
-	local _pkgver="1.16"
816
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
817
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
818
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
819
-	> ${_logfile}
820
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
821
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
822
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
823
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}	
824
-	build "	Configure" "./configure --prefix=/tools --disable-static" ${_logfile}
825
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
826
-	build "	Install" "make install" ${_logfile}
827
-	build "	Restore directory" "popd " /dev/null
828
-	build "	Restore directory" "popd " /dev/null
829
-	>  ${_complete}
830
-	return 0
831
-}
832
-build-readline() {
833
-	local _pkgname="readline"
834
-	local _pkgver="6.3"
835
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
836
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
837
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
838
-	> ${_logfile}
839
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
840
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
841
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
842
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
843
-	build "	sed -i '/MV.*old/d' Makefile.in" "sed -i '/MV.*old/d' Makefile.in" ${_logfile}
844
-	build "	sed -i '/{OLDSUFF}/c:' support/shlib-install" "sed -i '/{OLDSUFF}/c:' support/shlib-install" ${_logfile}
845
-	build "	Patch" "patch -Np1 -i ../../PATCHES/readline-6.3-upstream_fixes-3.patch" ${_logfile}
846
-	build "	Configure" "PKG_CONFIG_PATH='/tools/lib/pkgconfig' ./configure --prefix=/tools --libdir=/tools/lib --with-curses=/tools/lib" ${_logfile}
847
-	build "	Make" "make ${MKFLAGS} SHLIB_LIBS=-lncursesw" ${_logfile}
848
-	build "	Install" "make install" ${_logfile}
849
-	build "	Restore directory" "popd " /dev/null
850
-	build "	Restore directory" "popd " /dev/null
851
-	>  ${_complete}
852
-	return 0
853
-}
854
-build-elfutils() {
855
-	local _pkgname="elfutils"
856
-	local _pkgver="0.158"
857
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
858
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
859
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
860
-	> ${_logfile}
861
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
862
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
863
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
864
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
865
-	build "	Configure" 'PKG_CONFIG_PATH="/tools/lib/pkgconfig" ./configure --prefix=/tools --program-prefix="eu-" --with-bzlib=no' ${_logfile}
866
-	build "	Make" "make ${MKFLAGS} SHLIB_LIBS=-lncursesw" ${_logfile}
867
-	build "	Install" "make install" ${_logfile}
868
-	build "	Restore directory" "popd " /dev/null
869
-	build "	Restore directory" "popd " /dev/null
870
-	>  ${_complete}
871
-	return 0
872
-}
873
-build-rpm() {
874
-	local _pkgname="rpm"
875
-	local _pkgver="4.11.2"
876
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
877
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
878
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
879
-	> ${_logfile}
880
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
881
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
882
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
883
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
884
-	unpack "${PWD}" "db-5.3.28"
885
-	build "	ln -vs db-5.3.28 db" "ln -vs db-5.3.28 db" ${_logfile}
886
-	build "	Configure" "PKG_CONFIG_PATH=/tools/lib/pkgconfig CPPFLAGS='-I/tools/include -I/tools/include/nspr' ./configure --prefix=/tools --disable-static --disable-dependency-tracking --without-lua" ${_logfile}
887
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
888
-	build "	Install" "make install" ${_logfile}
889
-	build "	install -dm 755 /tools/etc/rpm" "install -dm 755 /tools/etc/rpm" ${_logfile}
890
-	build "	rm -v/tools/bin/{rpmquery,rpmverify}" "rm -v /tools/bin/{rpmquery,rpmverify}" ${_logfile}
891
-	build "	ln -vsf rpm /tools/bin/rpmquery" "ln -vsf rpm /tools/bin/rpmquery" ${_logfile}
892
-	build "	ln -vsf rpm /tools/bin/rpmverify" "ln -vsf rpm /tools/bin/rpmverify" ${_logfile}
893
-	build "	install -vm 755 ${BUILDDIR}/SCRIPTS/macros /tools/etc/rpm" "install -vm 755 ${BUILDDIR}/SCRIPTS/macros /tools/etc/rpm" ${_logfile}
894
-	build "	install -vm 755 ${BUILDDIR}/SCRIPTS/brp-strip-debug-symbols /tools/lib/rpm" "install -vm 755 ${BUILDDIR}/SCRIPTS/brp-strip-debug-symbols /tools/lib/rpm" ${_logfile}
895
-	build "	install -vm 755 ${BUILDDIR}/SCRIPTS/brp-strip-unneeded /tools/lib/rpm" "install -vm 755 ${BUILDDIR}/SCRIPTS/brp-strip-unneeded /tools/lib/rpm" ${_logfile}
896
-	build " sed -i 's@/usr/lib/rpm/debugedit@/tools/lib/rpm/debugedit@g' /tools/lib/rpm/find-debuginfo.sh" "sed -i 's@/usr/lib/rpm/debugedit@/tools/lib/rpm/debugedit@g' /tools/lib/rpm/find-debuginfo.sh" ${_logfile}
897
-	build "	Restore directory" "popd " /dev/null
898
-	build "	Restore directory" "popd " /dev/null
899
-	>  ${_complete}
900
-	return 0
901
-}
902
-
903
-build-cpio() {
904
-	local _pkgname="cpio"
905
-	local _pkgver="2.11"
906
-      	local	_complete="${PWD}/LOGS/${FUNCNAME}.completed"
907
-	local	_logfile="${PWD}/LOGS/${FUNCNAME}.log"
908
-	[ -e ${_complete} ] && { msg "${FUNCNAME}: SKIPPING";return 0; } || msg "${FUNCNAME}: Building"
909
-	> ${_logfile}
910
-	build "	Clean build directory" 'rm -rf BUILD/*' ${_logfile}
911
-	build "	Change directory: BUILD" "pushd BUILD" ${_logfile}
912
-	unpack "${PWD}" "${_pkgname}-${_pkgver}"
913
-	build "	Change directory: ${_pkgname}-${_pkgver}" "pushd ${_pkgname}-${_pkgver}" ${_logfile}
914
-	build " sed -i -e '/gets is a/d' gnu/stdio.in.h" "sed -i -e '/gets is a/d' gnu/stdio.in.h" ${_logfile}
915
-	build "	Configure" "PKG_CONFIG_PATH=/tools/lib/pkgconfig CPPFLAGS='-I/tools/include -I/tools/include/nspr' ./configure --prefix=/tools --enable-mt --with-rmt=/usr/libexec/rmt" ${_logfile}
916
-	build "	Make" "make ${MKFLAGS}" ${_logfile}
917
-	build "	Install" "make install" ${_logfile}
918
-	build "	Restore directory" "popd " /dev/null
919
-	build "	Restore directory" "popd " /dev/null
920
-	>  ${_complete}
921
-	return 0
922
-}
923
-
924
-#
925
-#	Main line	
926
-#
927
-msg "Building Tool chain"
928
-build-binutils1	
929
-build-gcc1
930
-build-linux-api-headers
931
-build-glibc
932
-build-libstdc++
933
-build-binutils2
934
-build-gcc2
935
-build-tcl
936
-#build-expect
937
-#build-dejagnu
938
-build-check
939
-build-ncurses
940
-build-bash
941
-build-bzip2
942
-build-coreutils
943
-build-diffutils
944
-build-file
945
-build-findutils
946
-build-gawk
947
-build-gettext
948
-build-grep
949
-build-gzip
950
-build-m4
951
-build-make
952
-build-patch
953
-build-perl
954
-build-sed
955
-build-tar
956
-build-texinfo
957
-build-util-linux
958
-build-xz
959
-#	The following packages comprise the package management system RPM
960
-build-zlib
961
-build-nspr
962
-build-nss
963
-build-popt
964
-build-readline
965
-build-elfutils
966
-build-rpm
967
-build-cpio
968
-#	The following are not used
969
-strip-ToolChain
970
-#	change-ownership
971
-msg "Creating tools tar ball"
972
-tar -cf $DESTDIR/tools-build.tar -C ${BUILDDIR} tools
973
-rm -rf ${BUILDDIR}
974
-rm /tools
975
-msg "Successfully built the Toolchain"
976
-exit 0
977 1
deleted file mode 100644
... ...
@@ -1,238 +0,0 @@
1
-tools/lib64
2
-tools/etc/rpc
3
-tools/etc/rpm/macros
4
-tools/bin/bash
5
-tools/bin/getconf
6
-tools/bin/date
7
-tools/bin/test
8
-tools/bin/env
9
-tools/bin/find
10
-tools/bin/cat
11
-tools/bin/pwd
12
-tools/bin/stty
13
-tools/bin/rpm
14
-tools/bin/echo
15
-tools/bin/rm
16
-tools/bin/strip
17
-tools/bin/mknod
18
-tools/lib/librpmbuild.so.3
19
-tools/lib/liblzma.so
20
-tools/lib/libnssckbi.so
21
-tools/lib/libdl.so
22
-tools/lib/libnss_hesiod-2.21.so
23
-tools/lib/libc.so.6
24
-tools/lib/libpopt.so.0.0.0
25
-tools/lib/libz.so.1.2.8
26
-tools/lib/libcheck.so.0
27
-tools/lib/librt.so
28
-tools/lib/libpthread.a
29
-tools/lib/libdl.a
30
-tools/lib/libnss_nisplus-2.21.so
31
-tools/lib/libcheck.so.0.0.0
32
-tools/lib/libcrypt.so.1
33
-tools/lib/librpmbuild.so
34
-tools/lib/liblzma.a
35
-tools/lib/libnss_nis.so
36
-tools/lib/libnss_hesiod.so
37
-tools/lib/libsqlite3.so
38
-tools/lib/librpmsign.so.1
39
-tools/lib/libnss_nisplus.so
40
-tools/lib/libm.so
41
-tools/lib/libm-2.21.so
42
-tools/lib/libnss_files-2.21.so
43
-tools/lib/librpmsign.la
44
-tools/lib/libnss_nisplus.so.2
45
-tools/lib/libz.so
46
-tools/lib/librpmsign.so.1.2.1
47
-tools/lib/libcrypt-2.21.so
48
-tools/lib/libcidn.so.1
49
-tools/lib/libnss_hesiod.so.2
50
-tools/lib/libfreebl3.so
51
-tools/lib/libnss_compat.so.2
52
-tools/lib/libnss_dns-2.21.so
53
-tools/lib/libpopt.so
54
-tools/lib/libnssdbm3.so
55
-tools/lib/libpopt.la
56
-tools/lib/libdl.so.2
57
-tools/lib/libnss_dns.so.2
58
-tools/lib/libc.so
59
-tools/lib/libnss_dns.so
60
-tools/lib/libnssutil3.so
61
-tools/lib/libm.so.6
62
-tools/lib/libc.a
63
-tools/lib/libnss3.so
64
-tools/lib/liblzma.so.5.0.5
65
-tools/lib/libnss_files.so.2
66
-tools/lib/libcrypt.a
67
-tools/lib/libnss_compat-2.21.so
68
-tools/lib/libplds4.so
69
-tools/lib/libnss_nis-2.21.so
70
-tools/lib/libnssdbm3.chk
71
-tools/lib/libnss_nis.so.2
72
-tools/lib/librt.a
73
-tools/lib/libcheck.la
74
-tools/lib/libz.so.1
75
-tools/lib/libcrypt.so
76
-tools/lib/librpm.so.3
77
-tools/lib/librpm.la
78
-tools/lib/libpthread-2.21.so
79
-tools/lib/librpmsign.so
80
-tools/lib/librt.so.1
81
-tools/lib/libcheck.so
82
-tools/lib/libnsssysinit.so
83
-tools/lib/libelf.so.1
84
-tools/lib/libpopt.so.0
85
-tools/lib/librpmbuild.so.3.2.1
86
-tools/lib/libelf.so
87
-tools/lib/rpm/script.req
88
-tools/lib/rpm/mono-find-requires
89
-tools/lib/rpm/osgideps.pl
90
-tools/lib/rpm/check-prereqs
91
-tools/lib/rpm/brp-java-gcjcompile
92
-tools/lib/rpm/ocaml-find-requires.sh
93
-tools/lib/rpm/rpmdb_upgrade
94
-tools/lib/rpm/tgpg
95
-tools/lib/rpm/perl.req
96
-tools/lib/rpm/elfdeps
97
-tools/lib/rpm/rpmdb_dump
98
-tools/lib/rpm/brp-strip-comment-note
99
-tools/lib/rpm/rpmpopt-4.11.2
100
-tools/lib/rpm/check-files
101
-tools/lib/rpm/brp-python-hardlink
102
-tools/lib/rpm/brp-compress
103
-tools/lib/rpm/check-buildroot
104
-tools/lib/rpm/rpmrc
105
-tools/lib/rpm/config.sub
106
-tools/lib/rpm/rpm.supp
107
-tools/lib/rpm/config.guess
108
-tools/lib/rpm/rpmdb_recover
109
-tools/lib/rpm/macros.python
110
-tools/lib/rpm/check-rpaths-worker
111
-tools/lib/rpm/platform/ppc64le-linux/macros
112
-tools/lib/rpm/platform/ppc64pseries-linux/macros
113
-tools/lib/rpm/platform/armv5tejl-linux/macros
114
-tools/lib/rpm/platform/sparcv9v-linux/macros
115
-tools/lib/rpm/platform/sh3-linux/macros
116
-tools/lib/rpm/platform/pentium4-linux/macros
117
-tools/lib/rpm/platform/noarch-linux/macros
118
-tools/lib/rpm/platform/sparcv9-linux/macros
119
-tools/lib/rpm/platform/armv6l-linux/macros
120
-tools/lib/rpm/platform/s390x-linux/macros
121
-tools/lib/rpm/platform/amd64-linux/macros
122
-tools/lib/rpm/platform/armv5tel-linux/macros
123
-tools/lib/rpm/platform/ppciseries-linux/macros
124
-tools/lib/rpm/platform/ia64-linux/macros
125
-tools/lib/rpm/platform/sparcv8-linux/macros
126
-tools/lib/rpm/platform/i686-linux/macros
127
-tools/lib/rpm/platform/geode-linux/macros
128
-tools/lib/rpm/platform/i386-linux/macros
129
-tools/lib/rpm/platform/sparc64-linux/macros
130
-tools/lib/rpm/platform/sparc64v-linux/macros
131
-tools/lib/rpm/platform/i486-linux/macros
132
-tools/lib/rpm/platform/ppc64iseries-linux/macros
133
-tools/lib/rpm/platform/x86_64-linux/macros
134
-tools/lib/rpm/platform/alphaev56-linux/macros
135
-tools/lib/rpm/platform/armv4b-linux/macros
136
-tools/lib/rpm/platform/pentium3-linux/macros
137
-tools/lib/rpm/platform/aarch64-linux/macros
138
-tools/lib/rpm/platform/ppc32dy4-linux/macros
139
-tools/lib/rpm/platform/alphaev6-linux/macros
140
-tools/lib/rpm/platform/sh4a-linux/macros
141
-tools/lib/rpm/platform/armv4l-linux/macros
142
-tools/lib/rpm/platform/ppc-linux/macros
143
-tools/lib/rpm/platform/ia32e-linux/macros
144
-tools/lib/rpm/platform/armv3l-linux/macros
145
-tools/lib/rpm/platform/alphaev67-linux/macros
146
-tools/lib/rpm/platform/s390-linux/macros
147
-tools/lib/rpm/platform/ppc64p7-linux/macros
148
-tools/lib/rpm/platform/sparc-linux/macros
149
-tools/lib/rpm/platform/athlon-linux/macros
150
-tools/lib/rpm/platform/sh4-linux/macros
151
-tools/lib/rpm/platform/alphaev5-linux/macros
152
-tools/lib/rpm/platform/i586-linux/macros
153
-tools/lib/rpm/platform/alphapca56-linux/macros
154
-tools/lib/rpm/platform/armv7l-linux/macros
155
-tools/lib/rpm/platform/ppc64-linux/macros
156
-tools/lib/rpm/platform/sh-linux/macros
157
-tools/lib/rpm/platform/ppc8560-linux/macros
158
-tools/lib/rpm/platform/ppcpseries-linux/macros
159
-tools/lib/rpm/platform/ppc8260-linux/macros
160
-tools/lib/rpm/platform/alpha-linux/macros
161
-tools/lib/rpm/brp-strip-shared
162
-tools/lib/rpm/brp-python-bytecompile
163
-tools/lib/rpm/find-requires
164
-tools/lib/rpm/debugedit
165
-tools/lib/rpm/macros
166
-tools/lib/rpm/find-debuginfo.sh
167
-tools/lib/rpm/macros.php
168
-tools/lib/rpm/perldeps.pl
169
-tools/lib/rpm/pkgconfigdeps.sh
170
-tools/lib/rpm/rpmdb_stat
171
-tools/lib/rpm/rpmdb_load
172
-tools/lib/rpm/perl.prov
173
-tools/lib/rpm/rpm.log
174
-tools/lib/rpm/brp-strip-static-archive
175
-tools/lib/rpm/rpmdb_loadcvt
176
-tools/lib/rpm/rpm.daily
177
-tools/lib/rpm/mono-find-provides
178
-tools/lib/rpm/tcl.req
179
-tools/lib/rpm/rpm2cpio.sh
180
-tools/lib/rpm/fontconfig.prov
181
-tools/lib/rpm/brp-strip
182
-tools/lib/rpm/libtooldeps.sh
183
-tools/lib/rpm/macros.perl
184
-tools/lib/rpm/find-lang.sh
185
-tools/lib/rpm/fileattrs/mono.attr
186
-tools/lib/rpm/fileattrs/appdata.attr
187
-tools/lib/rpm/fileattrs/pkgconfig.attr
188
-tools/lib/rpm/fileattrs/perl.attr
189
-tools/lib/rpm/fileattrs/script.attr
190
-tools/lib/rpm/fileattrs/font.attr
191
-tools/lib/rpm/fileattrs/ocaml.attr
192
-tools/lib/rpm/fileattrs/libtool.attr
193
-tools/lib/rpm/fileattrs/perllib.attr
194
-tools/lib/rpm/fileattrs/elf.attr
195
-tools/lib/rpm/fileattrs/python.attr
196
-tools/lib/rpm/fileattrs/desktop.attr
197
-tools/lib/rpm/desktop-file.prov
198
-tools/lib/rpm/rpmdeps
199
-tools/lib/rpm/find-provides
200
-tools/lib/rpm/ocaml-find-provides.sh
201
-tools/lib/rpm/rpmdb_verify
202
-tools/lib/rpm/pythondeps.sh
203
-tools/lib/rpm/mkinstalldirs
204
-tools/lib/rpm/check-rpaths
205
-tools/lib/libdl-2.21.so
206
-tools/lib/libpthread_nonshared.a
207
-tools/lib/libpthread.so.0
208
-tools/lib/librpm.so.3.2.1
209
-tools/lib/libpthread.so
210
-tools/lib/librpmio.so.3
211
-tools/lib/libc_nonshared.a
212
-tools/lib/libnss_files.so
213
-tools/lib/librpmbuild.la
214
-tools/lib/libelf.a
215
-tools/lib/librt-2.21.so
216
-tools/lib/libplc4.so
217
-tools/lib/libnss_db-2.21.so
218
-tools/lib/liblzma.la
219
-tools/lib/ld-2.21.so
220
-tools/lib/ld-linux-x86-64.so.2
221
-tools/lib/libsoftokn3.so
222
-tools/lib/libnss_db.so
223
-tools/lib/libc-2.21.so
224
-tools/lib/librpmio.so.3.2.1
225
-tools/lib/libfreebl3.chk
226
-tools/lib/liblzma.so.5
227
-tools/lib/libcidn.so
228
-tools/lib/librpmio.la
229
-tools/lib/libnss_db.so.2
230
-tools/lib/libelf-0.158.so
231
-tools/lib/libcrmf.a
232
-tools/lib/libcheck.a
233
-tools/lib/libnss_compat.so
234
-tools/lib/libsoftokn3.chk
235
-tools/lib/librpm.so
236
-tools/lib/libnspr4.so
237
-tools/lib/librpmio.so
238
-tools/lib/libcidn-2.21.so