2006-07-27 10:20:28 -04:00
|
|
|
#!/bin/bash -O extglob
|
2006-07-26 03:48:06 -04:00
|
|
|
|
2006-07-27 10:20:28 -04:00
|
|
|
BUILD="yes"
|
|
|
|
EDIT="no"
|
|
|
|
|
|
|
|
until [ -z "$1" ]; do
|
|
|
|
case $1 in
|
|
|
|
--no-build|-n)
|
|
|
|
BUILD="no"
|
|
|
|
;;
|
|
|
|
|
|
|
|
--edit|-e)
|
|
|
|
EDIT="yes"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
|
|
|
|
if [ "$#" = "0" ]; then
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$BUILD" = "yes" ]; then
|
2006-07-26 03:48:06 -04:00
|
|
|
# any argument leaves the server folder as-is
|
2006-07-27 10:20:28 -04:00
|
|
|
echo "** BUILDING SERVER FOLDER **"
|
|
|
|
|
2006-07-26 03:48:06 -04:00
|
|
|
AR="Firefly Helper/Server/admin-root"
|
|
|
|
|
|
|
|
|
2006-07-27 10:20:28 -04:00
|
|
|
rm -rf "Firefly Helper/Server/plugins"
|
|
|
|
rm -rf "Firefly Helper/Server/admin-root"
|
2006-07-26 03:48:06 -04:00
|
|
|
|
2006-07-27 10:20:28 -04:00
|
|
|
mkdir -p "Firefly Helper/Server/plugins"
|
|
|
|
mkdir -p "${AR}"
|
|
|
|
mkdir -p "${AR}/lib-js"
|
|
|
|
mkdir -p "${AR}/lib-js/script.aculo.us"
|
|
|
|
|
|
|
|
cp ../.build/ppc/mt-daapd "Firefly Helper/Server/firefly"
|
|
|
|
cp ../.build/ppc/*so "Firefly Helper/Server/Plugins"
|
|
|
|
cp ../.build/ppc/wavstreamer "Firefly Helper/Server"
|
|
|
|
cp ../.build/ppc/alac "Firefly Helper/Server"
|
|
|
|
cp ../admin-root/*.+(html|xml|txt|jar|gif|js|png|jpg) "${AR}"
|
2006-07-26 03:48:06 -04:00
|
|
|
cp ../admin-root/CREDITS "${AR}"
|
|
|
|
cp ../admin-root/lib-js/*js "${AR}/lib-js"
|
2006-07-27 10:20:28 -04:00
|
|
|
cp ../admin-root/lib-js/script.aculo.us/*js "${AR}/lib-js/script.aculo.us"
|
2006-07-26 03:48:06 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
pushd "Firefly Helper"
|
|
|
|
xcodebuild
|
|
|
|
if [ "$?" -ne "0" ]; then
|
|
|
|
echo "Could not build Firefly Helper Project"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
popd
|
|
|
|
rm -rf "FireflyPrefs/Firefly Helper.app"
|
|
|
|
mv "Firefly Helper/build/Release/Firefly Helper.app" FireflyPrefs
|
|
|
|
|
|
|
|
pushd "FireflyPrefs"
|
|
|
|
xcodebuild
|
|
|
|
if [ "$?" -ne "0" ]; then
|
|
|
|
echo "Could not build FireflyPrefs panel"
|
|
|
|
exit 2
|
|
|
|
fi
|
2006-07-27 10:20:28 -04:00
|
|
|
popd
|
2006-07-26 03:48:06 -04:00
|
|
|
|
|
|
|
# Now, build the image
|
|
|
|
|
2006-07-27 10:20:28 -04:00
|
|
|
rm -rf staging
|
|
|
|
rm -f tmp.dmg
|
|
|
|
|
|
|
|
STAGING_DIR="staging"
|
|
|
|
|
|
|
|
if [ "$EDIT" = "yes" ]; then
|
|
|
|
# build the image and stage directly to it
|
|
|
|
if [ -x "/Volumes/Install Firefly" ]; then
|
|
|
|
echo "You'll want to unmount the volume you have mounted first."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
hdiutil create -fs HFS+ -volname "Install Firefly" -size 10m tmp.dmg
|
|
|
|
hdiutil attach tmp.dmg -readwrite
|
|
|
|
|
|
|
|
if [ -x "/Volumes/Install Firefly" ]; then
|
|
|
|
STAGING_DIR="/Volumes/Install Firefly"
|
|
|
|
else
|
|
|
|
echo "Can't seem to make or attach tmp.dmg... Sorry..."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$STAGING_DIR"
|
|
|
|
|
|
|
|
cp Install/root_DS_Store "$STAGING_DIR/.DS_Store"
|
|
|
|
cp Install/_VolumeIcon.icns "$STAGING_DIR/.VolumeIcon.icns"
|
|
|
|
mkdir "$STAGING_DIR/.background"
|
|
|
|
cp Install/background.png "$STAGING_DIR/.background/background.png"
|
|
|
|
cp Install/_background_DS_Store "$STAGING_DIR/.background/.DS_Store"
|
2006-07-26 03:48:06 -04:00
|
|
|
|
|
|
|
if [ ! -x FireflyPrefs/build/Release/Firefly.prefPane ]; then
|
|
|
|
echo "Wait... I can't find the pref pane"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2006-07-27 10:20:28 -04:00
|
|
|
mv FireflyPrefs/build/Release/Firefly.prefPane "$STAGING_DIR"
|
|
|
|
|
|
|
|
osacompile -o "Uninstall Firefly.app" "Uninstall Firefly.applescript"
|
|
|
|
|
|
|
|
mv "Uninstall Firefly.app" "$STAGING_DIR"
|
|
|
|
cp -r "Install/Read Me First!.rtfd" "$STAGING_DIR"
|
|
|
|
/Developer/Tools/SetFile -a E "$STAGING_DIR/Read Me First!.rtfd"
|
|
|
|
/Developer/Tools/SetFile -a C "$STAGING_DIR"
|
|
|
|
|
|
|
|
if [ "$EDIT" = "no" ]; then
|
|
|
|
hdiutil makehybrid -hfs -hfs-volume-name "Install Firefly" -hfs-openfolder staging staging -o tmp.dmg
|
|
|
|
rm -f Firefly.dmg
|
|
|
|
rm -rf staging
|
|
|
|
hdiutil convert -format UDZO tmp.dmg -o Firefly.dmg
|
|
|
|
rm tmp.dmg
|
|
|
|
fi
|
2006-07-26 03:48:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|