-
Notifications
You must be signed in to change notification settings - Fork 0
/
makepackage.sh
executable file
·37 lines (33 loc) · 1.25 KB
/
makepackage.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
#!/bin/bash
#
# Script to make an installable package of the driver.
#
# Uses xcodebuild, pkgbuild and productbuild.
#
# Create a clean install directory...
if test -d build/Package; then
sudo chmod -R u+w build/Package
sudo rm -rf build/Package
fi
mkdir -p build/Package/Root
mkdir -p build/Package/Resources
# Install into this directory...
xcodebuild -workspace "$PWD/ImageWriterII.xcworkspace" \
-scheme ImageWriterIIBundle \
-configuration Release \
install \
DSTROOT="$PWD/build/Package/Root"
# Extract the version number from the project...
ver=$(/usr/libexec/PlistBuddy -c "Print:CFBundleShortVersionString" "DriverBundle/imagewriterii-Info.plist")
# Make the package with pkgbuild and the product distribution with productbuild...
echo pkgbuild...
pkgbuild --identifier com.danielecattaneo.printers.imagewriterii \
--version "$ver" \
--install-location / \
--root build/Package/Root \
"./DriverPackage.pkg"
productbuild --distribution ./PackageResources/Distribution.xml \
--resources ./PackageResources/Resources \
--package-path ./ \
"./AppleImageWriterII-$ver.pkg"
rm ./DriverPackage.pkg