␊ |
rm -R -f "${1}"␊ |
echo ""␉␊ |
echo -e $COL_BLACK"␉----------------------------------"$COL_RESET␊ |
echo -e $COL_BLACK"␉Building $packagename Install Package"$COL_RESET␊ |
echo -e $COL_BLACK"␉----------------------------------"$COL_RESET␊ |
echo ""␊ |
␊ |
outline[$((outlinecount++))]="${indent[$xmlindent]}<choices-outline>"␊ |
|
# build core package␊ |
␉echo "================= Core ================="␊ |
␉((xmlindent++))␊ |
␉packagesidentity="org.chameleon.core.pkg"␊ |
␉packagesidentity="org.chameleon"␊ |
␉mkdir -p ${1}/Core/Root/usr/sbin␊ |
␉mkdir -p ${1}/Core/Root/usr/local/bin␊ |
␉mkdir -p ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/boot ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/boot0 ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/boot0hfs ${1}/Core/Root/usr/standalone/i386␊ |
␉#cp -f ${1%/*}/i386/boot1f32 ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/boot1f32 ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/boot1h ${1}/Core/Root/usr/standalone/i386␊ |
␉#cp -f ${1%/*}/i386/boot1he ${1}/Core/Root/usr/standalone/i386␊ |
␉#cp -f ${1%/*}/i386/boot1hp ${1}/Core/Root/usr/standalone/i386␊ |
␉#cp -f ${1%/*}/i386/cdboot ${1}/Core/Root/usr/standalone/i386␊ |
␉#cp -f ${1%/*}/i386/chain0 ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/boot1he ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/boot1hp ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/cdboot ${1}/Core/Root/usr/standalone/i386␊ |
␉cp -f ${1%/*}/i386/chain0 ${1}/Core/Root/usr/standalone/i386␊ |
␉fixperms "${1}/Core/Root/"␊ |
␉cp -f ${pkgroot}/fdisk ${1}/Core/Root/usr/sbin␊ |
␉cp -f ${pkgroot}/fdisk440 ${1}/Core/Root/usr/sbin␊ |
␉cp -f ${1%/*}/i386/bdmesg ${1}/Core/Root/usr/sbin␊ |
␉local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )␊ |
␉echo "␉[BUILD] i386 "␊ |
␉buildpackage "${1}/Core" "/tmpcham" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1␊ |
␉buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1␊ |
␊ |
# build Chameleon package␊ |
␉echo "================= Chameleon ================="␊ |
|
␉␉mkdir -p ${1}/Standard/Root␊ |
␉␉mkdir -p ${1}/Standard/Scripts/Tools␊ |
␉␉cp -f ${pkgroot}/Scripts/Standard/* ${1}/Standard/Scripts␊ |
␉␉ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Tools/SetFile␊ |
␉␉# ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Tools/SetFile␊ |
␉␉echo "␉[BUILD] Standard "␊ |
␉␉buildpackage "${1}/Standard" "/tmpcham" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1␊ |
␉# End build standard package ␊ |
|
␉␉mkdir -p ${1}/EFI/Root␊ |
␉␉mkdir -p ${1}/EFI/Scripts/Tools␊ |
␉␉cp -f ${pkgroot}/Scripts/EFI/* ${1}/EFI/Scripts␊ |
␉␉ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Tools/SetFile␊ |
␉␉# ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Tools/SetFile␊ |
␉␉echo "␉[BUILD] EFI "␊ |
␉␉buildpackage "${1}/EFI" "/tmpcham" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1␊ |
␉␉buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1␊ |
␉# End build efi package␊ |
␊ |
␉# build reset choice package ␊ |
|
␉␉␉mkdir -p "${1}/${modules[$i]##*/}/Scripts"␊ |
␉␉␉ditto --noextattr --noqtn "${modules[$i]}/postinstall" "${1}/${modules[$i]##*/}/Scripts/postinstall"␊ |
␉␉␉echo "␉[BUILD] ${modules[$i]##*/} "␊ |
␉␉␉buildpackage "${1}/${modules[$i]##*/}" "/tmpcham" "" "start_selected=\"false\"" >/dev/null 2>&1␊ |
␉␉␉buildpackage "${1}/${modules[$i]##*/}" "/" "" "start_selected=\"false\"" >/dev/null 2>&1␊ |
␉␉␉rm -R -f "${1}/${i##*/}"␊ |
␉␉done␊ |
␉␉((xmlindent--))␊ |
|
␉␉␉mkdir -p "${1}/${options[$i]##*/}/Scripts"␊ |
␉␉␉ditto --noextattr --noqtn "${options[$i]}/postinstall" "${1}/${options[$i]##*/}/Scripts/postinstall"␊ |
␉␉␉echo "␉[BUILD] ${options[$i]##*/} "␊ |
␉␉␉buildpackage "${1}/${options[$i]##*/}" "/tmpcham" "" "start_selected=\"false\"" >/dev/null 2>&1␊ |
␉␉␉buildpackage "${1}/${options[$i]##*/}" "/" "" "start_selected=\"false\"" >/dev/null 2>&1␊ |
␉␉done␊ |
␉␉# End build base options packages␊ |
␊ |
|
␉␉␉␉mkdir -p "${1}/${optionsadv[$i]##*/}/Scripts"␊ |
␉␉␉␉ditto --noextattr --noqtn "${optionsadv[$i]}/postinstall" "${1}/${optionsadv[$i]##*/}/Scripts/postinstall"␊ |
␉␉␉␉echo "␉[BUILD] ${optionsadv[$i]##*/} "␊ |
␉␉␉␉buildpackage "${1}/${optionsadv[$i]##*/}" "/tmpcham" "" "start_selected=\"false\"" >/dev/null 2>&1␊ |
␉␉␉␉buildpackage "${1}/${optionsadv[$i]##*/}" "/" "" "start_selected=\"false\"" >/dev/null 2>&1␊ |
␉␉␉done␊ |
␉␉␊ |
␉␉␉((xmlindent--))␊ |
|
␉mkdir -p ${1}/Post/Scripts␊ |
␉cp -f ${pkgroot}/Scripts/Post/* ${1}/Post/Scripts␊ |
␉echo "␉[BUILD] Post "␊ |
␉buildpackage "${1}/Post" "/tmpcham" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1␊ |
␉buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>"␊ |
␊ |
# build meta package␊ |
|
␉md5=$( md5 "${1%/*}/${packagename// /}-${version}-r${revision}.pkg" | awk {'print $4'} )␊ |
␉echo "MD5 (${packagename// /}-${version}-r${revision}.pkg) = ${md5}" > "${1%/*}/${packagename// /}-${version}-r${revision}.pkg.md5"␊ |
␉echo ""␉␊ |
␊ |
␉echo -e $COL_BLACK"␉--------------------------"$COL_RESET␊ |
␉echo -e $COL_BLACK"␉Building process complete!"$COL_RESET␊ |
␉echo -e $COL_BLACK"␉--------------------------"$COL_RESET␊ |
␉echo ""␉␊ |
␉echo -e $COL_BLACK"␉Build info."␊ |
␉echo -e $COL_BLACK"␉==========="␊ |