Chameleon

Chameleon Svn Source Tree

Root/trunk/package/buildpkg.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3# $0 SRCROOT directory
4# $1 SYMROOT directory
5# $2 directory where pkgs will be created
6
7# Directory paths
8declare -r PKGROOT="${0%/*}"
9declare -r SRCROOT="$1"
10declare -r SYMROOT="$2"
11declare -r PKG_BUILD_DIR="$3"
12declare -r SCPT_TPL_DIR="${PKGROOT}/Scripts.templates"
13
14if [[ $# -lt 3 ]];then
15 echo "Too few arguments. Aborting..." >&2 && exit 1
16fi
17
18if [[ ! -d "$SYMROOT" ]];then
19 echo "Directory ${SYMROOT} doesn't exit. Aborting..." >&2 && exit 1
20fi
21
22# Prevent the script from doing bad things
23set -u # Abort with unset variables
24#set -e # Abort with any error can be suppressed locally using EITHER cmd||true OR set -e;cmd;set +e
25
26# ====== CONFIGURATION ======
27CONFIG_MODULES=""
28CONFIG_KLIBC_MODULE=""
29CONFIG_UCLIBCXX_MODULE=""
30CONFIG_SATA_MODULE=""
31CONFIG_RESOLUTION_MODULE=""
32CONFIG_KEYLAYOUT_MODULE=""
33source "${SRCROOT}/auto.conf"
34
35# ====== COLORS ======
36declare -r COL_BLACK="\x1b[30;01m"
37declare -r COL_RED="\x1b[31;01m"
38declare -r COL_GREEN="\x1b[32;01m"
39declare -r COL_YELLOW="\x1b[33;01m"
40declare -r COL_MAGENTA="\x1b[35;01m"
41declare -r COL_CYAN="\x1b[36;01m"
42declare -r COL_WHITE="\x1b[37;01m"
43declare -r COL_BLUE="\x1b[34;01m"
44declare -r COL_RESET="\x1b[39;49;00m"
45
46# ====== REVISION/VERSION ======
47declare -r CHAMELEON_VERSION=$( cat version )
48
49# stage
50CHAMELEON_STAGE=${CHAMELEON_VERSION##*-}
51CHAMELEON_STAGE=${CHAMELEON_STAGE/RC/Release Candidate }
52CHAMELEON_STAGE=${CHAMELEON_STAGE/FINAL/2.1 Final}
53declare -r CHAMELEON_STAGE
54
55declare -r CHAMELEON_REVISION=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' )
56declare -r CHAMELEON_BUILDDATE=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' )
57declare -r CHAMELEON_TIMESTAMP=$( date -j -f "%Y-%m-%d %H:%M:%S" "${CHAMELEON_BUILDDATE}" "+%s" )
58
59# ====== CREDITS ======
60declare -r CHAMELEON_DEVELOP=$(awk "NR==6{print;exit}" ${PKGROOT}/../CREDITS)
61declare -r CHAMELEON_CREDITS=$(awk "NR==10{print;exit}" ${PKGROOT}/../CREDITS)
62declare -r CHAMELEON_PKGDEV=$(awk "NR==14{print;exit}" ${PKGROOT}/../CREDITS)
63declare -r CHAMELEON_CPRYEAR=$(awk "NR==18{print;exit}" ${PKGROOT}/../CREDITS)
64if [[ $(whoami | awk '{print $1}' | cut -d ":" -f3) == "admin" ]];then
65 declare -r CHAMELEON_WHOBUILD="VoodooLabs BuildBot"
66else
67 declare -r CHAMELEON_WHOBUILD=$(whoami | awk '{print $1}' | cut -d ":" -f3)
68fi
69
70# ====== GLOBAL VARIABLES ======
71declare -r LOG_FILENAME="Chameleon_Installer_Log.txt"
72
73declare -a chameleonOptionType
74declare -a chameleonOptionKey
75declare -a chameleonOptionValues
76
77declare -a pkgrefs
78declare -a choice_key
79declare -a choice_options
80declare -a choice_pkgrefs
81declare -a choice_parent_group_index
82declare -a choice_group_items
83declare -a choice_group_exclusive
84
85# Init Main Group
86choice_key[0]=""
87choice_options[0]=""
88choices_pkgrefs[0]=""
89choice_group_items[0]=""
90choice_group_exclusive[0]=""
91
92# Package name
93declare -r packagename="Chameleon"
94
95# Package identifiers
96declare -r chameleon_package_identity="org.chameleon"
97declare -r modules_packages_identity="${chameleon_package_identity}.modules"
98
99# ====== FUNCTIONS ======
100trim () {
101 local result="${1#"${1%%[![:space:]]*}"}" # remove leading whitespace characters
102 echo "${result%"${result##*[![:space:]]}"}" # remove trailing whitespace characters
103}
104
105function makeSubstitutions () {
106 # Substition is like: Key=Value
107 #
108 # Optional arguments:
109 # --subst=<substition> : add a new substitution
110 #
111 # Last argument(s) is/are file(s) where substitutions must be made
112
113 local ownSubst=""
114
115 function addSubst () {
116 local mySubst="$1"
117 case "$mySubst" in
118*=*) keySubst=${mySubst%%=*}
119 valSubst=${mySubst#*=}
120 ownSubst=$(printf "%s\n%s" "$ownSubst" "s&@$keySubst@&$valSubst&g;t t")
121 ;;
122*) echo "Invalid substitution $mySubst" >&2
123 exit 1
124 ;;
125esac
126 }
127
128 # Check the arguments.
129 while [[ $# -gt 0 ]];do
130 local option="$1"
131 case "$option" in
132 --subst=*) shift; addSubst "${option#*=}" ;;
133 -*)
134 echo "Unrecognized makeSubstitutions option '$option'" >&2
135 exit 1
136 ;;
137 *) break ;;
138 esac
139 done
140
141 if [[ $# -lt 1 ]];then
142 echo "makeSubstitutions invalid number of arguments: at least one file needed" >&2
143 exit 1
144 fi
145
146 local chameleonSubsts="
147s&%CHAMELEONVERSION%&${CHAMELEON_VERSION%%-*}&g
148s&%CHAMELEONREVISION%&${CHAMELEON_REVISION}&g
149s&%CHAMELEONSTAGE%&${CHAMELEON_STAGE}&g
150s&%DEVELOP%&${CHAMELEON_DEVELOP}&g
151s&%CREDITS%&${CHAMELEON_CREDITS}&g
152s&%PKGDEV%&${CHAMELEON_PKGDEV}&g
153s&%CPRYEAR%&${CHAMELEON_CPRYEAR}&g
154s&%WHOBUILD%&${CHAMELEON_WHOBUILD}&g
155:t
156/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
157s&@LOG_FILENAME@&${LOG_FILENAME}&g;t t"
158
159 local allSubst="
160$chameleonSubsts
161$ownSubst"
162
163 for file in "$@";do
164 cp -pf "$file" "${file}.in"
165 sed "$allSubst" "${file}.in" > "${file}"
166 rm -f "${file}.in"
167 done
168}
169
170addTemplateScripts () {
171 # Arguments:
172 # --pkg-rootdir=<pkg_rootdir> : path of the pkg root dir
173 #
174 # Optional arguments:
175 # --subst=<substition> : add a new substitution
176 #
177 # Substition is like: Key=Value
178 #
179 # $n : Name of template(s) (templates are in package/Scripts.templates
180
181 local pkgRootDir=""
182 declare -a allSubst
183
184 # Check the arguments.
185 while [[ $# -gt 0 ]];do
186 local option="$1"
187 case "$option" in
188 --pkg-rootdir=*) shift; pkgRootDir="${option#*=}" ;;
189 --subst=*) shift; allSubst[${#allSubst[*]}]="${option}" ;;
190 -*)
191 echo "Unrecognized addTemplateScripts option '$option'" >&2
192 exit 1
193 ;;
194 *) break ;;
195 esac
196 done
197 if [[ $# -lt 1 ]];then
198 echo "addTemplateScripts invalid number of arguments: you must specify a template name" >&2
199 exit 1
200 fi
201 [[ -z "$pkgRootDir" ]] && { echo "Error addTemplateScripts: --pkg-rootdir option is needed" >&2 ; exit 1; }
202 [[ ! -d "$pkgRootDir" ]] && { echo "Error addTemplateScripts: directory '$pkgRootDir' doesn't exists" >&2 ; exit 1; }
203
204 for templateName in "$@";do
205 local templateRootDir="${SCPT_TPL_DIR}/${templateName}"
206 [[ ! -d "$templateRootDir" ]] && {
207 echo "Error addTemplateScripts: template '$templateName' doesn't exists" >&2; exit 1; }
208
209 # Copy files to destination
210 rsync -pr --exclude=.svn --exclude="*~" "$templateRootDir/" "$pkgRootDir/Scripts/"
211 done
212
213 files=$( find "$pkgRootDir/Scripts/" -type f )
214 if [[ ${#allSubst[*]} -gt 0 ]];then
215 makeSubstitutions "${allSubst[@]}" $files
216 else
217 makeSubstitutions $files
218 fi
219}
220
221getPackageRefId () {
222 echo ${1//_/.}.${2//_/.} | tr [:upper:] [:lower:]
223}
224
225# Return index of a choice
226getChoiceIndex () {
227 # $1 Choice Id
228 local found=0
229 for (( idx=0 ; idx < ${#choice_key[*]}; idx++ ));do
230 if [[ "${1}" == "${choice_key[$idx]}" ]];then
231 found=1
232 break
233 fi
234 done
235 echo "$idx"
236 return $found
237}
238
239# Add a new choice
240addChoice () {
241 # Optional arguments:
242 # --group=<group> : Group Choice Id
243 # --start-selected=<javascript code> : Specifies whether this choice is initially selected or unselected
244 # --start-enabled=<javascript code> : Specifies the initial enabled state of this choice
245 # --start-visible=<javascript code> : Specifies whether this choice is initially visible
246 # --pkg-refs=<pkgrefs> : List of package reference(s) id (separate by spaces)
247 #
248 # $1 Choice Id
249
250 local option
251 local groupChoice=""
252 local choiceOptions=""
253 local pkgrefs=""
254
255 # Check the arguments.
256 for option in "${@}";do
257 case "$option" in
258 --group=*)
259 shift; groupChoice=${option#*=} ;;
260 --start-selected=*)
261 shift; choiceOptions="$choiceOptions start_selected=\"${option#*=}\"" ;;
262 --start-enabled=*)
263 shift; choiceOptions="$choiceOptions start_enabled=\"${option#*=}\"" ;;
264 --start-visible=*)
265 shift; choiceOptions="$choiceOptions start_visible=\"${option#*=}\"" ;;
266 --pkg-refs=*)
267 shift; pkgrefs=${option#*=} ;;
268 -*)
269 echo "Unrecognized addChoice option '$option'" >&2
270 exit 1
271 ;;
272 *) break ;;
273 esac
274 done
275
276 if [[ $# -ne 1 ]];then
277 echo "addChoice invalid number of arguments: ${@}" >&2
278 exit 1
279 fi
280
281 local choiceId="${1}"
282
283 # Add choice in the group
284 idx_group=$(getChoiceIndex "$groupChoice")
285 found_group=$?
286 if [[ $found_group -ne 1 ]];then
287 # No group exist
288 echo "Error can't add choice '$choiceId' to group '$groupChoice': group choice '$groupChoice' doesn't exists." >&2
289 exit 1
290 else
291 set +u; oldItems=${choice_group_items[$idx_group]}; set -u
292 choice_group_items[$idx_group]="$oldItems $choiceId"
293 fi
294
295 # Check that the choice doesn't already exists
296 idx=$(getChoiceIndex "$choiceId")
297 found=$?
298 if [[ $found -ne 0 ]];then
299 # Choice already exists
300 echo "Error can't add choice '$choiceId': a choice with same name already exists." >&2
301 exit 1
302 fi
303
304 # Record new node
305 choice_key[$idx]="$choiceId"
306 choice_options[$idx]=$(trim "${choiceOptions}") # Removing leading and trailing whitespace(s)
307 choice_parent_group_index[$idx]=$idx_group
308 choice_pkgrefs[$idx]="$pkgrefs"
309
310 return $idx
311}
312
313# Add a group choice
314addGroupChoices() {
315 # Optional arguments:
316 # --parent=<parent> : parent group choice id
317 # --exclusive_zero_or_one_choice : only zero or one choice can be selected in the group
318 # --exclusive_one_choice : only one choice can be selected in the group
319 #
320 # $1 Choice Id
321
322 local option
323 local groupChoice=""
324 local exclusive_function=""
325
326 for option in "${@}";do
327 case "$option" in
328 --exclusive_zero_or_one_choice)
329 shift; exclusive_function="exclusive_zero_or_one_choice" ;;
330 --exclusive_one_choice)
331 shift; exclusive_function="exclusive_one_choice" ;;
332 --parent=*)
333 shift; groupChoice=${option#*=} ;;
334 -*)
335 echo "Unrecognized addGroupChoices option '$option'" >&2
336 exit 1
337 ;;
338 *) break ;;
339 esac
340 done
341
342 if [[ $# -ne 1 ]];then
343 echo "addGroupChoices invalid number of arguments: ${@}" >&2
344 exit 1
345 fi
346
347 addChoice --group="$groupChoice" "${1}"
348 local idx=$? # index of the new created choice
349
350 choice_group_exclusive[$idx]="$exclusive_function"
351}
352
353exclusive_one_choice () {
354 # $1 Current choice (ie: test1)
355 # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices
356 local myChoice="${1}"
357 local result="";
358 local separator=' || ';
359 for choice in ${@:2};do
360 if [[ "$choice" != "$myChoice" ]];then
361 result="${result}choices['$choice'].selected${separator}";
362 fi
363 done
364 if [[ -n "$result" ]];then
365 echo "!(${result%$separator})"
366 fi
367}
368
369exclusive_zero_or_one_choice () {
370 # $1 Current choice (ie: test1)
371 # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices
372 local myChoice="${1}"
373 local result;
374 echo "(my.choice.selected &amp;&amp; $(exclusive_one_choice ${@}))"
375}
376
377recordChameleonOption () {
378 local type="$1"
379 local key="$2"
380 local value="$3"
381
382 # Search for an existing key
383 local found=0
384 for (( idx=0 ; idx < ${#chameleonOptionKey[@]}; idx++ ));do
385 if [[ "$key" == "${chameleonOptionKey[$idx]}" ]];then
386 found=1
387 break
388 fi
389 done
390
391 # idx contain the index of a new key or an existing one
392 if [[ $found -eq 0 ]]; then
393 # Create a new one
394 chameleonOptionKey[$idx]="$key"
395 chameleonOptionType[$idx]="$type"
396 chameleonOptionValues[$idx]=""
397 fi
398
399 case "$type" in
400 bool) ;;
401 text|list) chameleonOptionValues[$idx]="${chameleonOptionValues[$idx]} $value" ;;
402 *) echo "Error unknown type '$type' for '$key'" >&2
403 exit 1
404 ;;
405 esac
406}
407
408generate_options_yaml_file () {
409 local yamlFile="$1"
410 echo "---" > $yamlFile
411 for (( idx=0; idx < ${#chameleonOptionKey[@]}; idx++ ));do
412 printf "%s:\n type: %s\n" "${chameleonOptionKey[$idx]}" "${chameleonOptionType[$idx]}" >> $yamlFile
413 case ${chameleonOptionType[$idx]} in
414 text|list)
415 printf " values:\n" >> $yamlFile
416 for value in ${chameleonOptionValues[$idx]};do
417 printf " - %s\n" "$value" >> $yamlFile
418 done
419 ;;
420 esac
421 done
422}
423
424main ()
425{
426
427# clean up the destination path
428
429 rm -R -f "${PKG_BUILD_DIR}"
430 echo ""
431 echo -e $COL_CYAN" ----------------------------------"$COL_RESET
432 echo -e $COL_CYAN" Building $packagename Install Package"$COL_RESET
433 echo -e $COL_CYAN" ----------------------------------"$COL_RESET
434 echo ""
435
436# Add pre install choice
437 echo "================= Preinstall ================="
438 packagesidentity="${chameleon_package_identity}"
439 choiceId="Pre"
440
441 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
442 addChoice --start-visible="false" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}"
443
444 # Package will be built at the end
445# End pre install choice
446
447# build core package
448 echo "================= Core ================="
449 packagesidentity="${chameleon_package_identity}"
450 choiceId="Core"
451 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
452 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
453 ditto --noextattr --noqtn ${SYMROOT}/i386/boot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
454 ditto --noextattr --noqtn ${SYMROOT}/i386/boot0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
455 ditto --noextattr --noqtn ${SYMROOT}/i386/boot0md ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
456 ditto --noextattr --noqtn ${SYMROOT}/i386/boot1f32 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
457 ditto --noextattr --noqtn ${SYMROOT}/i386/boot1h ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
458 ditto --noextattr --noqtn ${SYMROOT}/i386/boot1he ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
459 ditto --noextattr --noqtn ${SYMROOT}/i386/boot1hp ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
460 ditto --noextattr --noqtn ${SYMROOT}/i386/cdboot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
461 ditto --noextattr --noqtn ${SYMROOT}/i386/chain0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386
462 ditto --noextattr --noqtn ${SYMROOT}/i386/fdisk440 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
463 ditto --noextattr --noqtn ${SYMROOT}/i386/bdmesg ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
464
465 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
466 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
467 addChoice --start-visible="false" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}"
468# End build core package
469
470# build Chameleon package
471 echo "================= Chameleon ================="
472 addGroupChoices --exclusive_one_choice "Chameleon"
473
474 # build standard package
475 choiceId="Standard"
476 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
477 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources
478 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" InstallerLog
479 cp -f ${PKGROOT}/Scripts/Main/${choiceId}postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall
480 cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts
481 ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile
482
483 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
484 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
485 addChoice --group="Chameleon" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}"
486 # End build standard package
487
488 # build efi package
489if [[ 1 -eq 0 ]];then
490 # Only standard installation is currently supported
491 # We need to update the script to be able to install
492 # Chameleon on EFI partition
493 choiceId="EFI"
494 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
495 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources
496 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" InstallerLog
497 cp -f ${PKGROOT}/Scripts/Main/ESPpostinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall
498 cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts
499 ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile
500
501 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
502 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
503 addChoice --group="Chameleon" --start-visible="systemHasGPT()" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
504 # End build efi package
505fi
506 # build no bootloader choice package
507 choiceId="noboot"
508 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
509
510 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
511 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
512 addChoice --group="Chameleon" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
513 # End build no bootloader choice package
514
515# End build Chameleon package
516
517if [[ "${CONFIG_MODULES}" == 'y' ]];then
518# build Modules package
519 echo "================= Modules ================="
520 ###############################
521 # Supported Modules #
522 ###############################
523 # klibc.dylib #
524 # Resolution.dylib #
525 # uClibcxx.dylib #
526 # Sata.dylib #
527 # Keylayout.dylib #
528 ###############################
529 if [ "$(ls -A "${SYMROOT}/i386/modules")" ]; then
530 {
531 addGroupChoices "Module"
532
533# -
534 if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Resolution.dylib" ]]; then
535 {
536 # Start build Resolution package module
537 choiceId="AutoReso"
538 moduleFile="Resolution.dylib"
539 mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
540 ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
541 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
542 --subst="moduleName=$choiceId" \
543 --subst="moduleFile=$moduleFile" \
544 InstallModule
545
546 packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
547 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
548 addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
549 # End build Resolution package module
550 }
551 fi
552
553# -
554 if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then
555 {
556 # Start build klibc package module
557 choiceId="klibc"
558 moduleFile="${choiceId}.dylib"
559 mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
560 ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" ${PKG_BUILD_DIR}/${choiceId}/Root
561 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
562 --subst="moduleName=$choiceId" \
563 --subst="moduleFile=$moduleFile" \
564 InstallModule
565
566 packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
567 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
568 addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
569 # End build klibc package module
570 }
571 fi
572
573# -
574 if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \
575 -f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then
576 {
577 klibcPackageRefId=""
578 if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then
579 klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc")
580 fi
581 # Start build uClibc package module
582 choiceId="uClibc"
583 moduleFile="uClibcxx.dylib"
584 mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
585 ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
586 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
587 --subst="moduleName=$choiceId" \
588 --subst="moduleFile=$moduleFile" \
589 InstallModule
590
591 packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
592 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
593 # Add the klibc package because the uClibc module is dependent of klibc module
594 addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId $klibcPackageRefId" "${choiceId}"
595 # End build uClibc package module
596 }
597 fi
598# -
599 if [[ "${CONFIG_SATA_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Sata.dylib" ]]; then
600 {
601 # Start build Sata package module
602 choiceId="Sata"
603 moduleFile="Sata.dylib"
604 mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
605 ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
606 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
607 --subst="moduleName=$choiceId" \
608 --subst="moduleFile=$moduleFile" \
609 InstallModule
610
611 packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
612 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
613 addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
614 # End build Sata package module
615 }
616 fi
617
618# -
619 # Warning Keylayout module need additional files
620 if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then
621 {
622 # Start build Keylayout package module
623 choiceId="Keylayout"
624 moduleFile="${choiceId}.dylib"
625 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps}
626 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
627 layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src"
628 if [ -d "$layout_src_dir" ];then
629 # Create a tar.gz from layout sources
630 (cd "$layout_src_dir"; \
631 tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt)
632 fi
633 # Adding module
634 ditto --noextattr --noqtn ${SYMROOT}/i386/modules/$moduleFile ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules
635 # Adding Keymaps
636 ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps
637 # Adding tools
638 ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
639 # Adding scripts
640 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
641 --subst="moduleName=$choiceId" \
642 --subst="moduleFile=$moduleFile" \
643 InstallModule
644
645 packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
646 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
647
648 # Don't add a choice for Keylayout module
649 # addChoice "${choiceId}" "Module" --start-selected="false" "$packageRefId"
650 # End build Keylayout package module
651 }
652 fi
653
654 }
655 else
656 {
657 echo " -= no modules to include =-"
658 }
659 fi
660# End build Modules packages
661fi
662
663# build Options packages
664
665 addGroupChoices "Options"
666
667 # ------------------------------------------------------
668 # parse OptionalSettings folder to find files of boot options.
669 # ------------------------------------------------------
670 OptionalSettingsFolder="${PKGROOT}/OptionalSettings"
671
672 while IFS= read -r -d '' OptionsFile; do
673
674 # Take filename and strip .txt from end and path from front
675 builtOptionsList=${OptionsFile%.txt}
676 builtOptionsList=${builtOptionsList##*/}
677 packagesidentity="${chameleon_package_identity}.options.$builtOptionsList"
678
679 echo "================= $builtOptionsList ================="
680
681 # ------------------------------------------------------
682 # Read boot option file into an array.
683 # ------------------------------------------------------
684 availableOptions=() # array to hold the list of boot options, per 'section'.
685 exclusiveFlag="" # used to indicate list has exclusive options
686 while read textLine; do
687 # ignore lines in the file beginning with a #
688 [[ $textLine = \#* ]] && continue
689 local optionName="" key="" value=""
690 case "$textLine" in
691 Exclusive=[Tt][Rr][Uu][Ee]) exclusiveFlag="--exclusive_zero_or_one_choice" ;;
692 Exclusive=*) continue ;;
693 *@*:*=*)
694 availableOptions[${#availableOptions[*]}]="$textLine" ;;
695 *) echo "Error: invalid line '$textLine' in file '$OptionsFile'" >&2
696 exit 1
697 ;;
698 esac
699 done < "$OptionsFile"
700
701 addGroupChoices --parent="Options" $exclusiveFlag "${builtOptionsList}"
702
703 # ------------------------------------------------------
704 # Loop through options in array and process each in turn
705 # ------------------------------------------------------
706 for textLine in "${availableOptions[@]}"; do
707 # split line - taking all before ':' as option name
708 # and all after ':' as key/value
709 type=$( echo "${textLine%%@*}" | tr '[:upper:]' '[:lower:]' )
710 tmp=${textLine#*@}
711 optionName=${tmp%%:*}
712 keyValue=${tmp##*:}
713 key=${keyValue%%=*}
714 value=${keyValue#*=}
715
716 # create folders required for each boot option
717 mkdir -p "${PKG_BUILD_DIR}/$optionName/Root/"
718
719 case "$type" in
720 bool) startSelected="check_chameleon_bool_option('$key','$value')" ;;
721 text) startSelected="check_chameleon_text_option('$key','$value')" ;;
722 list) startSelected="check_chameleon_list_option('$key','$value')" ;;
723 *) echo "Error: invalid type '$type' in line '$textLine' in '$OptionsFile'" >&2
724 exit 1
725 ;;
726 esac
727 recordChameleonOption "$type" "$key" "$value"
728 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/$optionName" \
729 --subst="optionType=$type" \
730 --subst="optionKey=$key" \
731 --subst="optionValue=$value" \
732 AddOption
733 packageRefId=$(getPackageRefId "${packagesidentity}" "${optionName}")
734 buildpackage "$packageRefId" "${optionName}" "${PKG_BUILD_DIR}/${optionName}" "/"
735 addChoice --group="${builtOptionsList}" \
736 --start-selected="$startSelected" \
737 --pkg-refs="$packageRefId" "${optionName}"
738 done
739
740 done < <( find "${OptionalSettingsFolder}" -depth 1 -type f -name '*.txt' -print0 )
741
742# End build options packages
743
744if [[ -n "${CONFIG_KEYLAYOUT_MODULE}" ]];then
745# build Keymaps options packages
746 echo "================= Keymaps Options ================="
747 addGroupChoices --exclusive_zero_or_one_choice "Keymaps"
748 packagesidentity="${chameleon_package_identity}.options.keymaps"
749 keylayoutPackageRefId=""
750 if [[ "${CONFIG_MODULES}" == 'y' && "${CONFIG_KEYLAYOUT_MODULE}" = 'm' ]];then
751 keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout")
752 fi
753
754 chameleon_keylayout_key="KeyLayout"
755 # ------------------------------------------------------
756 # Available Keylayout boot options are discovered by
757 # reading contents of /Keymaps folder after compilation
758 # ------------------------------------------------------
759 availableOptions=($( find "${SRCROOT}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
760 # Adjust array contents to match expected format
761 # for boot options which is: name:key=value
762 for (( i = 0 ; i < ${#availableOptions[@]} ; i++ )); do
763 # Start build of a keymap package module
764 choiceId="${availableOptions[i]}"
765 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
766
767 recordChameleonOption "text" "$chameleon_keylayout_key" "$choiceId"
768 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
769 --subst="optionType=text" \
770 --subst="optionKey=$chameleon_keylayout_key" \
771 --subst="optionValue=$choiceId" \
772 AddOption
773 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
774 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
775 # Add the Keylayout package because the Keylayout module is needed
776 addChoice --group="Keymaps" \
777 --start-selected="check_chameleon_text_option('${chameleon_keylayout_key}','${choiceId}')" \
778 --pkg-refs="$packageRefId $keylayoutPackageRefId" "${choiceId}"
779 done
780
781# End build Keymaps options packages
782fi
783
784# build theme packages
785 echo "================= Themes ================="
786 addGroupChoices "Themes"
787
788 # Using themes section from Azi's/package branch.
789 packagesidentity="${chameleon_package_identity}.themes"
790 artwork="${SRCROOT}/artwork/themes"
791 themes=($( find "${artwork}" -type d -depth 1 -not -name '.svn' ))
792 for (( i = 0 ; i < ${#themes[@]} ; i++ )); do
793 themeName=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )
794 themeDir="$themeName"
795 mkdir -p "${PKG_BUILD_DIR}/${themeName}/Root/"
796 rsync -r --exclude=.svn --exclude="*~" "${themes[$i]}/" "${PKG_BUILD_DIR}/${themeName}/Root/${themeName}"
797 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${themeName}" \
798 --subst="themeName=$themeName" \
799 --subst="themeDir=$themeDir" \
800 InstallTheme
801
802 packageRefId=$(getPackageRefId "${packagesidentity}" "${themeName}")
803 buildpackage "$packageRefId" "${themeName}" "${PKG_BUILD_DIR}/${themeName}" "/Extra/Themes"
804 addChoice --group="Themes" --start-selected="false" --pkg-refs="$packageRefId" "${themeName}"
805 done
806# End build theme packages# End build Extras package
807
808# build pre install package
809 echo "================= Pre ================="
810 packagesidentity="${chameleon_package_identity}"
811 choiceId="Pre"
812
813 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
814 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
815 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources
816 local yamlFile="Resources/chameleon_options.yaml"
817 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
818 --subst="YAML_FILE=${yamlFile}" ${choiceId}
819 generate_options_yaml_file "${PKG_BUILD_DIR}/${choiceId}/Scripts/$yamlFile"
820 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
821# End build pre install package
822
823# build post install package
824 echo "================= Post ================="
825 packagesidentity="${chameleon_package_identity}"
826 choiceId="Post"
827 mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
828 addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" ${choiceId}
829 cp -f ${PKGROOT}/Scripts/Sub/UnMountEFIvolumes.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts
830
831 packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
832 buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
833 addChoice --start-visible="false" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}"
834# End build post install package
835
836}
837
838buildpackage ()
839{
840 # $1 Package Reference Id (ie: org.chameleon.themes.default)
841 # $2 Package Name (ie: Default)
842 # $3 Path to package to build containing Root and/or Scripts
843 # $4 Target install location
844 # $5 Size (optional)
845 if [[ -d "${3}/Root" ]]; then
846 local packageRefId="$1"
847 local packageName="$2"
848 local packagePath="$3"
849 local targetPath="$4"
850 set +u # packageSize is optional
851 local packageSize="$5"
852 set -u
853
854 echo -e "\t[BUILD] ${packageName}"
855
856 find "${packagePath}" -name '.DS_Store' -delete
857 local filecount=$( find "${packagePath}/Root" | wc -l )
858 if [ "${packageSize}" ]; then
859 local installedsize="${packageSize}"
860 else
861 local installedsize=$( du -hkc "${packagePath}/Root" | tail -n1 | awk {'print $1'} )
862 fi
863 local header="<?xml version=\"1.0\"?>\n<pkg-info format-version=\"2\" "
864
865 #[ "${3}" == "relocatable" ] && header+="relocatable=\"true\" "
866
867 header+="identifier=\"${packageRefId}\" "
868 header+="version=\"${CHAMELEON_VERSION}\" "
869
870 [ "${targetPath}" != "relocatable" ] && header+="install-location=\"${targetPath}\" "
871
872 header+="auth=\"root\">\n"
873 header+="\t<payload installKBytes=\"${installedsize##* }\" numberOfFiles=\"${filecount##* }\"/>\n"
874 rm -R -f "${packagePath}/Temp"
875
876 [ -d "${packagePath}/Temp" ] || mkdir -m 777 "${packagePath}/Temp"
877 [ -d "${packagePath}/Root" ] && mkbom "${packagePath}/Root" "${packagePath}/Temp/Bom"
878
879 if [ -d "${packagePath}/Scripts" ]; then
880 header+="\t<scripts>\n"
881 for script in $( find "${packagePath}/Scripts" -type f \( -name 'pre*' -or -name 'post*' \) ); do
882 header+="\t\t<${script##*/} file=\"./${script##*/}\"/>\n"
883 done
884 header+="\t</scripts>\n"
885 # Create the Script archive file (cpio format)
886 (cd "${packagePath}/Scripts" && find . -print | \
887 cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \
888 grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages
889 fi
890
891 header+="</pkg-info>"
892 echo -e "${header}" > "${packagePath}/Temp/PackageInfo"
893
894 # Create the Payload file (cpio format)
895 (cd "${packagePath}/Root" && find . -print | \
896 cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Payload") 2>&1 | \
897 grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages
898
899 # Create the package
900 (cd "${packagePath}/Temp" && xar -c -f "${packagePath}/../${packageName}.pkg" --compression none .)
901
902 # Add the package to the list of build packages
903 pkgrefs[${#pkgrefs[*]}]="\t<pkg-ref id=\"${packageRefId}\" installKBytes='${installedsize}' version='${CHAMELEON_VERSION}.0.0.${CHAMELEON_TIMESTAMP}'>#${packageName}.pkg</pkg-ref>"
904
905 rm -rf "${packagePath}"
906 fi
907}
908
909generateOutlineChoices() {
910 # $1 Main Choice
911 # $2 indent level
912 local idx=$(getChoiceIndex "$1")
913 local indentLevel="$2"
914 local indentString=""
915 for ((level=1; level <= $indentLevel ; level++)); do
916 indentString="\t$indentString"
917 done
918 set +u; subChoices="${choice_group_items[$idx]}"; set -u
919 if [[ -n "${subChoices}" ]]; then
920 # Sub choices exists
921 echo -e "$indentString<line choice=\"$1\">"
922 for subChoice in $subChoices;do
923 generateOutlineChoices $subChoice $(($indentLevel+1))
924 done
925 echo -e "$indentString</line>"
926 else
927 echo -e "$indentString<line choice=\"$1\"/>"
928 fi
929}
930
931generateChoices() {
932 for (( idx=1; idx < ${#choice_key[*]} ; idx++)); do
933 local choiceId=${choice_key[$idx]}
934 local choiceOptions=${choice_options[$idx]}
935 local choiceParentGroupIndex=${choice_parent_group_index[$idx]}
936 set +u; local group_exclusive=${choice_group_exclusive[$choiceParentGroupIndex]}; set -u
937
938 # Create the node and standard attributes
939 local choiceNode="\t<choice\n\t\tid=\"${choiceId}\"\n\t\ttitle=\"${choiceId}_title\"\n\t\tdescription=\"${choiceId}_description\""
940
941 # Add options like start_selected, etc...
942 [[ -n "${choiceOptions}" ]] && choiceNode="${choiceNode}\n\t\t${choiceOptions}"
943
944 # Add the selected attribute if options are mutually exclusive
945 if [[ -n "$group_exclusive" ]];then
946 local group_items="${choice_group_items[$choiceParentGroupIndex]}"
947 case $group_exclusive in
948 exclusive_one_choice)
949 local selected_option=$(exclusive_one_choice "$choiceId" "$group_items") ;;
950 exclusive_zero_or_one_choice)
951 local selected_option=$(exclusive_zero_or_one_choice "$choiceId" "$group_items") ;;
952 *) echo "Error: unknown function to generate exclusive mode '$group_exclusive' for group '${choice_key[$choiceParentGroupIndex]}'" >&2
953 exit 1
954 ;;
955 esac
956 choiceNode="${choiceNode}\n\t\tselected=\"$selected_option\""
957 fi
958
959 choiceNode="${choiceNode}>"
960
961 # Add the package references
962 for pkgRefId in ${choice_pkgrefs[$idx]};do
963 choiceNode="${choiceNode}\n\t\t<pkg-ref id=\"${pkgRefId}\"/>"
964 done
965
966 # Close the node
967 choiceNode="${choiceNode}\n\t</choice>\n"
968
969 echo -e "$choiceNode"
970 done
971}
972
973makedistribution ()
974{
975 declare -r distributionDestDir="${SYMROOT}"
976 declare -r distributionFilename="${packagename// /}-${CHAMELEON_VERSION}-r${CHAMELEON_REVISION}.pkg"
977 declare -r distributionFilePath="${distributionDestDir}/${distributionFilename}"
978
979 rm -f "${distributionDestDir}/${packagename// /}"*.pkg
980
981 mkdir -p "${PKG_BUILD_DIR}/${packagename}"
982
983 find "${PKG_BUILD_DIR}" -type f -name '*.pkg' -depth 1 | while read component
984 do
985 pkg="${component##*/}" # ie: EFI.pkg
986 pkgdir="${PKG_BUILD_DIR}/${packagename}/${pkg}"
987 # expand individual packages
988 pkgutil --expand "${PKG_BUILD_DIR}/${pkg}" "$pkgdir"
989 rm -f "${PKG_BUILD_DIR}/${pkg}"
990 done
991
992# Create the Distribution file
993 ditto --noextattr --noqtn "${PKGROOT}/Distribution" "${PKG_BUILD_DIR}/${packagename}/Distribution"
994
995 local start_indent_level=2
996 echo -e "\n\t<choices-outline>" >> "${PKG_BUILD_DIR}/${packagename}/Distribution"
997 for main_choice in ${choice_group_items[0]};do
998 generateOutlineChoices $main_choice $start_indent_level >> "${PKG_BUILD_DIR}/${packagename}/Distribution"
999 done
1000 echo -e "\t</choices-outline>\n" >> "${PKG_BUILD_DIR}/${packagename}/Distribution"
1001
1002 generateChoices >> "${PKG_BUILD_DIR}/${packagename}/Distribution"
1003
1004 for (( i=0; i < ${#pkgrefs[*]} ; i++)); do
1005 echo -e "${pkgrefs[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution"
1006 done
1007
1008 echo -e "\n</installer-gui-script>" >> "${PKG_BUILD_DIR}/${packagename}/Distribution"
1009
1010# Create the Resources directory
1011 ditto --noextattr --noqtn "${PKGROOT}/Resources/distribution" "${PKG_BUILD_DIR}/${packagename}/Resources"
1012
1013# Make the translation
1014 echo ""
1015 echo "========= Translating Resources ========"
1016 (cd "${PKGROOT}" && PERLLIB=${PKGROOT}/bin/po4a/lib \
1017 bin/po4a/po4a \
1018 --package-name 'Chameleon' \
1019 --package-version "${CHAMELEON_VERSION}-r${CHAMELEON_REVISION}" \
1020 --msgmerge-opt '--lang=$lang' \
1021 --variable PODIR="po" \
1022 --variable TEMPLATES_DIR="Resources/templates" \
1023 --variable OUTPUT_DIR="${PKG_BUILD_DIR}/${packagename}/Resources" \
1024 ${PKGROOT}/po4a-chameleon.cfg)
1025
1026 # Copy common files in english localisation directory
1027 ditto --noextattr --noqtn "${PKGROOT}/Resources/common" "${PKG_BUILD_DIR}/${packagename}/Resources/en.lproj"
1028
1029 # CleanUp the directory
1030 find "${PKG_BUILD_DIR}/${packagename}" \( -type d -name '.svn' \) -o -name '.DS_Store' -depth -exec rm -rf {} \;
1031 find "${PKG_BUILD_DIR}/${packagename}" -type d -depth -empty -exec rmdir {} \; # Remove empty directories
1032
1033 # Make substitutions for version, revision, stage, developers, credits, etc..
1034 makeSubstitutions $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
1035
1036# Create the final package
1037 pkgutil --flatten "${PKG_BUILD_DIR}/${packagename}" "${distributionFilePath}"
1038
1039# Here is the place to assign an icon to the pkg
1040 ditto -xk "${PKGROOT}/Icons/pkg.zip" "${PKG_BUILD_DIR}/Icons/"
1041 DeRez -only icns "${PKG_BUILD_DIR}/Icons/Icons/pkg.icns" > "${PKG_BUILD_DIR}/Icons/tempicns.rsrc"
1042 Rez -append "${PKG_BUILD_DIR}/Icons/tempicns.rsrc" -o "${distributionFilePath}"
1043 SetFile -a C "${distributionFilePath}"
1044 rm -rf "${PKG_BUILD_DIR}/Icons"
1045
1046# End
1047
1048 md5=$( md5 "${distributionFilePath}" | awk {'print $4'} )
1049 echo "MD5 (${distributionFilePath}) = ${md5}" > "${distributionFilePath}.md5"
1050 echo ""
1051
1052 echo -e $COL_GREEN" --------------------------"$COL_RESET
1053 echo -e $COL_GREEN" Building process complete!"$COL_RESET
1054 echo -e $COL_GREEN" --------------------------"$COL_RESET
1055 echo ""
1056 echo -e $COL_GREEN" Build info."
1057 echo -e $COL_GREEN" ==========="
1058 echo -e $COL_BLUE" Package name: "$COL_RESET"${distributionFilename}"
1059 echo -e $COL_BLUE" MD5: "$COL_RESET"$md5"
1060 echo -e $COL_BLUE" Version: "$COL_RESET"$CHAMELEON_VERSION"
1061 echo -e $COL_BLUE" Stage: "$COL_RESET"$CHAMELEON_STAGE"
1062 echo -e $COL_BLUE" Date/Time: "$COL_RESET"$CHAMELEON_BUILDDATE"
1063 echo -e $COL_BLUE" Built by: "$COL_RESET"$CHAMELEON_WHOBUILD"
1064 echo -e $COL_BLUE" Copyright $CHAMELEON_CPRYEAR ""$COL_RESET"
1065 echo ""
1066
1067}
1068
1069# build packages
1070main
1071
1072# build meta package
1073makedistribution
1074

Archive Download this file

Revision: 2028