summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 46978bc)
raw | patch | inline | side by side (parent: 46978bc)
author | Andriy Shinkarchuck <adriano32.gnu@gmail.com> | |
Tue, 26 Jul 2011 22:25:51 +0000 (01:25 +0300) | ||
committer | Andriy Shinkarchuck <adriano32.gnu@gmail.com> | |
Tue, 26 Jul 2011 22:25:51 +0000 (01:25 +0300) |
doom2d_deb_maker | [new file with mode: 0755] | patch | blob |
doom2d_tarball_maker | [new file with mode: 0755] | patch | blob |
diff --git a/doom2d_deb_maker b/doom2d_deb_maker
--- /dev/null
+++ b/doom2d_deb_maker
@@ -0,0 +1,105 @@
+#!/bin/bash
+#
+# Copyright (C) Andriy Shinkarchuck <adriano32.gnu@gmail.com> 2011
+#
+# This file is part of the Doom2D:Rembo project.
+#
+# Doom2D:Rembo is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# Doom2D:Rembo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/> or
+# write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+set -e
+echo "Usage: doom2d_deb_maker <SOURCE_DIR> <DEST_DIR> <PACKAGE_NAME> <VERSION> <ARCH>"
+echo "<SOURCE_DIR> and <DEST_DIR> should be absolute pathes"
+WORK_DIR=`pwd`
+if [ $# -ne 5 ]; then
+ echo "Error: Not enough actual parametres.";
+ echo "Usage: doom2d_deb_maker <SOURCE_DIR> <DEST_DIR> <PACKAGE_NAME> <VERSION> <ARCH>"
+ exit 1
+else
+ SOURCE_DIR=$1
+ DEST_DIR=$2
+ PACKAGE_NAME=$3
+ VERSION=$4
+ ARCH=$5
+ if [ -d $DEST_DIR ]; then
+ echo $DEST_DIR" is already created. mkdir skipping"
+ else
+ mkdir $DEST_DIR
+ chmod -fR 755 $DEST_DIR
+ echo "mkdir "$DEST_DIR" success"
+ fi
+ if [ "$(ls -A $DEST_DIR)" ]; then
+ echo "Error: "$DEST_DIR" is not empty. Please, check it content and delete if it is unnecesary before starting"
+ exit 1
+ fi
+ if [ -d $SOURCE_DIR ]; then
+ if [ -d $SOURCE_DIR/src ]; then
+ if [ -d $SOURCE_DIR/music ]; then
+ if [ -d $SOURCE_DIR/src/build ]; then
+ rm -rf $SOURCE_DIR/src/build
+ echo "Cleaning "$SOURCE_DIR"/src/build after previous build"
+ fi
+ cd $SOURCE_DIR/src
+ mkdir $SOURCE_DIR/src/build
+ cd $SOURCE_DIR/src/build
+ echo "Compilation of "$PACKAGE_NAME" started"
+ cmake ..
+ make
+ echo "Compilation of "$PACKAGE_NAME" finished succesfully"
+ else
+ echo "Error: Your source tree in "$SOURCE_DIR" is damaged. Check your sources tarball consistency"
+ exit 1
+ fi
+ else
+ echo "Error: Your source tree in "$SOURCE_DIR" is damaged. Check your sources tarball consistency"
+ exit 1
+ fi
+ else
+ echo "Error: "$SOURCE_DIR" not found. Please, check parametres"
+ exit 1
+ fi
+ echo "mkdir debian package folder structure in "$DEST_DIR
+ mkdir $DEST_DIR/DEBIAN
+ mkdir $DEST_DIR/usr
+ mkdir $DEST_DIR/usr/bin
+ mkdir $DEST_DIR/usr/share
+ mkdir $DEST_DIR/usr/share/doom2d-rembo
+ chmod -fR 755 $DEST_DIR/
+ echo "Done"
+ echo "Copying binary and data files"
+ cp -fR $SOURCE_DIR/music $DEST_DIR/usr/share/doom2d-rembo/
+ cp -f $SOURCE_DIR/src/*.wad $DEST_DIR/usr/share/doom2d-rembo/
+ cp -f $SOURCE_DIR/src/*.cfg $DEST_DIR/usr/share/doom2d-rembo/
+ cp -f $SOURCE_DIR/src/build/doom2d $DEST_DIR/usr/bin
+ echo "Done"
+ touch $DEST_DIR/DEBIAN/control
+ echo "control file generating"
+ echo "Package: "$PACKAGE_NAME >> $DEST_DIR/DEBIAN/control
+ echo "Version: "$VERSION >> $DEST_DIR/DEBIAN/control
+ echo "Architecture: "$ARCH >> $DEST_DIR/DEBIAN/control
+ echo "Maintainer: Rembo <arembo@gmail.com>" >> $DEST_DIR/DEBIAN/control
+ echo "Installed-Size: "`du -ks $DEST_DIR/usr/ | grep -o \[0-9\]*` >> $DEST_DIR/DEBIAN/control
+ echo "Depends: libc6 (>= 2.3), libsdl-mixer1.2 (>= 1.2.6), libsdl1.2debian (>= 1.2.10-1)" >> $DEST_DIR/DEBIAN/control
+ echo "Section: games" >> $DEST_DIR/DEBIAN/control
+ echo "Priority: optional" >> $DEST_DIR/DEBIAN/control
+ echo "Homepage: http://code.google.com/p/doom2d-rembo/" >> $DEST_DIR/DEBIAN/control
+ echo "Description: Doom2D:Rembo is a Linux port of Doom2D game," >> $DEST_DIR/DEBIAN/control
+ echo " free DOS two-dimensional arcade created by" >> $DEST_DIR/DEBIAN/control
+ echo " Russian video game company \"Prikol Software\"" >> $DEST_DIR/DEBIAN/control
+ echo " in early 1996 being inspired by original DOOM game by id Software." >> $DEST_DIR/DEBIAN/control
+ echo "Done"
+ ARCHIVE_NAME=$PACKAGE_NAME"-"$VERSION"_"$ARCH.deb
+ fakeroot dpkg-deb --build $DEST_DIR $ARCHIVE_NAME
+ echo $ARCHIVE_NAME" was created succesfully at "$SOURCE_DIR"/src/build/"
+fi
diff --git a/doom2d_tarball_maker b/doom2d_tarball_maker
--- /dev/null
+++ b/doom2d_tarball_maker
@@ -0,0 +1,58 @@
+#!/bin/bash
+#
+# Copyright (C) Andriy Shinkarchuck <adriano32.gnu@gmail.com> 2011
+#
+# This file is part of the Doom2D:Rembo project.
+#
+# Doom2D:Rembo is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# Doom2D:Rembo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/> or
+# write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+set -e
+echo "Usage: doom2d_tarball_maker <TARBALL_NAME>"
+echo "Example: doom2d_tarball_maker doom2d-1.35.1-src"
+WORK_DIR=`pwd`
+if [ $# -ne 1 ]; then
+ echo "Usage: doom2d_tarball_maker <TARBALL_NAME>"
+ echo "Example: doom2d_tarball_maker doom2d-1.35.1-src"
+ exit 1
+else
+ TARBALL_NAME=$1
+ mkdir $WORK_DIR/tmp
+ cd $WORK_DIR/tmp
+ if [ -x `which hg` ]; then
+ hg clone https://code.google.com/p/doom2d-rembo/ doom2d-rembo
+ fi
+ if [ "$(ls -A $WORK_DIR/tmp/doom2d-rembo/)" ]; then
+ if [ -d $WORK_DIR/tmp/doom2d-rembo/src ]; then
+ if [ -d $WORK_DIR/tmp/doom2d-rembo/music ]; then
+ rm -fR $WORK_DIR/tmp/doom2d-rembo/.hg
+ cd $WORK_DIR/tmp
+ tar cf - doom2d-rembo/ | gzip -f9 > $TARBALL_NAME.tar.gz
+ else
+ echo "Error: Your source tree in "$WORK_DIR" is damaged. Check it for consistency"
+ exit 1
+ fi
+ else
+ echo "Error: Your source tree in "$WORK_DIR" is damaged. Check it for consistency"
+ exit 1
+ fi
+ else
+ echo "Error: Your source tree in "$WORK_DIR" is empty. Check it for consistency"
+ exit 1
+ fi
+ cd $WORK_DIR
+ cp $WORK_DIR/tmp/$TARBALL_NAME.tar.gz $WORK_DIR
+ rm -fR $WORK_DIR/tmp
+ echo $TARBALL_NAME".tar.gz created succesfully in "$WORK_DIR". Temporary files were removed"
+fi