/[packages]/backports/6/mame/current/SPECS/mame.spec
ViewVC logotype

Contents of /backports/6/mame/current/SPECS/mame.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1140006 - (show annotations) (download)
Sat Aug 12 19:55:58 2017 UTC (6 years, 8 months ago) by neoclust
File size: 10482 byte(s)
SILENT: Really build against system lua
1 #The debug build is disabled by default, please use # --with debug to override
2 %bcond_with debug
3
4 %global baseversion 188
5
6 Name: mame
7 Version: 0.%{baseversion}
8 Release: %mkrel 1
9 Group: Games/Arcade
10 Summary: Multiple Arcade Machine Emulator
11
12 #LGPLv2+:
13 #src/mame/audio/snes_snd.cpp: LGPL (v2 or later)
14 #src/devices/sound/tiasound.cpp: LGPL (v2) (with incorrect FSF address)
15 #src/devices/sound/tiasound.h: LGPL (v2) (with incorrect FSF address)
16 #
17 #ASL 2.0
18 #3rdparty/bgfx
19
20 License: GPLv2+ and LGPLv2+ and ASL 2.0
21 URL: http://mamedev.org/
22 Source0: https://github.com/mamedev/%{name}/releases/download/%{name}0%{baseversion}/%{name}0%{baseversion}s.exe
23 Source1: http://mamedev.org/releases/whatsnew_0%{baseversion}.txt
24 Patch0: %{name}-fortify.patch
25 Patch1: %{name}-genie-systemlua.patch
26
27 BuildRequires: expat-devel
28 BuildRequires: libflac-devel
29 BuildRequires: fontconfig-devel
30 BuildRequires: libjpeg-devel
31 BuildRequires: libuv-devel
32 BuildRequires: lua5.3-devel >= 5.3.0
33 BuildRequires: p7zip
34 BuildRequires: portaudio-devel
35 BuildRequires: portmidi-devel
36 BuildRequires: python
37 BuildRequires: libqt5-devel
38 BuildRequires: sdl2_ttf-devel
39 BuildRequires: sqlite3-devel
40 BuildRequires: zlib-devel
41 BuildRequires: libxinerama-devel
42 BuildRequires: utf8proc-devel
43 BuildRequires: python-sphinx
44 BuildRequires: python-sphinx_rtd_theme
45
46 Requires: %{name}-data = %{version}-%{release}
47
48 #bx and bgfx are not made to be linked to dynamically as per http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=104437
49 Provides: bundled(bx)
50 Provides: bundled(bgfx)
51 #fedora contains linenoise package but it is not compatible
52 Provides: bundled(linenoise)
53 #Below have no fedora packages ATM and are very tiny
54 Provides: bundled(lsqlite3)
55 Provides: bundled(luafilesystem)
56 Provides: bundled(lua-linenoise)
57 Provides: bundled(lua-zlib)
58 #lzma is not made to be linked dynamically
59 Provides: bundled(lzma-sdk) = 16.04
60 #softfloat is not made to be linked dynamically
61 Provides: bundled(softfloat)
62 #ldplayer has been turned into a regular mame driver in 0.180 cycle
63 Provides: %{name}-ldplayer = %{version}-%{release}
64 Obsoletes: %{name}-ldplayer < 0.179-4
65
66
67 %description
68 MAME stands for Multiple Arcade Machine Emulator. When used in conjunction
69 with an arcade game's data files (ROMs), MAME will more or less faithfully
70 reproduce that game on a PC.
71
72 The ROM images that MAME utilizes are "dumped" from arcade games' original
73 circuit-board ROM chips. MAME becomes the "hardware" for the games, taking
74 the place of their original CPUs and support chips. Therefore, these games
75 are NOT simulations, but the actual, original games that appeared in arcades.
76
77 MAME's purpose is to preserve these decades of video-game history. As gaming
78 technology continues to rush forward, MAME prevents these important "vintage"
79 games from being lost and forgotten. This is achieved by documenting the
80 hardware and how it functions, thanks to the talent of programmers from the
81 MAME team and from other contributors. Being able to play the games is just
82 a nice side-effect, which doesn't happen all the time. MAME strives for
83 emulating the games faithfully.
84
85 %package tools
86 Summary: Additional tools for MAME
87 Requires: %{name}%{?_isa} = %{version}-%{release}
88
89 %description tools
90 %{summary}.
91
92 %package data
93 Summary: Data files used by MAME
94
95 BuildArch: noarch
96
97 %description data
98 %{summary}.
99
100 %package data-software-lists
101 Summary: Software lists used by MAME
102 Requires: %{name}-data = %{version}-%{release}
103
104 BuildArch: noarch
105
106 %description data-software-lists
107 %{summary}. These are split from the main -data
108 subpackage due to relatively large size.
109
110 %package doc
111 Summary: Documentation for MAME
112
113 BuildArch: noarch
114
115 %description doc
116 HTML documentation for MAME.
117
118
119 %prep
120 %setup -qcT
121
122 #do not extract system libs or document themes to ensure system ones are used
123 7za x \
124 -xr!3rdparty/expat \
125 -xr!3rdparty/genie/src/host/lua-5.3.0 \
126 -xr!3rdparty/libflac \
127 -xr!3rdparty/libjpeg \
128 -xr!3rdparty/lua \
129 -xr!3rdparty/portaudio \
130 -xr!3rdparty/portmidi \
131 -xr!3rdparty/SDL2 \
132 -xr!3rdparty/SDL2-override \
133 -xr!3rdparty/sqlite3 \
134 -xr!3rdparty/utf8proc \
135 -xr!3rdparty/zlib \
136 -xr!docs/themes \
137 %{SOURCE0}
138
139 install -pm 644 %{SOURCE1} whatsnew_0%{baseversion}.txt
140
141 find \( -regex '.*\.\(c\|cpp\|fsh\|fx\|h\|lua\|make\|map\|md\|txt\|vsh\|xml\)$' \
142 -o -wholename ./makefile \) -exec sed -i 's@\r$@@' {} \;
143
144 %patch0 -p1 -b .fortify
145 %patch1 -p1 -b .systemlua
146
147 # Create ini files
148 cat > %{name}.ini << EOF
149 # Define multi-user paths
150 artpath %{_datadir}/%{name}/artwork;%{_datadir}/%{name}/effects
151 bgfx_path %{_datadir}/%{name}/bgfx
152 cheatpath %{_datadir}/%{name}/cheat
153 crosshairpath %{_datadir}/%{name}/crosshair
154 ctrlrpath %{_datadir}/%{name}/ctrlr
155 fontpath %{_datadir}/%{name}/fonts
156 hashpath %{_datadir}/%{name}/hash
157 languagepath %{_datadir}/%{name}/language
158 pluginspath %{_datadir}/%{name}/plugins
159 rompath %{_datadir}/%{name}/roms;%{_datadir}/%{name}/chds
160 samplepath %{_datadir}/%{name}/samples
161
162 # Allow user to override ini settings
163 inipath \$HOME/.%{name}/ini;%{_sysconfdir}/%{name}
164
165 # Set paths for local storage
166 cfg_directory \$HOME/.%{name}/cfg
167 comment_directory \$HOME/.%{name}/comments
168 diff_directory \$HOME/.%{name}/diff
169 input_directory \$HOME/.%{name}/inp
170 nvram_directory \$HOME/.%{name}/nvram
171 snapshot_directory \$HOME/.%{name}/snap
172 state_directory \$HOME/.%{name}/sta
173
174 # Fedora custom defaults
175 video opengl
176 autosave 1
177 EOF
178
179 #ensure genie uses $RPM_OPT_FLAGS and $RPM_LD_FLAGS
180 sed -i "s@-Wall -Wextra -Os@$RPM_OPT_FLAGS@" 3rdparty/genie/build/gmake.linux/genie.make
181 sed -i "s@\. -s@\. $RPM_LD_FLAGS@" 3rdparty/genie/build/gmake.linux/genie.make
182
183 #rename various license files so that they can be installed with %%license
184 mv artwork/LICENSE LICENSE.CC0
185 mv bgfx/LICENSE LICENSE.BSD3
186 mv plugins/json/LICENSE LICENSE.MIT
187
188 %build
189 #save some space
190 MAME_FLAGS="NOWERROR=1 OPTIMIZE=2 VERBOSE=1 USE_SYSTEM_LIB_EXPAT=1 \
191 USE_SYSTEM_LIB_ZLIB=1 USE_SYSTEM_LIB_JPEG=1 USE_SYSTEM_LIB_FLAC=1 \
192 USE_SYSTEM_LIB_LUA=1 USE_SYSTEM_LIB_SQLITE3=1 USE_SYSTEM_LIB_PORTMIDI=1 \
193 USE_SYSTEM_LIB_PORTAUDIO=1 USE_SYSTEM_LIB_UTF8PROC=1 \
194 SDL_INI_PATH=%{_sysconfdir}/%{name};"
195
196 #standard -g causes builder to run out of memory
197 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed "s@-g@-g1@")
198
199 %if %{with debug}
200 %make_build $MAME_FLAGS DEBUG=1 TOOLS=1 OPT_FLAGS="$RPM_OPT_FLAGS" \
201 LDOPTS="$RPM_LD_FLAGS"
202 %else
203 %make_build $MAME_FLAGS TOOLS=1 OPT_FLAGS="$RPM_OPT_FLAGS" \
204 LDOPTS="$RPM_LD_FLAGS"
205 %endif
206
207 pushd docs
208 %make_build html
209 popd
210
211
212 %install
213 rm -rf $RPM_BUILD_ROOT
214
215 # create directories
216 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
217 for folder in cfg comments diff ini inp memcard nvram snap sta
218 do
219 install -d $RPM_BUILD_ROOT%{_sysconfdir}/skel/.%{name}/$folder
220 done
221 install -d $RPM_BUILD_ROOT%{_bindir}
222 for folder in artwork bgfx chds cheats ctrlr effects fonts hash language \
223 plugins hlsl keymaps roms samples shader
224 do
225 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/$folder
226 done
227 install -d $RPM_BUILD_ROOT%{_mandir}/man1
228 install -d $RPM_BUILD_ROOT%{_mandir}/man6
229
230 # install files
231 install -pm 644 %{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
232 %if %{with debug}
233 install -pm 755 %{name}d $RPM_BUILD_ROOT%{_bindir}/%{name}d || \
234 install -pm 755 %{name}64d $RPM_BUILD_ROOT%{_bindir}/%{name}d
235 %else
236 install -pm 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name} || \
237 install -pm 755 %{name}64 $RPM_BUILD_ROOT%{_bindir}/%{name}
238 %endif
239 install -pm 755 castool chdman floptool imgtool jedutil ldresample ldverify \
240 nltool nlwav pngcmp romcmp unidasm $RPM_BUILD_ROOT%{_bindir}
241 for tool in regrep split src2html srcclean
242 do
243 install -pm 755 $tool $RPM_BUILD_ROOT%{_bindir}/%{name}-$tool
244 done
245 pushd artwork
246 find -type d -exec install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/artwork/{} \;
247 find -type f -exec install -pm 644 {} $RPM_BUILD_ROOT%{_datadir}/%{name}/artwork/{} \;
248 popd
249 pushd bgfx
250 find -type d -exec install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/bgfx/{} \;
251 find -type f -exec install -pm 644 {} $RPM_BUILD_ROOT%{_datadir}/%{name}/bgfx/{} \;
252 popd
253 install -pm 644 hash/* $RPM_BUILD_ROOT%{_datadir}/%{name}/hash
254 install -pm 644 hlsl/*.fx $RPM_BUILD_ROOT%{_datadir}/%{name}/hlsl
255 install -pm 644 keymaps/* $RPM_BUILD_ROOT%{_datadir}/%{name}/keymaps
256 pushd language
257 find -type d -exec install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/language/{} \;
258 find -type f -name \*.mo -exec install -pm 644 {} $RPM_BUILD_ROOT%{_datadir}/%{name}/language/{} \;
259 popd
260 pushd plugins
261 find -type d -exec install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/plugins/{} \;
262 find -type f -exec install -pm 644 {} $RPM_BUILD_ROOT%{_datadir}/%{name}/plugins/{} \;
263 popd
264 pushd src/osd/modules/opengl
265 install -pm 644 shader/*.?sh $RPM_BUILD_ROOT%{_datadir}/%{name}/shader
266 popd
267 pushd docs/man
268 install -pm 644 castool.1 chdman.1 imgtool.1 floptool.1 jedutil.1 ldresample.1 \
269 ldverify.1 romcmp.1 $RPM_BUILD_ROOT%{_mandir}/man1
270 install -pm 644 mame.6 mess.6 $RPM_BUILD_ROOT%{_mandir}/man6
271 popd
272 find $RPM_BUILD_ROOT%{_datadir}/%{name} -name LICENSE -exec rm {} \;
273
274
275 %files
276 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.ini
277 %dir %{_sysconfdir}/%{name}
278 %{_sysconfdir}/skel/.%{name}
279 %if %{with debug}
280 %{_bindir}/%{name}d
281 %else
282 %{_bindir}/%{name}
283 %endif
284 %{_mandir}/man6/mame.6*
285 %{_mandir}/man6/mess.6*
286
287 %files tools
288 %{_bindir}/castool
289 %{_bindir}/chdman
290 %{_bindir}/floptool
291 %{_bindir}/imgtool
292 %{_bindir}/jedutil
293 %{_bindir}/ldresample
294 %{_bindir}/ldverify
295 %{_bindir}/nltool
296 %{_bindir}/nlwav
297 %{_bindir}/pngcmp
298 %{_bindir}/%{name}-regrep
299 %{_bindir}/romcmp
300 %{_bindir}/%{name}-split
301 %{_bindir}/%{name}-src2html
302 %{_bindir}/%{name}-srcclean
303 %{_bindir}/unidasm
304 %{_mandir}/man1/castool.1*
305 %{_mandir}/man1/chdman.1*
306 %{_mandir}/man1/floptool.1*
307 %{_mandir}/man1/imgtool.1*
308 %{_mandir}/man1/jedutil.1*
309 %{_mandir}/man1/ldresample.1*
310 %{_mandir}/man1/ldverify.1*
311 %{_mandir}/man1/romcmp.1*
312
313 %files data
314 %doc README.md whatsnew*.txt
315 %license LICENSE.md LICENSE.BSD3 LICENSE.CC0 LICENSE.MIT
316 %{_datadir}/%{name}
317 %exclude %{_datadir}/%{name}/hash/*
318
319 %files data-software-lists
320 %{_datadir}/%{name}/hash/*
321
322 %files doc
323 %doc docs/build/html
324

  ViewVC Help
Powered by ViewVC 1.1.30