Created
August 28, 2013 08:41
-
-
Save MyGodIsHe/6363654 to your computer and use it in GitHub Desktop.
Deploy script for love2d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
VERSION=$1 | |
PACKAGE_NAME=love-game | |
if [ -z "$VERSION" ] | |
then | |
echo "Need setup version" | |
exit 0 | |
fi | |
BUILD_DIR=`pwd`/build | |
DEB_PACKAGE_DIR=`pwd`/build/${PACKAGE_NAME} | |
################ | |
# DEBIAN AMD64 # | |
################ | |
ARCH=amd64 | |
mkdir -p build | |
git archive --format zip --output build/${PACKAGE_NAME}.love master | |
cd $BUILD_DIR | |
rm -rf $BUILD_DIR/${PACKAGE_NAME}/ | |
mkdir -p ${PACKAGE_NAME}/DEBIAN | |
mkdir -p ${PACKAGE_NAME}/usr/bin/ | |
cat /usr/bin/love ${PACKAGE_NAME}.love > ${PACKAGE_NAME}/usr/bin/${PACKAGE_NAME} | |
chmod +x ${PACKAGE_NAME}/usr/bin/${PACKAGE_NAME} | |
cat > ${PACKAGE_NAME}/DEBIAN/control << EOF | |
Package: ${PACKAGE_NAME} | |
Version: $VERSION-0ubuntu1 | |
Maintainer: Chistyakov Ilya <ilchistyakov@gmail.com> | |
Architecture: $ARCH | |
Section: games | |
Description: Game Test Project One | |
Depends: libc6 (>= 2.15), libdevil1c2, libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libglee0d1, liblua5.1-0, libmodplug1, libmpg123-0 (>= 1.13.7), libopenal1 (>= 1:1.13), libphysfs1, libsdl1.2debian (>= 1.2.11), libstdc++6 (>= 4.6), libvorbisfile3 (>= 1.1.2) | |
EOF | |
cd $DEB_PACKAGE_DIR | |
md5deep -r usr > DEBIAN/md5sums | |
cd $BUILD_DIR | |
fakeroot dpkg-deb --build ${PACKAGE_NAME} | |
rm -rf $BUILD_DIR/${PACKAGE_NAME}/ | |
mv ${PACKAGE_NAME}.deb ${PACKAGE_NAME}_$VERSION-$ARCH.deb | |
echo build/${PACKAGE_NAME}_$VERSION-$ARCH.deb | |
build_window() { | |
ARCH=$1 | |
WIN_LOVE=love-0.8.0-win-x$ARCH | |
WIN_PRJ=${PACKAGE_NAME}_$VERSION-win-x$ARCH.zip | |
cd $BUILD_DIR | |
if [ ! -f $WIN_LOVE.zip ] | |
then | |
wget https://bitbucket.org/rude/love/downloads/$WIN_LOVE.zip | |
fi | |
rm -rf $WIN_LOVE | |
unzip -q $WIN_LOVE.zip | |
rm -rf ${PACKAGE_NAME} | |
mv $WIN_LOVE ${PACKAGE_NAME} | |
rm ${PACKAGE_NAME}/*.txt | |
cat ${PACKAGE_NAME}/love.exe ${PACKAGE_NAME}.love > ${PACKAGE_NAME}/${PACKAGE_NAME}.exe | |
rm ${PACKAGE_NAME}/love.exe | |
rm -f $WIN_PRJ | |
zip -qr $WIN_PRJ ${PACKAGE_NAME} | |
rm -rf ${PACKAGE_NAME} | |
echo build/$WIN_PRJ | |
} | |
############## | |
# WINDOWS 32 # | |
############## | |
build_window 86 | |
################# | |
# WINDOWS AMD64 # | |
################# | |
build_window 64 | |
rm $BUILD_DIR/${PACKAGE_NAME}.love |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment