Name: qmc2
Version: 0.195
Release: %autorelease
Summary: M.A.M.E. Catalog / Launcher II
#PDF.js is ASL 2.0
#data/js/pdfjs/web/l10n.js is MIT
#everything else is GPLv2
License: GPLv2 and ASL 2.0 and MIT
URL: http://qmc2.batcom-it.net
Source0: http://downloads.sourceforge.net/qmc2/%{name}-%{version}.tar.bz2
%if 0%{?fedora} >= 30
Patch0: %{name}-minizip.patch
%endif
Patch2: %{name}-listxml-softlist-fix.patch
Patch3: %{name}-fedora-linux.patch
#Fedora-specific configuration
Patch1: %{name}-ini.patch
BuildRequires: make
BuildRequires: desktop-file-utils
BuildRequires: libarchive-devel
BuildRequires: libXmu-devel
BuildRequires: minizip-devel
BuildRequires: phonon-devel
BuildRequires: qt4-webkit-devel
BuildRequires: rsync
BuildRequires: SDL2-devel
Requires: games-menus
Provides: bundled(lzma-sdk) = 16.04
Provides: PDF.js = 3f320f0b
%description
A Qt based multi-platform GUI front-end for MAME.
%package -n qchdman
Summary: Qt CHDMAN GUI
License: GPLv2
Requires: mame-tools
%description -n qchdman
A stand-alone graphical user interface / front-end to chdman
%package arcade
Summary: Arcade QMC2 GUI
License: GPLv2
%description arcade
A QML-based standalone graphical arcade mode binary which utilizes the cached
data of qmc2 to quickly display and launch emulators and get you "straight into
the games"
%prep
%autosetup -p1 -n %{name}
pushd arch/Linux/
ln -s Fedora.cfg Fedora_release_33.cfg
ln -s Fedora.cfg Fedora_release_34.cfg
ln -s Fedora.cfg Fedora_release_35.cfg
ln -s Fedora.cfg Fedora_release_36.cfg
popd
#ensure system minizip and zlib are used
rm -rf minizip
rm -rf zlib
%build
%make_build DISTCFG=1 CC_FLAGS="$RPM_OPT_FLAGS" CXX_FLAGS="$RPM_OPT_FLAGS" \
L_FLAGS="$RPM_LD_FLAGS" SYSTEM_MINIZIP=1 SYSTEM_ZLIB=1 LIBARCHIVE=1
%make_build arcade DISTCFG=1 CC_FLAGS="$RPM_OPT_FLAGS" CXX_FLAGS="$RPM_OPT_FLAGS" \
L_FLAGS="$RPM_LD_FLAGS" SYSTEM_MINIZIP=1 SYSTEM_ZLIB=1 LIBARCHIVE=1
%make_build qchdman DISTCFG=1 CXX_FLAGS="$RPM_OPT_FLAGS" L_FLAGS="$RPM_LD_FLAGS"
%make_build doc DISTCFG=1
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 PREFIX=%{_prefix} \
QT_TRANSLATION=../../qt4/translations
make arcade-install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 PREFIX=%{_prefix} \
QT_TRANSLATION=../../qt4/translations
make qchdman-install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 PREFIX=%{_prefix} \
QT_TRANSLATION=../../qt4/translations
make doc-install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 MAN_DIR=%{_mandir}
#remove docs since we are installing docs in %%doc
pushd $RPM_BUILD_ROOT%{_datadir}/%{name}
rm -fr doc
ln -s %{_docdir}/%{name} doc
popd
#validate the desktop files
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/qmc2-sdlmame.desktop
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/qmc2-arcade.desktop
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/qchdman.desktop
%files
%doc data/doc/html/*
%license data/doc/html/us/copying.html data/js/pdfjs/LICENSE
%config(noreplace) %{_sysconfdir}/qmc2
%{_bindir}/qmc2
%{_bindir}/qmc2-sdlmame
%{_datadir}/applications/qmc2-sdlmame.desktop
%{_mandir}/man6/qmc2-main-gui.6*
%{_mandir}/man6/qmc2-sdlmame.6*
%{_mandir}/man6/qmc2.6*
%{_datadir}/qmc2
%files arcade
%license data/doc/html/us/copying.html
%{_bindir}/qmc2-arcade
%{_datadir}/applications/qmc2-arcade.desktop
%{_mandir}/man6/qmc2-arcade.6*
%files -n qchdman
%license data/doc/html/us/copying.html
%{_bindir}/qchdman
%{_datadir}/applications/qchdman.desktop
%{_mandir}/man6/qchdman.6*
%changelog
%autochangelog