/[gentoo-alt]/trunk/prefix/scripts/bootstrap-prefix.sh
Gentoo

Diff of /trunk/prefix/scripts/bootstrap-prefix.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1291 Revision 1292
80# make install || exit 1 80# make install || exit 1
81 81
82# einfo "${A%-*} succesfully bootstrapped" 82# einfo "${A%-*} succesfully bootstrapped"
83# } 83# }
84 84
85setup_portage() {
86 local profile=""
87 local keywords=""
88 einfo "setting up some guessed defaults"
89 case ${CHOST} in
90 powerpc-*-darwin8)
91 profile="${PORTDIR}/profiles/default-darwin/macos/10.4/ppc"
92 keywords="~ppc-macos ppc-macos"
93 ;;
94 i*86-*-darwin8)
95 profile="${PORTDIR}/profiles/default-darwin/macos/10.4/x86"
96 keywords="~x86-macos x86-macos"
97 ;;
98 i*86-pc-linux-gnu)
99 profile="${PORTDIR}/profiles/default-linux/x86/2005.1"
100 keywords="~x86 x86"
101 ;;
102 x64_86-pc-linux-gnu)
103 profile="${PORTDIR}/profiles/default-linux/amd64/2005.1/no-multilib"
104 keywords="~amd64 amd64"
105 ;;
106 *)
107 einfo "You might need to set up a make.profile symlink to a profile in ${PORTDIR}"
108 ;;
109 esac
110 if [ ! -z "${profile}" -a ! -e "${ROOT}"/etc/make.profile ];
111 then
112 ln -s "${profile}" "${ROOT}"/etc/make.profile
113 einfo "Your profile is set to ${profile}."
114 einfo "If your system supports multilib, then this is a no-multilib profile."
115 fi
116
117 [ -e "${ROOT}"/etc/make.conf ] && return
118
119 if [ ! -z "${keywords}" ];
120 then
121 echo "ACCEPT_KEYWORDS=\"${keywords}\"" >> "${ROOT}"/etc/make.conf
122 einfo "Your ACCEPT_KEYWORDS is set to ${keywords}"
123 fi
124
125 einfo "Adding DEFAULT_PATH to etc/make.conf which includes host files"
126 echo -n "DEFAULT_PATH=\"" >> ${ROOT}/etc/make.conf
127 echo -n "${ROOT}/sbin:" >> ${ROOT}/etc/make.conf
128 echo -n "${ROOT}/bin:" >> ${ROOT}/etc/make.conf
129 echo -n "${ROOT}/usr/sbin:" >> ${ROOT}/etc/make.conf
130 echo -n "${ROOT}/usr/bin:" >> ${ROOT}/etc/make.conf
131 echo -n "${ROOT}/usr/lib/portage/bin:" >> ${ROOT}/etc/make.conf
132 echo -n "/bin:" >> ${ROOT}/etc/make.conf
133 echo -n "/usr/bin:" >> ${ROOT}/etc/make.conf
134 echo "\"" >> ${ROOT}/etc/make.conf
135}
136
85bootstrap_portage() { 137bootstrap_portage() {
86 PV=latest 138 PV=latest
87 A=portage-prefix-${PV}.tar.bz2 139 A=portage-prefix-${PV}.tar.bz2
88 einfo "Bootstrapping ${A%-*}" 140 einfo "Bootstrapping ${A%-*}"
89 141
109 make || exit 1 161 make || exit 1
110 162
111 einfo "Installing ${A%-*}" 163 einfo "Installing ${A%-*}"
112 make install || exit 1 164 make install || exit 1
113 165
114 einfo "setting up some guessed defaults" 166 setup_portage
115 167
116 local profile=""
117 local keywords=""
118 case ${CHOST} in
119 powerpc-*-darwin8)
120 profile="${PORTDIR}/profiles/default-darwin/macos/10.4/ppc"
121 keywords="~ppc-macos ppc-macos"
122 ;;
123 i*86-*-darwin8)
124 profile="${PORTDIR}/profiles/default-darwin/macos/10.4/x86"
125 keywords="~x86-macos x86-macos"
126 ;;
127 i*86-pc-linux-gnu)
128 profile="${PORTDIR}/profiles/default-linux/x86/2005.1"
129 keywords="~x86 x86"
130 ;;
131 x64_86-pc-linux-gnu)
132 profile="${PORTDIR}/profiles/default-linux/amd64/2005.1/no-multilib"
133 keywords="~amd64 amd64"
134 ;;
135 *)
136 einfo "You might need to set up a make.profile symlink to a profile in ${PORTDIR}"
137 ;;
138 esac
139 if [ ! -z "${profile}" -a ! -e "${ROOT}"/etc/make.profile ];
140 then
141 ln -s "${profile}" "${ROOT}"/etc/make.profile
142 einfo "Your profile is set to ${profile}."
143 einfo "If your system supports multilib, then this is a no-multilib profile."
144 fi
145
146 local write_make_conf=0
147 [ -e "${ROOT}"/etc/make.conf ] || write_make_conf=1
148
149 if [ ! -z "${keywords}" -a ${write_make_conf} == 1 ];
150 then
151 echo "ACCEPT_KEYWORDS=\"${keywords}\"" >> "${ROOT}"/etc/make.conf
152 einfo "Your ACCEPT_KEYWORDS is set to ${keywords}"
153 fi
154
155 # portage defaults to wget, but if we don't have it in the prefix
156 # (most probably, because it's empty) we need to make sure portage
157 # can find it.
158 if [ x$(type -t wget) == "xfile" -a ! -x "${ROOT}"/usr/bin/wget ];
159 then
160 einfo "Found wget"
161 # symlink wget to the prefix, an emerge wget will overwrite it
162 ln -s "`which wget`" "${ROOT}"/usr/bin/wget
163 elif [ x$(type -t curl) == "xfile" -a ! -x "${ROOT}"/usr/bin/curl ];
164 then
165 if [ ${write_make_conf} == 1 ];
166 then
167 einfo "Found curl, adding curl support to etc/make.conf"
168 while read line; do echo "${line}" >> ${ROOT}/etc/make.conf; done <<EOF
169FETCHCOMMAND="${ROOT}/usr/bin/curl --connect-timeout 15 -# -f -o \${DISTDIR}/\${FILE} \${URI}"
170RESUMECOMMAND="${ROOT}/usr/bin/curl --connect-timeout 15 -# -f -C - -o \${DISTDIR}/\${FILE} \${URI}"
171EOF
172 # symlink curl to the prefix, such that the above command works
173 ln -s "`which curl`" "${ROOT}"/usr/bin/curl
174 fi
175 else
176 einfo "No wget or curl found (this is pretty weird at this stage)"
177 fi
178
179 if [ ${write_make_conf} == 1 ];
180 then
181 einfo "Adding DEFAULT_PATH to etc/make.conf which includes host files"
182 echo -n "DEFAULT_PATH=\"" >> ${ROOT}/etc/make.conf
183 echo -n "${ROOT}/sbin:" >> ${ROOT}/etc/make.conf
184 echo -n "${ROOT}/bin:" >> ${ROOT}/etc/make.conf
185 echo -n "${ROOT}/usr/sbin:" >> ${ROOT}/etc/make.conf
186 echo -n "${ROOT}/usr/bin:" >> ${ROOT}/etc/make.conf
187 echo -n "${ROOT}/usr/lib/portage/bin:" >> ${ROOT}/etc/make.conf
188 echo -n "/bin:" >> ${ROOT}/etc/make.conf
189 echo -n "/usr/bin:" >> ${ROOT}/etc/make.conf
190 echo "\"" >> ${ROOT}/etc/make.conf
191 fi
192
193 einfo "${A%-*} succesfully bootstrapped" 168 einfo "${A%-*} succesfully bootstrapped"
194} 169}
195 170
196bootstrap_odcctools() { 171bootstrap_odcctools() {
197 PV=20060123 172 PV=20060413
198 A=odcctools-${PV}.tar.bz2 173 A=odcctools-${PV}.tar.bz2
199 174
200 fetch http://www.opendarwin.org/downloads/${A} 175 fetch http://www.opendarwin.org/downloads/${A}
201 176
202 export S="${PORTAGE_TMPDIR}/odcctools-${PV}" 177 export S="${PORTAGE_TMPDIR}/odcctools-${PV}"
355 330
356bootstrap_findutils() { 331bootstrap_findutils() {
357 bootstrap_gnu findutils 4.2.27 332 bootstrap_gnu findutils 4.2.27
358} 333}
359 334
335bootstrap_wget() {
336 bootstrap_gnu wget 1.10.2
337}
338
360bootstrap_all() { 339bootstrap_all() {
340 make_tree
361 case ${CHOST} in 341 case ${CHOST} in
362 *-*-darwin*) 342 *-*-darwin*)
363 bootstrap_odcctools 343 bootstrap_odcctools
364 esac 344 esac
365 bootstrap_gcc 345 bootstrap_gcc
366 bootstrap_sed 346 bootstrap_sed
367 bootstrap_findutils 347 bootstrap_findutils
348 bootstrap_wget
368 bootstrap_python 349 bootstrap_python
369 bootstrap_portage 350 bootstrap_portage
370} 351}
371 352
372## End Functions 353## End Functions
454then 435then
455 eerror "bootstrap target ${TODO} unknown" 436 eerror "bootstrap target ${TODO} unknown"
456 exit 1 437 exit 1
457fi 438fi
458 439
459make_tree
460einfo "ready to bootstrap ${TODO}" 440einfo "ready to bootstrap ${TODO}"
461bootstrap_${TODO} 441bootstrap_${TODO}

Legend:
Removed from v.1291  
changed lines
  Added in v.1292

  ViewVC Help
Powered by ViewVC 1.1.20