File: doom-common

package info (click to toggle)
game-data-packager 30
  • links: PTS, VCS
  • area: contrib
  • in suites: wheezy
  • size: 292 kB
  • sloc: sh: 117; makefile: 69
file content (37 lines) | stat: -rw-r--r-- 774 bytes parent folder | download
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
DEBBASE="${SHORTNAME}-wad_${GAME_PACKAGE_VERSION}_all.deb"

doom_usage() {
	echo "${SHORTNAME} arguments:"  >&2
	printf "\twadfile - path to a ${SHORTNAME}.wad\n" >&2
}

verify_args() {
	if [ $# -ne 1 ]; then
		echo "error: no wadfile specified" >&2
		usage >&2
		doom_usage >&2
		exit 1
	fi
}
checksum() {
	CHECKSUM=`md5sum "$1" | cut -d' ' -f1`
	debug "checksum = $CHECKSUM"
}

WADDIR="/usr/share/games/doom"
DEB="$DATADIR/$DEBBASE"

go() {
	verify_args "$@"
	WADFILE=`unravel "$1"`
    [ -f "$WADFILE" ] || die "ERROR: '$WADFILE' does not exist."
	checksum "$WADFILE"
	debug "WADFILE=$WADFILE"
	check_for_v19

	DEST=`echo $WADDIR | sed 's,^/,,'`/$SHORTNAME.wad

	OUTFILE=`unravel "$OUTDIR"`"/$DEBBASE"
	cp -p "$DEB" "$OUTFILE"
	slipstream "$OUTFILE" "$DEST" "$WADFILE"
}