DEADSOFTWARE

4250b59abaec90ebf0ba4969c1bda98e36ef8f82
[flatwaifu.git] / src / copy.sh
1 #!/bin/sh
2 #
3 # Copyright (C) Andriy Shinkarchuck <adriano32.gnu@gmail.com> 2011
4 #
5 # This file is part of the Doom2D:Rembo project.
6 #
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.
10 #
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.
15 #
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
20 #
21 set -e
22 WORK_DIR=`pwd`
23 if [ $# -eq 0 ]; then
24 DEST_DIR=/usr/share/doom2d-rembo
25 if [ -d $DEST_DIR ]; then
26 if [ "$(ls -A $DEST_DIR)" ]; then
27 echo "Error: "$DEST_DIR" is not empty. Please, check it content and delete if it is unnecesary before starting"
28 exit 1
29 fi
30 else
31 mkdir $DEST_DIR
32 chmod 755 $DEST_DIR
33 fi
34 if [ -d $DEST_DIR ]; then
35 if [ -d $WORK_DIR/../music ]; then
36 cp -R $WORK_DIR/../music $DEST_DIR/music
37 cp $WORK_DIR/doom2d.wad $DEST_DIR
38 cp $WORK_DIR/megadm.wad $DEST_DIR
39 cp $WORK_DIR/superdm.wad $DEST_DIR
40 cp $WORK_DIR/default.cfg $DEST_DIR;
41 echo "Copying data files to "$DEST_DIR" completed succesfully"
42 else
43 echo "music subdirectory was not found in "$WORK_DIR". Check you source tarball consistency";
44 fi
45 else
46 echo $DEST_DIR" does not exist or yet not been created. Please, check your rights and create it befory executing.";
47 fi
48 fi