1 | #!/bin/bash |
---|
2 | |
---|
3 | # build-blfs-extra.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 | |
---|
25 | # HACK: while in untested dir, plfs-config resides one dir below |
---|
26 | . `dirname ${0}`/../plfs-config |
---|
27 | |
---|
28 | # Sanity check, are ${LFS}, ${HST_TOOLS} and ${TGT_TOOLS} set? |
---|
29 | if [ "X${LFS}" = "X" -o "X${HST_TOOLS}" = "X" -o "X${TGT_TOOLS}" = "X" ]; then |
---|
30 | echo "Error: Not all required environment vars have been set." 1>&2 |
---|
31 | echo " Check plfs-config" 1>&2 |
---|
32 | exit 1 |
---|
33 | fi |
---|
34 | |
---|
35 | export LFS="" |
---|
36 | |
---|
37 | # Get package version information |
---|
38 | . ${SCRIPTS}/plfs-packages |
---|
39 | . ${SCRIPTS}/blfs-packages |
---|
40 | |
---|
41 | # Source Functions and definitions |
---|
42 | . ${SCRIPTS}/build-init.sh |
---|
43 | |
---|
44 | # extra for under untested dir |
---|
45 | . ${SCRIPTS}/untested/blfs-scripts/blfs-packages |
---|
46 | |
---|
47 | . ${SCRIPTS}/untested/gnome-scripts/gnome-platform-packages |
---|
48 | . ${SCRIPTS}/untested/gnome-scripts/gnome-desktop-packages |
---|
49 | #env |
---|
50 | . ${SCRIPTS}/untested/kde-scripts/kde-packages |
---|
51 | |
---|
52 | . ${SCRIPTS}/untested/blfs-scripts/qt-setup.sh |
---|
53 | . ${SCRIPTS}/untested/gnome-scripts/gnome-setup.sh |
---|
54 | . ${SCRIPTS}/untested/kde-scripts/kde-setup.sh |
---|
55 | . ${SCRIPTS}/untested/blfs-scripts/java-setup.sh |
---|
56 | |
---|
57 | export TARBALLS=/proj/blfs-pkgs |
---|
58 | export GNOME_TARBALLS=/mnt/tarballs/gnome |
---|
59 | export KDE_TARBALLS=/mnt/tarballs/kde |
---|
60 | export PATCHES=${SCRIPTS}/untested/blfs-patches |
---|
61 | |
---|
62 | unset LD_LIBRARY_PATH |
---|
63 | unset LD_PRELOAD |
---|
64 | |
---|
65 | # Configure uses these if set, and will not look for a cross-compiler |
---|
66 | unset CC CXX |
---|
67 | |
---|
68 | # Setup PATH |
---|
69 | #export PATH=/bin:/sbin:/usr/bin:/usr/sbin |
---|
70 | |
---|
71 | # If ${SRC} does not exist, create it |
---|
72 | test -d ${SRC} || mkdir -p ${SRC} |
---|
73 | |
---|
74 | mkdir -p ${CONFLOGS} |
---|
75 | mkdir -p ${BUILDLOGS} |
---|
76 | mkdir -p ${INSTLOGS} |
---|
77 | mkdir -p ${TESTLOGS} |
---|
78 | cd ${SRC} |
---|
79 | |
---|
80 | #scripts_dir="cross-scripts-${VERSION}" |
---|
81 | scripts_dir="untested" |
---|
82 | |
---|
83 | . ${SCRIPTS}/untested/blfs-scriptlist |
---|
84 | |
---|
85 | #echo ${script_list} |
---|
86 | |
---|
87 | SCRIPTLIST=`echo "${script_list}" | \ |
---|
88 | sed "s@\(.*\)@${scripts_dir}/\1@"` |
---|
89 | |
---|
90 | # Check if we are resuming from a particular script |
---|
91 | test ! -z "${1}" && |
---|
92 | { |
---|
93 | SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@untested/\1@g"` |
---|
94 | } |
---|
95 | |
---|
96 | echo ' o Checking for needed sources and tarballs' |
---|
97 | #check_tarballs ${SCRIPTLIST} |
---|
98 | |
---|
99 | for script in ${SCRIPTLIST}; do |
---|
100 | echo "Running ${SCRIPTS}/${script}" |
---|
101 | # HACK: export SELF to be the script we are running |
---|
102 | # (keeps logfile output correct) |
---|
103 | export SELF=${script} |
---|
104 | ${SCRIPTS}/${script} |
---|
105 | |
---|
106 | test 0 = ${?} || |
---|
107 | { |
---|
108 | echo |
---|
109 | echo "Failed script was ${script}" |
---|
110 | echo "Please fix the error above from" |
---|
111 | echo " ${SCRIPTS}/${script}" |
---|
112 | echo "and rerun the build with the command" |
---|
113 | echo |
---|
114 | echo " ${0} $script" |
---|
115 | echo |
---|
116 | echo "to resume the build." |
---|
117 | exit 1 |
---|
118 | } |
---|
119 | done |
---|