This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
distbuild.sh
executable file
·67 lines (50 loc) · 1.54 KB
/
distbuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# Created by Brian Bergstrand for the iScrobbler project.
# Licensed under the GPL. See gpl.txt for the terms.
PATH="/usr/bin:/usr/local/bin:/bin:"
if [ ! -d ./build ]; then
echo "Invalid working directory"
exit 1
fi
BIN=./build/Release # XCode 2.1 default
if [ ! -z $1 ] && [ "$1" == "-d" ]; then
BIN=./build/Debug
fi
if [ ! -d ${BIN} ]; then
BIN=./build/Deployment
if [ ! -d ${BIN} ]; then
BIN=./build
fi
fi
if [ ! -d ${BIN} ]; then
exit 1
fi
echo "Using ${BIN}/iScrobbler.app, continue?"
read ANS
if [ ! -z ${ANS} ] && [ ${ANS} != 'y' ] && [ ${ANS} != 'Y' ]; then
exit 2
fi
echo "Enter the iScrobbler version number:"
read VER
IMAGE=/tmp/scrobbuild_$$.dmg
#VOLUME="iScrobbler ${VER}"
VOLUME="iScrobbler"
hdiutil create -megabytes 10 -fs HFS+ -volname "${VOLUME}" -layout SPUD ${IMAGE}
DEVICE=`hdid "${IMAGE}" | sed -n 1p | cut -f1`
cp -pR ${BIN}/iScrobbler.app "/Volumes/${VOLUME}/"
cp ./CHANGE_LOG "/Volumes/${VOLUME}"/
cp ./res/English.lproj/Readme.webarchive "/Volumes/${VOLUME}/"
cp ./res/gpl.txt "/Volumes/${VOLUME}/LICENSE"
ln -sf /Applications "/Volumes/${VOLUME}/Applications"
mkdir "/Volumes/${VOLUME}/hidden"
/Developer/Tools/SetFile -a V "/Volumes/${VOLUME}/hidden"
cp res/bg_DS_Store "/Volumes/${VOLUME}/.DS_Store"
cp res/bg.png "/Volumes/${VOLUME}/hidden/"
cd ~/Desktop
hdiutil eject ${DEVICE}
# UDBZ is 10.4+ only
hdiutil convert -format UDBZ -o ~/Desktop/iscrobbler."${VER}".dmg -ov ${IMAGE}
# hdiutil internet-enable -yes ~/Desktop/iscrobbler."${VER}".dmg
rm ${IMAGE}
cd ~/Desktop
openssl sha1 iscrobbler."${VER}".dmg