-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstage3
executable file
·95 lines (76 loc) · 2.13 KB
/
stage3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
#
# This script is the third stage in bootstrapping a Fedora build to a
# new platform or architecture.
#
# This script assumes that all the needed source RPMs are installed in
# /SRPMS unless local.conf overrides $SRPMS. It's up to you to figure
# out how to get them there. If you're building in a chroot, you'll
# also need to bind mount /proc into the chroot.
#
# You may pass a single package name on the command line to rebuild
# just that one package.
#
# The master upstream for this script is:
# git://fedorapeople.org/~djdelorie/bootstrap.git
#
# ------------------------------------------------------------
#
# --- NOTES FOR PACKAGE PORTING ---
#
# This script is stage THREE of a bootstrap process. EVERYTHING that
# this script uses MUST be provided by the stage ONE or TWO scripts -
# filesystem, utilities, sources, etc. Please keep this in mind when
# editing this script - anything you do manually to "prepare" for your
# build, will NOT be reproducible.
#
# To "port" a package, create a shell script in stage3.d/ that calls
# one of the rpm* macros in macros.bashrc (rpmi to install, rpmb to
# build, or rpma to do it all). List dependencies with #requires
# lines which name other scripts which must be built first.
# ------------------------------------------------------------
TOP=/stage3
MYDIR=${0%/*}
STAGE3=$MYDIR/stage3
HOME=$TOP
J=-j2
# The cross-compiler target
TARGET=aarch64-redhat-linux-gnu
export TARGET BUILDDIR J SRC STAGE2 MYDIR TOP
. $MYDIR/macros.bashrc
mkdirp $BUILDDIR
test -d /stage2/done || mkdir /stage2/done
test -e /etc/ld.so.conf || true > /etc/ld.so.conf
scriptmake()
{
export HOME=/stage3
test -d $TOP/stage3.mk || mkdir -p $TOP/stage3.mk
SRC="$SRC" \
J="$J" \
BUILDDIR="$BUILDDIR" \
TARGET="$TARGET" \
make -f $MYDIR/script2makefile \
RCFILE=$TOP/macros.bashrc \
SCRIPTDIR=$TOP/stage3.d \
FRAGDIR=$TOP/stage3.mk \
$1
}
cat <<EOF > $TOP/.rpmmacros
%check \\
%%check \\
exit 0
EOF
case "$1" in
"" )
go clean
scriptmake
;;
"clean" )
;;
#--------------------------------------------------
*~ ) ;;
* )
scriptmake "$@"
;;
esac
exit 0