-
Notifications
You must be signed in to change notification settings - Fork 23
/
make_deb_mac64
executable file
·154 lines (124 loc) · 6.56 KB
/
make_deb_mac64
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
# redtamarin-sdk packaging
STARTTIME=$(date +%s)
RELEASE=bin-release
BINDEPS=bin-deps
ARCHITECTURE=darwin-amd64
DEBVER=0.4.1
BASE=redtamarin-sdk_${DEBVER}_${ARCHITECTURE}
ROOTDIR=$RELEASE/$BASE
rm -Rf $RELEASE
mkdir -p $ROOTDIR
DIST=`pwd`/$ROOTDIR
DEST=$DIST/usr
mkdir -p $DEST/bin
mkdir -p $DEST/lib/redtamarin
mkdir -p $DEST/lib/redtamarin/bin
mkdir -p $DEST/lib/redtamarin/support
mkdir -p $DEST/lib/redtamarin/lib
mkdir -p $DEST/lib/redtamarin/runtimes
mkdir -p $DEST/lib/redtamarin/run
mkdir -p $DEST/share/man/man1
mkdir -p $DEST/share/doc/redtamarin
mkdir -p $DEST/share/doc/redbean
find $DIST -type d | xargs chmod 755
# cp bin-deps/bin-release/macintosh/64/debugger/redshell_dd redshell_dd_mac64
# chmod +x redshell_dd_mac64
# redtamarin projector / man
cp bin-deps/redtamarin-release/redtamarin.swf $RELEASE/
cp bin-deps/redtamarin-release/redtamarin.1.gz $RELEASE/
./redshell_dd_nix64 projectormake.abc -- -o bin-release/redtamarin redshell_dd_mac64 bin-release/redtamarin.swf -- -Dlanguage en
sudo chmod 755 $RELEASE/redtamarin
sudo chown root:root $RELEASE/redtamarin
sudo chmod 644 $RELEASE/redtamarin.1.gz
sudo chown root:root $RELEASE/redtamarin.1.gz
sudo mv $RELEASE/redtamarin $DEST/lib/redtamarin/bin/
sudo mv $RELEASE/redtamarin.1.gz $DEST/share/man/man1/
rm $RELEASE/redtamarin.swf
cp bin-deps/redtamarin-release/components/redtamarin.abc $DEST/lib/redtamarin/lib/
cp bin-deps/redtamarin-release/components/redtamarin.swc $DEST/lib/redtamarin/lib/
sudo chmod 664 $DEST/lib/redtamarin/lib/*
sudo chown root:root $DEST/lib/redtamarin/lib/*
# redbean projector / man
cp bin-deps/redbean-release/redbean.abc $RELEASE/
cp bin-deps/redbean-release/redbean.1.gz $RELEASE/
./redshell_dd_nix64 projectormake.abc -- -o bin-release/redbean redshell_dd_mac64 bin-release/redbean.abc -- -Dlanguage en
sudo chmod 755 $RELEASE/redbean
sudo chown root:root $RELEASE/redbean
sudo chmod 644 $RELEASE/redbean.1.gz
sudo chown root:root $RELEASE/redbean.1.gz
sudo mv $RELEASE/redbean $DEST/lib/redtamarin/bin/
sudo mv $RELEASE/redbean.1.gz $DEST/share/man/man1/
rm $RELEASE/redbean.abc
cp bin-deps/redbean-release/redbean.abc $DEST/lib/redtamarin/run/
sudo chmod 775 $DEST/lib/redtamarin/run/redbean.abc
sudo chown root:root $DEST/lib/redtamarin/run/redbean.abc
cp bin-deps/redbean-release/redbeanlib.abc $DEST/lib/redtamarin/lib/
cp bin-deps/redbean-release/redbean.swc $DEST/lib/redtamarin/lib/redbeanlib.swc
sudo chmod 664 $DEST/lib/redtamarin/lib/*
sudo chown root:root $DEST/lib/redtamarin/lib/*
cp bin-deps/redbean-release/asc.jar $DEST/lib/redtamarin/support/
cp bin-deps/redbean-release/asc2.jar $DEST/lib/redtamarin/support/
sudo chmod 664 $DEST/lib/redtamarin/support/*
sudo chown root:root $DEST/lib/redtamarin/support/*
# redshell runtimes for Linux
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/linux
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/linux/32
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/linux/64
cp bin-deps/bin-release/linux/32/release/redshell $DEST/lib/redtamarin/runtimes/redshell/linux/32/
cp bin-deps/bin-release/linux/32/debug/redshell_d $DEST/lib/redtamarin/runtimes/redshell/linux/32/
cp bin-deps/bin-release/linux/32/debugger/redshell_dd $DEST/lib/redtamarin/runtimes/redshell/linux/32/
cp bin-deps/bin-release/linux/64/release/redshell $DEST/lib/redtamarin/runtimes/redshell/linux/64/
cp bin-deps/bin-release/linux/64/debug/redshell_d $DEST/lib/redtamarin/runtimes/redshell/linux/64/
cp bin-deps/bin-release/linux/64/debugger/redshell_dd $DEST/lib/redtamarin/runtimes/redshell/linux/64/
# redshell runtimes for Mac OS X
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/macintosh
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/macintosh/32
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/macintosh/64
cp bin-deps/bin-release/macintosh/32/release/redshell $DEST/lib/redtamarin/runtimes/redshell/macintosh/32/
cp bin-deps/bin-release/macintosh/32/debug/redshell_d $DEST/lib/redtamarin/runtimes/redshell/macintosh/32/
cp bin-deps/bin-release/macintosh/32/debugger/redshell_dd $DEST/lib/redtamarin/runtimes/redshell/macintosh/32/
cp bin-deps/bin-release/macintosh/64/release/redshell $DEST/lib/redtamarin/runtimes/redshell/macintosh/64/
cp bin-deps/bin-release/macintosh/64/debug/redshell_d $DEST/lib/redtamarin/runtimes/redshell/macintosh/64/
cp bin-deps/bin-release/macintosh/64/debugger/redshell_dd $DEST/lib/redtamarin/runtimes/redshell/macintosh/64/
# redshell runtimes for Windows
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/windows
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/windows/32
mkdir -p $DEST/lib/redtamarin/runtimes/redshell/windows/64
cp bin-deps/bin-release/windows/32/release/redshell.exe $DEST/lib/redtamarin/runtimes/redshell/windows/32/
cp bin-deps/bin-release/windows/32/debug/redshell_d.exe $DEST/lib/redtamarin/runtimes/redshell/windows/32/
cp bin-deps/bin-release/windows/32/debugger/redshell_dd.exe $DEST/lib/redtamarin/runtimes/redshell/windows/32/
cp bin-deps/bin-release/windows/64/release/redshell.exe $DEST/lib/redtamarin/runtimes/redshell/windows/64/
cp bin-deps/bin-release/windows/64/debug/redshell_d.exe $DEST/lib/redtamarin/runtimes/redshell/windows/64/
cp bin-deps/bin-release/windows/64/debugger/redshell_dd.exe $DEST/lib/redtamarin/runtimes/redshell/windows/64/
# all runtimes
sudo chmod -R 755 $DEST/lib/redtamarin/runtimes/*
sudo chown -R root:root $DEST/lib/redtamarin/runtimes/*
# redtamarin API HTML doc
mkdir $DEST/share/doc/redtamarin/api
sudo cp -a bin-deps/redtamarin-release/documentation/. $DEST/share/doc/redtamarin/api/
sudo find $DEST/share/doc/redtamarin/api -type d -exec chmod 0775 {} +
sudo find $DEST/share/doc/redtamarin/api -type f -exec chmod 0664 {} +
sudo chown -R root:root $DEST/share/doc/redtamarin/*
# redbean API HTML doc
mkdir $DEST/share/doc/redbean/api
sudo cp -a bin-deps/redbean-release/docs/redbean/. $DEST/share/doc/redbean/api/
sudo find $DEST/share/doc/redbean/api -type d -exec chmod 0775 {} +
sudo find $DEST/share/doc/redbean/api -type f -exec chmod 0664 {} +
sudo chown -R root:root $DEST/share/doc/redbean/*
# package
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
cp build/macintosh/postinst $DIST/DEBIAN/postinst
sudo chmod 755 $DIST/DEBIAN/postinst
sudo chown root:root $DIST/DEBIAN/postinst
cp build/macintosh/postrm $DIST/DEBIAN/postrm
sudo chmod 755 $DIST/DEBIAN/postrm
sudo chown root:root $DIST/DEBIAN/postrm
fakeroot dpkg-deb --build $DIST
ENDTIME=$(date +%s)
echo "Packaged ${BASE}.deb in $(($ENDTIME - $STARTTIME)) seconds"