-
Notifications
You must be signed in to change notification settings - Fork 4
/
make_deb_mac32
executable file
·53 lines (39 loc) · 1.29 KB
/
make_deb_mac32
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
#!/bin/bash
# dependencies:
# dpkg-deb
# fakeroot
# gzip
# pandoc
RELEASE=bin-release
ARCHITECTURE=darwin-i386
DEBVER=1.0.0
BASE=as3shebang_${DEBVER}_${ARCHITECTURE}
ROOTDIR=$RELEASE/$BASE
rm -Rf $RELEASE
mkdir -p $ROOTDIR
DIST=`pwd`/$ROOTDIR
DEST=$DIST/usr
mkdir -p $DEST/bin
mkdir -p $DEST/share/man/man1
find $DIST -type d | xargs chmod 755
# make abc
java -jar build/asc.jar -AS3 -optimize -import lib-abc/redtamarin.abc src/as3shebang.as
mv src/as3shebang.abc bin-release/
# make projector
./redshell_dd_nix64 projectormake.abc -- -o bin-release/as3shebang redshell_dd_mac32 bin-release/as3shebang.abc -- -Dlanguage en
cp $RELEASE/as3shebang $DEST/bin/
sudo chmod 755 $DEST/bin/as3shebang
sudo chown root:root $DEST/bin/as3shebang
# make man
pandoc build/as3shebang.1.md -s -t man -o bin-release/as3shebang.1
cp $RELEASE/as3shebang.1 $DEST/share/man/man1/as3shebang.1
gzip -9 $DEST/share/man/man1/as3shebang.1
sudo chmod 644 $DEST/share/man/man1/as3shebang.1.gz
sudo chown root:root $DEST/share/man/man1/as3shebang.1.gz
INSTALLED_SIZE=$(du -k -s $DEST | awk '{print $1}')
mkdir $DIST/DEBIAN
perl -pe "s/VERSION/$DEBVER/" build/macintosh/control.in | \
perl -pe "s/ARCHITECTURE/$ARCHITECTURE/" | \
perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \
> $DIST/DEBIAN/control
fakeroot dpkg-deb --build $DIST