3 # Copyright (C) Andriy Shinkarchuck <adriano32.gnu@gmail.com> 2011
5 # This file is part of the Doom2D:Rembo project.
7 # Doom2D:Rembo is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2 as
9 # published by the Free Software Foundation.
11 # Doom2D:Rembo is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/> or
18 # write to the Free Software Foundation, Inc.,
19 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 echo "Usage: doom2d_deb_maker <SOURCE_DIR> <DEST_DIR> <PACKAGE_NAME> <VERSION> <ARCH>"
23 echo "<SOURCE_DIR> and <DEST_DIR> should be absolute pathes"
26 echo "Error: Not enough actual parametres.";
27 echo "Usage: doom2d_deb_maker <SOURCE_DIR> <DEST_DIR> <PACKAGE_NAME> <VERSION> <ARCH>"
35 if [ -d $DEST_DIR ]; then
36 echo $DEST_DIR" is already created. mkdir skipping"
39 chmod -fR 755 $DEST_DIR
40 echo "mkdir "$DEST_DIR" success"
42 if [ "$(ls -A $DEST_DIR)" ]; then
43 echo "Error: "$DEST_DIR" is not empty. Please, check it content and delete if it is unnecesary before starting"
46 if [ -d $SOURCE_DIR ]; then
47 if [ -d $SOURCE_DIR/src
]; then
48 if [ -d $SOURCE_DIR/music
]; then
49 if [ -d $SOURCE_DIR/src
/build
]; then
50 rm -rf $SOURCE_DIR/src
/build
51 echo "Cleaning "$SOURCE_DIR"/src/build after previous build"
54 mkdir $SOURCE_DIR/src
/build
55 cd $SOURCE_DIR/src
/build
56 echo "Compilation of "$PACKAGE_NAME" started"
59 echo "Compilation of "$PACKAGE_NAME" finished succesfully"
61 echo "Error: Your source tree in "$SOURCE_DIR" is damaged. Check your sources tarball consistency"
65 echo "Error: Your source tree in "$SOURCE_DIR" is damaged. Check your sources tarball consistency"
69 echo "Error: "$SOURCE_DIR" not found. Please, check parametres"
72 echo "mkdir debian package folder structure in "$DEST_DIR
73 mkdir $DEST_DIR/DEBIAN
75 mkdir $DEST_DIR/usr
/bin
76 mkdir $DEST_DIR/usr
/share
77 mkdir $DEST_DIR/usr
/share
/doom2d
-rembo
78 chmod -fR 755 $DEST_DIR/
80 echo "Copying binary and data files"
81 cp -fR $SOURCE_DIR/music
$DEST_DIR/usr
/share
/doom2d
-rembo/
82 cp -f $SOURCE_DIR/src
/*.wad
$DEST_DIR/usr
/share
/doom2d
-rembo/
83 cp -f $SOURCE_DIR/src
/*.cfg
$DEST_DIR/usr
/share
/doom2d
-rembo/
84 cp -f $SOURCE_DIR/src
/build
/doom2d
$DEST_DIR/usr
/bin
86 touch $DEST_DIR/DEBIAN
/control
87 echo "control file generating"
88 echo "Package: "$PACKAGE_NAME >> $DEST_DIR/DEBIAN
/control
89 echo "Version: "$VERSION >> $DEST_DIR/DEBIAN
/control
90 echo "Architecture: "$ARCH >> $DEST_DIR/DEBIAN
/control
91 echo "Maintainer: Rembo <arembo@gmail.com>" >> $DEST_DIR/DEBIAN
/control
92 echo "Installed-Size: "`du -ks $DEST_DIR/usr/ | grep -o \[0-9\]*` >> $DEST_DIR/DEBIAN
/control
93 echo "Depends: libc6 (>= 2.3), libsdl-mixer1.2 (>= 1.2.6), libsdl1.2debian (>= 1.2.10-1)" >> $DEST_DIR/DEBIAN
/control
94 echo "Section: games" >> $DEST_DIR/DEBIAN
/control
95 echo "Priority: optional" >> $DEST_DIR/DEBIAN
/control
96 echo "Homepage: http://code.google.com/p/doom2d-rembo/" >> $DEST_DIR/DEBIAN
/control
97 echo "Description: Doom2D:Rembo is a Linux port of Doom2D game," >> $DEST_DIR/DEBIAN
/control
98 echo " free DOS two-dimensional arcade created by" >> $DEST_DIR/DEBIAN
/control
99 echo " Russian video game company \"Prikol Software\"" >> $DEST_DIR/DEBIAN
/control
100 echo " in early 1996 being inspired by original DOOM game by id Software." >> $DEST_DIR/DEBIAN
/control
102 ARCHIVE_NAME
=$PACKAGE_NAME"_"$VERSION"_"$ARCH.deb
103 fakeroot dpkg
-deb --build $DEST_DIR $ARCHIVE_NAME
104 echo $ARCHIVE_NAME" was created succesfully at "$SOURCE_DIR"/src/build/"