4 # The first argument is the shell script that initializes the variables:
5 # addBuildCompatibilityLibDir
24 echo "$0: Missing parameters!" >&2
37 # this adds the build library dir to LD_LIBRARY_PATH
38 eval "$addBuildCompatibilityLibDir"
41 # make a clean contents dir
42 packageName
=`basename "$packagePath"`
43 echo "$packageName: Removing and re-creating package contents dir ..."
44 contentsDir
="$tmpDir/contents"
45 $rmAttrs -rf "$contentsDir"
46 mkdir
-p "$contentsDir"
49 # map the shell commands
51 tPrefix
="$contentsDir/"
64 # extractFile <archive> <directory> <extractedSubDir>
69 extractDir
=$tmpDir/extract
70 $rmAttrs -rf "$extractDir"
71 mkdir
-p "$extractDir"
73 case "$archiveFile" in
75 $unzip -q -d "$extractDir" "$archiveFile"
78 tar -C "$extractDir" -xf "$archiveFile"
81 if [ -n "$extractedSubDir" ]; then
82 $package extract
-C "$extractDir" "$archiveFile" \
85 $package extract
-C "$extractDir" "$archiveFile"
89 echo "Unhandled archive extension in build_haiku_image" \
95 $cp -r "${sPrefix}$extractDir/$extractedSubDir/." \
96 "${tPrefix}$targetExtractedDir"
98 $rmAttrs -rf "$extractDir"
102 # execute the scripts preparing the package contents
103 echo "$packageName: Collecting package contents ..."
104 while [ $# -gt 0 ]; do
110 # mimeset the whole package content
111 echo "$packageName: mimeset'ing package contents ..."
112 $mimeset --mimedb "$mimeDB" "$contentsDir"
116 if [ ! $updateOnly ]; then
117 echo "$packageName: Creating the package ..."
119 $package create
-q "-$compressionLevel" -i "$packageInfoPath" \
120 -C "$contentsDir" "$packagePath"
122 echo "$packageName: Updating the package ..."
123 $package add
-q -f "-$compressionLevel" -i "$packageInfoPath" \
124 -C "$contentsDir" "$packagePath" .