␊ |
# clean up the destination path␊ |
␊ |
␉rm -R -f "${1}"␊ |
rm -R -f "${1}"␊ |
␉␊ |
␉echo "Building $packagename Install Package (Standard) v${version%%-*} $stage r$revision $builddate"␊ |
␉␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}<choices-outline>"␊ |
echo "Building $packagename Install Package (Standard) v${version%%-*} $stage r$revision $builddate"␊ |
␊ |
outline[$((outlinecount++))]="${indent[$xmlindent]}<choices-outline>"␊ |
␊ |
# Start␊ |
␊ |
# build Chameleon package ␊ |
␉((xmlindent++))␊ |
# build core package␊ |
␉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/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␊ |
␉fixperms "${1}/Core/Root/"␊ |
␉cp -f ${pkgroot}/fdisk ${1}/Core/Root/usr/sbin␊ |
␉cp -f ${pkgroot}/fdisk440 ${1}/Core/Root/usr/sbin␊ |
␉local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )␊ |
␉echo "Building core package"␊ |
␉buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\""␊ |
␊ |
␊ |
# End build core package␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Chameleon\">"␊ |
␉choices[$((choicescount++))]="<choice\n\tid=\"Chameleon\"\n\ttitle=\"Chameleon_title\"\n\tdescription=\"Chameleon_description\"\n>\n</choice>\n"␊ |
␉((xmlindent++))␊ |
␊ |
␉# build core package␊ |
␉␉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/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␊ |
␉␉fixperms "${1}/Core/Root/"␊ |
␉␉cp -f ${pkgroot}/fdisk ${1}/Core/Root/usr/sbin␊ |
␉␉cp -f ${pkgroot}/fdisk440 ${1}/Core/Root/usr/sbin␊ |
␉␉local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )␊ |
␉␉echo "Building core package"␊ |
␉␉buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\""␊ |
␉# End build core package␊ |
␊ |
␉# build standard package ␊ |
␉␉mkdir -p ${1}/Standard/Root␊ |
␉␉mkdir -p ${1}/Standard/Scripts/Tools␊ |
|
␊ |
␉# build standard package with boot0hfs␊ |
␉␉mkdir -p ${1}/Standardhfs/Root␊ |
␉␉mkdir -p ${1}/Standardhfs/Scripts␊ |
␉␉mkdir -p ${1}/Standardhfs/Scripts/Tools␊ |
␉␉cp -f ${pkgroot}/Scripts/Standardhfs/* ${1}/Standardhfs/Scripts␊ |
␉␉ditto --arch i386 `which SetFile` ${1}/Standardhfs/Scripts/Tools/SetFile␊ |
␉␉echo "Building boot0hfs package"␊ |
|
␉␉echo "Building efi hfs package"␊ |
␉␉buildpackage "${1}/EnhancedHFS" "/" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) && exclusive(choices['Standardhfs']) && exclusive(choices['EnhancedFAT']) && exclusive(choices['noboot'])\""␊ |
␉# End build efi hfs package ␊ |
␊ |
␉# build reset choice package ␊ |
␉␉mkdir -p ${1}/noboot/Root␊ |
␉#␉echo "Building reset choice package"␊ |
␉␉echo "Building reset choice package"␊ |
␉␉buildpackage "${1}/noboot" "/" "" "start_visible=\"true\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) && exclusive(choices['Standardhfs']) && exclusive(choices['EnhancedFAT']) && exclusive(choices['EnhancedHFS'])\""␊ |
␉# End build reset choice package ␊ |
␊ |
␉((xmlindent--))␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>" # End Chameleon pakage␊ |
␊ |
# build theme packages␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Themes\">"␊ |
␉choices[$((choicescount++))]="<choice\n\tid=\"Themes\"\n\ttitle=\"Themes_title\"\n\tdescription=\"Themes_description\"\n>\n</choice>\n"␊ |
␉((xmlindent++))␊ |
␉␉packagesidentity="org.chameleon.theme"␊ |
␉␉artwork="${1%/*}"␊ |
␉␉themes=($( find "${artwork%/*}/artwork/themes" -type d -depth 1 -not -name '.svn' ))␊ |
␉␉for (( i = 0 ; i < ${#themes[@]} ; i++ )) ␊ |
␉␉do␊ |
␉␉theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )␊ |
␉␉mkdir -p "${1}/${theme}/Root/"␊ |
␉␉ditto --noextattr --noqtn "${themes[$i]}" "${1}/${themes[$i]##*/}/Root/${theme}"␊ |
␉␉find "${1}/${themes[$i]##*/}" -name '.DS_Store' -or -name '.svn' -exec rm -R {} \+␊ |
␉␉find "${1}/${themes[$i]##*/}" -type f -exec chmod 644 {} \+␊ |
␉␉buildpackage "${1}/${theme}" "/Extra/Themes" "" "start_selected=\"false\""␊ |
␉␉rm -R -f "${1}/${i##*/}"␊ |
␉done␊ |
␉echo "Building themes package"␊ |
␉((xmlindent--))␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"␊ |
# End build theme packages␊ |
# End build Chameleon package␊ |
␊ |
# build options packages␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Options\">"␊ |
␉choices[$((choicescount++))]="<choice\n\tid=\"Options\"\n\ttitle=\"Options_title\"\n\tdescription=\"Options_description\"\n>\n</choice>\n"␊ |
␉((xmlindent++))␊ |
␊ |
␉␉# build base options packages␊ |
␉␉packagesidentity="org.chameleon.options"␊ |
␊ |
␉␉options=($( find "${pkgroot}/Scripts/BaseOptions" -type d -depth 1 -not -name '.svn' ))␊ |
␉␉␉for (( i = 0 ; i < ${#options[@]} ; i++ )) ␊ |
␉␉␉do␊ |
␉␉␉␉mkdir -p "${1}/${options[$i]##*/}/Root"␊ |
␉␉␉␉mkdir -p "${1}/${options[$i]##*/}/Scripts"␊ |
␉␉␉␉ditto --noextattr --noqtn "${options[$i]}/postinstall" "${1}/${options[$i]##*/}/Scripts/postinstall"␊ |
␉␉␉␉echo "Building ${options[$i]##*/} package"␊ |
␉␉␉␉buildpackage "${1}/${options[$i]##*/}" "/" "" "start_selected=\"false\""␊ |
␉␉␉␉rm -R -f "${1}/${i##*/}"␊ |
␉␉␉done␊ |
␉␉for (( i = 0 ; i < ${#options[@]} ; i++ )) ␊ |
␉␉do␊ |
␉␉␉mkdir -p "${1}/${options[$i]##*/}/Root"␊ |
␉␉␉mkdir -p "${1}/${options[$i]##*/}/Scripts/Tools"␊ |
␊ |
␉␉␉ditto --noextattr --noqtn "${options[$i]}/postinstall" "${1}/${options[$i]##*/}/Scripts/postinstall"␊ |
␊ |
␉␉␉echo "Building ${options[$i]##*/} package"␊ |
␉␉␉buildpackage "${1}/${options[$i]##*/}" "/" "" "start_selected=\"false\""␊ |
␉␉done␊ |
␉␉# End build base options packages␊ |
␊ |
␉␉# build resolution packages␊ |
␉␉␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Resolution\">"␊ |
␉␉␉choices[$((choicescount++))]="<choice\n\tid=\"Resolution\"\n\ttitle=\"Resolution_title\"\n\tdescription=\"Resolution_description\"\n>\n</choice>\n"␊ |
␉␉␉((xmlindent++))␊ |
␉␉␉␉packagesidentity="org.chameleon.resolution"␊ |
␉␉␉␉resolutions=($( find "${pkgroot}/Scripts/Resolutions" -type d -depth 1 -not -name '.svn' ))␊ |
␉␉␉␉␉for (( y = 0 ; y < ${#resolutions[@]} ; y++ )) ␊ |
␉␉␉␉␉do␊ |
␉␉␉␉␉␉mkdir -p "${1}/${resolutions[$y]##*/}/Root"␊ |
␉␉␉␉␉␉mkdir -p "${1}/${resolutions[$y]##*/}/Scripts"␊ |
␉␉␉␉␉␉ditto --noextattr --noqtn "${resolutions[$y]}/postinstall" "${1}/${resolutions[$y]##*/}/Scripts/postinstall"␊ |
␉␉␉␉␉␉buildpackage "${1}/${resolutions[$y]##*/}" "/" "" "start_selected=\"false\""␊ |
␉␉␉␉␉␉rm -R -f "${1}/${y##*/}"␊ |
␉␉␉␉␉done␊ |
␉␉␉␉␉echo "Building Resolution package"␊ |
␉␉␉packagesidentity="org.chameleon.resolution"␊ |
␉␉␉resolutions=($( find "${pkgroot}/Scripts/Resolutions" -type d -depth 1 -not -name '.svn' ))␊ |
␉␉␉for (( i = 0 ; i < ${#resolutions[@]} ; i++ )) ␊ |
␉␉␉do␊ |
␉␉␉␉mkdir -p "${1}/${resolutions[$i]##*/}/Root"␊ |
␉␉␉␉mkdir -p "${1}/${resolutions[$i]##*/}/Scripts"␊ |
␊ |
␉␉␉␉ditto --noextattr --noqtn "${resolutions[$i]}/postinstall" "${1}/${resolutions[$i]##*/}/Scripts/postinstall"␊ |
␊ |
␉␉␉␉buildpackage "${1}/${resolutions[$i]##*/}" "/" "" "start_selected=\"false\""␊ |
␉␉␉done␊ |
␉␉echo "Building Resolution package"␊ |
␉␉␉((xmlindent--))␊ |
␉␉␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"␊ |
␉␉# End build resolution packages␊ |
␉␉echo "Building Options package"␊ |
␉echo "Building Options package"␊ |
␊ |
␉␉# build Advanced packages␊ |
#␉␉␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Advanced\">"␊ |
#␉␉␉choices[$((choicescount++))]="<choice\n\tid=\"Advanced\"\n\ttitle=\"Advanced_title\"\n\tdescription=\"Advanced_description\"\n>\n</choice>\n"␊ |
#␉␉␉((xmlindent++))␊ |
#␉␉␉packagesidentity="org.chameleon.advanced"␊ |
#␉␉␉optionsadv=($( find "${pkgroot}/Scripts/AdvOpt" -type d -depth 1 -not -name '.svn' ))␊ |
#␉␉␉for (( i = 0 ; i < ${#optionsadv[@]} ; i++ )) ␊ |
#␉␉␉do␊ |
#␉␉␉␉mkdir -p "${1}/${optionsadv[$i]##*/}/Root"␊ |
#␉␉␉␉mkdir -p "${1}/${optionsadv[$i]##*/}/Scripts"␊ |
␊ |
#␉␉␉␉ditto --noextattr --noqtn "${optionsadv[$i]}/postinstall" "${1}/${optionsadv[$i]##*/}/Scripts/postinstall"␊ |
␊ |
#␉␉␉␉echo "Building ${optionsadv[$i]##*/} package"␊ |
#␉␉␉␉buildpackage "${1}/${optionsadv[$i]##*/}" "/" "" "start_selected=\"false\""␊ |
#␉␉␉done␉␉␊ |
#␉␉␉((xmlindent--))␊ |
#␉␉␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"␊ |
␉␉# End build Advanced packages␊ |
␊ |
␉((xmlindent--))␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"␊ |
␊ |
# End build options packages␊ |
␊ |
␉# build utility package␊ |
|
␉␉␉chown 501:20 "${1}/${filename%.kext}/Root/"␊ |
␉␉␉buildpackage "${1}/${filename%.kext}" "/Extra/Extensions" "" "start_selected=\"false\""␊ |
␉␉␉rm -R -f "${1}/${filename%.kext}"␊ |
␉␉␉echo "Building ${filename%.kext} package"␊ |
␉␉done␊ |
␉␉␉echo "Building Kext package"␊ |
␉␉((xmlindent--))␊ |
␉␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"␊ |
␉# End build kext packages ␊ |
␊ |
# build theme packages␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Themes\">"␊ |
␉choices[$((choicescount++))]="<choice\n\tid=\"Themes\"\n\ttitle=\"Themes_title\"\n\tdescription=\"Themes_description\"\n>\n</choice>\n"␊ |
␉((xmlindent++))␊ |
␉␉packagesidentity="org.chameleon.theme"␊ |
␉␉artwork="${1%/*}"␊ |
␉␉themes=($( find "${artwork%/*}/artwork/themes" -type d -depth 1 -not -name '.svn' ))␊ |
␉␉for (( i = 0 ; i < ${#themes[@]} ; i++ )) ␊ |
␉␉do␊ |
␉␉theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )␊ |
␉␉mkdir -p "${1}/${theme}/Root/"␊ |
␉␉ditto --noextattr --noqtn "${themes[$i]}" "${1}/${themes[$i]##*/}/Root/${theme}"␊ |
␉␉find "${1}/${themes[$i]##*/}" -name '.DS_Store' -or -name '.svn' -exec rm -R {} \+␊ |
␉␉find "${1}/${themes[$i]##*/}" -type f -exec chmod 644 {} \+␊ |
␉␉buildpackage "${1}/${theme}" "/Extra/Themes" "" "start_selected=\"false\""␊ |
␉␉rm -R -f "${1}/${i##*/}"␊ |
␉done␊ |
␉echo "Building themes package"␊ |
␉((xmlindent--))␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"␊ |
# End build theme packages␊ |
␊ |
# build package for Documents␊ |
␉packagesidentity="org.chameleon.Documents"␊ |
␉mkdir -p "${1}/Documents/Root"␊ |
|
␉packagesidentity="org.chameleon.post"␊ |
␉mkdir -p ${1}/Post/Root␊ |
␉mkdir -p ${1}/Post/Scripts␊ |
␉cp -f ${pkgroot}/Scripts/Post/postinstall ${1}/Post/Scripts␊ |
␉cp -f ${pkgroot}/Scripts/Post/* ${1}/Post/Scripts␊ |
␉ditto --arch i386 `which SetFile` ${1}/Post/Scripts/Tools/SetFile␊ |
␉buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\""␊ |
␉echo "Building post package"␊ |
# End post install package ␉␊ |
␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>" # End main package␊ |
␉outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>"␊ |
# End main package␊ |
␊ |
# build meta package␊ |
␊ |