1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# $Id$ |
3 |
|
|
4 |
# compiles/installs .smage2 source install scripts |
# compiles/installs .smage2 source install scripts |
5 |
# needs pkgbuild_dir (mage) |
# needs pkgbuild_dir (mage) |
6 |
|
|
7 |
# SMAGE2 |
# TODO: record dynlib, gz | xz database |
|
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $ |
|
8 |
|
|
|
#01.10.2004 |
|
|
# added ccache support |
|
|
# added distcc support |
|
9 |
|
|
10 |
# set default user mage.rc |
# set default user mage.rc |
11 |
: ${MAGERC="/etc/mage.rc"} |
: ${MAGERC="/etc/mage.rc"} |
47 |
|
|
48 |
source /etc/mage.rc.global |
source /etc/mage.rc.global |
49 |
source ${MAGERC} |
source ${MAGERC} |
50 |
|
source ${MLIBDIR}/mage4.functions.sh |
51 |
|
|
52 |
# set PKGDIR and BUILDDIR and BINDIR to MROOT |
# set PKGDIR and BUILDDIR and BINDIR to MROOT |
53 |
if [[ -n ${MROOT} ]] |
if [[ -n ${MROOT} ]] |
57 |
export BINDIR=${MROOT}/${BINDIR} |
export BINDIR=${MROOT}/${BINDIR} |
58 |
fi |
fi |
59 |
|
|
60 |
|
# sources the smage file and uses state from distribution file if exist |
61 |
|
# may helpful for repository support later on |
62 |
|
smagesource() |
63 |
|
{ |
64 |
|
local file="$1" |
65 |
|
local mystate |
66 |
|
local mycodename |
67 |
|
|
68 |
|
source ${file} |
69 |
|
|
70 |
|
[[ -n ${STATE} ]] && mystate="${STATE}" |
71 |
|
|
72 |
|
# do not overide if local state was broken or disabled! |
73 |
|
case ${STATE} in |
74 |
|
broken) return ;; |
75 |
|
disabled) return ;; |
76 |
|
esac |
77 |
|
|
78 |
|
if [ -f ${SMAGESCRIPTSDIR}/distribution ] |
79 |
|
then |
80 |
|
source ${SMAGESCRIPTSDIR}/distribution |
81 |
|
[[ -n ${STATE} ]] && mystate="${STATE}" |
82 |
|
fi |
83 |
|
# now switch state and export it |
84 |
|
STATE="${mystate}" |
85 |
|
} |
86 |
|
|
87 |
showversion() |
showversion() |
88 |
{ |
{ |
89 |
echo -en "Magellan Source Install v${SMAGEVERSION} " |
echo -en "Magellan Source Install v${SMAGEVERSION} " |
178 |
local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5" |
local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5" |
179 |
local FETCHING |
local FETCHING |
180 |
local i mirror |
local i mirror |
181 |
|
local wget_opts |
182 |
|
|
183 |
|
# filter wget command if busybox was found |
184 |
|
wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
185 |
|
|
186 |
# install SRCDIR/PNAME if not exist |
# install SRCDIR/PNAME if not exist |
187 |
[ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME} |
[ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME} |
188 |
|
|
189 |
# check if FETCHING is needed |
# check if FETCHING is needed |
190 |
( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null ) |
( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} &> /dev/null ) |
191 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
192 |
then |
then |
193 |
# md5's ok, no fetching needed |
# md5's ok, no fetching needed |
226 |
then |
then |
227 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
228 |
wget \ |
wget \ |
229 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
230 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
231 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
232 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
247 |
then |
then |
248 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
249 |
wget \ |
wget \ |
250 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
251 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
252 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
253 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
268 |
then |
then |
269 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
270 |
wget \ |
wget \ |
271 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
272 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
273 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
274 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
289 |
then |
then |
290 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
291 |
wget \ |
wget \ |
292 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
293 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
294 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
295 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
310 |
then |
then |
311 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
312 |
wget \ |
wget \ |
313 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
314 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
315 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
316 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
326 |
then |
then |
327 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}" |
328 |
wget \ |
wget \ |
329 |
--passive-ftp \ |
${wget_opts} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
330 |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \ |
331 |
"${my_SRC_URI}" |
"${my_SRC_URI}" |
332 |
fi |
fi |
342 |
# recheck md5 sums |
# recheck md5 sums |
343 |
echo |
echo |
344 |
echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}" |
345 |
( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed" |
( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} ) || die "md5 failed" |
346 |
echo |
echo |
347 |
|
|
348 |
# not needed anymore |
# not needed anymore |
466 |
popd > /dev/null |
popd > /dev/null |
467 |
fi |
fi |
468 |
;; |
;; |
469 |
|
xz) |
470 |
|
IFTAR="$(basename $SRCFILE .xz)" |
471 |
|
IFTAR="${IFTAR##*.}" |
472 |
|
if [[ ${IFTAR} = tar ]] |
473 |
|
then |
474 |
|
tar --no-same-owner -xvJf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tar.xz unpack failed." |
475 |
|
else |
476 |
|
pushd ${DEST} > /dev/null |
477 |
|
xzcat ${SOURCEDIR}/${PNAME}/${SRCFILE} > ${DEST}/$(basename ${SRCFILE} .xz) || die ".xz unpack failed." |
478 |
|
popd > /dev/null |
479 |
|
fi |
480 |
|
;; |
481 |
tbz2|mpks|mpk) |
tbz2|mpks|mpk) |
482 |
tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tbz2 unpack failed." |
tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tbz2 unpack failed." |
483 |
;; |
;; |
484 |
tgz) |
tgz) |
485 |
tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tgz unpack failed." |
tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tgz unpack failed." |
486 |
;; |
;; |
487 |
|
txz|mpkzs|mpkz) |
488 |
|
tar --no-same-owner -xvJf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".txz unpack failed." |
489 |
|
;; |
490 |
rar) |
rar) |
491 |
unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST} || die ".rar unpack failed." |
unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST} || die ".rar unpack failed." |
492 |
;; |
;; |
540 |
mlibtoolize() |
mlibtoolize() |
541 |
{ |
{ |
542 |
local opts="$@" |
local opts="$@" |
543 |
[[ -z ${opts} ]] && opts="--copy --force" |
[[ -z ${opts} ]] && opts="--verbose --install --force" |
544 |
|
|
545 |
libtoolize ${opts} || die "running: mlibtoolize ${opts}" |
libtoolize ${opts} || die "running: mlibtoolize ${opts}" |
546 |
} |
} |
547 |
|
|
548 |
|
mautoreconf() |
549 |
|
{ |
550 |
|
local opts="$@" |
551 |
|
[[ -z ${opts} ]] && opts="--verbose --install --force" |
552 |
|
|
553 |
|
autoreconf ${opts} || die "running: mautoreconf ${opts}" |
554 |
|
} |
555 |
|
|
556 |
minstalldocs() |
minstalldocs() |
557 |
{ |
{ |
558 |
local docfiles |
local docfiles |
580 |
local stripdir="$@" |
local stripdir="$@" |
581 |
|
|
582 |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
583 |
find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_LIB} 2> /dev/null |
584 |
} |
} |
585 |
|
|
586 |
mstripbins() |
mstripbins() |
588 |
local stripdir="$@" |
local stripdir="$@" |
589 |
|
|
590 |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
591 |
find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_BIN} 2> /dev/null |
592 |
|
} |
593 |
|
|
594 |
|
mstripstatic() |
595 |
|
{ |
596 |
|
local stripdir="$@" |
597 |
|
|
598 |
|
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
599 |
|
find ${stripdir} | xargs file | grep "ar archive" | cut -f 1 -d : | xargs strip ${STRIP_STATIC_LIB} 2> /dev/null |
600 |
} |
} |
601 |
|
|
602 |
mcompressdocs() |
mcompressdocs() |
771 |
# now build the mage file |
# now build the mage file |
772 |
> ${dest} |
> ${dest} |
773 |
|
|
|
# header |
|
|
echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $' >> ${dest} |
|
|
echo >> ${dest} |
|
|
|
|
774 |
# pgkname and state |
# pgkname and state |
775 |
echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest} |
echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest} |
776 |
echo "STATE=\"${STATE}\"" >> ${dest} |
echo "STATE=\"${STATE}\"" >> ${dest} |
|
echo >> ${dest} |
|
777 |
|
|
778 |
# description and homepage |
# description and homepage |
779 |
echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest} |
echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest} |
780 |
echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest} |
echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest} |
|
echo >> ${dest} |
|
781 |
|
|
782 |
# special tags and vars |
# special tags and vars |
783 |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
784 |
|
|
785 |
# echo MAGE_TARGETS ## note -target is needed ! |
# echo MAGE_TARGETS ## note -target is needed ! |
786 |
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
|
echo >> ${dest} |
|
787 |
|
|
788 |
# split package base |
# split package base |
789 |
echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest} |
echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest} |
|
echo >> ${dest} |
|
790 |
|
|
791 |
# add special vars |
# add special vars |
792 |
if [ -n "${SPECIAL_VARS}" ] |
if [ -n "${SPECIAL_VARS}" ] |
797 |
# being tricky here :) |
# being tricky here :) |
798 |
echo "${i}=\"$(eval echo \$${i})\"" >> ${dest} |
echo "${i}=\"$(eval echo \$${i})\"" >> ${dest} |
799 |
done |
done |
|
echo >> ${dest} |
|
800 |
fi |
fi |
801 |
|
|
802 |
# add at least all includes |
# add at least all includes |
808 |
do |
do |
809 |
echo -n " ${i}" >> ${dest} |
echo -n " ${i}" >> ${dest} |
810 |
done |
done |
811 |
echo >> ${dest} |
# a CRLF is needed here! |
812 |
|
echo >> ${dest} |
813 |
fi |
fi |
|
echo >> ${dest} |
|
814 |
|
|
815 |
# deps and provides |
# deps and provides |
816 |
echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest} |
echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest} |
|
echo >> ${dest} |
|
817 |
echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest} |
echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest} |
|
echo >> ${dest} |
|
818 |
echo "PROVIDE=\"${PROVIDE}\"" >> ${dest} |
echo "PROVIDE=\"${PROVIDE}\"" >> ${dest} |
|
echo >> ${dest} |
|
819 |
|
|
820 |
# add special functions |
# add special functions |
821 |
if [ -n "${SPECIAL_FUNCTIONS}" ] |
if [ -n "${SPECIAL_FUNCTIONS}" ] |
825 |
do |
do |
826 |
# add to mage (quotes needed !) |
# add to mage (quotes needed !) |
827 |
typeset -f "${i}" >> ${dest} |
typeset -f "${i}" >> ${dest} |
|
echo >> ${dest} |
|
828 |
# unset to be safe (quotes needed !) |
# unset to be safe (quotes needed !) |
829 |
#unset "${i}" <-- later to get every target built |
#unset "${i}" <-- later to get every target built |
830 |
done |
done |
|
echo >> ${dest} |
|
831 |
fi |
fi |
832 |
|
|
833 |
# pre|post-install|removes |
# pre|post-install|removes |
834 |
typeset -f preinstall >> ${dest} |
typeset -f preinstall >> ${dest} |
|
echo >> ${dest} |
|
835 |
typeset -f postinstall >> ${dest} |
typeset -f postinstall >> ${dest} |
|
echo >> ${dest} |
|
836 |
typeset -f preremove >> ${dest} |
typeset -f preremove >> ${dest} |
|
echo >> ${dest} |
|
837 |
typeset -f postremove >> ${dest} |
typeset -f postremove >> ${dest} |
|
echo >> ${dest} |
|
838 |
} |
} |
839 |
|
|
840 |
regen_mage_tree() |
regen_mage_tree() |
841 |
{ |
{ |
842 |
local i |
local subpackage |
843 |
|
|
844 |
# build them only if requested |
# build them only if requested |
845 |
if [[ ${REGEN_MAGE_TREE} = true ]] |
if [[ ${REGEN_MAGE_TREE} = true ]] |
850 |
# build for each target a mage file |
# build for each target a mage file |
851 |
# run it with several targets |
# run it with several targets |
852 |
echo |
echo |
853 |
for i in ${MAGE_TARGETS} |
for subpackage in ${MAGE_TARGETS} |
854 |
do |
do |
855 |
build_mage_script --target "${i}" |
build_mage_script --target "${subpackage}" |
856 |
done |
done |
857 |
echo |
echo |
858 |
|
|
865 |
# build for each subpackage a mage file |
# build for each subpackage a mage file |
866 |
# run it with several targets |
# run it with several targets |
867 |
echo |
echo |
868 |
for i in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
869 |
do |
do |
870 |
# get the right variables for the split |
# get the right variables for the split |
871 |
export PNAME="${i}" |
export PNAME="${subpackage}" |
872 |
split_info_${i} |
split_info_${subpackage} |
873 |
|
# get the preinstall etc |
874 |
|
split_export_inherits ${subpackage} |
875 |
build_mage_script --split-pkg-base "${split_pkg_base}" |
build_mage_script --split-pkg-base "${split_pkg_base}" |
876 |
|
# delete split preinstall etc |
877 |
|
split_delete_inherits ${subpackage} |
878 |
# restore smage environment |
# restore smage environment |
879 |
split_restore_variables |
split_restore_variables |
880 |
done |
done |
1060 |
unset -f SAVED_postremove |
unset -f SAVED_postremove |
1061 |
} |
} |
1062 |
|
|
1063 |
|
split_export_inherits() |
1064 |
|
{ |
1065 |
|
local subpackage="$1" |
1066 |
|
local func |
1067 |
|
local newfunc |
1068 |
|
|
1069 |
|
for func in preinstall postinstall preremove postremove |
1070 |
|
do |
1071 |
|
if [[ ! -z $(typeset -f ${func}_${subpackage}) ]] |
1072 |
|
then |
1073 |
|
newfunc=$(typeset -f ${func}_${subpackage}) |
1074 |
|
newfunc="${newfunc/_${subpackage} (/ (}" |
1075 |
|
eval "${newfunc}" |
1076 |
|
fi |
1077 |
|
done |
1078 |
|
} |
1079 |
|
|
1080 |
|
split_delete_inherits() |
1081 |
|
{ |
1082 |
|
local subpackage="$1" |
1083 |
|
local func |
1084 |
|
|
1085 |
|
for func in preinstall postinstall preremove postremove |
1086 |
|
do |
1087 |
|
if [[ ! -z $(typeset -f ${func}_${subpackage}) ]] |
1088 |
|
then |
1089 |
|
unset -f ${func} |
1090 |
|
fi |
1091 |
|
done |
1092 |
|
} |
1093 |
|
|
1094 |
export_inherits() |
export_inherits() |
1095 |
{ |
{ |
1096 |
local include="$1" |
local include="$1" |
1246 |
# creates md5sums for smages to given dir |
# creates md5sums for smages to given dir |
1247 |
if [[ $1 = calcmd5 ]] |
if [[ $1 = calcmd5 ]] |
1248 |
then |
then |
1249 |
if [ $# -ge 3 ] |
if [ $# -ge 2 ] |
1250 |
then |
then |
1251 |
SMAGENAME="$2" |
SMAGENAME="$2" |
1252 |
MD5DIR="$3" |
MD5DIR="$3" |
1253 |
source ${SMAGENAME} || die "download source failed" |
[[ -z ${MD5DIR} ]] && MD5DIR="$(dirname ${SMAGENAME})/md5" |
1254 |
|
|
1255 |
|
smagesource ${SMAGENAME} || die "download source failed" |
1256 |
|
|
1257 |
# overridable sourcedir; must be declared after source of the smage2 |
# overridable sourcedir; must be declared after source of the smage2 |
1258 |
CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}" |
CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}" |
1304 |
echo |
echo |
1305 |
else |
else |
1306 |
echo "Usage: Calculating MD5 Sums:" |
echo "Usage: Calculating MD5 Sums:" |
1307 |
echo " $(basename $0) calcmd5 /path/to/SMAGENAME /path/to/MD5DIR" |
echo " $(basename $0) calcmd5 /path/to/SMAGENAME [/path/to/MD5DIR]" |
1308 |
echo |
echo |
1309 |
echo |
echo |
1310 |
echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs." |
echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs." |
1326 |
# get smage |
# get smage |
1327 |
SMAGENAME="$2" |
SMAGENAME="$2" |
1328 |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
1329 |
source ${SMAGENAME} || die "download source failed" |
smagesource ${SMAGENAME} || die "download source failed" |
1330 |
|
|
1331 |
download_sources |
download_sources |
1332 |
exit 0 |
exit 0 |
1338 |
# set correct SMAGENAME |
# set correct SMAGENAME |
1339 |
SMAGENAME="$2" |
SMAGENAME="$2" |
1340 |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
1341 |
source ${SMAGENAME} || die "regen: smage2 not found" |
smagesource ${SMAGENAME} || die "regen: smage2 not found" |
1342 |
|
|
1343 |
regen_mage_tree |
regen_mage_tree |
1344 |
|
|
1400 |
|
|
1401 |
echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}" |
echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}" |
1402 |
|
|
1403 |
source ${SMAGENAME} || die "regen: smage2 not found" |
smagesource ${SMAGENAME} || die "regen: smage2 not found" |
1404 |
|
|
1405 |
if [[ -d ${SOURCEDIR}/${PNAME} ]] |
if [[ -d ${SOURCEDIR}/${PNAME} ]] |
1406 |
then |
then |
1449 |
[ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}" |
[ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}" |
1450 |
[ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}" |
[ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}" |
1451 |
|
|
1452 |
source ${SMAGENAME} || die "source failed" |
smagesource ${SMAGENAME} || die "source failed" |
1453 |
PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}" |
PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}" |
1454 |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
1455 |
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
1598 |
then |
then |
1599 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1600 |
do |
do |
1601 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
1602 |
mstripbins ${BINDIR}_${subpackage} |
mstripbins ${BINDIR}_${subpackage} |
1603 |
echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
1604 |
mstriplibs ${BINDIR}_${subpackage} |
mstriplibs ${BINDIR}_${subpackage} |
1605 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
1606 |
|
mstripstatic ${BINDIR}_${subpackage} |
1607 |
done |
done |
1608 |
else |
else |
1609 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
1610 |
mstripbins ${BINDIR} |
mstripbins ${BINDIR} |
1611 |
echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
1612 |
mstriplibs ${BINDIR} |
mstriplibs ${BINDIR} |
1613 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
1614 |
|
mstripstatic ${BINDIR} |
1615 |
fi |
fi |
1616 |
;; |
;; |
1617 |
esac |
esac |