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
|
--- a/bmp/Makefile.am
+++ b/bmp/Makefile.am
@@ -1,4 +1,4 @@
-bmpdir = $(prefix)/share/SpaceAryarya/bmp
+bmpdir = $(BMP_PATH)
bmp_DATA = my.bmp enemy1.bmp shot.bmp bomb.bmp\
enemy2.bmp kage.bmp wall.bmp wall2.bmp eshot.bmp\
boss1_b.bmp boss1_do.bmp boss1_f.bmp\
--- a/configure.in
+++ b/configure.in
@@ -25,17 +25,20 @@
BMP_PATH=/usr/local/share/SpaceAryarya/bmp
WAV_PATH=/usr/local/share/SpaceAryarya/wav
else
- DATA_PATH=$prefix/share/SpaceAryarya/data
- BMP_PATH=$prefix/share/SpaceAryarya/bmp
- WAV_PATH=$prefix/share/SpaceAryarya/wav
+ DATA_PATH=$datadir/SpaceAryarya/data
+ BMP_PATH=$datadir/SpaceAryarya/bmp
+ WAV_PATH=$datadir/SpaceAryarya/wav
+ SCORE_PATH=$localstatedir/SpaceAryarya
fi
AC_DEFINE_UNQUOTED(DATA_PATH,"$DATA_PATH")
AC_DEFINE_UNQUOTED(BMP_PATH,"$BMP_PATH")
AC_DEFINE_UNQUOTED(WAV_PATH,"$WAV_PATH")
+AC_DEFINE_UNQUOTED(SCORE_PATH,"$SCORE_PATH")
AC_DEFINE_UNQUOTED(TITLE,"$PACKAGE $VERSION")
AC_SUBST(DATA_PATH)
AC_SUBST(BMP_PATH)
AC_SUBST(WAV_PATH)
+AC_SUBST(SCORE_PATH)
AC_OUTPUT([data/Makefile wav/Makefile bmp/Makefile src/Makefile
spacearyarya.spec Makefile])
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,6 +1,7 @@
-datadir = $(prefix)/share/SpaceAryarya/data
+datadir = $(DATA_PATH)
data_DATA = stage1.dat stage2.dat
EXTRA_DIST = stage1.dat stage2.dat .score
-install:
- $(INSTALL) -c -m 666 ./.score $(DESTDIR)$(DATA_PATH)
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(SCORE_PATH)
+ $(INSTALL) -m 660 .score $(DESTDIR)$(SCORE_PATH)
--- a/src/ranking.c
+++ b/src/ranking.c
@@ -36,7 +36,7 @@
FILE *fp;
Uint16 i;
- if ((fp = fopen(DATA_PATH "/.score", "r"))) {
+ if ((fp = fopen(SCORE_PATH "/.score", "r"))) {
fscanf(fp, "%d", &(Root->HiScore));
for (i = 0; i < 5; i ++)
fscanf(fp, "%d %d %s",
@@ -65,7 +65,7 @@
FILE *fp;
Uint16 i;
- if ((fp = fopen(DATA_PATH "/.score", "w"))) {
+ if ((fp = fopen(SCORE_PATH "/.score", "w"))) {
fprintf(fp, "%d\n", Root->HiScore);
for (i = 0; i < 5; i ++)
fprintf(fp, "%d %d %s\n",
--- a/wav/Makefile.am
+++ b/wav/Makefile.am
@@ -1,3 +1,3 @@
-wavdir = $(prefix)/share/SpaceAryarya/wav
+wavdir = $(WAV_PATH)
wav_DATA = bgm1.wav bomb.wav hit.wav fire.wav die.wav boss.wav
EXTRA_DIST = bgm1.wav bomb.wav hit.wav fire.wav die.wav boss.wav
|