Summary:   A graphical front-end to Qemu virtual machines
Summary(ja): Qemu 仮想マシン用グラフィカルフロントエンド
Name:      qemu-launcher
Version:   1.7.4
Release:   1%{?_dist_release}

Group:     Applications/Emulators
License:   GPLv2+
URL:       https://gna.org/projects/qemulaunch/

Source0:   http://download.gna.org/qemulaunch/1.7.x/%{name}_%{version}.tar.gz
#Patch0 changes:
# qemu-launcher.desktop: Removed file extension from Icon, changed Categories
#   to System
# Makefile: "install" commands given -p switch to preserve timestamps
Patch0:    %{name}-%{version}.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
ExcludeArch: ppc64

BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: libxml2
Requires:      qemu
Requires:      perl-Gtk2-GladeXML
Requires:      perl-gettext

%description
Qemu Launcher provides a graphical front-end to all basic, and many advanced
QEMU computer emulator options. It allows you to create, save, and run multiple
virtual machine configurations, create and convert disk images.

%prep
%setup -q
%patch -p1


%build
make PREFIX=%{_prefix} %{?_smp_mflags}


%install
rm -rf %{buildroot}
make install                                 \
  PREFIX=%{_prefix} DESTDIR=%{buildroot}     \
  DOCSDIR="." #Install docs in cwd, and catch them with %doc below
desktop-file-install --vendor fedora --delete-original  \
  --dir %{buildroot}/%{_datadir}/applications/          \
  %{buildroot}/%{_datadir}/applications/%{name}.desktop
%find_lang %{name}


%clean
rm -rf %{buildroot}


%post
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%postun
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc Changelog COPYING README TODO
%{_bindir}/*
%{_datadir}/%{name}
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%{_datadir}/icons/hicolor/*/apps/*
%{_mandir}/man1/*


%changelog
* Sun Jul 06 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.7.4-1
- initial build for Vine Linux

* Sat Dec 09 2007 Nicholas Boyle <nsboyle@gmail.com> - 1.7.4-4
- Added ExcludeArch: ppc64, as there is no ppc64 build for qemu
* Tue Dec 04 2007 Nicholas Boyle <nsboyle@gmail.com> - 1.7.4-3
- Clean after build now correctly removes buildroot
- Package now takes ownership of directories it creates
- Patched Makefile to preserve timestamps on files during install
- Included source tarball with original timestamps
* Sat Dec 01 2007 Nicholas Boyle <nsboyle@gmail.com> - 1.7.4-2
- Changed BuildArch to noarch
- Changed PREFIX and doc installation behavior during make and make install
  rather than patching the Makefile
- Changed package Group to Applications/Emulators
* Sun Nov 25 2007 Nicholas Boyle <nsboyle@gmail.com> - 1.7.4-1
- Initial Fedora packaging
