1 | #!/bin/bash |
---|
2 | |
---|
3 | # build-blfs.sh |
---|
4 | # |
---|
5 | # Script to build blfs packages |
---|
6 | # |
---|
7 | # Authors: Ryan Oliver <ryan.oliver@pha.com.au |
---|
8 | # |
---|
9 | # $LastChangedBy: ryan $ |
---|
10 | # $LastChangedDate: 2004-09-28 17:23:32 +1000 (Tue, 28 Sep 2004) $ |
---|
11 | # $LastChangedRevision: 238 $ |
---|
12 | |
---|
13 | # Set SELF to be name of script called, minus any path... |
---|
14 | SELF=$(basename ${0}) |
---|
15 | echo "Running ${SELF}" |
---|
16 | VERSION="3.0.1" |
---|
17 | DATE=$(date +'%Y%m%d') |
---|
18 | export DATE |
---|
19 | |
---|
20 | # Read in build configuration information |
---|
21 | # plfs-config should reside in the same directory as this script. |
---|
22 | # We need to use dirname to determine where to find it as SCRIPTS |
---|
23 | # env var is not set yet (set in plfs-config itself) |
---|
24 | . `dirname ${0}`/plfs-config |
---|
25 | |
---|
26 | # Sanity check, are ${LFS}, ${HST_TOOLS} and ${TGT_TOOLS} set? |
---|
27 | if [ "X${LFS}" = "X" -o "X${HST_TOOLS}" = "X" -o "X${TGT_TOOLS}" = "X" ]; then |
---|
28 | echo "Error: Not all required environment vars have been set." 1>&2 |
---|
29 | echo " Check plfs-config" 1>&2 |
---|
30 | exit 1 |
---|
31 | fi |
---|
32 | |
---|
33 | export LFS="" |
---|
34 | |
---|
35 | # Get package version information |
---|
36 | . ${SCRIPTS}/plfs-packages |
---|
37 | . ${SCRIPTS}/blfs-packages |
---|
38 | |
---|
39 | # Source Functions and definitions |
---|
40 | . ${SCRIPTS}/build-init.sh |
---|
41 | |
---|
42 | |
---|
43 | set +x |
---|
44 | unset LD_LIBRARY_PATH |
---|
45 | unset LD_PRELOAD |
---|
46 | |
---|
47 | # Configure uses these if set, and will not look for a cross-compiler |
---|
48 | unset CC CXX |
---|
49 | |
---|
50 | export LDFLAGS="-s" |
---|
51 | |
---|
52 | # Setup PATH |
---|
53 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin |
---|
54 | |
---|
55 | # If ${SRC} does not exist, create it |
---|
56 | test -d ${SRC} || mkdir -p ${SRC} |
---|
57 | |
---|
58 | mkdir -p ${CONFLOGS} |
---|
59 | mkdir -p ${BUILDLOGS} |
---|
60 | mkdir -p ${INSTLOGS} |
---|
61 | mkdir -p ${TESTLOGS} |
---|
62 | cd ${SRC} |
---|
63 | |
---|
64 | #scripts_dir="cross-scripts-${VERSION}" |
---|
65 | scripts_dir="blfs-scripts" |
---|
66 | |
---|
67 | # scripts for building target tools |
---|
68 | |
---|
69 | ############## |
---|
70 | # NFS support |
---|
71 | ############## |
---|
72 | test "Y" = "${MULTIARCH}" && |
---|
73 | { |
---|
74 | script_list="blfs-tcp-wrappers-32.sh |
---|
75 | blfs-tcp-wrappers-64.sh" |
---|
76 | } || { |
---|
77 | script_list="blfs-tcp-wrappers.sh" |
---|
78 | } |
---|
79 | |
---|
80 | script_list="${script_list} |
---|
81 | blfs-portmap.sh |
---|
82 | blfs-nfs-utils.sh" |
---|
83 | |
---|
84 | ################### |
---|
85 | # |
---|
86 | ################### |
---|
87 | # TCL here so we can test kerberos. |
---|
88 | # BDB also dependant |
---|
89 | test "Y" = "${MULTIARCH}" && |
---|
90 | { |
---|
91 | script_list="${script_list} |
---|
92 | blfs-tcl-32.sh |
---|
93 | blfs-tcl-64.sh" |
---|
94 | } || { |
---|
95 | script_list="${script_list} |
---|
96 | blfs-tcl.sh" |
---|
97 | } |
---|
98 | |
---|
99 | test "Y" = "${MULTIARCH}" && |
---|
100 | { |
---|
101 | script_list="${script_list} |
---|
102 | blfs-cracklib-32.sh |
---|
103 | blfs-cracklib-64.sh |
---|
104 | blfs-linux-pam-32.sh |
---|
105 | blfs-linux-pam-64.sh |
---|
106 | blfs-mit-krb5-32.sh |
---|
107 | blfs-mit-krb5-64.sh |
---|
108 | blfs-bdb-32.sh |
---|
109 | blfs-bdb-64.sh" |
---|
110 | } || { |
---|
111 | script_list="${script_list} |
---|
112 | blfs-cracklib.sh |
---|
113 | blfs-linux-pam.sh |
---|
114 | blfs-mit-krb5.sh |
---|
115 | blfs-bdb.sh" |
---|
116 | } |
---|
117 | #script_list="blfs-shadow-pam.sh" |
---|
118 | |
---|
119 | #################### |
---|
120 | # OPENSSL + OPENSSH |
---|
121 | #################### |
---|
122 | # Depends on krb5 libs (MIT) |
---|
123 | test "Y" = "${MULTIARCH}" && |
---|
124 | { |
---|
125 | script_list="${script_list} |
---|
126 | blfs-openssl-32.sh |
---|
127 | blfs-openssl-64.sh |
---|
128 | blfs-openssh.sh" |
---|
129 | } || { |
---|
130 | script_list="${script_list} |
---|
131 | blfs-openssl.sh |
---|
132 | blfs-openssh.sh" |
---|
133 | } |
---|
134 | |
---|
135 | # reqs openssl, krb5, bdb, tcpwrappers (ldap) |
---|
136 | test "Y" = "${MULTIARCH}" && |
---|
137 | { |
---|
138 | script_list="${script_list} |
---|
139 | blfs-cyrus-sasl-32.sh |
---|
140 | blfs-cyrus-sasl-64.sh |
---|
141 | blfs-openldap-32.sh |
---|
142 | blfs-openldap-64.sh |
---|
143 | blfs-nssldap-32.sh |
---|
144 | blfs-nssldap-64.sh |
---|
145 | blfs-ntp.sh" |
---|
146 | } || { |
---|
147 | script_list="${script_list} |
---|
148 | blfs-cyrus-sasl.sh |
---|
149 | blfs-openldap.sh |
---|
150 | blfs-nssldap.sh |
---|
151 | blfs-ntp.sh" |
---|
152 | } |
---|
153 | |
---|
154 | # TODO: have to do something with catering for 2 freetype-configs |
---|
155 | # for biarch, specifying the right freetype-config for |
---|
156 | # fontconfig, and fix the biarch libtool issues w fontconfig |
---|
157 | test "Y" = "${MULTIARCH}" && |
---|
158 | { |
---|
159 | script_list="${script_list} |
---|
160 | blfs-libpng-32.sh |
---|
161 | blfs-libpng-64.sh |
---|
162 | blfs-freetype2-32.sh |
---|
163 | blfs-freetype2-64.sh |
---|
164 | blfs-expat-32.sh |
---|
165 | blfs-expat-64.sh" |
---|
166 | } || { |
---|
167 | script_list="${script_list} |
---|
168 | blfs-libpng.sh |
---|
169 | blfs-freetype2.sh |
---|
170 | blfs-expat.sh" |
---|
171 | } |
---|
172 | |
---|
173 | test "Y" = "${MULTIARCH}" && |
---|
174 | { |
---|
175 | script_list="${script_list} |
---|
176 | blfs-fontconfig-32.sh |
---|
177 | blfs-fontconfig-64.sh |
---|
178 | blfs-xorg-32.sh |
---|
179 | blfs-xorg-64.sh" |
---|
180 | } || { |
---|
181 | script_list="${script_list} |
---|
182 | blfs-fontconfig.sh |
---|
183 | blfs-xorg.sh" |
---|
184 | } |
---|
185 | |
---|
186 | SCRIPTLIST=`echo "${script_list}" | \ |
---|
187 | sed "s@\(.*\)@${scripts_dir}/\1@"` |
---|
188 | |
---|
189 | # Check if we are resuming from a particular script |
---|
190 | test ! -z "${1}" && |
---|
191 | { |
---|
192 | SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@\1@g"` |
---|
193 | } |
---|
194 | |
---|
195 | echo ' o Checking for needed sources and tarballs' |
---|
196 | check_tarballs ${SCRIPTLIST} |
---|
197 | |
---|
198 | for script in ${SCRIPTLIST}; do |
---|
199 | echo "Running ${SCRIPTS}/${script}" |
---|
200 | # HACK: export SELF to be the script we are running |
---|
201 | # (keeps logfile output correct) |
---|
202 | export SELF=${script} |
---|
203 | ${SCRIPTS}/${script} |
---|
204 | |
---|
205 | test 0 = ${?} || |
---|
206 | { |
---|
207 | echo |
---|
208 | echo "Failed script was ${script}" |
---|
209 | echo "Please fix the error above from" |
---|
210 | echo " ${SCRIPTS}/${script}" |
---|
211 | echo "and rerun the build with the command" |
---|
212 | echo |
---|
213 | echo " ${0} $script" |
---|
214 | echo |
---|
215 | echo "to resume the build." |
---|
216 | exit 1 |
---|
217 | } |
---|
218 | done |
---|