# ldplayer can be disabled by --without ldplayer or by changing to %bcond_with # if it does not build. The debug build is disabled by default, please use # --with debug to override %bcond_without ldplayer %bcond_with debug %bcond_with simd %global baseversion 188 # work around low memory on the RPM Fusion builder %bcond_without lowmem %global with_lowmem 1 %if %{with lowmem} %global _find_debuginfo_dwz_opts %{nil} %endif Name: mame Version: 0.%{baseversion} Release: %mkrel 1 Summary: Multiple Arcade Machine Emulator Group: Games/Arcade License: BSD and GPLv2+ and LGPLv2+ and Public Domain and zlib URL: http://mamedev.org/ Source0: https://github.com/mamedev/mame/releases/download/mame0%{baseversion}/mame0%{baseversion}s.exe Source1: http://mamedev.org/releases/whatsnew_0%{baseversion}.txt Patch0: %{name}-fortify.patch Patch1: %{name}-genie-systemlua.patch BuildRequires: expat-devel BuildRequires: libflac-devel BuildRequires: fontconfig-devel BuildRequires: libjpeg-devel BuildRequires: libuv-devel BuildRequires: lua-devel BuildRequires: p7zip BuildRequires: portaudio-devel BuildRequires: portmidi-devel BuildRequires: python BuildRequires: libqt5-devel BuildRequires: sdl2_ttf-devel BuildRequires: sqlite3-devel BuildRequires: zlib-devel BuildRequires: libxinerama-devel Requires: %{name}-data = %{version}-%{release} Provides: bundled(bgfx) Provides: bundled(http-parser) Provides: bundled(lsqlite3) Provides: bundled(luafilesystem) Provides: bundled(lua-zlib) Provides: bundled(lua) = 5.3.0 Provides: bundled(lzma-sdk) = 9.22 Provides: bundled(softfloat) Provides: mess = %{version}-%{release} Obsoletes: mess < 0.160-2 %description MAME stands for Multiple Arcade Machine Emulator. When used in conjunction with an arcade game's data files (ROMs), MAME will more or less faithfully reproduce that game on a PC. The ROM images that MAME utilizes are "dumped" from arcade games' original circuit-board ROM chips. MAME becomes the "hardware" for the games, taking the place of their original CPUs and support chips. Therefore, these games are NOT simulations, but the actual, original games that appeared in arcades. MAME's purpose is to preserve these decades of video-game history. As gaming technology continues to rush forward, MAME prevents these important "vintage" games from being lost and forgotten. This is achieved by documenting the hardware and how it functions, thanks to the talent of programmers from the MAME team and from other contributors. Being able to play the games is just a nice side-effect, which doesn't happen all the time. MAME strives for emulating the games faithfully. %package tools Summary: Additional tools for MAME Requires: %{name} = %{version}-%{release} Provides: mess-tools = %{version}-%{release} Obsoletes: mess-tools < 0.160-2 %description tools %{summary}. %if %{with ldplayer} %package ldplayer Summary: Standalone laserdisc player based on MAME %description ldplayer %{summary}. %endif %package data Summary: Data files used by MAME Provides: mess-data = %{version}-%{release} BuildArch: noarch %description data %{summary}. %package data-software-lists Summary: Software lists used by MAME Requires: %{name}-data = %{version}-%{release} Provides: mess-data-software-lists = %{version}-%{release} Obsoletes: mess-data < 0.146-2 BuildArch: noarch %description data-software-lists %{summary}. These are split from the main -data subpackage due to relatively large size. %prep %setup -qcT 7za x %{SOURCE0} install -pm 644 %{SOURCE1} whatsnew_0%{baseversion}.txt find \( -regex '.*\.\(c\|fsh\|fx\|h\|lua\|map\|md\|txt\|vsh\|xml\)$' \ -o -wholename ./makefile \) -exec sed -i 's@\r@@' {} \; sed -i -e 's!osd_directory_entry!osd::directory::entry!g' src/ldplayer/ldplayer.cpp %patch0 -p1 -b .fortify %patch1 -p1 -b .lua52 # Fix encoding #for whatsnew in whatsnew_0162.txt; do # iconv -f iso8859-1 -t utf-8 $whatsnew > $whatsnew.conv # mv -f $whatsnew.conv $whatsnew #done # Create ini files cat > %{name}.ini << EOF # Define multi-user paths artpath %{_datadir}/%{name}/artwork;%{_datadir}/%{name}/effects cheatpath %{_datadir}/%{name}/cheat crosshairpath %{_datadir}/%{name}/crosshair ctrlrpath %{_datadir}/%{name}/ctrlr fontpath %{_datadir}/%{name}/fonts hashpath %{_datadir}/%{name}/hash rompath %{_datadir}/%{name}/roms;%{_datadir}/%{name}/chds samplepath %{_datadir}/%{name}/samples # Allow user to override ini settings inipath \$HOME/.%{name}/ini;%{_sysconfdir}/%{name} # Set paths for local storage cfg_directory \$HOME/.%{name}/cfg comment_directory \$HOME/.%{name}/comments diff_directory \$HOME/.%{name}/diff input_directory \$HOME/.%{name}/inp nvram_directory \$HOME/.%{name}/nvram snapshot_directory \$HOME/.%{name}/snap state_directory \$HOME/.%{name}/sta # Fedora custom defaults video opengl autosave 1 EOF %if %{with simd} sed -i 's@USE_SIMD (0)@USE_SIMD (1)@' src/emu/cpu/rsp/rsp.h %endif %build #these flags are already included in the genie.lua RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's@-O2 -g -pipe -Wall @@') %if %{with simd} RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's@-mtune=generic@-march=corei7-avx@') %endif #save some space MAME_FLAGS="NOWERROR=1 SYMBOLS=1 OPTIMIZE=2 VERBOSE=1 USE_SYSTEM_LIB_EXPAT=1 \ USE_SYSTEM_LIB_ZLIB=1 USE_SYSTEM_LIB_JPEG=1 USE_SYSTEM_LIB_FLAC=1 \ USE_SYSTEM_LIB_LUA=1 USE_SYSTEM_LIB_SQLITE3=1 USE_SYSTEM_LIB_PORTMIDI=1 \ USE_SYSTEM_LIB_PORTAUDIO=1 \ USE_SYSTEM_LIB_UV=1 \ SDL_INI_PATH=%{_sysconfdir}/%{name};" %if %{with lowmem} MAME_FLAGS="$MAME_FLAGS LDOPTS=-Wl,--no-keep-memory,--reduce-memory-overheads \ SYMLEVEL=1" %endif #only use assembly on supported architectures %ifnarch %{ix86} x86_64 ppc ppc64 MAME_FLAGS="$MAME_FLAGS NOASM=1" %endif %if %{with ldplayer} %make $MAME_FLAGS TARGET=ldplayer OPT_FLAGS="$RPM_OPT_FLAGS" %endif %if %{with debug} %make $MAME_FLAGS DEBUG=1 TOOLS=1 OPT_FLAGS="$RPM_OPT_FLAGS" %else %make $MAME_FLAGS TOOLS=1 OPT_FLAGS="$RPM_OPT_FLAGS" %endif %install # create directories install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name} for folder in cfg comments diff ini inp memcard nvram snap sta do install -d $RPM_BUILD_ROOT%{_sysconfdir}/skel/.%{name}/$folder done install -d $RPM_BUILD_ROOT%{_bindir} for folder in artwork chds cheats ctrlr effects fonts hash hlsl keymaps roms \ samples shader do install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/$folder done install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hlsl/artwork_support install -d $RPM_BUILD_ROOT%{_mandir}/man1 install -d $RPM_BUILD_ROOT%{_mandir}/man6 # install files install -pm 644 %{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}/%{name} %if %{with ldplayer} install -pm 755 ldplayer $RPM_BUILD_ROOT%{_bindir}/ldplayer || \ install -pm 755 ldplayer64 $RPM_BUILD_ROOT%{_bindir}/ldplayer %endif %if %{with debug} install -pm 755 %{name}d $RPM_BUILD_ROOT%{_bindir}/%{name}d || \ install -pm 755 %{name}64d $RPM_BUILD_ROOT%{_bindir}/%{name}d %else install -pm 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name} || \ install -pm 755 %{name}64 $RPM_BUILD_ROOT%{_bindir}/%{name} %endif install -pm 755 castool chdman floptool imgtool jedutil ldresample ldverify \ nltool pngcmp romcmp unidasm $RPM_BUILD_ROOT%{_bindir} for tool in regrep split src2html srcclean do install -pm 755 $tool $RPM_BUILD_ROOT%{_bindir}/%{name}-$tool done cp -r -p artwork/* $RPM_BUILD_ROOT%{_datadir}/%{name}/artwork install -pm 644 hash/* $RPM_BUILD_ROOT%{_datadir}/%{name}/hash install -pm 644 hlsl/*.fx $RPM_BUILD_ROOT%{_datadir}/%{name}/hlsl install -pm 644 keymaps/* $RPM_BUILD_ROOT%{_datadir}/%{name}/keymaps pushd src/osd/modules/opengl install -pm 644 shader/*.?sh $RPM_BUILD_ROOT%{_datadir}/%{name}/shader popd pushd docs/man %if %{with ldplayer} install -pm 644 ldplayer.1 $RPM_BUILD_ROOT%{_mandir}/man1 %endif install -pm 644 castool.1 chdman.1 imgtool.1 floptool.1 jedutil.1 ldresample.1 \ ldverify.1 romcmp.1 $RPM_BUILD_ROOT%{_mandir}/man1 install -pm 644 mame.6 mess.6 $RPM_BUILD_ROOT%{_mandir}/man6 popd %files %doc docs/config.txt docs/floppy.txt docs/hlsl.txt docs/luaengine.md %doc docs/m6502.txt docs/mame.txt docs/newvideo.txt %doc docs/nscsi.txt docs/SDL.txt README.md %doc whatsnew_*.txt %license docs/LICENSE %config(noreplace) %{_sysconfdir}/%{name}/%{name}.ini %dir %{_sysconfdir}/%{name} %{_sysconfdir}/skel/.%{name} %if %{with debug} %{_bindir}/%{name}d %else %{_bindir}/%{name} %endif %{_mandir}/man6/mame.6* %{_mandir}/man6/mess.6* %files tools %doc docs/imgtool.txt %{_bindir}/castool %{_bindir}/chdman %{_bindir}/jedutil %{_bindir}/floptool %{_bindir}/imgtool %{_bindir}/ldresample %{_bindir}/ldverify %{_bindir}/%{name}-regrep %{_bindir}/nltool %{_bindir}/pngcmp %{_bindir}/romcmp %{_bindir}/%{name}-split %{_bindir}/%{name}-src2html %{_bindir}/%{name}-srcclean %{_bindir}/unidasm %{_mandir}/man1/castool.1* %{_mandir}/man1/chdman.1* %{_mandir}/man1/floptool.1* %{_mandir}/man1/imgtool.1* %{_mandir}/man1/jedutil.1* %{_mandir}/man1/ldresample.1* %{_mandir}/man1/ldverify.1* %{_mandir}/man1/romcmp.1* %if %{with ldplayer} %files ldplayer %{_bindir}/ldplayer %{_mandir}/man1/ldplayer.1* %endif %files data %{_datadir}/%{name} %exclude %{_datadir}/%{name}/hash/* %files data-software-lists %{_datadir}/%{name}/hash/*