annotate sources/native-builds/bootstrap-skeleton/files/build-one-package.sh @ 1269:7a60afa1846c

More tweaks to bootstrap-skeleton, implement the first half of lfs-bootstrap for Linux From Scratch 6.7 against the new infrastructure, and tweak gentoo build to stay current with bootstrap-skeleton changes. (Now more common infrastructure, and requires package-list file.)
author Rob Landley <rob@landley.net>
date Sun, 24 Oct 2010 04:17:15 -0500
parents c264495fbf21
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1256
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/sh
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 source /mnt/functions.sh || exit 1
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 # build $1 using manifest file $2
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
6
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
7 # Is it already installed?
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
8
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 if [ ! -z "$2" ] && [ -z "$FORCE" ] && grep -q "$1" "$2"
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
10 then
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 echo "$1 already installed"
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
12 exit 0
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
13 fi
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
14
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 set_titlebar "$1"
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
16
1258
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
17 if [ -d "/mnt/packages/$1" ]
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
18 then
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
19
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
20 # Snapshot source
1256
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
21
1258
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
22 cd /home &&
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
23 rm -rf "/home/$1" &&
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
24 cp -sfR "/mnt/packages/$1" "$1" &&
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
25 cd "$1" || exit 1
1256
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
26
1258
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
27 # Lobotomize config.guess so it won't complain about unknown target types.
1269
7a60afa1846c More tweaks to bootstrap-skeleton, implement the first half of lfs-bootstrap for Linux From Scratch 6.7 against the new infrastructure, and tweak gentoo build to stay current with bootstrap-skeleton changes. (Now more common infrastructure, and requires package-list file.)
Rob Landley <rob@landley.net>
parents: 1258
diff changeset
28 # 99% of packages do not care, but autoconf throws a temper tantrum if
7a60afa1846c More tweaks to bootstrap-skeleton, implement the first half of lfs-bootstrap for Linux From Scratch 6.7 against the new infrastructure, and tweak gentoo build to stay current with bootstrap-skeleton changes. (Now more common infrastructure, and requires package-list file.)
Rob Landley <rob@landley.net>
parents: 1258
diff changeset
29 # the version of autoconf that created this back when the package shipped
7a60afa1846c More tweaks to bootstrap-skeleton, implement the first half of lfs-bootstrap for Linux From Scratch 6.7 against the new infrastructure, and tweak gentoo build to stay current with bootstrap-skeleton changes. (Now more common infrastructure, and requires package-list file.)
Rob Landley <rob@landley.net>
parents: 1258
diff changeset
30 # didn't know what a microblaze or hexagon was. Repeat after me:
7a60afa1846c More tweaks to bootstrap-skeleton, implement the first half of lfs-bootstrap for Linux From Scratch 6.7 against the new infrastructure, and tweak gentoo build to stay current with bootstrap-skeleton changes. (Now more common infrastructure, and requires package-list file.)
Rob Landley <rob@landley.net>
parents: 1258
diff changeset
31 # "Autoconf is useless"
1256
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
32
1258
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
33 for guess in $(find . -name config.guess)
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
34 do
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
35 rm "$guess" &&
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
36 echo -e "#!/bin/sh\ngcc -dumpmachine" > "$guess" || exit 1
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
37 done
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
38 EXT=sh
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
39 else
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
40 EXT=nosrc
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
41 fi
1256
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
42
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
43 # Call package build script
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
44
1258
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
45 if ! time "/mnt/build/${1}.$EXT"
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
46 then
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
47 echo "$1" died >&2
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
48 exit 1
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
49 fi
1256
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
50
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
51 # Add file to manifest, removing previous version (if any).
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
52
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
53 if [ ! -z "$2" ]
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
54 then
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
55 sed -i -e "/$1/d" "$2" &&
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
56 echo "$1" >> "$2" || exit 1
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
57 fi
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
58
1258
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
59 if [ -d "/mnt/packages/$1" ]
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
60 then
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
61
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
62 # Delete copy of source if build succeeded
1256
df70740df1a5 Add generic native-build infastructure.
Rob Landley <rob@landley.net>
parents:
diff changeset
63
1258
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
64 cd /home &&
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
65 rm -rf "$1" &&
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
66 sync || exit 1
c264495fbf21 Update the common code, use "files" directory instead of build for subdir.
Rob Landley <rob@landley.net>
parents: 1256
diff changeset
67 fi