Skip to content

Commit

Permalink
deb packagign for Mac OS X 32-bit
Browse files Browse the repository at this point in the history
git-svn-id: http://dev.corsaair.com/svn/redtamarin/trunk@1787 8266667d-5eeb-4550-8638-74b212e0aa7d
  • Loading branch information
zwetan committed Feb 3, 2016
1 parent 4a9eb95 commit 6486dc7
Showing 1 changed file with 154 additions and 0 deletions.
154 changes: 154 additions & 0 deletions make_deb_mac32
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#!/bin/bash

# redtamarin-sdk packaging
STARTTIME=$(date +%s)

RELEASE=bin-release
BINDEPS=bin-deps
ARCHITECTURE=darwin-i386
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/32/debugger/redshell_dd redshell_dd_mac32
# chmod +x redshell_dd_mac32

# 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_mac32 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_mac32 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"

0 comments on commit 6486dc7

Please sign in to comment.