-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·31 lines (22 loc) · 956 Bytes
/
build.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
#!/bin/sh
#
IDENTIFIER="com.github.managedmac"
MMVERS=0.1
GITREV=`git log -n1 --format="%H" -- .`
GITREVINDEX=`git rev-list --reverse HEAD | grep -n $GITREV | cut -d: -f1`
VERSION=$MMVERS.$GITREVINDEX.0
TMPROOT="/tmp/mmbuild-root.$$"
mkdir -p "$TMPROOT"
mkdir -p "$TMPROOT"/usr/local/managedmac
mkdir -p "$TMPROOT"/usr/local/managedmac/mmlib
mkdir -p "$TMPROOT"/usr/local/managedmac/plugins/actions
mkdir -p "$TMPROOT"/Library/LaunchDaemons
cp -a source/managedmac "$TMPROOT"/usr/local/managedmac
cp -a source/mmlib/*.py "$TMPROOT"/usr/local/managedmac/mmlib
cp -a source/plugins/actions/*.py "$TMPROOT"/usr/local/managedmac/plugins/actions
cp -a launchd/LaunchDaemons/com.github.managedmac-auto.plist "$TMPROOT"/Library/LaunchDaemons
pkgbuild --root "$TMPROOT" --identifier "$IDENTIFIER" --version "$VERSION" --install-location / --scripts package_scripts managedmac.pkg
if [ $? -eq 0 ]; then
echo "Built version $VERSION"
fi
rm -rf "$TMPROOT"