20 |
SMAGESUFFIX="smage2" |
SMAGESUFFIX="smage2" |
21 |
MLIBDIR=/usr/lib/mage |
MLIBDIR=/usr/lib/mage |
22 |
SMAGEVERSION="$( < ${MLIBDIR}/version)" |
SMAGEVERSION="$( < ${MLIBDIR}/version)" |
23 |
|
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
24 |
|
|
25 |
|
|
26 |
## only for tests -> normally in /etc/rc.d/init.d/functions |
## only for tests -> normally in /etc/rc.d/init.d/functions |
27 |
COLRED="\033[1;6m\033[31m" |
COLRED="\033[1;6m\033[31m" |
173 |
my_SOURCEDIR="${SOURCEDIR}/${PNAME}" |
my_SOURCEDIR="${SOURCEDIR}/${PNAME}" |
174 |
fi |
fi |
175 |
|
|
176 |
|
# create the SOURCEDIR |
177 |
|
install -d ${my_SOURCEDIR} |
178 |
|
|
179 |
# if an mirrored file than replace first the mirror uri |
# if an mirrored file than replace first the mirror uri |
180 |
if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]] |
if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]] |
181 |
then |
then |
191 |
--tries 3 \ |
--tries 3 \ |
192 |
--continue \ |
--continue \ |
193 |
--progress bar \ |
--progress bar \ |
194 |
--directory-prefix="${my_SOURCEDIR}" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
195 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
196 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
197 |
then |
then |
215 |
--tries 3 \ |
--tries 3 \ |
216 |
--continue \ |
--continue \ |
217 |
--progress bar \ |
--progress bar \ |
218 |
--directory-prefix="${my_SOURCEDIR}" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
219 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
220 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
221 |
then |
then |
239 |
--tries 3 \ |
--tries 3 \ |
240 |
--continue \ |
--continue \ |
241 |
--progress bar \ |
--progress bar \ |
242 |
--directory-prefix="${my_SOURCEDIR}" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
243 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
244 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
245 |
then |
then |
263 |
--tries 3 \ |
--tries 3 \ |
264 |
--continue \ |
--continue \ |
265 |
--progress bar \ |
--progress bar \ |
266 |
--directory-prefix="${my_SOURCEDIR}" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
267 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
268 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
269 |
then |
then |
287 |
--tries 3 \ |
--tries 3 \ |
288 |
--continue \ |
--continue \ |
289 |
--progress bar \ |
--progress bar \ |
290 |
--directory-prefix="${my_SOURCEDIR}" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ |
291 |
"${my_SRC_URI_MIRROR}" |
"${my_SRC_URI_MIRROR}" |
292 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
293 |
then |
then |
306 |
--tries 3 \ |
--tries 3 \ |
307 |
--continue \ |
--continue \ |
308 |
--progress bar \ |
--progress bar \ |
309 |
--directory-prefix="${my_SOURCEDIR}" \ |
--output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \ |
310 |
"${my_SRC_URI}" |
"${my_SRC_URI}" |
311 |
fi |
fi |
312 |
fi |
fi |
942 |
echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}" |
echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}" |
943 |
} |
} |
944 |
|
|
945 |
|
step_by_step() |
946 |
|
{ |
947 |
|
if [[ ${STEP_BY_STEP} = true ]] |
948 |
|
then |
949 |
|
echo "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}" |
950 |
|
echo "Press [enter] to continue" |
951 |
|
read |
952 |
|
fi |
953 |
|
} |
954 |
|
|
955 |
|
|
956 |
# print out our version |
# print out our version |
957 |
showversion |
showversion |
1218 |
mage rmstamp |
mage rmstamp |
1219 |
fi |
fi |
1220 |
|
|
1221 |
src_prepare || die "src_prepare failed" |
# setup build loggins |
1222 |
src_compile || die "src_compile failed" |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1223 |
src_install || die "src_install failed" |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
1224 |
|
|
1225 |
|
src_prepare || die "src_prepare failed" | ${SMAGE_LOG_CMD} |
1226 |
|
step_by_step $_ |
1227 |
|
src_compile || die "src_compile failed" | ${SMAGE_LOG_CMD} |
1228 |
|
step_by_step $_ |
1229 |
|
src_install || die "src_install failed" | ${SMAGE_LOG_CMD} |
1230 |
|
step_by_step $_ |
1231 |
|
|
1232 |
|
|
1233 |
# compressing doc, info & man files |
# compressing doc, info & man files |
1308 |
;; |
;; |
1309 |
esac |
esac |
1310 |
|
|
1311 |
|
if [[ ${SMAGE_BUILD_LOGGING} != false ]] |
1312 |
|
then |
1313 |
|
bzip2 -9f /var/log/smage/${PKGNAME}.log |
1314 |
|
else |
1315 |
|
[[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log |
1316 |
|
fi |
1317 |
|
|
1318 |
# for sure |
# for sure |
1319 |
unset NOPKGBUILD |
unset NOPKGBUILD |
1320 |
unset NOSTRIP |
unset NOSTRIP |