Blob Blame History Raw
%global forgeurl https://github.com/qmc2/qmc2-mame-fe/
%global commit 2cc9d99fbff31c03a78c7b9698ced54eae61495c

Version:        0.242

%forgemeta

Name:           qmc2
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:        %{forgesource}
#Fedora-specific configuration
Patch1:         %{name}-ini.patch

BuildRequires:  desktop-file-utils
BuildRequires:  libarchive-devel
BuildRequires:  libXmu-devel
BuildRequires:  make
BuildRequires:  minizip-devel
BuildRequires:  qt5-qtmultimedia-devel
BuildRequires:  qt5-qtscript-devel
BuildRequires:  qt5-qtsvg-devel
BuildRequires:  qt5-qtwebkit-devel
BuildRequires:  qt5-qtxmlpatterns-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
%forgeautosetup -p1
#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 GIT_REV=0
%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 GIT_REV=0
%make_build qchdman DISTCFG=1 CXX_FLAGS="$RPM_OPT_FLAGS" L_FLAGS="$RPM_LD_FLAGS" \
    GIT_REV=0
%make_build doc DISTCFG=1


%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 PREFIX=%{_prefix}
make arcade-install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 PREFIX=%{_prefix}
make qchdman-install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 PREFIX=%{_prefix}
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