overhauled qmc2 spec file

Julian Sikorski belegdol at gmail.com
Mon Jan 5 13:23:00 CET 2009


Hi list,

as of 0.2b6, qmc2 added support for SDLMESS, which requires a separate
binary to be built. It is still preliminary and pretty much useless now,
but it is quite likely to change with next release. Thus, I have made an
initial attempt to overhaul the spec file so that both binaries could be
 built in one go (attached). Could anybody please have a look at it and
tell me if it makes sense? Thanks in advance!

Regards,
Julian
-------------- next part --------------
%define beta b6

Name:           qmc2
Version:        0.2
Release:        0.8.%{beta}%{?dist}
Summary:        M.A.M.E. Catalog / Launcher II, common files

Group:          Applications/Emulators
License:        GPLv2
URL:            http://www.mameworld.net/mamecat
Source0:        http://dl.sourceforge.net/qmc2/%{name}-%{version}.%{beta}.tar.bz2
Source1:        %{name}.png
Patch1:         qmc2-ini.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  desktop-file-utils
BuildRequires:  phonon-devel
BuildRequires:  qt4-devel
BuildRequires:  rsync
BuildRequires:  SDL-devel
Requires:       games-menus
Requires:       hicolor-icon-theme
Requires:       %{name}-binary = %{version}

%description
QMC2 is a Qt4 based UNIX MAME/MESS frontend for SDLMAME and SDLMESS. This
package contains the common files.

%package sdlmame
Summary:        M.A.M.E. Catalog / Launcher II, SDLMESS support
Group:          Applications/Emulators
Requires:       %{name} = %{version}
Requires:       sdlmame
Provides:       %{name}-binary = %{version}

%description sdlmame
QMC2 is a Qt4 based UNIX MAME/MESS frontend for SDLMAME and SDLMESS. This
package contains the parts required for SDLMESS support.

%package sdlmess
Summary:        M.A.M.E. Catalog / Launcher II, SDLMESS support
Group:          Applications/Emulators
Requires:       %{name} = %{version}
Requires:       sdlmess
Provides:       %{name}-binary = %{version}

%description sdlmess
QMC2 is a Qt4 based UNIX MAME/MESS frontend for SDLMAME and SDLMESS. This
package contains the parts required for SDLMESS support.


%prep
%setup -qcT
tar -xjf %{SOURCE0}
mv %{name} sdlmame
tar -xjf %{SOURCE0}
mv %{name} sdlmess
%patch1 -p0 -b .ini~

# create qmc2 desktop files
cat > %{name}.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=%{name} for SDLMAME
GenericName=M.A.M.E. Catalog / Launcher II for SDLMAME
Comment=SDLMAME Frontend
Exec=%{name}-sdlmame
Icon=%{name}
Terminal=false
Type=Application
Categories=Game;Emulator;
EOF

cat > %{name}-sdlmess.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=%{name} for SDLMESS
GenericName=M.A.M.E. Catalog / Launcher II for SDLMESS
Comment=SDLMESS Frontend
Exec=%{name}-sdlmess
Icon=%{name}
Terminal=false
Type=Application
Categories=Game;Emulator;
EOF


%build
pushd sdlmess
QTDIR=%{_prefix} make %{?_smp_mflags} CTIME=0 DISTCFG=1\
    PRETTY=0 PREFIX=%{_prefix} SYSCONFDIR=%{_sysconfdir} \
    EMULATOR=SDLMESS
popd

pushd sdlmame
QTDIR=%{_prefix} make %{?_smp_mflags} CTIME=0 DISTCFG=1\
    PRETTY=0 PREFIX=%{_prefix} SYSCONFDIR=%{_sysconfdir} \
    EMULATOR=SDLMAME
popd


%install
rm -rf $RPM_BUILD_ROOT

pushd sdlmess
QTDIR=%{_prefix} make install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 \
    PRETTY=0 CTIME=0 PREFIX=%{_prefix} SYSCONFDIR=%{_sysconfdir} \
    EMULATOR=SDLMESS
popd

pushd sdlmame
QTDIR=%{_prefix} make install DESTDIR=$RPM_BUILD_ROOT DISTCFG=1 \
    PRETTY=0 CTIME=0 PREFIX=%{_prefix} SYSCONFDIR=%{_sysconfdir} \
    EMULATOR=SDLMAME
popd

# remove docs since we are intalling docs in %doc
pushd $RPM_BUILD_ROOT%{_datadir}/%{name}
rm -fr doc
ln -s ../doc/%{name}-%{version} doc
popd

# install fedora desktop files
desktop-file-install --vendor=dribble \
    --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
    %{name}.desktop
desktop-file-install --vendor=rpmfusion\
    --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
    %{name}-sdlmess.desktop

# install icon
install -d $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps

#fix the executable permissions
chmod 755 $RPM_BUILD_ROOT%{_bindir}/%{name}


%post
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%postun
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc sdlmame/data/doc/html
%config(noreplace) %{_sysconfdir}/%{name}
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
%{_datadir}/applications/*.desktop

%files sdlmame
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_bindir}/%{name}-sdlmame
%{_datadir}/applications/dribble-qmc2.desktop

%files sdlmess
%defattr(-,root,root,-)
%{_bindir}/%{name}-sdlmess
%{_datadir}/applications/rpmfusion-qmc2-sdlmess.desktop


%changelog
* Thu Oct 16 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.2-0.7.b5
- Updated to 0.2b5

* Tue Aug 19 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.2-0.6.b4
- Added phonon-devel to BuildRequires
- Cleaned up BuildRequires and Requires

* Tue Aug 19 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.2-0.5.b4
- Updated to 0.2b4

* Wed Jul 30 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.2-0.4.b3
- rebuild for buildsys cflags issue

* Mon Jul  7 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.2-0.3.b3
- Updated to 0.2b3
- Dropped the qt4 patch, use DISTCFG instead
- Updated the ini patch to include dat files location
- Added SDL-devel to BuildRequires

* Sat May 10 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.2-0.2.b2
- Updated to 0.2b2
- Dropped %%{?dist} from %%changelog
- Added hyphen before version number in %%changelog

* Wed Mar 26 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.2-0.1.b1
- Updated to 0.2b1
- Dropped the ini fix since it has been merged upstream

* Sat Feb 23 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.1-4
- Updated the inipaths to reflect the post-0.123u1 SDLMAME configuration

* Sat Feb 23 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.1-3
- Replaced the previous workaround with a proper fix from upstream

* Mon Feb 11 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.1-2
- Updated the ini path to fix import/export feature

* Wed Feb  6 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.1-1
- Upstream sync

* Thu Jan 31 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.1-0.10.b11
- Upstream sync
- Drop backup files deletion, there are none present
- Adjusted the License tag
- Fixed the executable permissions

* Mon Jul 30 2007 XulChris <tkmame at retrogames.com> - 0.1-0.9.b10
- Upstream sync
- Remove no longer needed qt43 patch

* Mon Jul 02 2007 XulChris <tkmame at retrogames.com> - 0.1-0.8.b9
- Add patch to fix Qt-4.3 segmentation fault

* Sun Apr 22 2007 XulChris <tkmame at retrogames.com> - 0.1-0.7.b9
- Remove style from desktop file and add it to ini file instead
- Dribble Bugzilla #89

* Fri Mar 30 2007 XulChris <tkmame at retrogames.com> - 0.1-0.6.b9
- Upstream sync
- Remove no longer needed datadir patch

* Sun Mar 11 2007 XulChris <tkmame at retrogames.com> - 0.1-0.5.b8
- Update desktop category
- Include new paths in ini file
- Add patch to fix DATADIR parsing in Makefile

* Fri Feb 23 2007 XulChris <tkmame at retrogames.com> - 0.1-0.4.b8
- Upstream sync
- Update Source0 URL
- Remove patches which are now included in upstream
- Move creation of desktop file to %%prep
- Sync ini patch with new ini template

* Wed Jan 31 2007 XulChris <tkmame at retrogames.com> - 0.1-0.3.b7
- Fix ini patch

* Wed Jan 17 2007 XulChris <tkmame at retrogames.com> - 0.1-0.2.b7
- Make opengl default video mode
- Remove macros from Patch tags
- Move creation of .desktop file into %%build
- Fix Categories field in .desktop file
- Remove Version field from .desktop file
- Fix documentation

* Sun Dec 24 2006 XulChris <tkmame at retrogames.com> - 0.1-0.1.b7
- Initial Release2


More information about the rpmfusion-developers mailing list