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 |
|
# the status change if we do any parameter declarations!! |
79 |
|
# dont do this anymore, keep this in mind! |
80 |
|
# |
81 |
|
# local pos="$1" |
82 |
|
# local comment="$2" |
83 |
|
# |
84 |
|
# [ ${PIPESTATUS[${pos}]} -ne 0 ] && die "${comment}" |
85 |
|
# |
86 |
|
[ ${PIPESTATUS[$1]} -ne 0 ] && die "$2" |
87 |
|
} |
88 |
|
|
89 |
xtitle() |
xtitle() |
90 |
{ |
{ |
91 |
if [[ ${TERM} = xterm ]] |
if [[ ${TERM} = xterm ]] |
184 |
my_SOURCEDIR="${SOURCEDIR}/${PNAME}" |
my_SOURCEDIR="${SOURCEDIR}/${PNAME}" |
185 |
fi |
fi |
186 |
|
|
187 |
|
# create the SOURCEDIR |
188 |
|
install -d ${my_SOURCEDIR} |
189 |
|
|
190 |
# if an mirrored file than replace first the mirror uri |
# if an mirrored file than replace first the mirror uri |
191 |
if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]] |
if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]] |
192 |
then |
then |
554 |
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-unneeded 2> /dev/null |
555 |
} |
} |
556 |
|
|
557 |
|
mcompressdocs() |
558 |
|
{ |
559 |
|
local bindir="$@" |
560 |
|
|
561 |
|
if [ -d ${bindir}/usr/share/man ] |
562 |
|
then |
563 |
|
echo -e "${COLBLUE}===${COLGREEN} compressing man-pages ...${COLDEFAULT}" |
564 |
|
${MLIBDIR}/compressdoc -g -9 ${bindir}/usr/share/man |
565 |
|
fi |
566 |
|
|
567 |
|
if [ -d ${bindir}/usr/share/info ] |
568 |
|
then |
569 |
|
echo -e "${COLBLUE}===${COLGREEN} compressing info-pages ...${COLDEFAULT}" |
570 |
|
${MLIBDIR}/compressdoc -g -9 ${bindir}/usr/share/info |
571 |
|
fi |
572 |
|
} |
573 |
|
|
574 |
sminclude() |
sminclude() |
575 |
{ |
{ |
576 |
local i |
local i |
686 |
# INHERITS which functions get included |
# INHERITS which functions get included |
687 |
# SPECIAL_FUNCTIONS special functions which should also be added |
# SPECIAL_FUNCTIONS special functions which should also be added |
688 |
# warning: they get killed before the build starts ! |
# warning: they get killed before the build starts ! |
689 |
|
# SPLIT_PACKAGES names of all subpackages which are splitted from parent |
690 |
|
# SPLIT_PACKAGE_BASE base package name for splitpackages |
691 |
|
# (only in the resulting magefile} |
692 |
# |
# |
693 |
# MAGE_TREE_DEST target destination of the generated tree |
# MAGE_TREE_DEST target destination of the generated tree |
694 |
# REGEN_MAGE_TREE set to 'true' to enable this |
# REGEN_MAGE_TREE set to 'true' to enable this |
699 |
local magefile |
local magefile |
700 |
local dest |
local dest |
701 |
local target |
local target |
702 |
|
local split_pkg_base |
703 |
local sym |
local sym |
704 |
local depname |
local depname |
705 |
|
|
707 |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
708 |
|
|
709 |
# determinate which suffix this mage file should get, if any |
# determinate which suffix this mage file should get, if any |
710 |
[ -n "$1" ] && target="-$1" |
[[ $1 = --target ]] && shift && target="-$1" |
711 |
|
|
712 |
|
# mark package as splitpackage |
713 |
|
[[ $1 = --split-pkg-base ]] && shift && split_pkg_base="$1" |
714 |
|
|
715 |
# name of magefile |
# name of magefile |
716 |
magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage" |
magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage" |
747 |
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
748 |
echo >> ${dest} |
echo >> ${dest} |
749 |
|
|
750 |
|
# split package base |
751 |
|
echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest} |
752 |
|
echo >> ${dest} |
753 |
|
|
754 |
# add special vars |
# add special vars |
755 |
if [ -n "${SPECIAL_VARS}" ] |
if [ -n "${SPECIAL_VARS}" ] |
756 |
then |
then |
818 |
if [[ ${REGEN_MAGE_TREE} = true ]] |
if [[ ${REGEN_MAGE_TREE} = true ]] |
819 |
then |
then |
820 |
# run it without targets |
# run it without targets |
821 |
if [ -z "${MAGE_TARGETS}" ] |
if [[ -n ${MAGE_TARGETS} ]] |
822 |
then |
then |
823 |
|
# build for each target a mage file |
824 |
|
# run it with several targets |
825 |
echo |
echo |
826 |
build_mage_script |
for i in ${MAGE_TARGETS} |
827 |
|
do |
828 |
|
build_mage_script --target "${i}" |
829 |
|
done |
830 |
echo |
echo |
|
else |
|
831 |
|
|
832 |
# build for each target an mage file |
# run it for splitpackages |
833 |
|
elif [[ -n ${SPLIT_PACKAGES} ]] |
834 |
|
then |
835 |
|
local split_pkg_base="${PNAME}" |
836 |
|
# save smage environment |
837 |
|
split_save_variables |
838 |
|
# build for each subpackage a mage file |
839 |
# run it with several targets |
# run it with several targets |
840 |
for i in ${MAGE_TARGETS} |
echo |
841 |
|
for i in ${SPLIT_PACKAGES} |
842 |
do |
do |
843 |
echo |
# get the right variables for the split |
844 |
build_mage_script "${i}" |
export PNAME="${i}" |
845 |
echo |
split_info_${i} |
846 |
|
build_mage_script --split-pkg-base "${split_pkg_base}" |
847 |
done |
done |
848 |
|
echo |
849 |
|
# restore smage environment |
850 |
|
split_restore_variables |
851 |
|
|
852 |
|
else |
853 |
|
echo |
854 |
|
build_mage_script |
855 |
|
echo |
856 |
fi |
fi |
857 |
fi |
fi |
858 |
|
|
883 |
unset postremove |
unset postremove |
884 |
} |
} |
885 |
|
|
886 |
|
split_save_variables() |
887 |
|
{ |
888 |
|
export SAVED_PNAME="${PNAME}" |
889 |
|
export SAVED_PVER="${PVER}" |
890 |
|
export SAVED_PBUILD="${PBUILD}" |
891 |
|
export SAVED_PCATEGORIE="${PCATEGORIE}" |
892 |
|
export SAVED_DESCRIPTION="${DESCRIPTION}" |
893 |
|
export SAVED_HOMEPAGE="${HOMEPAGE}" |
894 |
|
export SAVED_SPECIAL_VARS="${SPECIAL_VARS}" |
895 |
|
export SAVED_STATE="${STATE}" |
896 |
|
export SAVED_PKGTYPE="${PKGTYPE}" |
897 |
|
export SAVED_INHERITS="${INHERITS}" |
898 |
|
export SAVED_DEPEND="${DEPEND}" |
899 |
|
export SAVED_SDEPEND="${SDEPEND}" |
900 |
|
export SAVED_PROVIDE="${PROVIDE}" |
901 |
|
|
902 |
|
# functions |
903 |
|
if [[ ! -z $(typeset -f preinstall) ]] |
904 |
|
then |
905 |
|
# rename the old one |
906 |
|
local saved_preinstall |
907 |
|
saved_preinstall=SAVED_$(typeset -f preinstall) |
908 |
|
eval "${saved_preinstall}" |
909 |
|
export -f SAVED_preinstall |
910 |
|
fi |
911 |
|
|
912 |
|
if [[ ! -z $(typeset -f postinstall) ]] |
913 |
|
then |
914 |
|
# rename the old one |
915 |
|
local saved_postinstall |
916 |
|
saved_postinstall=SAVED_$(typeset -f postinstall) |
917 |
|
eval "${saved_postinstall}" |
918 |
|
export -f SAVED_postinstall |
919 |
|
fi |
920 |
|
|
921 |
|
if [[ ! -z $(typeset -f preremove) ]] |
922 |
|
then |
923 |
|
# rename the old one |
924 |
|
local saved_preremove |
925 |
|
saved_preremove=SAVED_$(typeset -f preremove) |
926 |
|
eval "${saved_preremove}" |
927 |
|
export -f SAVED_preremove |
928 |
|
fi |
929 |
|
|
930 |
|
if [[ ! -z $(typeset -f postremove) ]] |
931 |
|
then |
932 |
|
# rename the old one |
933 |
|
local saved_postremove |
934 |
|
saved_postremove=SAVED_$(typeset -f postremove) |
935 |
|
eval "${saved_postremove}" |
936 |
|
export -f SAVED_postremove |
937 |
|
fi |
938 |
|
} |
939 |
|
|
940 |
|
split_restore_variables() |
941 |
|
{ |
942 |
|
export PNAME="${SAVED_PNAME}" |
943 |
|
export PVER="${SAVED_PVER}" |
944 |
|
export PBUILD="${SAVED_PBUILD}" |
945 |
|
export PCATEGORIE="${SAVED_PCATEGORIE}" |
946 |
|
export DESCRIPTION="${SAVED_DESCRIPTION}" |
947 |
|
export HOMEPAGE="${SAVED_HOMEPAGE}" |
948 |
|
export SPECIAL_VARS="${SAVED_SPECIAL_VARS}" |
949 |
|
export STATE="${SAVED_STATE}" |
950 |
|
export PKGTYPE="${SAVED_PKGTYPE}" |
951 |
|
export INHERITS="${SAVED_INHERITS}" |
952 |
|
export DEPEND="${SAVED_DEPEND}" |
953 |
|
export SDEPEND="${SAVED_SDEPEND}" |
954 |
|
export PROVIDE="${SAVED_PROVIDE}" |
955 |
|
|
956 |
|
# functions |
957 |
|
if [[ ! -z $(typeset -f SAVED_preinstall) ]] |
958 |
|
then |
959 |
|
# rename the old one |
960 |
|
local saved_preinstall |
961 |
|
saved_preinstall=$(typeset -f SAVED_preinstall) |
962 |
|
eval "${saved_preinstall/SAVED_/}" |
963 |
|
export -f preinstall |
964 |
|
fi |
965 |
|
|
966 |
|
if [[ ! -z $(typeset -f SAVED_postinstall) ]] |
967 |
|
then |
968 |
|
# rename the old one |
969 |
|
local saved_postinstall |
970 |
|
saved_postinstall=$(typeset -f SAVED_postinstall) |
971 |
|
eval "${saved_postinstall/SAVED_/}" |
972 |
|
export -f postinstall |
973 |
|
fi |
974 |
|
|
975 |
|
if [[ ! -z $(typeset -f SAVED_preremove) ]] |
976 |
|
then |
977 |
|
# rename the old one |
978 |
|
local saved_preremove |
979 |
|
saved_preremove=$(typeset -f SAVED_preremove) |
980 |
|
eval "${saved_preremove/SAVED_/}" |
981 |
|
export -f preremove |
982 |
|
fi |
983 |
|
|
984 |
|
if [[ ! -z $(typeset -f SAVED_postremove) ]] |
985 |
|
then |
986 |
|
# rename the old one |
987 |
|
local saved_postremove |
988 |
|
saved_postremove=$(typeset -f SAVED_postremove) |
989 |
|
eval "${saved_postremove/SAVED_/}" |
990 |
|
export -f postremove |
991 |
|
fi |
992 |
|
|
993 |
|
# unset saved vars; not needed anymore |
994 |
|
unset SAVED_PNAME |
995 |
|
unset SAVED_PVER |
996 |
|
unset SAVED_PBUILD |
997 |
|
unset SAVED_PCATEGORIE |
998 |
|
unset SAVED_DESCRIPTION |
999 |
|
unset SAVED_HOMEPAGE |
1000 |
|
unset SAVED_SPECIAL_VARS |
1001 |
|
unset SAVED_STATE |
1002 |
|
unset SAVED_PKGTYPE |
1003 |
|
unset SAVED_INHERITS |
1004 |
|
unset SAVED_DEPEND |
1005 |
|
unset SAVED_SDEPEND |
1006 |
|
unset SAVED_PROVIDE |
1007 |
|
unset -f SAVED_preinstall |
1008 |
|
unset -f SAVED_postinstall |
1009 |
|
unset -f SAVED_preremove |
1010 |
|
unset -f SAVED_postremove |
1011 |
|
} |
1012 |
|
|
1013 |
export_inherits() |
export_inherits() |
1014 |
{ |
{ |
1015 |
local include="$1" |
local include="$1" |
1071 |
# fix target as it may be empty ! |
# fix target as it may be empty ! |
1072 |
[ -n "${target}" ] && target="-${target}" |
[ -n "${target}" ] && target="-${target}" |
1073 |
|
|
1074 |
|
|
1075 |
# build pkgname |
# build pkgname |
1076 |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
1077 |
|
|
1091 |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
: ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} |
1092 |
|
|
1093 |
# setup md5 dir |
# setup md5 dir |
1094 |
dest="${MAGE_TREE_DEST}/${pcat}/${pname}/md5" |
dest="${MAGE_TREE_DEST}/${pcat}/${pname}${target}/md5" |
1095 |
install -d ${dest} |
install -d ${dest} |
1096 |
|
|
1097 |
# gen md5sum |
# gen md5sum |
1259 |
|
|
1260 |
regen_mage_tree |
regen_mage_tree |
1261 |
|
|
1262 |
# build md5sum for existing packages |
# build several targets |
1263 |
generate_package_md5sum \ |
if [[ -n ${MAGE_TARGETS} ]] |
1264 |
--pcat "${PCATEGORIE}" \ |
then |
1265 |
--pname "${PNAME}" \ |
for target in ${MAGE_TARGETS} |
1266 |
--pver "${PVER}" \ |
do |
1267 |
--pbuild "${PBUILD}" \ |
# build md5sum for existing packages |
1268 |
--parch "${ARCH}" \ |
generate_package_md5sum \ |
1269 |
--target "${target}" |
--pcat "${PCATEGORIE}" \ |
1270 |
|
--pname "${PNAME}" \ |
1271 |
|
--pver "${PVER}" \ |
1272 |
|
--pbuild "${PBUILD}" \ |
1273 |
|
--parch "${ARCH}" \ |
1274 |
|
--target "${target}" |
1275 |
|
done |
1276 |
|
|
1277 |
|
# build several subpackages |
1278 |
|
elif [[ -n ${SPLIT_PACKAGES} ]] |
1279 |
|
then |
1280 |
|
split_save_variables |
1281 |
|
for subpackage in ${SPLIT_PACKAGE} |
1282 |
|
do |
1283 |
|
# get the right variables for the split |
1284 |
|
export PNAME="${subpackage}" |
1285 |
|
split_info_${subpackage} |
1286 |
|
# build md5sum for existing packages |
1287 |
|
generate_package_md5sum \ |
1288 |
|
--pcat "${PCATEGORIE}" \ |
1289 |
|
--pname "${PNAME}" \ |
1290 |
|
--pver "${PVER}" \ |
1291 |
|
--pbuild "${PBUILD}" \ |
1292 |
|
--parch "${ARCH}" |
1293 |
|
done |
1294 |
|
split_restore_variables |
1295 |
|
|
1296 |
|
else |
1297 |
|
# build md5sum for existing packages |
1298 |
|
generate_package_md5sum \ |
1299 |
|
--pcat "${PCATEGORIE}" \ |
1300 |
|
--pname "${PNAME}" \ |
1301 |
|
--pver "${PVER}" \ |
1302 |
|
--pbuild "${PBUILD}" \ |
1303 |
|
--parch "${ARCH}" |
1304 |
|
fi |
1305 |
|
|
1306 |
exit 0 |
exit 0 |
1307 |
fi |
fi |
1366 |
source ${SMAGENAME} || die "source failed" |
source ${SMAGENAME} || die "source failed" |
1367 |
PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}" |
PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}" |
1368 |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
1369 |
|
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
1370 |
|
|
1371 |
xtitle "Compiling ${PKGNAME}" |
xtitle "Compiling ${PKGNAME}" |
1372 |
echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}" |
echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}" |
1445 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1446 |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
1447 |
|
|
1448 |
src_prepare || die "src_prepare failed" | ${SMAGE_LOG_CMD} |
src_prepare | ${SMAGE_LOG_CMD} |
1449 |
step_by_step $_ |
die_pipestatus 0 "src_prepare failed" |
|
src_compile || die "src_compile failed" | ${SMAGE_LOG_CMD} |
|
|
step_by_step $_ |
|
|
src_install || die "src_install failed" | ${SMAGE_LOG_CMD} |
|
1450 |
step_by_step $_ |
step_by_step $_ |
1451 |
|
|
1452 |
|
src_compile | ${SMAGE_LOG_CMD} |
1453 |
|
die_pipestatus 0 "src_compile failed" |
1454 |
|
step_by_step $_ |
1455 |
|
|
1456 |
# compressing doc, info & man files |
# build several subpackages |
1457 |
if [ -d ${BUILDDIR}/builded/usr/share/man ] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1458 |
then |
then |
1459 |
echo -e "${COLBLUE}===${COLGREEN} compressing man-pages ...${COLDEFAULT}" |
# save bindir |
1460 |
${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/man |
export SAVED_BINDIR="${BINDIR}" |
1461 |
|
for subpackage in ${SPLIT_PACKAGES} |
1462 |
|
do |
1463 |
|
if typeset -f src_install_${subpackage} > /dev/null |
1464 |
|
then |
1465 |
|
# export subpackage bindir |
1466 |
|
export BINDIR="${SAVED_BINDIR}_${subpackage}" |
1467 |
|
src_install_${subpackage} | ${SMAGE_LOG_CMD} |
1468 |
|
die_pipestatus 0 "src_install_${subpackage} failed" |
1469 |
|
step_by_step $_ |
1470 |
|
fi |
1471 |
|
done |
1472 |
|
# restore bindir |
1473 |
|
export BINDIR="${SAVED_BINDIR}" |
1474 |
|
unset SAVED_BINDIR |
1475 |
|
else |
1476 |
|
src_install | ${SMAGE_LOG_CMD} |
1477 |
|
die_pipestatus 0 "src_install failed" |
1478 |
|
step_by_step $_ |
1479 |
fi |
fi |
1480 |
|
|
1481 |
if [ -d ${BUILDDIR}/builded/usr/share/info ] |
echo -e "${COLGREEN}DEB${COLRED}UG!${COLDEFAULT}" |
1482 |
|
|
1483 |
|
# compressing doc, info & man files |
1484 |
|
if [[ -n ${SPLIT_PACKAGES} ]] |
1485 |
then |
then |
1486 |
echo -e "${COLBLUE}===${COLGREEN} compressing info-pages ...${COLDEFAULT}" |
for subpackage in ${SPLIT_PACKAGE} |
1487 |
${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info |
do |
1488 |
|
mcompressdocs ${BINDIR}_${subpackage} |
1489 |
|
done |
1490 |
|
else |
1491 |
|
mcompressdocs ${BINDIR} |
1492 |
fi |
fi |
1493 |
|
|
1494 |
|
|
1495 |
# stripping all bins and libs |
# stripping all bins and libs |
1496 |
case ${NOSTRIP} in |
case ${NOSTRIP} in |
1497 |
true|TRUE|yes|y) |
true|TRUE|yes|y) |
1498 |
echo -e "NOSTRIP=true detected; Package will not be stripped ..." |
echo -e "NOSTRIP=true detected; Package will not be stripped ..." |
1499 |
;; |
;; |
1500 |
*) |
*) |
1501 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
if [[ -n ${SPLIT_PACKAGES} ]] |
1502 |
mstripbins ${BINDIR} |
then |
1503 |
echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}" |
for subpackage in ${SPLIT_PACKAGE} |
1504 |
mstriplibs ${BINDIR} |
do |
1505 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
1506 |
|
mstripbins ${BINDIR}_${subpackage} |
1507 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}" |
1508 |
|
mstriplibs ${BINDIR}_${subpackage} |
1509 |
|
done |
1510 |
|
else |
1511 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
1512 |
|
mstripbins ${BINDIR} |
1513 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}" |
1514 |
|
mstriplibs ${BINDIR} |
1515 |
|
fi |
1516 |
;; |
;; |
1517 |
esac |
esac |
1518 |
|
|
1523 |
;; |
;; |
1524 |
*) |
*) |
1525 |
# build several targets |
# build several targets |
1526 |
if [ -n "${MAGE_TARGETS}" ] |
if [[ -n ${MAGE_TARGETS} ]] |
1527 |
then |
then |
1528 |
for target in ${MAGE_TARGETS} |
for target in ${MAGE_TARGETS} |
1529 |
do |
do |
1549 |
|
|
1550 |
echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
1551 |
done |
done |
1552 |
|
|
1553 |
|
# build several subpackages |
1554 |
|
elif [[ -n ${SPLIT_PACKAGES} ]] |
1555 |
|
then |
1556 |
|
split_save_variables |
1557 |
|
for subpackage in ${SPLIT_PACKAGES} |
1558 |
|
do |
1559 |
|
# get the right variables for the split |
1560 |
|
export PNAME="${subpackage}" |
1561 |
|
split_info_${PNAME} |
1562 |
|
|
1563 |
|
# check if an special subpackage_pkgbuild exists |
1564 |
|
if typeset -f ${PNAME}_pkgbuild > /dev/null |
1565 |
|
then |
1566 |
|
# run it |
1567 |
|
${PNAME}_pkgbuild |
1568 |
|
fi |
1569 |
|
# now create the target package |
1570 |
|
${MLIBDIR}/pkgbuild_dir.sh \ |
1571 |
|
"${PNAME}-${PVER}-${ARCH}-${PBUILD}" \ |
1572 |
|
"${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed" |
1573 |
|
|
1574 |
|
# build pkg-md5-sum if requested |
1575 |
|
generate_package_md5sum \ |
1576 |
|
--pcat "${PCATEGORIE}" \ |
1577 |
|
--pname "${PNAME}" \ |
1578 |
|
--pver "${PVER}" \ |
1579 |
|
--pbuild "${PBUILD}" \ |
1580 |
|
--parch "${ARCH}" |
1581 |
|
|
1582 |
|
echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
1583 |
|
done |
1584 |
|
split_restore_variables |
1585 |
|
|
1586 |
else |
else |
1587 |
${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed" |
${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed" |
1588 |
|
|