summaryrefslogtreecommitdiff
blob: 312e895b8fd86b476dbfd483d32fe41ebc00ffe7 (plain)
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
From 6d8c1dc720b09fb9c6ff6edb273ad2a2ea31d768 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Sat, 25 Apr 2020 11:16:01 +0100
Subject: [PATCH 1/2] Use /usr/share/man and /usr/share/doc and not /usr/man
 and /usr/doc

This has been mandated by the Filesystem Hierarchy Standard since 2.0
in 1997. Autoconf actually does the right thing by default.
---
 Makefile.usr        |  4 ++--
 advance/advance.mak | 11 +++++------
 configure.ac        |  2 --
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/Makefile.usr b/Makefile.usr
index 4519857..74a4d53 100644
--- a/Makefile.usr
+++ b/Makefile.usr
@@ -238,8 +238,8 @@ srcdir=.
 datadir=${prefix}/share
 sysconfdir=${prefix}/etc
 bindir=${prefix}/bin
-mandir=${prefix}/man
-docdir=${prefix}/share/doc
+mandir=${datadir}/man
+docdir=${datadir}/doc/advancemame
 
 #############################################################################
 # Extra configuration common for ./configure and manual
diff --git a/advance/advance.mak b/advance/advance.mak
index 100dd23..8cd0444 100644
--- a/advance/advance.mak
+++ b/advance/advance.mak
@@ -373,12 +373,11 @@ CONF_SRC = \
 # Install
 
 pkgdir = $(datadir)/advance
-pkgdocdir = $(docdir)/advance
 
 install-dirs:
 	-$(INSTALL_PROGRAM_DIR) $(DESTDIR)$(bindir)
 	-$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)
-	-$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdocdir)
+	-$(INSTALL_DATA_DIR) $(DESTDIR)$(docdir)
 	-$(INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man1
 	-$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/rom
 	-$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/sample
@@ -463,15 +462,15 @@ uninstall-bin:
 install-doc: $(INSTALL_DOCFILES)
 ifdef INSTALL_DOCFILES
 	@for i in $(INSTALL_DOCFILES); do \
-		echo "$(INSTALL_DATA) $$i $(DESTDIR)$(pkgdocdir)"; \
-		$(INSTALL_DATA) $$i $(DESTDIR)$(pkgdocdir); \
+		echo "$(INSTALL_DATA) $$i $(DESTDIR)$(docdir)"; \
+		$(INSTALL_DATA) $$i $(DESTDIR)$(docdir); \
 	done
 endif
 
 uninstall-doc:
 ifdef INSTALL_DOCFILES
 	@for i in $(notdir $(INSTALL_DOCFILES)); do \
-		rm -f $(DESTDIR)$(pkgdocdir)/$$i; \
+		rm -f $(DESTDIR)$(docdir)/$$i; \
 	done
 endif
 
@@ -500,7 +499,7 @@ uninstall-dirs:
 	-rmdir $(DESTDIR)$(pkgdir)/snap/ti99_4a
 	-rmdir $(DESTDIR)$(pkgdir)/snap
 	-rmdir $(DESTDIR)$(pkgdir)
-	-rmdir $(DESTDIR)$(pkgdocdir)
+	-rmdir $(DESTDIR)$(docdir)
 
 install: install-dirs install-bin install-data install-doc install-man
 
diff --git a/configure.ac b/configure.ac
index f8ba989..e54c038 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1220,8 +1220,6 @@ AC_SUBST([CONF_LIB_JEVENT],[$ac_lib_jevent])
 
 dnl Final
 AC_SUBST([CONF_LIB_DIRECT],[$ac_lib_direct_flag])
-AC_SUBST([mandir],['${prefix}/man'])
-AC_SUBST([docdir],['${prefix}/doc'])
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 
-- 
2.26.0

From e35a602a73880bf529083bee5de911e1490a27b5 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Sat, 25 Apr 2020 11:52:13 +0100
Subject: [PATCH 2/2] Install *.html files to a separately htmldir rather than
 docdir

Autoconf already sets up htmldir for you. It defaults to the same as
docdir but some distributions set it differently.
---
 Makefile.in         |  1 +
 Makefile.usr        |  1 +
 advance/advance.mak | 21 +++++++++++++++++----
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index e92a107..86905d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,6 +14,7 @@ exec_prefix=@exec_prefix@
 bindir=@bindir@
 mandir=@mandir@
 docdir=@docdir@
+htmldir=@htmldir@
 CONF_SYSTEM=@CONF_SYSTEM@
 CONF_HOST=@CONF_HOST@
 CONF_BUILD=@CONF_BUILD@
diff --git a/Makefile.usr b/Makefile.usr
index 74a4d53..c8e7430 100644
--- a/Makefile.usr
+++ b/Makefile.usr
@@ -240,6 +240,7 @@ sysconfdir=${prefix}/etc
 bindir=${prefix}/bin
 mandir=${datadir}/man
 docdir=${datadir}/doc/advancemame
+htmldir=${docdir}
 
 #############################################################################
 # Extra configuration common for ./configure and manual
diff --git a/advance/advance.mak b/advance/advance.mak
index 8cd0444..009ccd6 100644
--- a/advance/advance.mak
+++ b/advance/advance.mak
@@ -152,7 +152,7 @@ endif
 endif
 
 INSTALL_DOCFILES += $(subst $(srcdir)/doc/,$(DOCOBJ)/,$(subst .d,.txt,$(wildcard $(srcdir)/doc/*.d)))
-INSTALL_DOCFILES += $(subst $(srcdir)/doc/,$(DOCOBJ)/,$(subst .d,.html,$(wildcard $(srcdir)/doc/*.d)))
+INSTALL_HTMLFILES += $(subst $(srcdir)/doc/,$(DOCOBJ)/,$(subst .d,.html,$(wildcard $(srcdir)/doc/*.d)))
 WEB_DOCFILES += $(subst $(srcdir)/doc/,$(DOCOBJ)/,$(subst .d,.hh,$(wildcard $(srcdir)/doc/*.d)))
 
 ############################################################################
@@ -162,7 +162,7 @@ ifdef ADV_ALL
 all_override: $(ADV_ALL)
 endif
 
-all: $(OBJ_DIRS) $(INSTALL_BINFILES) $(INSTALL_DOCFILES) $(INSTALL_MANFILES)
+all: $(OBJ_DIRS) $(INSTALL_BINFILES) $(INSTALL_DOCFILES) $(INSTALL_HTMLFILES) $(INSTALL_MANFILES)
 mame: $(OBJ) $(OBJ)/advmame$(EXE)
 mess: $(MESSOBJ) $(MESSOBJ)/advmess$(EXE)
 emu: mame mess
@@ -182,7 +182,7 @@ web: $(WEB_DOCFILES)
 # Ensure that the doc target is always created also if a doc directory exists
 .PHONY: doc
 
-doc: $(INSTALL_DOCFILES)
+doc: $(INSTALL_DOCFILES) $(INSTALL_HTMLFILES)
 
 ############################################################################
 # Source
@@ -378,6 +378,7 @@ install-dirs:
 	-$(INSTALL_PROGRAM_DIR) $(DESTDIR)$(bindir)
 	-$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)
 	-$(INSTALL_DATA_DIR) $(DESTDIR)$(docdir)
+	-$(INSTALL_DATA_DIR) $(DESTDIR)$(htmldir)
 	-$(INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man1
 	-$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/rom
 	-$(INSTALL_DATA_DIR) $(DESTDIR)$(pkgdir)/sample
@@ -459,13 +460,19 @@ uninstall-bin:
 		rm -f $(DESTDIR)$(bindir)/$$i; \
 	done
 
-install-doc: $(INSTALL_DOCFILES)
+install-doc: $(INSTALL_DOCFILES) $(INSTALL_HTMLFILES)
 ifdef INSTALL_DOCFILES
 	@for i in $(INSTALL_DOCFILES); do \
 		echo "$(INSTALL_DATA) $$i $(DESTDIR)$(docdir)"; \
 		$(INSTALL_DATA) $$i $(DESTDIR)$(docdir); \
 	done
 endif
+ifdef INSTALL_HTMLFILES
+	@for i in $(INSTALL_HTMLFILES); do \
+		echo "$(INSTALL_DATA) $$i $(DESTDIR)$(htmldir)"; \
+		$(INSTALL_DATA) $$i $(DESTDIR)$(htmldir); \
+	done
+endif
 
 uninstall-doc:
 ifdef INSTALL_DOCFILES
@@ -473,6 +480,11 @@ ifdef INSTALL_DOCFILES
 		rm -f $(DESTDIR)$(docdir)/$$i; \
 	done
 endif
+ifdef INSTALL_HTMLFILES
+	@for i in $(notdir $(INSTALL_HTMLFILES)); do \
+		rm -f $(DESTDIR)$(htmldir)/$$i; \
+	done
+endif
 
 install-man: $(INSTALL_MANFILES)
 ifdef INSTALL_MANFILES
@@ -500,6 +512,7 @@ uninstall-dirs:
 	-rmdir $(DESTDIR)$(pkgdir)/snap
 	-rmdir $(DESTDIR)$(pkgdir)
 	-rmdir $(DESTDIR)$(docdir)
+	-rmdir $(DESTDIR)$(htmldir)
 
 install: install-dirs install-bin install-data install-doc install-man
 
-- 
2.26.0