-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpackage-appswitch.sh
More file actions
executable file
·40 lines (33 loc) · 985 Bytes
/
package-appswitch.sh
File metadata and controls
executable file
·40 lines (33 loc) · 985 Bytes
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
#!/bin/zsh -ef
set -x -v
PACKAGEDIR="$PWD"
PRODUCT="appswitch"
# gather information
cd $PACKAGEDIR/$PRODUCT
VERSION=$(agvtool mvers -terse1)
TARBALL="$PRODUCT-$VERSION.tar.gz"
DISTDIR="$PRODUCT-$VERSION"
EXCLUSIONS=("${(ps:\000:)$(git ls-files -zo --directory -x $PRODUCT/$PRODUCT)}")
EXCLUSIONS=($EXCLUSIONS) # remove empty items
# clean and build
find . -name \*~ -exec rm '{}' \;
rm -rf build/
xcodebuild -configuration Deployment DSTROOT=$PWD DEPLOYMENT_LOCATION=YES install
SetFile -c 'ttxt' -t 'TEXT' README $PRODUCT.1
chmod 755 $PRODUCT
chmod 644 $PRODUCT.1
# install locally
sudo -s <<EOF
umask 022
/bin/mkdir -p /usr/local/bin /usr/local/share/man/man1
/usr/bin/install $PRODUCT /usr/local/bin
/usr/bin/install -m 644 $PRODUCT.1 /usr/local/share/man/man1
EOF
# create tarball
cd ..
rm -f $DISTDIR $TARBALL
ln -s $PRODUCT $DISTDIR
/usr/bin/tar -zcLf $TARBALL --exclude=${^EXCLUSIONS} $DISTDIR
rm -f $DISTDIR
# update Web presence
scp $TARBALL osric:web/nriley/software/