File imagewriter.spec of Package imagewriter

#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# needsrootforbuild
%global debug_package %{nil}
%define breq qt4-devel
%define backend udisks2
%define qmake /usr/bin/qmake-qt4  
%define lrelease /usr/bin/lrelease-qt4
%define definedbackend USEUDISKS2

Name:           imagewriter
Summary:        SUSE Imagewriter
Version:        1.10
Release:        0
Group:          Hardware/Other
License:        GPL-2.0
Url:            https://github.com/openSUSE/imagewriter
Source:         imagewriter-%{version}.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++
BuildRequires:  %{breq} %{backend}

%description
A graphical utility for writing raw disk images and hybrid ISOs to USB keys.

%prep
%setup 

%build
%{qmake} PREFIX=$RPM_BUILD_ROOT/%{_prefix} DEFINES=%{definedbackend} imagewriter.pro
make buildroot=$RPM_BUILD_ROOT CFLAGS="$RPM_OPT_FLAGS -DKIOSKHACK"

%install
# build
# I don't know why 'make install' ignores the binary when built in OBS
install -d $RPM_BUILD_ROOT/usr/bin
install -m 755 -p imagewriter $RPM_BUILD_ROOT/%{_bindir}
make install
%if 0%{?suse_version}
    %suse_update_desktop_file imagewriter
%endif
perl -i -l -wpe 's/^(Exec=).*/${1}beesu imagewriter/' $RPM_BUILD_ROOT%{_prefix}/share/applications/imagewriter.desktop

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_bindir}/imagewriter
%{_prefix}/share/applications/imagewriter.desktop
#%{_prefix}/share/icons/hicolor/*/apps/imagewriter.png
%dir %{_datadir}/icons/hicolor/*/apps/
%dir %{_datadir}/icons/hicolor/*/
%dir %{_datadir}/icons/hicolor/
%{_datadir}/icons/hicolor/*/apps/imagewriter.*
%doc COPYING
%{_mandir}/man1/imagewriter.1.*

%changelog