Chameleon

Chameleon Svn Source Tree

Root/branches/blackosx/package/buildpkg.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3# $1 Path to store built package
4
5packagesidentity="org.chameleon"
6
7packagename="Chameleon"
8
9pkgroot="${0%/*}"
10
11# blackosx to use /usr/local as a place for temporary files
12# taken from http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard#cite_note-27
13chamTemp="usr/local/chamTemp"
14
15COL_BLACK="\x1b[30;01m"
16COL_RED="\x1b[31;01m"
17COL_GREEN="\x1b[32;01m"
18COL_YELLOW="\x1b[33;01m"
19COL_MAGENTA="\x1b[35;01m"
20COL_CYAN="\x1b[36;01m"
21COL_WHITE="\x1b[37;01m"
22COL_BLUE="\x1b[34;01m"
23COL_RESET="\x1b[39;49;00m"
24
25#version=$( grep I386BOOT_CHAMELEONVERSION vers.h | awk '{ print $3 }' | tr -d '\"' )
26version=$( cat version )
27stage=${version##*-}
28revision=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' )
29builddate=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' )
30timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" )
31
32# =================
33
34develop=$(awk "NR==6{print;exit}" ${pkgroot}/../CREDITS)
35credits=$(awk "NR==10{print;exit}" ${pkgroot}/../CREDITS)
36pkgdev=$(awk "NR==14{print;exit}" ${pkgroot}/../CREDITS)
37# =================
38
39distributioncount=0
40xmlindent=0
41
42indent[0]="\t"
43indent[1]="\t\t"
44indent[2]="\t\t\t"
45indent[3]="\t\t\t\t"
46
47main ()
48{
49
50# clean up the destination path
51
52rm -R -f "${1}"
53echo ""
54echo -e $COL_CYAN"----------------------------------"$COL_RESET
55echo -e $COL_CYAN"Building $packagename Install Package"$COL_RESET
56echo -e $COL_CYAN"----------------------------------"$COL_RESET
57echo ""
58
59outline[$((outlinecount++))]="${indent[$xmlindent]}<choices-outline>"
60
61# build core package
62echo "================= Core ================="
63((xmlindent++))
64packagesidentity="org.chameleon.core"
65mkdir -p ${1}/Core/Root/usr/local/bin
66mkdir -p ${1}/Core/Root/usr/standalone/i386
67ditto --noextattr --noqtn ${1%/*}/i386/boot ${1}/Core/Root/usr/standalone/i386
68ditto --noextattr --noqtn ${1%/*}/i386/boot0 ${1}/Core/Root/usr/standalone/i386
69ditto --noextattr --noqtn ${1%/*}/i386/boot0md ${1}/Core/Root/usr/standalone/i386
70ditto --noextattr --noqtn ${1%/*}/i386/boot1f32 ${1}/Core/Root/usr/standalone/i386
71ditto --noextattr --noqtn ${1%/*}/i386/boot1h ${1}/Core/Root/usr/standalone/i386
72ditto --noextattr --noqtn ${1%/*}/i386/boot1he ${1}/Core/Root/usr/standalone/i386
73ditto --noextattr --noqtn ${1%/*}/i386/boot1hp ${1}/Core/Root/usr/standalone/i386
74ditto --noextattr --noqtn ${1%/*}/i386/cdboot ${1}/Core/Root/usr/standalone/i386
75ditto --noextattr --noqtn ${1%/*}/i386/chain0 ${1}/Core/Root/usr/standalone/i386
76ditto --noextattr --noqtn ${1%/*}/i386/fdisk440 ${1}/Core/Root/usr/local/bin
77ditto --noextattr --noqtn ${1%/*}/i386/bdmesg ${1}/Core/Root/usr/local/bin
78local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )
79echo "[BUILD] i386 "
80buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
81
82# build Chameleon package
83echo "================= Chameleon ================="
84outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Chameleon\">"
85choices[$((choicescount++))]="<choice\n\tid=\"Chameleon\"\n\ttitle=\"Chameleon_title\"\n\tdescription=\"Chameleon_description\"\n>\n</choice>\n"
86
87# build standard package
88mkdir -p ${1}/Standard/Root
89mkdir -p ${1}/Standard/Scripts/Resources
90cp -f ${pkgroot}/Scripts/Main/Standard/* ${1}/Standard/Scripts
91cp -f ${pkgroot}/Scripts/Sub/* ${1}/Standard/Scripts
92ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Resources/SetFile
93ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Standard/Scripts/Resources/revision
94ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Standard/Scripts/Resources/version
95echo "[BUILD] Standard "
96 buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EFI']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
97# End build standard package
98
99# build efi package
100mkdir -p ${1}/EFI/Root
101mkdir -p ${1}/EFI/Scripts/Resources
102cp -f ${pkgroot}/Scripts/Main/EFI/* ${1}/EFI/Scripts
103cp -f ${pkgroot}/Scripts/Sub/* ${1}/EFI/Scripts
104ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Resources/SetFile
105ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/EFI/Scripts/Resources/revision
106ditto --noextattr --noqtn ${1%/*/*}/version ${1}/EFI/Scripts/Resources/version
107echo "[BUILD] EFI "
108buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
109# End build efi package
110
111# build reset choice package
112mkdir -p ${1}/noboot/Root
113echo "[BUILD] Reset choice "
114buildpackage "${1}/noboot" "/$chamTemp" "" "start_visible=\"true\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['EFI'])\"" >/dev/null 2>&1
115# End build reset choice package
116
117# build Modules package
118 echo "================= Modules ================="
119 ###############################
120 # Supported Modules #
121 ###############################
122 # klibc.dylib #
123 # Resolution.dylib #
124 # uClibcxx.dylib #
125 # Keylayout.dylib #
126 ###############################
127 if [ "$(ls -A "${1%/*}/i386/modules")" ]; then
128 {
129 outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Module\">"
130 choices[$((choicescount++))]="<choice\n\tid=\"Module\"\n\ttitle=\"Module_title\"\n\tdescription=\"Module_description\"\n>\n</choice>\n"
131 ((xmlindent++))
132 packagesidentity="org.chameleon.modules"
133# -
134 if [ -e ${1%/*}/i386/modules/klibc.dylib ]; then
135 {
136 mkdir -p ${1}/klibc/Root
137 ditto --noextattr --noqtn ${1%/*}/i386/modules/klibc.dylib ${1}/klibc/Root
138 echo "[BUILD] klibc "
139 buildpackage "${1}/klibc" "/$chamTemp/Extra/modules" "" "start_selected=\"true\"" >/dev/null 2>&1
140 }
141 fi
142# -
143 if [ -e ${1%/*}/i386/modules/Resolution.dylib ]; then
144 {
145 mkdir -p ${1}/AutoReso/Root
146 ditto --noextattr --noqtn ${1%/*}/i386/modules/Resolution.dylib ${1}/AutoReso/Root
147 echo "[BUILD] Resolution "
148 buildpackage "${1}/AutoReso" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
149 }
150 fi
151# -
152 if [ -e ${1%/*}/i386/modules/uClibcxx.dylib ]; then
153 {
154 mkdir -p ${1}/uClibc/Root
155 ditto --noextattr --noqtn ${1%/*}/i386/modules/uClibcxx.dylib ${1}/uClibc/Root
156 ditto --noextattr --noqtn ${1%/*}/i386/modules/klibc.dylib ${1}/uClibc/Root
157 echo "[BUILD] uClibc++ "
158 buildpackage "${1}/uClibc" "/$chamTemp/Extra/modules" "" "start_selected=\"true\"" >/dev/null 2>&1
159 }
160 fi
161# -
162 if [ -e ${1%/*}/i386/modules/Keylayout.dylib ]; then
163 {
164 mkdir -p ${1}/Keylayout/Root
165 ditto --noextattr --noqtn ${1%/*}/i386/modules/Keylayout.dylib ${1}/Keylayout/Root
166 echo "[BUILD] Keylayout "
167 buildpackage "${1}/Keylayout" "/$chamTemp/Extra/modules" "" "start_selected=\"true\"" >/dev/null 2>&1
168 }
169 fi
170
171 ((xmlindent--))
172 outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
173 }
174 else
175 {
176 echo " -= no modules to include =-"
177 }
178 fi
179# End build Modules packages
180 ((xmlindent--))
181 outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
182# End build Chameleon package
183
184# build Extras package
185# build options packages
186
187outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Options\">"
188choices[$((choicescount++))]="<choice\n\tid=\"Options\"\n\ttitle=\"Options_title\"\n\tdescription=\"Options_description\"\n>\n</choice>\n"
189((xmlindent++))
190
191# ------------------------------------------------------
192# parse BootOptions folder to find files of boot options.
193# ------------------------------------------------------
194bootOptionsFolder="${pkgroot}/BootOptions"
195bootOptionFiles=($( find "${bootOptionsFolder}" -depth 1 -not -name '.svn' ))
196
197for (( i = 0 ; i < ${#bootOptionFiles[@]} ; i++ ))
198do
199
200# Take filename and Strip .txt from end and path from front
201builtOptionsList=$( echo ${bootOptionFiles[$i]%.txt} )
202builtOptionsList=$( echo ${builtOptionsList##*/} )
203echo "================= $builtOptionsList ================="
204outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"${builtOptionsList}\">"
205choices[$((choicescount++))]="<choice\n\tid=\"${builtOptionsList}\"\n\ttitle=\"${builtOptionsList}_title\"\n\tdescription=\"${builtOptionsList}_description\"\n>\n</choice>\n"
206((xmlindent++))
207packagesidentity="org.chameleon.options.$builtOptionsList"
208
209# ------------------------------------------------------
210# Read boot option file in to an array.
211# ------------------------------------------------------
212availableOptions=() # array to hold the list of boot options, per 'section'.
213exclusiveFlag=0 # used to indicate list has exclusive options.
214exclusiveName="" # will be appended to exclusive 'none' option name.
215count=0 # used as index for stepping through array.
216while read textLine
217do
218# ignore lines in the file beginning with a # and Exclusive=False
219if [[ ${textLine} != \#* ]] && [[ ${textLine} != "Exclusive=False" ]];then
220# check for 'Exclusive=True' option in file
221if [[ ${textLine} == "Exclusive=True" ]];then
222exclusiveFlag=1
223exclusiveName=$builtOptionsList
224else
225availableOptions[count]=$textLine
226((count++))
227fi
228fi
229done < ${bootOptionFiles[$i]}
230buildbootoptions "$1" "${exclusiveFlag}" "${exclusiveName}"
231
232((xmlindent--))
233outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
234done
235
236# build KeyLayout options packages
237echo "================= Keymaps Options ================="
238outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"KeyLayout\">"
239choices[$((choicescount++))]="<choice\n\tid=\"KeyLayout\"\n\ttitle=\"KeyLayout_title\"\n\tdescription=\"KeyLayout_description\"\n>\n</choice>\n"
240((xmlindent++))
241packagesidentity="org.chameleon.options.keylayout"
242
243# ------------------------------------------------------
244# Available Keylayout boot options are discovered by
245# reading contents of /Keymaps folder after compilation
246# ------------------------------------------------------
247availableOptions=()
248availableOptions=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
249# add "KeyLayout=" infront of each string
250for (( i = 0 ; i < ${#availableOptions[@]} ; i++ ))
251do
252availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]}
253done
254
255# call buildbootoptions with 1 to indicate exclusive option wanted.
256buildbootoptions "$1" "1" "keylayout"
257
258((xmlindent--))
259outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
260
261# End build KeyLayout options packages
262
263((xmlindent--))
264outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
265
266# End build options packages
267
268# build theme packages
269echo "================= Themes ================="
270outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Themes\">"
271choices[$((choicescount++))]="<choice\n\tid=\"Themes\"\n\ttitle=\"Themes_title\"\n\tdescription=\"Themes_description\"\n>\n</choice>\n"
272((xmlindent++))
273
274# Using themes section from Azi's/package branch.
275packagesidentity="org.chameleon.themes"
276artwork="${1%/sym/package}/artwork/themes"
277themes=($( find "${artwork}" -type d -depth 1 -not -name '.svn' ))
278for (( i = 0 ; i < ${#themes[@]} ; i++ ))
279do
280theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )
281mkdir -p "${1}/${theme}/Root/"
282rsync -r --exclude=.svn "${themes[$i]}/" "${1}/${theme}/Root/${theme}"
283echo "[BUILD] ${theme}"
284buildpackage "${1}/${theme}" "/$chamTemp/Extra/Themes" "" "start_selected=\"false\"" >/dev/null 2>&1
285done
286
287((xmlindent--))
288outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
289# End build theme packages
290# End build Extras package
291
292# build post install package
293echo "================= Post ================="
294mkdir -p ${1}/Post/Root
295mkdir -p ${1}/Post/Scripts
296cp -f ${pkgroot}/Scripts/Main/Post/* ${1}/Post/Scripts
297cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/Post/Scripts
298echo "[BUILD] Post "
299buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
300outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>"
301
302# build meta package
303
304makedistribution "${1}" "${2}" "${3}" "${4}" "${5}"
305
306# clean up
307
308#rm -R -f "${1}"
309
310}
311
312fixperms ()
313{
314# $1 path
315find "${1}" -type f -exec chmod 644 {} \;
316find "${1}" -type d -exec chmod 755 {} \;
317chown -R 0:0 "${1}"
318}
319
320buildbootoptions()
321{
322# $1 Path to package to build containing Root and or Scripts
323# $2 = exclusiveFlag
324# S3 = exclusiveName
325
326# ------------------------------------------------------
327# if exclusiveFlag=1 then re-build array
328# adding extra boot option at beginning to give
329
330# ------------------------------------------------------
331if [ ${2} = "1" ]; then
332tempArray=("${availableOptions[@]}")
333availableOptions=()
334availableOptions[0]="ChooseNone-"$3":DONT=ADD"
335position=0
336totalItems="${#tempArray[@]}"
337for (( position = 0 ; position < $totalItems ; position++ ))
338do
339availableOptions[$position+1]=${tempArray[${position}]}
340done
341fi
342
343# ------------------------------------------------------
344# Loop through options in array and process each in turn
345# ------------------------------------------------------
346for (( c = 0 ; c < ${#availableOptions[@]} ; c++ ))
347do
348textLine=${availableOptions[c]}
349# split line - taking all before ':' as option name
350# and all after ':' as key/value
351optionName=${textLine%:*}
352keyValue=${textLine##*:}
353
354# create folders required for each boot option
355mkdir -p "${1}/$optionName/Root/"
356
357# create dummy file with name of key/value
358echo "" > "${1}/$optionName/Root/${keyValue}"
359
360echo "[BUILD] ${optionName} "
361
362# ------------------------------------------------------
363# Before calling buildpackage, add exclusive options
364# to buildpackage call if requested.
365# ------------------------------------------------------
366if [ $2 = "1" ]; then
367
368# Prepare individual string parts
369stringStart="selected=\""
370stringBefore="exclusive(choices['"
371stringAfter="']) &amp;&amp; "
372stringEnd="'])\""
373x=${stringStart}${stringBefore}
374
375# build string for sending to buildpackage
376totalItems="${#availableOptions[@]}"
377lastItem=$((totalItems-1))
378
379for (( r = 0 ; r < ${totalItems} ; r++ ))
380do
381textLineTemp=${availableOptions[r]}
382optionNameTemp=${textLineTemp%:*}
383if [ "${optionNameTemp}" != "${optionName}" ]; then
384 x="${x}${optionNameTemp}"
385 # Only add these to end of string up to the one before the last item
386if [ $r -lt $lastItem ]; then
387x="${x}${stringAfter}${stringBefore}"
388fi
389fi
390done
391x="${x}${stringEnd}"
392buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\" ${x}" >/dev/null 2>&1
393else
394buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
395fi
396done
397}
398
399buildpackage ()
400{
401# $1 Path to package to build containing Root and or Scripts
402# $2 Install Location
403# $3 Size
404# $4 Options
405
406if [ -d "${1}/Root" ] && [ "${1}/Scripts" ]; then
407
408local packagename="${1##*/}"
409local identifier=$( echo ${packagesidentity}.${packagename//_/.} | tr [:upper:] [:lower:] )
410find "${1}" -name '.DS_Store' -delete
411local filecount=$( find "${1}/Root" | wc -l )
412if [ "${3}" ]; then
413local installedsize="${3}"
414else
415local installedsize=$( du -hkc "${1}/Root" | tail -n1 | awk {'print $1'} )
416fi
417local header="<?xml version=\"1.0\"?>\n<pkg-info format-version=\"2\" "
418
419#[ "${3}" == "relocatable" ] && header+="relocatable=\"true\" "
420
421header+="identifier=\"${identifier}\" "
422header+="version=\"${version}\" "
423
424[ "${2}" != "relocatable" ] && header+="install-location=\"${2}\" "
425
426header+="auth=\"root\">\n"
427header+="\t<payload installKBytes=\"${installedsize##* }\" numberOfFiles=\"${filecount##* }\"/>\n"
428#rm -R -f "${1}/Temp"
429
430[ -d "${1}/Temp" ] || mkdir -m 777 "${1}/Temp"
431[ -d "${1}/Root" ] && mkbom "${1}/Root" "${1}/Temp/Bom"
432
433if [ -d "${1}/Scripts" ]; then
434header+="\t<scripts>\n"
435for script in $( find "${1}/Scripts" -type f \( -name 'pre*' -or -name 'post*' \) )
436do
437header+="\t\t<${script##*/} file=\"./${script##*/}\"/>\n"
438done
439header+="\t</scripts>\n"
440chown -R 0:0 "${1}/Scripts"
441pushd "${1}/Scripts" >/dev/null
442find . -print | cpio -o -z -H cpio > "../Temp/Scripts"
443popd >/dev/null
444fi
445
446header+="</pkg-info>"
447echo -e "${header}" >> ~/Desktop/header
448echo -e "${header}" > "${1}/Temp/PackageInfo"
449pushd "${1}/Root" >/dev/null
450find . -print | cpio -o -z -H cpio > "../Temp/Payload"
451popd >/dev/null
452pushd "${1}/Temp" >/dev/null
453
454xar -c -f "${1%/*}/${packagename// /}.pkg" --compression none .
455
456popd >/dev/null
457
458outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"${packagename// /}\"/>"
459
460if [ "${4}" ]; then
461local choiceoptions="${indent[$xmlindent]}${4}\n"
462fi
463choices[$((choicescount++))]="<choice\n\tid=\"${packagename// /}\"\n\ttitle=\"${packagename}_title\"\n\tdescription=\"${packagename}_description\"\n${choiceoptions}>\n\t<pkg-ref id=\"${identifier}\" installKBytes='${installedsize}' version='${version}.0.0.${timestamp}' auth='root'>#${packagename// /}.pkg</pkg-ref>\n</choice>\n"
464
465#rm -R -f "${1}"
466fi
467}
468
469makedistribution ()
470{
471rm -f "${1%/*}/${packagename// /}"*.pkg
472
473find "${1}" -type f -name '*.pkg' -depth 1 | while read component
474do
475mkdir -p "${1}/${packagename}/${component##*/}"
476pushd "${1}/${packagename}/${component##*/}" >/dev/null
477xar -x -f "${1%}/${component##*/}"
478popd >/dev/null
479done
480
481ditto --noextattr --noqtn "${pkgroot}/Distribution" "${1}/${packagename}/Distribution"
482ditto --noextattr --noqtn "${pkgroot}/Resources" "${1}/${packagename}/Resources"
483
484find "${1}/${packagename}/Resources" -type d -name '.svn' -exec rm -R -f {} \; 2>/dev/null
485
486for (( i=0; i < ${#outline[*]} ; i++));
487do
488echo -e "${outline[$i]}" >> "${1}/${packagename}/Distribution"
489done
490
491for (( i=0; i < ${#choices[*]} ; i++));
492do
493echo -e "${choices[$i]}" >> "${1}/${packagename}/Distribution"
494done
495
496echo "</installer-gui-script>" >> "${1}/${packagename}/Distribution"
497
498perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" `find "${1}/${packagename}/Resources" -type f`
499perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" `find "${1}/${packagename}/Resources" -type f`
500
501# Adding Developer and credits
502perl -i -p -e "s/%DEVELOP%/${develop}/g" `find "${1}/${packagename}/Resources" -type f`
503perl -i -p -e "s/%CREDITS%/${credits}/g" `find "${1}/${packagename}/Resources" -type f`
504perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" `find "${1}/${packagename}/Resources" -type f`
505
506stage=${stage/RC/Release Candidate }
507stage=${stage/FINAL/2.0 Final}
508perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" `find "${1}/${packagename}/Resources" -type f`
509
510find "${1}/${packagename}" -name '.DS_Store' -delete
511pushd "${1}/${packagename}" >/dev/null
512xar -c -f "${1%/*}/${packagename// /}-${version}-r${revision}.pkg" --compression none .
513popd >/dev/null
514
515# Here is the place for assign a Icon to the pkg
516# command use to generate the file:
517# ditto -c -k --sequesterRsrc --keepParent Icon.icns Icon.zip
518# ----
519# ditto -xk "${pkgroot}/Icons/pkg.zip" "${pkgroot}/Icons/"
520# DeRez -only icns "${pkgroot}/Icons/Icons/pkg.icns" > tempicns.rsrc
521# Rez -append tempicns.rsrc -o "${1%/*}/$packagename-${version}-r$revision.pkg"
522# SetFile -a C "${1%/*}/$packagename-${version}-r$revision.pkg"
523# rm -f tempicns.rsrc
524# rm -rf "${pkgroot}/Icons/Icons"
525# End
526
527md5=$( md5 "${1%/*}/${packagename// /}-${version}-r${revision}.pkg" | awk {'print $4'} )
528echo "MD5 (${packagename// /}-${version}-r${revision}.pkg) = ${md5}" > "${1%/*}/${packagename// /}-${version}-r${revision}.pkg.md5"
529echo ""
530
531echo -e $COL_GREEN"--------------------------"$COL_RESET
532echo -e $COL_GREEN"Building process complete!"$COL_RESET
533echo -e $COL_GREEN"--------------------------"$COL_RESET
534echo ""
535echo -e $COL_GREEN"Build info."
536echo -e $COL_GREEN"==========="
537echo -e $COL_BLUE"Package name:"$COL_RESET"$packagename-${version}-r$revision.pkg"
538echo -e $COL_BLUE"MD5:"$COL_RESET"$md5"
539echo -e $COL_BLUE"Version:"$COL_RESET"$version"
540echo -e $COL_BLUE"Stage:"$COL_RESET"$stage"
541echo -e $COL_BLUE"Date/Time:"$COL_RESET"$builddate"
542echo ""
543
544}
545
546main "${1}" "${2}" "${3}" "${4}" "${5}"
547
548

Archive Download this file

Revision: 1585