-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathput-data
executable file
·109 lines (91 loc) · 2.66 KB
/
put-data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#! /bin/sh -e
# development directory configuration:
#
# DEVDIR/race/*.c, *.h, etc
# DEVDIR/gamedat/gamedata-files
# DEVDIR/avdata/avdata-files
# DEVDIR/avdata/audio/
# DEVDIR/avdata/video/
#
# when everything is packaged in one tar, and then used to build
# the .deb file, the directory configuration is
#
# raceintospace-1.0/*.c, *.h, etc
# raceintospace-1.0/gamedata-files
# raceintospace-1.0/gamedata/
# raceintospace-1.0/avdata-files
# raceintospace-1.0/audio/
# raceintospace-1.0/video/
#
# this script tracks down the gamedata and avdata locations, and copies
# the files to the runtime location (/usr/local/share/raceintospace)
if [ $# != 1 ]
then
echo "usage: put-data DATA_DIR"
exit 1
fi
DATA_DIR=$1
mkdir -p ${DATA_DIR}
# ================================================================
# install gamedata
# careful: the source repository is "gamedat", but most uses are "gamedata"
if [ -r gamedata/gamedata-files ]
then
echo "installing gamedata from working directory"
gamedata_dir=gamedata
elif [ -r ../gamedat/gamedata-files ]
then
echo "installing gamedata from ../gamedata"
gamedata_dir=../gamedat
else
echo "put-data: can't find gamedata directory"
echo ""
echo "if you're trying to do development, you probably want"
echo "something like this:"
echo ""
cdir=`pwd`
pdir=`dirname $cdir`
echo "\$ cd $pdir"
echo "\$ cvs checkout -d:ext:raceintospace.cvs.sourceforge.net:/cvsroot/raceintospace co gamedat"
echo ""
echo "which will make the gamedat module a sibling"
echo "to the main source directory"
exit 1
fi
(
cd ${gamedata_dir}
mkdir -p ${DATA_DIR}/gamedata
cp --parents `cat gamedata-files` ${DATA_DIR}/gamedata
sed "s:^:${DATA_DIR}/gamedata/:" < gamedata-files | xargs chmod a=r,u+w
)
# ================================================================
# install avdata
if [ -r avdata-files ]
then
echo "installing avdata files from working directory"
avdata_dir=.
elif [ -r ../avdata/avdata-files ]
then
echo "installing avdata files from ../avdata"
avdata_dir=../avdata
else
echo "put-data: can't find avdata directory"
echo ""
echo "if you're trying to do development, you probably want"
echo "something like this:"
echo ""
cdir=`pwd`
pdir=`dirname $cdir`
echo "\$ cd $pdir"
echo "\$ git clone ssh://raceintospace.git.sourceforge.net/gitroot/raceintospace/avdata"
echo ""
echo "which will make the avdata module a sibling"
echo "to the main source directory"
exit 1
fi
(
cd ${avdata_dir}
cp --parents `cat avdata-files` ${DATA_DIR}
sed "s:^:${DATA_DIR}/:" < avdata-files | xargs chmod a=r,u+w
)
echo "done"