20 |
SMAGESUFFIX="smage2" |
SMAGESUFFIX="smage2" |
21 |
MLIBDIR=/usr/lib/mage |
MLIBDIR=/usr/lib/mage |
22 |
SMAGEVERSION="$( < ${MLIBDIR}/version)" |
SMAGEVERSION="$( < ${MLIBDIR}/version)" |
|
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
|
|
|
|
23 |
|
|
24 |
## only for tests -> normally in /etc/rc.d/init.d/functions |
## only for tests -> normally in /etc/rc.d/init.d/functions |
25 |
COLRED="\033[1;6m\033[31m" |
COLRED="\033[1;6m\033[31m" |
73 |
exit 1 |
exit 1 |
74 |
} |
} |
75 |
|
|
76 |
|
die_pipestatus() |
77 |
|
{ |
78 |
|
local pos="$1" |
79 |
|
local comment="$2" |
80 |
|
|
81 |
|
[ ${PIPESTATUS[${pos}]} -gt 0 ] && die "${comment}" |
82 |
|
} |
83 |
|
|
84 |
xtitle() |
xtitle() |
85 |
{ |
{ |
86 |
if [[ ${TERM} = xterm ]] |
if [[ ${TERM} = xterm ]] |
179 |
my_SOURCEDIR="${SOURCEDIR}/${PNAME}" |
my_SOURCEDIR="${SOURCEDIR}/${PNAME}" |
180 |
fi |
fi |
181 |
|
|
182 |
|
# create the SOURCEDIR |
183 |
|
install -d ${my_SOURCEDIR} |
184 |
|
|
185 |
# if an mirrored file than replace first the mirror uri |
# if an mirrored file than replace first the mirror uri |
186 |
if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]] |
if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]] |
187 |
then |
then |
891 |
# fix target as it may be empty ! |
# fix target as it may be empty ! |
892 |
[ -n "${target}" ] && target="-${target}" |
[ -n "${target}" ] && target="-${target}" |
893 |
|
|
894 |
|
|
895 |
# build pkgname |
# build pkgname |
896 |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
897 |
|
|
911 |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
912 |
|
|
913 |
# setup md5 dir |
# setup md5 dir |
914 |
dest="${MAGE_TREE_DEST}/${pcat}/${pname}/md5" |
dest="${MAGE_TREE_DEST}/${pcat}/${pname}${target}/md5" |
915 |
install -d ${dest} |
install -d ${dest} |
916 |
|
|
917 |
# gen md5sum |
# gen md5sum |
1079 |
|
|
1080 |
regen_mage_tree |
regen_mage_tree |
1081 |
|
|
1082 |
# build md5sum for existing packages |
# build several targets |
1083 |
generate_package_md5sum \ |
if [ -n "${MAGE_TARGETS}" ] |
1084 |
--pcat "${PCATEGORIE}" \ |
then |
1085 |
--pname "${PNAME}" \ |
for target in ${MAGE_TARGETS} |
1086 |
--pver "${PVER}" \ |
do |
1087 |
--pbuild "${PBUILD}" \ |
# build md5sum for existing packages |
1088 |
--parch "${ARCH}" \ |
generate_package_md5sum \ |
1089 |
--target "${target}" |
--pcat "${PCATEGORIE}" \ |
1090 |
|
--pname "${PNAME}" \ |
1091 |
|
--pver "${PVER}" \ |
1092 |
|
--pbuild "${PBUILD}" \ |
1093 |
|
--parch "${ARCH}" \ |
1094 |
|
--target "${target}" |
1095 |
|
done |
1096 |
|
else |
1097 |
|
# build md5sum for existing packages |
1098 |
|
generate_package_md5sum \ |
1099 |
|
--pcat "${PCATEGORIE}" \ |
1100 |
|
--pname "${PNAME}" \ |
1101 |
|
--pver "${PVER}" \ |
1102 |
|
--pbuild "${PBUILD}" \ |
1103 |
|
--parch "${ARCH}" \ |
1104 |
|
--target "${target}" |
1105 |
|
fi |
1106 |
|
|
1107 |
exit 0 |
exit 0 |
1108 |
fi |
fi |
1167 |
source ${SMAGENAME} || die "source failed" |
source ${SMAGENAME} || die "source failed" |
1168 |
PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}" |
PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}" |
1169 |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
1170 |
|
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
1171 |
|
|
1172 |
xtitle "Compiling ${PKGNAME}" |
xtitle "Compiling ${PKGNAME}" |
1173 |
echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}" |
echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}" |
1246 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1247 |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
1248 |
|
|
1249 |
src_prepare || die "src_prepare failed" | ${SMAGE_LOG_CMD} |
src_prepare | ${SMAGE_LOG_CMD} |
1250 |
|
die_pipestatus 0 "src_prepare failed" |
1251 |
step_by_step $_ |
step_by_step $_ |
1252 |
src_compile || die "src_compile failed" | ${SMAGE_LOG_CMD} |
|
1253 |
|
src_compile | ${SMAGE_LOG_CMD} |
1254 |
|
die_pipestatus 0 "src_compile failed" |
1255 |
step_by_step $_ |
step_by_step $_ |
1256 |
src_install || die "src_install failed" | ${SMAGE_LOG_CMD} |
|
1257 |
|
src_install | ${SMAGE_LOG_CMD} |
1258 |
|
die_pipestatus 0 "src_install failed" |
1259 |
step_by_step $_ |
step_by_step $_ |
1260 |
|
|
1261 |
|
|