Index: branches/ErmaC/Trunk/i386/boot2/gui.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/gui.c (revision 1762) +++ branches/ErmaC/Trunk/i386/boot2/gui.c (revision 1763) @@ -125,14 +125,14 @@ {.name = "device_hfsraid", .image = NULL}, {.name = "device_hfsraid_o", .image = NULL}, - {.name = "device_hfsplus_raid_lion", .image = NULL}, - {.name = "device_hfsplus_raid_lion_o", .image = NULL}, - {.name = "device_hfsplus_raid_sl", .image = NULL}, - {.name = "device_hfsplus_raid_sl_o", .image = NULL}, - {.name = "device_hfsplus_raid_leo", .image = NULL}, - {.name = "device_hfsplus_raid_leo_o", .image = NULL}, - {.name = "device_hfsplus_raid_tiger", .image = NULL}, - {.name = "device_hfsplus_raid_tiger_o", .image = NULL}, + {.name = "device_hfsraid_lion", .image = NULL}, + {.name = "device_hfsraid_lion_o", .image = NULL}, + {.name = "device_hfsraid_sl", .image = NULL}, + {.name = "device_hfsraid_sl_o", .image = NULL}, + {.name = "device_hfsraid_leo", .image = NULL}, + {.name = "device_hfsraid_leo_o", .image = NULL}, + {.name = "device_hfsraid_tiger", .image = NULL}, + {.name = "device_hfsraid_tiger_o", .image = NULL}, {.name = "device_ext3", .image = NULL}, {.name = "device_ext3_o", .image = NULL}, {.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ @@ -375,14 +375,14 @@ LOADPNG(device_hfsraid, iDeviceGeneric); LOADPNG(device_hfsraid_o, iDeviceHFSRAID); - LOADPNG(device_hfsplus_raid_lion, iDeviceHFSRAID_Lion); - LOADPNG(device_hfsplus_raid_lion_o, iDeviceHFSRAID_Lion_o); - LOADPNG(device_hfsplus_raid_sl, iDeviceHFSRAID_SL); - LOADPNG(device_hfsplus_raid_sl_o, iDeviceHFSRAID_SL_o); - LOADPNG(device_hfsplus_raid_leo, iDeviceHFSRAID_Leo); - LOADPNG(device_hfsplus_raid_leo_o, iDeviceHFSRAID_Leo_o); - LOADPNG(device_hfsplus_raid_tiger, iDeviceHFSRAID_Tiger); - LOADPNG(device_hfsplus_raid_tiger_o, iDeviceHFSRAID_Tiger_o); + LOADPNG(device_hfsraid_lion, iDeviceHFSRAID_Lion); + LOADPNG(device_hfsraid_lion_o, iDeviceHFSRAID_Lion_o); + LOADPNG(device_hfsraid_sl, iDeviceHFSRAID_SL); + LOADPNG(device_hfsraid_sl_o, iDeviceHFSRAID_SL_o); + LOADPNG(device_hfsraid_leo, iDeviceHFSRAID_Leo); + LOADPNG(device_hfsraid_leo_o, iDeviceHFSRAID_Leo_o); + LOADPNG(device_hfsraid_tiger, iDeviceHFSRAID_Tiger); + LOADPNG(device_hfsraid_tiger_o, iDeviceHFSRAID_Tiger_o); LOADPNG(device_ext3, iDeviceGeneric); LOADPNG(device_ext3_o, iDeviceEXT3); LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ Index: branches/ErmaC/Trunk/package/Changes.txt =================================================================== --- branches/ErmaC/Trunk/package/Changes.txt (revision 1762) +++ branches/ErmaC/Trunk/package/Changes.txt (revision 1763) @@ -1,3 +1,9 @@ +- JrCs - Make selection of keymaps a specific menu to avoid polluting chameleon and kernel options menu +- JrCs - Use configuration to know which modules to add to the generated meta-package +- JrCs - Declare some variables read-only +- JrCs - Make the script more robust against errors +- JrCs - Replace misleading variables + - Change Localizable.strings to match the recent changes to the install process. - Improve messages written to the installation log. Index: branches/ErmaC/Trunk/package/Resources/ja.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/he.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/fi.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/fi.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/fi.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/fi.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/bs.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/fr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/nl.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/hr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/pl.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/th.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/th.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/th.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/th.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/no.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/no.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/no.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/no.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/hu.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/hu.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/hu.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/hu.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/vi.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/vi.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/vi.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/vi.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/ro.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/ro.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/ro.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/ro.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/ca.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/ca.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/ca.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/ca.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/pt-BR.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/tr.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/tr.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/tr.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/tr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/ru.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/zh_TW.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/id.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/el.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/zh_CN.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/en.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf =================================================================== --- branches/ErmaC/Trunk/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf (revision 1763) @@ -1,4 +1,4 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 {\fonttbl\f0\fnil\fcharset0 LucidaGrande;} {\colortbl;\red255\green255\blue255;\red255\green0\blue9;\red0\green0\blue255;} \margl1440\margr1440\vieww11660\viewh12980\viewkind0 @@ -12,7 +12,11 @@ \fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ -\fs50 \cf0 \ +\fs50 \ +\pard\ri0 + +\fs22 \cf0 \ +\ \pard\ri0\qc \fs28 \cf2 Do not install to an Apple Macintosh computer\ Index: branches/ErmaC/Trunk/package/Resources/ar.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/pt-PT.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/cs.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/cs.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/cs.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/cs.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/es.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/mk.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/ko.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/sk.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/sk.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/sk.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/sk.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/ms.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/ms.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/ms.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/ms.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/uk.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/uk.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/uk.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/uk.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/sr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/da.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/da.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/da.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/da.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/sv.lproj/Description.html =================================================================== --- branches/ErmaC/Trunk/package/Resources/sv.lproj/Description.html (revision 1762) +++ branches/ErmaC/Trunk/package/Resources/sv.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Trunk/package/Resources/sv.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/Resources/de.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Trunk/package/buildpkg.sh =================================================================== --- branches/ErmaC/Trunk/package/buildpkg.sh (revision 1762) +++ branches/ErmaC/Trunk/package/buildpkg.sh (revision 1763) @@ -1,37 +1,69 @@ #!/bin/bash -# $1 Path to store built package +# $0 SRCROOT directory +# $1 SYMROOT directory +# $2 directory where pkgs will be created -packagesidentity="org.chameleon" -packagename="Chameleon" -pkgroot="${0%/*}" -chamTemp="usr/local/chamTemp" +# Directory paths +declare -r PKGROOT="${0%/*}" +declare -r SRCROOT="$1" +declare -r SYMROOT="$2" +declare -r PKG_BUILD_DIR="$3" -COL_BLACK="\x1b[30;01m" -COL_RED="\x1b[31;01m" -COL_GREEN="\x1b[32;01m" -COL_YELLOW="\x1b[33;01m" -COL_MAGENTA="\x1b[35;01m" -COL_CYAN="\x1b[36;01m" -COL_WHITE="\x1b[37;01m" -COL_BLUE="\x1b[34;01m" -COL_RESET="\x1b[39;49;00m" +if [[ $# -lt 3 ]];then + echo "Too few arguments. Aborting..." >&2 && exit 1 +fi -version=$( cat version ) +if [[ ! -d "$SYMROOT" ]];then + echo "Directory ${SYMROOT} doesn't exit. Aborting..." >&2 && exit 1 +fi + +# Prevent the script from doing bad things +set -u # Abort with unset variables +#set -e # Abort with any error can be suppressed locally using EITHER cmd||true OR set -e;cmd;set +e + +# ====== CONFIGURATION ====== +CONFIG_MODULES="" +CONFIG_KLIBC_MODULE="" +CONFIG_UCLIBCXX_MODULE="" +CONFIG_RESOLUTION_MODULE="" +CONFIG_KEYLAYOUT_MODULE="" +source "${SRCROOT}/auto.conf" + +# ====== COLORS ====== + +declare -r COL_BLACK="\x1b[30;01m" +declare -r COL_RED="\x1b[31;01m" +declare -r COL_GREEN="\x1b[32;01m" +declare -r COL_YELLOW="\x1b[33;01m" +declare -r COL_MAGENTA="\x1b[35;01m" +declare -r COL_CYAN="\x1b[36;01m" +declare -r COL_WHITE="\x1b[37;01m" +declare -r COL_BLUE="\x1b[34;01m" +declare -r COL_RESET="\x1b[39;49;00m" + +# ====== REVISION/VERSION ====== + +declare -r version=$( cat version ) + +# stage stage=${version##*-} -revision=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' ) -builddate=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' ) -timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" ) +stage=${stage/RC/Release Candidate } +stage=${stage/FINAL/2.1 Final} +declare -r stage -# ================= +declare -r revision=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' ) +declare -r builddate=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' ) +declare -r timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" ) -develop=$(awk "NR==6{print;exit}" ${pkgroot}/../CREDITS) -credits=$(awk "NR==10{print;exit}" ${pkgroot}/../CREDITS) -pkgdev=$(awk "NR==14{print;exit}" ${pkgroot}/../CREDITS) +# ====== CREDITS ====== +declare -r develop=$(awk "NR==6{print;exit}" ${PKGROOT}/../CREDITS) +declare -r credits=$(awk "NR==10{print;exit}" ${PKGROOT}/../CREDITS) +declare -r pkgdev=$(awk "NR==14{print;exit}" ${PKGROOT}/../CREDITS) + # ================= -distributioncount=0 xmlindent=0 indent[0]="\t" @@ -39,11 +71,21 @@ indent[2]="\t\t\t" indent[3]="\t\t\t\t" +# ====== GLOBAL VARIABLES ====== declare -a pkgrefs +declare -a outline +declare -a choices +# Package name +declare -r packagename="Chameleon" + # Package identifiers -modules_packages_identity="org.chameleon.modules" +declare -r chameleon_package_identity="org.chameleon" +declare -r modules_packages_identity="${chameleon_package_identity}.modules" +declare -r chamTemp="usr/local/chamTemp" +# ====== FUNCTIONS ====== + getPackageRefId () { echo ${1//_/.}.${2//_/.} | tr [:upper:] [:lower:] } @@ -64,22 +106,24 @@ fi choiceNode="${choiceNode}\n\t\n" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="$choiceNode" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="$choiceNode" } exclusive_one_choice () { # $1 Current choice (ie: test1) # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices local myChoice="${1}" - local result; + local result=""; local separator=' || '; for choice in ${@:2};do if [[ "$choice" != "$myChoice" ]];then result="${result}choices['$choice'].selected${separator}"; fi done - echo "!(${result%$separator})" + if [[ -n "$result" ]];then + echo "!(${result%$separator})" + fi } exclusive_zero_or_one_choice () { @@ -95,139 +139,140 @@ # clean up the destination path - rm -R -f "${1}" + rm -R -f "${PKG_BUILD_DIR}" echo "" echo -e $COL_CYAN" ----------------------------------"$COL_RESET echo -e $COL_CYAN" Building $packagename Install Package"$COL_RESET echo -e $COL_CYAN" ----------------------------------"$COL_RESET echo "" - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # build pre install package echo "================= Preinstall =================" ((xmlindent++)) - packagesidentity="org.chameleon" + packagesidentity="${chameleon_package_identity}" choiceId="Pre" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts - ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/${choiceId}/Scripts/Resources/revision - ditto --noextattr --noqtn ${1%/*/*}/version ${1}/${choiceId}/Scripts/Resources/version - cp -f ${pkgroot}/Scripts/Main/preinstall ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/${choiceId}/Scripts + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --noextattr --noqtn ${SRCROOT}/revision ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/revision + ditto --noextattr --noqtn ${SRCROOT}/version ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/version + cp -f ${PKGROOT}/Scripts/Main/preinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Sub/InstallLog.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId" # End build pre install package # build core package echo "================= Core =================" - packagesidentity="org.chameleon" + packagesidentity="${chameleon_package_identity}" choiceId="Core" - mkdir -p ${1}/${choiceId}/Root/usr/local/bin - mkdir -p ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot0 ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot0md ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1f32 ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1h ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1he ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1hp ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/cdboot ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/chain0 ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/fdisk440 ${1}/${choiceId}/Root/usr/local/bin - ditto --noextattr --noqtn ${1%/*}/i386/bdmesg ${1}/${choiceId}/Root/usr/local/bin + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot0md ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1f32 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1h ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1he ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1hp ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/cdboot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/chain0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/fdisk440 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + ditto --noextattr --noqtn ${SYMROOT}/i386/bdmesg ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId" # End build core package # build install type echo "================= Chameleon =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) - packagesidentity="org.chameleon.type" + packagesidentity="${chameleon_package_identity}.type" allChoices="New Upgrade" # build new install package choiceId="New" - mkdir -p ${1}/${choiceId}/Root - echo "" > "${1}/${choiceId}/Root/install_type_new" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + echo "" > "${PKG_BUILD_DIR}/${choiceId}/Root/install_type_new" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"!choices['Upgrade'].selected\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build new install package # build upgrade package choiceId="Upgrade" - mkdir -p ${1}/${choiceId}/Root - echo "" > "${1}/${choiceId}/Root/install_type_upgrade" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + echo "" > "${PKG_BUILD_DIR}/${choiceId}/Root/install_type_upgrade" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"chameleon_boot_plist_exists()\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build upgrade package ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # End build install type # build Chameleon package echo "================= Chameleon =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) allChoices="Standard EFI noboot" # build standard package choiceId="Standard" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts/Resources - cp -f ${pkgroot}/Scripts/Main/${choiceId}postinstall ${1}/${choiceId}/Scripts/postinstall - cp -f ${pkgroot}/Scripts/Sub/* ${1}/${choiceId}/Scripts - ditto --arch i386 `which SetFile` ${1}/${choiceId}/Scripts/Resources/SetFile + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources + cp -f ${PKGROOT}/Scripts/Main/${choiceId}postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall + cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"true\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build standard package # build efi package choiceId="EFI" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts/Resources - cp -f ${pkgroot}/Scripts/Main/ESPpostinstall ${1}/${choiceId}/Scripts/postinstall - cp -f ${pkgroot}/Scripts/Sub/* ${1}/${choiceId}/Scripts - ditto --arch i386 `which SetFile` ${1}/${choiceId}/Scripts/Resources/SetFile + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources + cp -f ${PKGROOT}/Scripts/Main/ESPpostinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall + cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build efi package # build no bootloader choice package choiceId="noboot" - mkdir -p ${1}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"false\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build no bootloader choice package ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # End build Chameleon package +if [[ "${CONFIG_MODULES}" == 'y' ]];then # build Modules package echo "================= Modules =================" ############################### @@ -238,54 +283,58 @@ # uClibcxx.dylib # # Keylayout.dylib # ############################### - if [ "$(ls -A "${1%/*}/i386/modules")" ]; then + if [ "$(ls -A "${SYMROOT}/i386/modules")" ]; then { - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) # - - if [ -e ${1%/*}/i386/modules/klibc.dylib ]; then + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then { # Start build klibc package module choiceId="klibc" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/${choiceId}.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/${choiceId}.dylib" ${PKG_BUILD_DIR}/${choiceId}/Root echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build klibc package module } fi # - - if [ -e ${1%/*}/i386/modules/uClibcxx.dylib ]; then + if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \ + -f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then { + klibcPackageRefId="" + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then + klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc") + fi # Start build uClibc package module choiceId="uClibc" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/uClibcxx.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/uClibcxx.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 # Add the klibc package because the uClibc module is dependent of klibc module - addChoice "${choiceId}" "start_selected=\"false\"" \ - "$packageRefId" $(getPackageRefId "${modules_packages_identity}" "klibc") + addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" "$klibcPackageRefId" # End build uClibc package module } fi # - - if [ -e ${1%/*}/i386/modules/Resolution.dylib ]; then + if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Resolution.dylib" ]]; then { # Start build Resolution package module choiceId="AutoReso" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/Resolution.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/Resolution.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build Resolution package module } @@ -293,27 +342,27 @@ # - # Warning Keylayout module need additional files - if [ -e ${1%/*}/i386/modules/Keylayout.dylib ]; then + if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then { # Start build Keylayout package module choiceId="Keylayout" - mkdir -p ${1}/${choiceId}/Root/Extra/{modules,Keymaps} - mkdir -p ${1}/${choiceId}/Root/usr/local/bin - layout_src_dir="${1%/sym/*}/i386/modules/Keylayout/layouts/layouts-src" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps} + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src" if [ -d "$layout_src_dir" ];then # Create a tar.gz from layout sources (cd "$layout_src_dir"; \ - tar czf "${1}/Keylayout/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt) + tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt) fi # Adding module - ditto --noextattr --noqtn ${1%/*}/i386/modules/${choiceId}.dylib ${1}/${choiceId}/Root/Extra/modules + ditto --noextattr --noqtn ${SYMROOT}/i386/modules/${choiceId}.dylib ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules # Adding Keymaps - ditto --noextattr --noqtn ${1%/sym/*}/Keymaps ${1}/${choiceId}/Root/Extra/Keymaps + ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps # Adding tools - ditto --noextattr --noqtn ${1%/*}/i386/cham-mklayout ${1}/${choiceId}/Root/usr/local/bin + ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 # Don't add a choice for Keylayout module # addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" @@ -322,7 +371,7 @@ fi ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" } else { @@ -330,18 +379,19 @@ } fi # End build Modules packages +fi # build Options packages - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) # ------------------------------------------------------ # parse OptionalSettings folder to find files of boot options. # ------------------------------------------------------ - OptionalSettingsFolder="${pkgroot}/OptionalSettings" + OptionalSettingsFolder="${PKGROOT}/OptionalSettings" OptionalSettingsFiles=($( find "${OptionalSettingsFolder}" -depth 1 ! -name '.svn' ! -name '.DS_Store' )) for (( i = 0 ; i < ${#OptionalSettingsFiles[@]} ; i++ )) @@ -351,10 +401,10 @@ builtOptionsList=$( echo ${OptionalSettingsFiles[$i]%.txt} ) builtOptionsList=$( echo ${builtOptionsList##*/} ) echo "================= $builtOptionsList =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) - packagesidentity="org.chameleon.options.$builtOptionsList" + packagesidentity="${chameleon_package_identity}.options.$builtOptionsList" # ------------------------------------------------------ # Read boot option file into an array. @@ -386,14 +436,14 @@ keyValue=${textLine##*:} # create folders required for each boot option - mkdir -p "${1}/$optionName/Root/" + mkdir -p "${PKG_BUILD_DIR}/$optionName/Root/" # create dummy file with name of key/value - echo "" > "${1}/$optionName/Root/${keyValue}" + echo "" > "${PKG_BUILD_DIR}/$optionName/Root/${keyValue}" echo -e "\t[BUILD] ${optionName} " packageRefId=$(getPackageRefId "${packagesidentity}" "${optionName}") - buildpackage "$packageRefId" "${optionName}" "${1}/${optionName}" "/$chamTemp/options" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${optionName}" "${PKG_BUILD_DIR}/${optionName}" "/$chamTemp/options" # >/dev/null 2>&1 exclusiveSelect="" if [[ ${exclusiveFlag} -eq 1 ]];then exclusiveSelect="selected=\"$(exclusive_zero_or_one_choice "$optionName" "$allChoices")\"" @@ -402,22 +452,30 @@ done ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" done - # build KeyLayout options packages + ((xmlindent--)) + outline[${#outline[*]}]="${indent[$xmlindent]}" +# End build options packages + +if [[ -n "${CONFIG_KEYLAYOUT_MODULE}" ]];then +# build KeyLayout options packages echo "================= Keymaps Options =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) - packagesidentity="org.chameleon.options.keylayout" - keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout") + packagesidentity="${chameleon_package_identity}.options.keylayout" + keylayoutPackageRefId="" + if [[ "${CONFIG_MODULES}" == 'y' && "${CONFIG_KEYLAYOUT_MODULE}" = 'm' ]];then + keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout") + fi # ------------------------------------------------------ # Available Keylayout boot options are discovered by # reading contents of /Keymaps folder after compilation # ------------------------------------------------------ - availableOptions=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' )) + availableOptions=($( find "${SRCROOT}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' )) allChoices="${availableOptions[@]}" # Adjust array contents to match expected format # for boot options which is: name:key=value @@ -425,14 +483,14 @@ # availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]} # Start build of a keymap package module choiceId="${availableOptions[i]}" - mkdir -p ${1}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root # create dummy file with name of key/value - echo "" > "${1}/${choiceId}/Root/KeyLayout=${availableOptions[i]}" + echo "" > "${PKG_BUILD_DIR}/${choiceId}/Root/KeyLayout=${availableOptions[i]}" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/options" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/options" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_zero_or_one_choice "$choiceId" "$allChoices") # Add the Keylayout package because the Keylayout module is needed addChoice "${choiceId}" "start_selected=\"false\" selected=\"${exclusiveChoice}\"" \ @@ -441,65 +499,55 @@ done ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" - # End build KeyLayout options packages +# End build KeyLayout options packages +fi - ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" -# End build options packages - # build theme packages echo "================= Themes =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) # Using themes section from Azi's/package branch. - packagesidentity="org.chameleon.themes" - artwork="${1%/sym/package}/artwork/themes" + packagesidentity="${chameleon_package_identity}.themes" + artwork="${SRCROOT}/artwork/themes" themes=($( find "${artwork}" -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/" - rsync -r --exclude=.svn "${themes[$i]}/" "${1}/${theme}/Root/${theme}" + mkdir -p "${PKG_BUILD_DIR}/${theme}/Root/" + rsync -r --exclude=.svn "${themes[$i]}/" "${PKG_BUILD_DIR}/${theme}/Root/${theme}" echo -e "\t[BUILD] ${theme}" packageRefId=$(getPackageRefId "${packagesidentity}" "${theme}") - buildpackage "$packageRefId" "${theme}" "${1}/${theme}" "/$chamTemp/Extra/Themes" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${theme}" "${PKG_BUILD_DIR}/${theme}" "/$chamTemp/Extra/Themes" # >/dev/null 2>&1 addChoice "${theme}" "start_selected=\"false\"" "$packageRefId" done ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # End build theme packages# End build Extras package # build post install package echo "================= Post =================" - packagesidentity="org.chameleon" + packagesidentity="${chameleon_package_identity}" choiceId="Post" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Main/postinstall ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Sub/UnMountEFIvolumes.sh ${1}/${choiceId}/Scripts - ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/${choiceId}/Scripts/Resources/revision - ditto --noextattr --noqtn ${1%/*/*}/version ${1}/${choiceId}/Scripts/Resources/version + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Main/postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Sub/InstallLog.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Sub/UnMountEFIvolumes.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --noextattr --noqtn ${SRCROOT}/revision ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/revision + ditto --noextattr --noqtn ${SRCROOT}/version ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/version echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId" # End build post install package ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" -# build meta package - - makedistribution "${1}" "${2}" "${3}" "${4}" #"${5}" - -# clean up - # rm -R -f "${1}" - } buildpackage () @@ -514,7 +562,9 @@ local packageName="$2" local packagePath="$3" local targetPath="$4" - local packageSize="$5" + set +u # packageSize is optional + local packageSize="$5" + set -u find "${packagePath}" -name '.DS_Store' -delete local filecount=$( find "${packagePath}/Root" | wc -l ) @@ -546,7 +596,7 @@ done header+="\t\n" # Create the Script archive file (cpio format) - (cd "${packagePath}/Scripts" && find . -print | cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \ + (cd "${packagePath}/Scripts" && find . -print | cpio -o -z -R 0:0 --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \ grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages fi @@ -554,7 +604,7 @@ echo -e "${header}" > "${packagePath}/Temp/PackageInfo" # Create the Payload file (cpio format) - (cd "${packagePath}/Root" && find . -print | cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Payload") 2>&1 | \ + (cd "${packagePath}/Root" && find . -print | cpio -o -z -R 0:0 --format cpio > "${packagePath}/Temp/Payload") 2>&1 | \ grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages # Create the package @@ -569,73 +619,70 @@ makedistribution () { - distributionDestDir="${1%/*}" - distributionFilename="${packagename// /}-${version}-r${revision}.pkg" - distributionFilePath="${distributionDestDir}/${distributionFilename}" + declare -r distributionDestDir="${SYMROOT}" + declare -r distributionFilename="${packagename// /}-${version}-r${revision}.pkg" + declare -r distributionFilePath="${distributionDestDir}/${distributionFilename}" rm -f "${distributionDestDir}/${packagename// /}"*.pkg - mkdir -p "${1}/${packagename}" + mkdir -p "${PKG_BUILD_DIR}/${packagename}" - find "${1}" -type f -name '*.pkg' -depth 1 | while read component + find "${PKG_BUILD_DIR}" -type f -name '*.pkg' -depth 1 | while read component do pkg="${component##*/}" # ie: EFI.pkg - pkgdir="${1}/${packagename}/${pkg}" + pkgdir="${PKG_BUILD_DIR}/${packagename}/${pkg}" # expand individual packages - pkgutil --expand "${1%}/${pkg}" "$pkgdir" - rm -f "${1%}/${pkg}" + pkgutil --expand "${PKG_BUILD_DIR}/${pkg}" "$pkgdir" + rm -f "${PKG_BUILD_DIR}/${pkg}" done # Create the Distribution file - ditto --noextattr --noqtn "${pkgroot}/Distribution" "${1}/${packagename}/Distribution" + ditto --noextattr --noqtn "${PKGROOT}/Distribution" "${PKG_BUILD_DIR}/${packagename}/Distribution" for (( i=0; i < ${#outline[*]} ; i++)); do - echo -e "${outline[$i]}" >> "${1}/${packagename}/Distribution" + echo -e "${outline[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" done for (( i=0; i < ${#choices[*]} ; i++)); do - echo -e "${choices[$i]}" >> "${1}/${packagename}/Distribution" + echo -e "${choices[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" done for (( i=0; i < ${#pkgrefs[*]} ; i++)); do - echo -e "${pkgrefs[$i]}" >> "${1}/${packagename}/Distribution" + echo -e "${pkgrefs[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" done - echo -e "\n" >> "${1}/${packagename}/Distribution" + echo -e "\n" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" # Create the Resources directory - ditto --noextattr --noqtn "${pkgroot}/Resources" "${1}/${packagename}/Resources" + ditto --noextattr --noqtn "${PKGROOT}/Resources" "${PKG_BUILD_DIR}/${packagename}/Resources" # CleanUp the directory - find "${1}/${packagename}" -type d -name '.svn' -exec rm -rf {} \; 2>/dev/null - find "${1}/${packagename}" -name '.DS_Store' -delete + find "${PKG_BUILD_DIR}/${packagename}" \( -type d -name '.svn' \) -o -name '.DS_Store' -exec rm -rf {} \; # Add Chameleon Version and Revision - perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" $( find "${1}/${packagename}/Resources" -type f ) - perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" $( find "${1}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) # Add Chameleon Stage - stage=${stage/RC/Release Candidate } - stage=${stage/FINAL/2.0 Final} - perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" $( find "${1}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) # Adding Developer and credits - perl -i -p -e "s/%DEVELOP%/${develop}/g" $( find "${1}/${packagename}/Resources" -type f ) - perl -i -p -e "s/%CREDITS%/${credits}/g" $( find "${1}/${packagename}/Resources" -type f ) - perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" $( find "${1}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%DEVELOP%/${develop}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CREDITS%/${credits}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) # Create the final package - pkgutil --flatten "${1}/${packagename}" "${distributionFilePath}" + pkgutil --flatten "${PKG_BUILD_DIR}/${packagename}" "${distributionFilePath}" # Here is the place for assign a Icon to the pkg # command use to generate the file: # ditto -c -k --sequesterRsrc --keepParent Icon.icns Icon.zip # ---- - ditto -xk "${pkgroot}/Icons/pkg.zip" "${1}/Icons/" - DeRez -only icns "${1}/Icons/Icons/pkg.icns" > "${1}/Icons/tempicns.rsrc" - Rez -append "${1}/Icons/tempicns.rsrc" -o "${distributionFilePath}" + ditto -xk "${PKGROOT}/Icons/pkg.zip" "${PKG_BUILD_DIR}/Icons/" + DeRez -only icns "${PKG_BUILD_DIR}/Icons/Icons/pkg.icns" > "${PKG_BUILD_DIR}/Icons/tempicns.rsrc" + Rez -append "${PKG_BUILD_DIR}/Icons/tempicns.rsrc" -o "${distributionFilePath}" SetFile -a C "${distributionFilePath}" - rm -rf "${1}/Icons" + rm -rf "${PKG_BUILD_DIR}/Icons" # End @@ -658,4 +705,8 @@ } -main "${1}" "${2}" "${3}" "${4}" #"${5}" +# build packages +main + +# build meta package +makedistribution Index: branches/ErmaC/Trunk/CHANGES =================================================================== --- branches/ErmaC/Trunk/CHANGES (revision 1762) +++ branches/ErmaC/Trunk/CHANGES (revision 1763) @@ -1,3 +1,4 @@ +- cparm : Fixed naming convention for raid hfs devices in gui - Added support for using UUIDs with ext2 filesystems (credits to bitz): http://forge.voodooprojects.org/p/chameleon/issues/208/ - Added Guerrero's patch on gui.c: http://forge.voodooprojects.org/p/chameleon/issues/178/ - cparm : Ported the OS detection to the trunk, updated the default theme to v 1.1 (credit to blackosx) Index: branches/ErmaC/Trunk/Makefile =================================================================== --- branches/ErmaC/Trunk/Makefile (revision 1762) +++ branches/ErmaC/Trunk/Makefile (revision 1763) @@ -6,8 +6,8 @@ DOCROOT = $(SRCROOT)/doc IMGSKELROOT = $(SRCROOT)/imgskel CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot +PKG_BUILD_DIR = $(SYMROOT)/package - include Make.rules @@ -100,10 +100,10 @@ @mv ${DISTFILE}.tar.gz ${DISTFILE}.tgz clean-local: - @if [ -d "$(SYMROOT)/package" ];then echo "\t[RMDIR] $(SYMROOT)/package"; fi + @if [ -d "$(PKG_BUILD_DIR)" ];then echo "\t[RMDIR] $(PKG_BUILD_DIR)"; fi @if [ -f "$(HEADER_VERSION)" ];then echo "\t[RM] $(HEADER_VERSION)"; fi @if [ -f "$(SRCROOT)/revision" ];then echo "\t[RM] $(SRCROOT)/revision"; fi - @rm -rf "$(SYMROOT)/package" $(HEADER_VERSION) $(SRCROOT)/revision + @rm -rf "$(PKG_BUILD_DIR)" $(HEADER_VERSION) $(SRCROOT)/revision AUTOCONF_FILES = $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h \ $(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(SRCROOT)/.config.old @@ -121,7 +121,8 @@ $(AUTOCONF_FILES) pkg installer: all - ${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package + @echo "================= Building Package =================" + @${SRCROOT}/package/buildpkg.sh "$(SRCROOT)" "$(SYMROOT)" "$(PKG_BUILD_DIR)" dmg: all ${SRCROOT}/package/slimpkg.sh ${SYMROOT}/package; Index: branches/ErmaC/Modules/i386/boot2/gui.c =================================================================== --- branches/ErmaC/Modules/i386/boot2/gui.c (revision 1762) +++ branches/ErmaC/Modules/i386/boot2/gui.c (revision 1763) @@ -125,14 +125,14 @@ {.name = "device_hfsraid", .image = NULL}, {.name = "device_hfsraid_o", .image = NULL}, - {.name = "device_hfsplus_raid_lion", .image = NULL}, - {.name = "device_hfsplus_raid_lion_o", .image = NULL}, - {.name = "device_hfsplus_raid_sl", .image = NULL}, - {.name = "device_hfsplus_raid_sl_o", .image = NULL}, - {.name = "device_hfsplus_raid_leo", .image = NULL}, - {.name = "device_hfsplus_raid_leo_o", .image = NULL}, - {.name = "device_hfsplus_raid_tiger", .image = NULL}, - {.name = "device_hfsplus_raid_tiger_o", .image = NULL}, + {.name = "device_hfsraid_lion", .image = NULL}, + {.name = "device_hfsraid_lion_o", .image = NULL}, + {.name = "device_hfsraid_sl", .image = NULL}, + {.name = "device_hfsraid_sl_o", .image = NULL}, + {.name = "device_hfsraid_leo", .image = NULL}, + {.name = "device_hfsraid_leo_o", .image = NULL}, + {.name = "device_hfsraid_tiger", .image = NULL}, + {.name = "device_hfsraid_tiger_o", .image = NULL}, {.name = "device_ext3", .image = NULL}, {.name = "device_ext3_o", .image = NULL}, {.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ @@ -375,14 +375,14 @@ LOADPNG(device_hfsraid, iDeviceGeneric); LOADPNG(device_hfsraid_o, iDeviceHFSRAID); - LOADPNG(device_hfsplus_raid_lion, iDeviceHFSRAID_Lion); - LOADPNG(device_hfsplus_raid_lion_o, iDeviceHFSRAID_Lion_o); - LOADPNG(device_hfsplus_raid_sl, iDeviceHFSRAID_SL); - LOADPNG(device_hfsplus_raid_sl_o, iDeviceHFSRAID_SL_o); - LOADPNG(device_hfsplus_raid_leo, iDeviceHFSRAID_Leo); - LOADPNG(device_hfsplus_raid_leo_o, iDeviceHFSRAID_Leo_o); - LOADPNG(device_hfsplus_raid_tiger, iDeviceHFSRAID_Tiger); - LOADPNG(device_hfsplus_raid_tiger_o, iDeviceHFSRAID_Tiger_o); + LOADPNG(device_hfsraid_lion, iDeviceHFSRAID_Lion); + LOADPNG(device_hfsraid_lion_o, iDeviceHFSRAID_Lion_o); + LOADPNG(device_hfsraid_sl, iDeviceHFSRAID_SL); + LOADPNG(device_hfsraid_sl_o, iDeviceHFSRAID_SL_o); + LOADPNG(device_hfsraid_leo, iDeviceHFSRAID_Leo); + LOADPNG(device_hfsraid_leo_o, iDeviceHFSRAID_Leo_o); + LOADPNG(device_hfsraid_tiger, iDeviceHFSRAID_Tiger); + LOADPNG(device_hfsraid_tiger_o, iDeviceHFSRAID_Tiger_o); LOADPNG(device_ext3, iDeviceGeneric); LOADPNG(device_ext3_o, iDeviceEXT3); LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ Index: branches/ErmaC/Modules/package/Changes.txt =================================================================== --- branches/ErmaC/Modules/package/Changes.txt (revision 1762) +++ branches/ErmaC/Modules/package/Changes.txt (revision 1763) @@ -1,3 +1,9 @@ +- JrCs - Make selection of keymaps a specific menu to avoid polluting chameleon and kernel options menu +- JrCs - Use configuration to know which modules to add to the generated meta-package +- JrCs - Declare some variables read-only +- JrCs - Make the script more robust against errors +- JrCs - Replace misleading variables + - Change Localizable.strings to match the recent changes to the install process. - Improve messages written to the installation log. Index: branches/ErmaC/Modules/package/Resources/ja.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/he.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/fi.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/fi.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/fi.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/fi.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/bs.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/fr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/nl.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/hr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/pl.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/th.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/th.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/th.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/th.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/no.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/no.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/no.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/no.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/hu.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/hu.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/hu.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/hu.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/vi.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/vi.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/vi.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/vi.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/ro.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/ro.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/ro.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/ro.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/ca.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/ca.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/ca.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/ca.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/pt-BR.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/tr.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/tr.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/tr.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/tr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/ru.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/zh_TW.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/id.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/el.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/zh_CN.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/en.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf =================================================================== --- branches/ErmaC/Modules/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf (revision 1762) +++ branches/ErmaC/Modules/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf (revision 1763) @@ -1,4 +1,4 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 {\fonttbl\f0\fnil\fcharset0 LucidaGrande;} {\colortbl;\red255\green255\blue255;\red255\green0\blue9;\red0\green0\blue255;} \margl1440\margr1440\vieww11660\viewh12980\viewkind0 @@ -12,7 +12,11 @@ \fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ -\fs50 \cf0 \ +\fs50 \ +\pard\ri0 + +\fs22 \cf0 \ +\ \pard\ri0\qc \fs28 \cf2 Do not install to an Apple Macintosh computer\ Index: branches/ErmaC/Modules/package/Resources/ar.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/pt-PT.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/cs.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/cs.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/cs.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/cs.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/es.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/mk.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/ko.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/sk.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/sk.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/sk.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/sk.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/ms.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/ms.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/ms.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/ms.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/uk.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/uk.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/uk.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/uk.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/sr.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/da.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/da.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/da.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/da.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/sv.lproj/Description.html =================================================================== --- branches/ErmaC/Modules/package/Resources/sv.lproj/Description.html (revision 1762) +++ branches/ErmaC/Modules/package/Resources/sv.lproj/Description.html (revision 1763) @@ -34,7 +34,6 @@

- Automatic P-State & C-State generation for native power management.

- Message logging.


-


The code is released under version 2 of the Gnu Public License.

http://forge.voodooprojects.org/p/chameleon


Index: branches/ErmaC/Modules/package/Resources/sv.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/Resources/de.lproj/Localizable.strings =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: branches/ErmaC/Modules/package/buildpkg.sh =================================================================== --- branches/ErmaC/Modules/package/buildpkg.sh (revision 1762) +++ branches/ErmaC/Modules/package/buildpkg.sh (revision 1763) @@ -1,37 +1,73 @@ #!/bin/bash -# $1 Path to store built package +# $0 SRCROOT directory +# $1 SYMROOT directory +# $2 directory where pkgs will be created -packagesidentity="org.chameleon" -packagename="Chameleon" -pkgroot="${0%/*}" -chamTemp="usr/local/chamTemp" +# Directory paths +declare -r PKGROOT="${0%/*}" +declare -r SRCROOT="$1" +declare -r SYMROOT="$2" +declare -r PKG_BUILD_DIR="$3" -COL_BLACK="\x1b[30;01m" -COL_RED="\x1b[31;01m" -COL_GREEN="\x1b[32;01m" -COL_YELLOW="\x1b[33;01m" -COL_MAGENTA="\x1b[35;01m" -COL_CYAN="\x1b[36;01m" -COL_WHITE="\x1b[37;01m" -COL_BLUE="\x1b[34;01m" -COL_RESET="\x1b[39;49;00m" +if [[ $# -lt 3 ]];then + echo "Too few arguments. Aborting..." >&2 && exit 1 +fi -version=$( cat version ) +if [[ ! -d "$SYMROOT" ]];then + echo "Directory ${SYMROOT} doesn't exit. Aborting..." >&2 && exit 1 +fi + +# Prevent the script from doing bad things +set -u # Abort with unset variables +#set -e # Abort with any error can be suppressed locally using EITHER cmd||true OR set -e;cmd;set +e + +# ====== CONFIGURATION ====== +CONFIG_MODULES="" +CONFIG_KLIBC_MODULE="" +CONFIG_UCLIBCXX_MODULE="" +CONFIG_RESOLUTION_MODULE="" +CONFIG_AMDGRAPHICSENABLER_MODULE="" +CONFIG_ATIGRAPHICSENABLER_MODULE="" +CONFIG_INTELGRAPHICSENABLER_MODULE="" +CONFIG_NVIDIAGRAPHICSENABLER_MODULE="" +CONFIG_KEYLAYOUT_MODULE="" +source "${SRCROOT}/auto.conf" + +# ====== COLORS ====== + +declare -r COL_BLACK="\x1b[30;01m" +declare -r COL_RED="\x1b[31;01m" +declare -r COL_GREEN="\x1b[32;01m" +declare -r COL_YELLOW="\x1b[33;01m" +declare -r COL_MAGENTA="\x1b[35;01m" +declare -r COL_CYAN="\x1b[36;01m" +declare -r COL_WHITE="\x1b[37;01m" +declare -r COL_BLUE="\x1b[34;01m" +declare -r COL_RESET="\x1b[39;49;00m" + +# ====== REVISION/VERSION ====== + +declare -r version=$( cat version ) + +# stage stage=${version##*-} -revision=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' ) -builddate=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' ) -timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" ) +stage=${stage/RC/Release Candidate } +stage=${stage/FINAL/2.1 Final} +declare -r stage -# ================= +declare -r revision=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' ) +declare -r builddate=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' ) +declare -r timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" ) -develop=$(awk "NR==6{print;exit}" ${pkgroot}/../CREDITS) -credits=$(awk "NR==10{print;exit}" ${pkgroot}/../CREDITS) -pkgdev=$(awk "NR==14{print;exit}" ${pkgroot}/../CREDITS) +# ====== CREDITS ====== +declare -r develop=$(awk "NR==6{print;exit}" ${PKGROOT}/../CREDITS) +declare -r credits=$(awk "NR==10{print;exit}" ${PKGROOT}/../CREDITS) +declare -r pkgdev=$(awk "NR==14{print;exit}" ${PKGROOT}/../CREDITS) + # ================= -distributioncount=0 xmlindent=0 indent[0]="\t" @@ -39,11 +75,21 @@ indent[2]="\t\t\t" indent[3]="\t\t\t\t" +# ====== GLOBAL VARIABLES ====== declare -a pkgrefs +declare -a outline +declare -a choices +# Package name +declare -r packagename="Chameleon" + # Package identifiers -modules_packages_identity="org.chameleon.modules" +declare -r chameleon_package_identity="org.chameleon" +declare -r modules_packages_identity="${chameleon_package_identity}.modules" +declare -r chamTemp="usr/local/chamTemp" +# ====== FUNCTIONS ====== + getPackageRefId () { echo ${1//_/.}.${2//_/.} | tr [:upper:] [:lower:] } @@ -64,22 +110,24 @@ fi choiceNode="${choiceNode}\n\t\n" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="$choiceNode" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="$choiceNode" } exclusive_one_choice () { # $1 Current choice (ie: test1) # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices local myChoice="${1}" - local result; + local result=""; local separator=' || '; for choice in ${@:2};do if [[ "$choice" != "$myChoice" ]];then result="${result}choices['$choice'].selected${separator}"; fi done - echo "!(${result%$separator})" + if [[ -n "$result" ]];then + echo "!(${result%$separator})" + fi } exclusive_zero_or_one_choice () { @@ -95,139 +143,140 @@ # clean up the destination path - rm -R -f "${1}" + rm -R -f "${PKG_BUILD_DIR}" echo "" echo -e $COL_CYAN" ----------------------------------"$COL_RESET echo -e $COL_CYAN" Building $packagename Install Package"$COL_RESET echo -e $COL_CYAN" ----------------------------------"$COL_RESET echo "" - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # build pre install package echo "================= Preinstall =================" ((xmlindent++)) - packagesidentity="org.chameleon" + packagesidentity="${chameleon_package_identity}" choiceId="Pre" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts - ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/${choiceId}/Scripts/Resources/revision - ditto --noextattr --noqtn ${1%/*/*}/version ${1}/${choiceId}/Scripts/Resources/version - cp -f ${pkgroot}/Scripts/Main/preinstall ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/${choiceId}/Scripts + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --noextattr --noqtn ${SRCROOT}/revision ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/revision + ditto --noextattr --noqtn ${SRCROOT}/version ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/version + cp -f ${PKGROOT}/Scripts/Main/preinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Sub/InstallLog.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId" # End build pre install package # build core package echo "================= Core =================" - packagesidentity="org.chameleon" + packagesidentity="${chameleon_package_identity}" choiceId="Core" - mkdir -p ${1}/${choiceId}/Root/usr/local/bin - mkdir -p ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot0 ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot0md ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1f32 ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1h ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1he ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/boot1hp ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/cdboot ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/chain0 ${1}/${choiceId}/Root/usr/standalone/i386 - ditto --noextattr --noqtn ${1%/*}/i386/fdisk440 ${1}/${choiceId}/Root/usr/local/bin - ditto --noextattr --noqtn ${1%/*}/i386/bdmesg ${1}/${choiceId}/Root/usr/local/bin + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot0md ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1f32 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1h ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1he ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1hp ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/cdboot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/chain0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/fdisk440 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + ditto --noextattr --noqtn ${SYMROOT}/i386/bdmesg ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId" # End build core package # build install type echo "================= Chameleon =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) - packagesidentity="org.chameleon.type" + packagesidentity="${chameleon_package_identity}.type" allChoices="New Upgrade" # build new install package choiceId="New" - mkdir -p ${1}/${choiceId}/Root - echo "" > "${1}/${choiceId}/Root/install_type_new" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + echo "" > "${PKG_BUILD_DIR}/${choiceId}/Root/install_type_new" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"!choices['Upgrade'].selected\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build new install package # build upgrade package choiceId="Upgrade" - mkdir -p ${1}/${choiceId}/Root - echo "" > "${1}/${choiceId}/Root/install_type_upgrade" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + echo "" > "${PKG_BUILD_DIR}/${choiceId}/Root/install_type_upgrade" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"chameleon_boot_plist_exists()\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build upgrade package ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # End build install type # build Chameleon package echo "================= Chameleon =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) allChoices="Standard EFI noboot" # build standard package choiceId="Standard" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts/Resources - cp -f ${pkgroot}/Scripts/Main/${choiceId}postinstall ${1}/${choiceId}/Scripts/postinstall - cp -f ${pkgroot}/Scripts/Sub/* ${1}/${choiceId}/Scripts - ditto --arch i386 `which SetFile` ${1}/${choiceId}/Scripts/Resources/SetFile + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources + cp -f ${PKGROOT}/Scripts/Main/${choiceId}postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall + cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"true\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build standard package # build efi package choiceId="EFI" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts/Resources - cp -f ${pkgroot}/Scripts/Main/ESPpostinstall ${1}/${choiceId}/Scripts/postinstall - cp -f ${pkgroot}/Scripts/Sub/* ${1}/${choiceId}/Scripts - ditto --arch i386 `which SetFile` ${1}/${choiceId}/Scripts/Resources/SetFile + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources + cp -f ${PKGROOT}/Scripts/Main/ESPpostinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall + cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build efi package # build no bootloader choice package choiceId="noboot" - mkdir -p ${1}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices") addChoice "${choiceId}" "start_selected=\"false\" selected=\"${exclusiveChoice}\"" "$packageRefId" # End build no bootloader choice package ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # End build Chameleon package +if [[ "${CONFIG_MODULES}" == 'y' ]];then # build Modules package echo "================= Modules =================" ############################### @@ -242,54 +291,58 @@ # uClibcxx.dylib # # Keylayout.dylib # ############################### - if [ "$(ls -A "${1%/*}/i386/modules")" ]; then + if [ "$(ls -A "${SYMROOT}/i386/modules")" ]; then { - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) # - - if [ -e ${1%/*}/i386/modules/klibc.dylib ]; then + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then { # Start build klibc package module choiceId="klibc" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/${choiceId}.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/${choiceId}.dylib" ${PKG_BUILD_DIR}/${choiceId}/Root echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build klibc package module } fi # - - if [ -e ${1%/*}/i386/modules/uClibcxx.dylib ]; then + if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \ + -f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then { + klibcPackageRefId="" + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then + klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc") + fi # Start build uClibc package module choiceId="uClibc" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/uClibcxx.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/uClibcxx.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 # Add the klibc package because the uClibc module is dependent of klibc module - addChoice "${choiceId}" "start_selected=\"false\"" \ - "$packageRefId" $(getPackageRefId "${modules_packages_identity}" "klibc") + addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" "$klibcPackageRefId" # End build uClibc package module } fi # - - if [ -e ${1%/*}/i386/modules/Resolution.dylib ]; then + if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Resolution.dylib" ]]; then { # Start build Resolution package module choiceId="AutoReso" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/Resolution.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/Resolution.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build Resolution package module } @@ -297,27 +350,27 @@ # - # Warning Keylayout module need additional files - if [ -e ${1%/*}/i386/modules/Keylayout.dylib ]; then + if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then { # Start build Keylayout package module choiceId="Keylayout" - mkdir -p ${1}/${choiceId}/Root/Extra/{modules,Keymaps} - mkdir -p ${1}/${choiceId}/Root/usr/local/bin - layout_src_dir="${1%/sym/*}/i386/modules/Keylayout/layouts/layouts-src" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps} + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src" if [ -d "$layout_src_dir" ];then # Create a tar.gz from layout sources (cd "$layout_src_dir"; \ - tar czf "${1}/Keylayout/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt) + tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt) fi # Adding module - ditto --noextattr --noqtn ${1%/*}/i386/modules/${choiceId}.dylib ${1}/${choiceId}/Root/Extra/modules + ditto --noextattr --noqtn ${SYMROOT}/i386/modules/${choiceId}.dylib ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules # Adding Keymaps - ditto --noextattr --noqtn ${1%/sym/*}/Keymaps ${1}/${choiceId}/Root/Extra/Keymaps + ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps # Adding tools - ditto --noextattr --noqtn ${1%/*}/i386/cham-mklayout ${1}/${choiceId}/Root/usr/local/bin + ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp" # >/dev/null 2>&1 # Don't add a choice for Keylayout module # addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" @@ -327,15 +380,15 @@ # - - if [ -e ${1%/*}/i386/modules/AMDGraphicsEnabler.dylib ]; then + if [[ "${CONFIG_AMDGRAPHICSENABLER_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/AMDGraphicsEnabler.dylib" ]]; then { # Start build AMDGraphicsEnabler package module choiceId="AMDGraphicsEnabler" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/AMDGraphicsEnabler.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/AMDGraphicsEnabler.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build AMDGraphicsEnabler package module } @@ -343,15 +396,15 @@ # - - if [ -e ${1%/*}/i386/modules/ATiGraphicsEnabler.dylib ]; then + if [[ "${CONFIG_ATIGRAPHICSENABLER_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/ATiGraphicsEnabler.dylib" ]]; then { # Start build ATiGraphicsEnabler package module choiceId="AMDGraphicsEnabler" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/ATiGraphicsEnabler.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/ATiGraphicsEnabler.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build ATiGraphicsEnabler package module } @@ -359,15 +412,15 @@ # - - if [ -e ${1%/*}/i386/modules/IntelGraphicsEnabler.dylib ]; then + if [[ "${CONFIG_INTELGRAPHICSENABLER_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/IntelGraphicsEnabler.dylib" ]]; then { - # Start build ATiGraphicsEnabler package module + # Start build IntelGraphicsEnabler package module choiceId="IntelGraphicsEnabler" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/IntelGraphicsEnabler.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/IntelGraphicsEnabler.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build IntelGraphicsEnabler package module } @@ -375,22 +428,22 @@ # - - if [ -e ${1%/*}/i386/modules/NVIDIAGraphicsEnabler.dylib ]; then + if [[ "${CONFIG_NVIDIAGRAPHICSENABLER_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/NVIDIAGraphicsEnabler.dylib" ]]; then { # Start build NVIDIAGraphicsEnabler package module choiceId="NVIDIAGraphicsEnabler" - mkdir -p ${1}/${choiceId}/Root - ditto --noextattr --noqtn ${1%/*}/i386/modules/NVIDIAGraphicsEnabler.dylib ${1}/${choiceId}/Root + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/NVIDIAGraphicsEnabler.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules" # >/dev/null 2>&1 addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" # End build NVIDIAGraphicsEnabler package module } fi ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" } else { @@ -398,18 +451,19 @@ } fi # End build Modules packages +fi # build Options packages - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) # ------------------------------------------------------ # parse OptionalSettings folder to find files of boot options. # ------------------------------------------------------ - OptionalSettingsFolder="${pkgroot}/OptionalSettings" + OptionalSettingsFolder="${PKGROOT}/OptionalSettings" OptionalSettingsFiles=($( find "${OptionalSettingsFolder}" -depth 1 ! -name '.svn' ! -name '.DS_Store' )) for (( i = 0 ; i < ${#OptionalSettingsFiles[@]} ; i++ )) @@ -419,10 +473,10 @@ builtOptionsList=$( echo ${OptionalSettingsFiles[$i]%.txt} ) builtOptionsList=$( echo ${builtOptionsList##*/} ) echo "================= $builtOptionsList =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) - packagesidentity="org.chameleon.options.$builtOptionsList" + packagesidentity="${chameleon_package_identity}.options.$builtOptionsList" # ------------------------------------------------------ # Read boot option file into an array. @@ -454,14 +508,14 @@ keyValue=${textLine##*:} # create folders required for each boot option - mkdir -p "${1}/$optionName/Root/" + mkdir -p "${PKG_BUILD_DIR}/$optionName/Root/" # create dummy file with name of key/value - echo "" > "${1}/$optionName/Root/${keyValue}" + echo "" > "${PKG_BUILD_DIR}/$optionName/Root/${keyValue}" echo -e "\t[BUILD] ${optionName} " packageRefId=$(getPackageRefId "${packagesidentity}" "${optionName}") - buildpackage "$packageRefId" "${optionName}" "${1}/${optionName}" "/$chamTemp/options" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${optionName}" "${PKG_BUILD_DIR}/${optionName}" "/$chamTemp/options" # >/dev/null 2>&1 exclusiveSelect="" if [[ ${exclusiveFlag} -eq 1 ]];then exclusiveSelect="selected=\"$(exclusive_zero_or_one_choice "$optionName" "$allChoices")\"" @@ -470,22 +524,30 @@ done ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" done - # build KeyLayout options packages + ((xmlindent--)) + outline[${#outline[*]}]="${indent[$xmlindent]}" +# End build options packages + +if [[ -n "${CONFIG_KEYLAYOUT_MODULE}" ]];then +# build KeyLayout options packages echo "================= Keymaps Options =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) - packagesidentity="org.chameleon.options.keylayout" - keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout") + packagesidentity="${chameleon_package_identity}.options.keylayout" + keylayoutPackageRefId="" + if [[ "${CONFIG_MODULES}" == 'y' && "${CONFIG_KEYLAYOUT_MODULE}" = 'm' ]];then + keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout") + fi # ------------------------------------------------------ # Available Keylayout boot options are discovered by # reading contents of /Keymaps folder after compilation # ------------------------------------------------------ - availableOptions=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' )) + availableOptions=($( find "${SRCROOT}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' )) allChoices="${availableOptions[@]}" # Adjust array contents to match expected format # for boot options which is: name:key=value @@ -493,14 +555,14 @@ # availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]} # Start build of a keymap package module choiceId="${availableOptions[i]}" - mkdir -p ${1}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root # create dummy file with name of key/value - echo "" > "${1}/${choiceId}/Root/KeyLayout=${availableOptions[i]}" + echo "" > "${PKG_BUILD_DIR}/${choiceId}/Root/KeyLayout=${availableOptions[i]}" echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/options" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/options" # >/dev/null 2>&1 exclusiveChoice=$(exclusive_zero_or_one_choice "$choiceId" "$allChoices") # Add the Keylayout package because the Keylayout module is needed addChoice "${choiceId}" "start_selected=\"false\" selected=\"${exclusiveChoice}\"" \ @@ -509,65 +571,55 @@ done ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" - # End build KeyLayout options packages +# End build KeyLayout options packages +fi - ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" -# End build options packages - # build theme packages echo "================= Themes =================" - outline[$((outlinecount++))]="${indent[$xmlindent]}" - choices[$((choicescount++))]="\t\n\t\n" + outline[${#outline[*]}]="${indent[$xmlindent]}" + choices[${#choices[*]}]="\t\n\t\n" ((xmlindent++)) # Using themes section from Azi's/package branch. - packagesidentity="org.chameleon.themes" - artwork="${1%/sym/package}/artwork/themes" + packagesidentity="${chameleon_package_identity}.themes" + artwork="${SRCROOT}/artwork/themes" themes=($( find "${artwork}" -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/" - rsync -r --exclude=.svn "${themes[$i]}/" "${1}/${theme}/Root/${theme}" + mkdir -p "${PKG_BUILD_DIR}/${theme}/Root/" + rsync -r --exclude=.svn "${themes[$i]}/" "${PKG_BUILD_DIR}/${theme}/Root/${theme}" echo -e "\t[BUILD] ${theme}" packageRefId=$(getPackageRefId "${packagesidentity}" "${theme}") - buildpackage "$packageRefId" "${theme}" "${1}/${theme}" "/$chamTemp/Extra/Themes" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${theme}" "${PKG_BUILD_DIR}/${theme}" "/$chamTemp/Extra/Themes" # >/dev/null 2>&1 addChoice "${theme}" "start_selected=\"false\"" "$packageRefId" done ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" # End build theme packages# End build Extras package # build post install package echo "================= Post =================" - packagesidentity="org.chameleon" + packagesidentity="${chameleon_package_identity}" choiceId="Post" - mkdir -p ${1}/${choiceId}/Root - mkdir -p ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Main/postinstall ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/${choiceId}/Scripts - cp -f ${pkgroot}/Scripts/Sub/UnMountEFIvolumes.sh ${1}/${choiceId}/Scripts - ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/${choiceId}/Scripts/Resources/revision - ditto --noextattr --noqtn ${1%/*/*}/version ${1}/${choiceId}/Scripts/Resources/version + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Main/postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Sub/InstallLog.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts + cp -f ${PKGROOT}/Scripts/Sub/UnMountEFIvolumes.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --noextattr --noqtn ${SRCROOT}/revision ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/revision + ditto --noextattr --noqtn ${SRCROOT}/version ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/version echo -e "\t[BUILD] ${choiceId} " packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") - buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" # >/dev/null 2>&1 + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" # >/dev/null 2>&1 addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId" # End build post install package ((xmlindent--)) - outline[$((outlinecount++))]="${indent[$xmlindent]}" + outline[${#outline[*]}]="${indent[$xmlindent]}" -# build meta package - - makedistribution "${1}" "${2}" "${3}" "${4}" #"${5}" - -# clean up - # rm -R -f "${1}" - } buildpackage () @@ -582,7 +634,9 @@ local packageName="$2" local packagePath="$3" local targetPath="$4" - local packageSize="$5" + set +u # packageSize is optional + local packageSize="$5" + set -u find "${packagePath}" -name '.DS_Store' -delete local filecount=$( find "${packagePath}/Root" | wc -l ) @@ -614,7 +668,7 @@ done header+="\t\n" # Create the Script archive file (cpio format) - (cd "${packagePath}/Scripts" && find . -print | cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \ + (cd "${packagePath}/Scripts" && find . -print | cpio -o -z -R 0:0 --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \ grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages fi @@ -622,7 +676,7 @@ echo -e "${header}" > "${packagePath}/Temp/PackageInfo" # Create the Payload file (cpio format) - (cd "${packagePath}/Root" && find . -print | cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Payload") 2>&1 | \ + (cd "${packagePath}/Root" && find . -print | cpio -o -z -R 0:0 --format cpio > "${packagePath}/Temp/Payload") 2>&1 | \ grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages # Create the package @@ -637,73 +691,70 @@ makedistribution () { - distributionDestDir="${1%/*}" - distributionFilename="${packagename// /}-${version}-r${revision}.pkg" - distributionFilePath="${distributionDestDir}/${distributionFilename}" + declare -r distributionDestDir="${SYMROOT}" + declare -r distributionFilename="${packagename// /}-${version}-r${revision}.pkg" + declare -r distributionFilePath="${distributionDestDir}/${distributionFilename}" rm -f "${distributionDestDir}/${packagename// /}"*.pkg - mkdir -p "${1}/${packagename}" + mkdir -p "${PKG_BUILD_DIR}/${packagename}" - find "${1}" -type f -name '*.pkg' -depth 1 | while read component + find "${PKG_BUILD_DIR}" -type f -name '*.pkg' -depth 1 | while read component do pkg="${component##*/}" # ie: EFI.pkg - pkgdir="${1}/${packagename}/${pkg}" + pkgdir="${PKG_BUILD_DIR}/${packagename}/${pkg}" # expand individual packages - pkgutil --expand "${1%}/${pkg}" "$pkgdir" - rm -f "${1%}/${pkg}" + pkgutil --expand "${PKG_BUILD_DIR}/${pkg}" "$pkgdir" + rm -f "${PKG_BUILD_DIR}/${pkg}" done # Create the Distribution file - ditto --noextattr --noqtn "${pkgroot}/Distribution" "${1}/${packagename}/Distribution" + ditto --noextattr --noqtn "${PKGROOT}/Distribution" "${PKG_BUILD_DIR}/${packagename}/Distribution" for (( i=0; i < ${#outline[*]} ; i++)); do - echo -e "${outline[$i]}" >> "${1}/${packagename}/Distribution" + echo -e "${outline[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" done for (( i=0; i < ${#choices[*]} ; i++)); do - echo -e "${choices[$i]}" >> "${1}/${packagename}/Distribution" + echo -e "${choices[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" done for (( i=0; i < ${#pkgrefs[*]} ; i++)); do - echo -e "${pkgrefs[$i]}" >> "${1}/${packagename}/Distribution" + echo -e "${pkgrefs[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" done - echo -e "\n" >> "${1}/${packagename}/Distribution" + echo -e "\n" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" # Create the Resources directory - ditto --noextattr --noqtn "${pkgroot}/Resources" "${1}/${packagename}/Resources" + ditto --noextattr --noqtn "${PKGROOT}/Resources" "${PKG_BUILD_DIR}/${packagename}/Resources" # CleanUp the directory - find "${1}/${packagename}" -type d -name '.svn' -exec rm -rf {} \; 2>/dev/null - find "${1}/${packagename}" -name '.DS_Store' -delete + find "${PKG_BUILD_DIR}/${packagename}" \( -type d -name '.svn' \) -o -name '.DS_Store' -exec rm -rf {} \; # Add Chameleon Version and Revision - perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" $( find "${1}/${packagename}/Resources" -type f ) - perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" $( find "${1}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) # Add Chameleon Stage - stage=${stage/RC/Release Candidate } - stage=${stage/FINAL/2.0 Final} - perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" $( find "${1}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) # Adding Developer and credits - perl -i -p -e "s/%DEVELOP%/${develop}/g" $( find "${1}/${packagename}/Resources" -type f ) - perl -i -p -e "s/%CREDITS%/${credits}/g" $( find "${1}/${packagename}/Resources" -type f ) - perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" $( find "${1}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%DEVELOP%/${develop}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%CREDITS%/${credits}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) + perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) # Create the final package - pkgutil --flatten "${1}/${packagename}" "${distributionFilePath}" + pkgutil --flatten "${PKG_BUILD_DIR}/${packagename}" "${distributionFilePath}" # Here is the place for assign a Icon to the pkg # command use to generate the file: # ditto -c -k --sequesterRsrc --keepParent Icon.icns Icon.zip # ---- - ditto -xk "${pkgroot}/Icons/pkg.zip" "${1}/Icons/" - DeRez -only icns "${1}/Icons/Icons/pkg.icns" > "${1}/Icons/tempicns.rsrc" - Rez -append "${1}/Icons/tempicns.rsrc" -o "${distributionFilePath}" + ditto -xk "${PKGROOT}/Icons/pkg.zip" "${PKG_BUILD_DIR}/Icons/" + DeRez -only icns "${PKG_BUILD_DIR}/Icons/Icons/pkg.icns" > "${PKG_BUILD_DIR}/Icons/tempicns.rsrc" + Rez -append "${PKG_BUILD_DIR}/Icons/tempicns.rsrc" -o "${distributionFilePath}" SetFile -a C "${distributionFilePath}" - rm -rf "${1}/Icons" + rm -rf "${PKG_BUILD_DIR}/Icons" # End @@ -726,4 +777,8 @@ } -main "${1}" "${2}" "${3}" "${4}" #"${5}" +# build packages +main + +# build meta package +makedistribution Index: branches/ErmaC/Modules/CHANGES =================================================================== --- branches/ErmaC/Modules/CHANGES (revision 1762) +++ branches/ErmaC/Modules/CHANGES (revision 1763) @@ -1,3 +1,4 @@ +- cparm : Fixed naming convention for raid hfs devices in gui - Added support for using UUIDs with ext2 filesystems (credits to bitz): http://forge.voodooprojects.org/p/chameleon/issues/208/ - Added Guerrero's patch on gui.c: http://forge.voodooprojects.org/p/chameleon/issues/178/ - cparm : Ported the OS detection to the trunk, updated the default theme to v 1.1 (credit to blackosx) Index: branches/ErmaC/Modules/Makefile =================================================================== --- branches/ErmaC/Modules/Makefile (revision 1762) +++ branches/ErmaC/Modules/Makefile (revision 1763) @@ -6,8 +6,8 @@ DOCROOT = $(SRCROOT)/doc IMGSKELROOT = $(SRCROOT)/imgskel CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot +PKG_BUILD_DIR = $(SYMROOT)/package - include Make.rules @@ -100,10 +100,10 @@ @mv ${DISTFILE}.tar.gz ${DISTFILE}.tgz clean-local: - @if [ -d "$(SYMROOT)/package" ];then echo "\t[RMDIR] $(SYMROOT)/package"; fi + @if [ -d "$(PKG_BUILD_DIR)" ];then echo "\t[RMDIR] $(PKG_BUILD_DIR)"; fi @if [ -f "$(HEADER_VERSION)" ];then echo "\t[RM] $(HEADER_VERSION)"; fi @if [ -f "$(SRCROOT)/revision" ];then echo "\t[RM] $(SRCROOT)/revision"; fi - @rm -rf "$(SYMROOT)/package" $(HEADER_VERSION) $(SRCROOT)/revision + @rm -rf "$(PKG_BUILD_DIR)" $(HEADER_VERSION) $(SRCROOT)/revision AUTOCONF_FILES = $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h \ $(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(SRCROOT)/.config.old @@ -121,7 +121,8 @@ $(AUTOCONF_FILES) pkg installer: all - ${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package + @echo "================= Building Package =================" + @${SRCROOT}/package/buildpkg.sh "$(SRCROOT)" "$(SYMROOT)" "$(PKG_BUILD_DIR)" dmg: all ${SRCROOT}/package/slimpkg.sh ${SYMROOT}/package;