50 |
|
|
51 |
source /etc/mage.rc.global |
source /etc/mage.rc.global |
52 |
source ${MAGERC} |
source ${MAGERC} |
53 |
|
source ${MLIBDIR}/mage4.functions.sh |
54 |
|
|
55 |
# set PKGDIR and BUILDDIR and BINDIR to MROOT |
# set PKGDIR and BUILDDIR and BINDIR to MROOT |
56 |
if [[ -n ${MROOT} ]] |
if [[ -n ${MROOT} ]] |
154 |
local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5" |
local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5" |
155 |
local FETCHING |
local FETCHING |
156 |
local i mirror |
local i mirror |
157 |
|
local wget_opts |
158 |
|
|
159 |
|
# filter wget command if busybox was found |
160 |
|
wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
161 |
|
|
162 |
# install SRCDIR/PNAME if not exist |
# install SRCDIR/PNAME if not exist |
163 |
[ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME} |
[ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME} |
164 |
|
|
165 |
# check if FETCHING is needed |
# check if FETCHING is needed |
166 |
( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null ) |
( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} &> /dev/null ) |
167 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
168 |
then |
then |
169 |
# md5's ok, no fetching needed |
# md5's ok, no fetching needed |
202 |
then |
then |
203 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
204 |
wget \ |
wget \ |
205 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
206 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
207 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
208 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
223 |
then |
then |
224 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
225 |
wget \ |
wget \ |
226 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
227 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
228 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
229 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
244 |
then |
then |
245 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
246 |
wget \ |
wget \ |
247 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
248 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
249 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
250 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
265 |
then |
then |
266 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
267 |
wget \ |
wget \ |
268 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
269 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
270 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
271 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
286 |
then |
then |
287 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
288 |
wget \ |
wget \ |
289 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
290 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
291 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
292 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
302 |
then |
then |
303 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}" |
304 |
wget \ |
wget \ |
305 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
306 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \ |
307 |
"${my_SRC_URI}" |
"${my_SRC_URI}" |
308 |
fi |
fi |
318 |
# recheck md5 sums |
# recheck md5 sums |
319 |
echo |
echo |
320 |
echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}" |
321 |
( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed" |
( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} ) || die "md5 failed" |
322 |
echo |
echo |
323 |
|
|
324 |
# not needed anymore |
# not needed anymore |
506 |
libtoolize ${opts} || die "running: mlibtoolize ${opts}" |
libtoolize ${opts} || die "running: mlibtoolize ${opts}" |
507 |
} |
} |
508 |
|
|
509 |
|
mautoreconf() |
510 |
|
{ |
511 |
|
local opts="$@" |
512 |
|
[[ -z ${opts} ]] && opts="--verbose --install --force" |
513 |
|
|
514 |
|
autoreconf ${opts} || die "running: mautoreconf ${opts}" |
515 |
|
} |
516 |
|
|
517 |
minstalldocs() |
minstalldocs() |
518 |
{ |
{ |
519 |
local docfiles |
local docfiles |
1182 |
# creates md5sums for smages to given dir |
# creates md5sums for smages to given dir |
1183 |
if [[ $1 = calcmd5 ]] |
if [[ $1 = calcmd5 ]] |
1184 |
then |
then |
1185 |
if [ $# -ge 3 ] |
if [ $# -ge 2 ] |
1186 |
then |
then |
1187 |
SMAGENAME="$2" |
SMAGENAME="$2" |
1188 |
MD5DIR="$3" |
MD5DIR="$3" |
1189 |
|
[[ -z ${MD5DIR} ]] && MD5DIR="$(dirname ${SMAGENAME})/md5" |
1190 |
|
|
1191 |
source ${SMAGENAME} || die "download source failed" |
source ${SMAGENAME} || die "download source failed" |
1192 |
|
|
1193 |
# overridable sourcedir; must be declared after source of the smage2 |
# overridable sourcedir; must be declared after source of the smage2 |
1240 |
echo |
echo |
1241 |
else |
else |
1242 |
echo "Usage: Calculating MD5 Sums:" |
echo "Usage: Calculating MD5 Sums:" |
1243 |
echo " $(basename $0) calcmd5 /path/to/SMAGENAME /path/to/MD5DIR" |
echo " $(basename $0) calcmd5 /path/to/SMAGENAME [/path/to/MD5DIR]" |
1244 |
echo |
echo |
1245 |
echo |
echo |
1246 |
echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs." |
echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs." |
1534 |
then |
then |
1535 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1536 |
do |
do |
1537 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
1538 |
mstripbins ${BINDIR}_${subpackage} |
mstripbins ${BINDIR}_${subpackage} |
1539 |
echo -e "${COLBLUE}===${COLGREEN} stripping libraries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping libraries for '${subpackage}' ...${COLDEFAULT}" |
1540 |
mstriplibs ${BINDIR}_${subpackage} |
mstriplibs ${BINDIR}_${subpackage} |
1541 |
done |
done |
1542 |
else |
else |