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

Archive Download this file

Revision: 1592