File imagewriter.spec of Package imagewriter

# spec file for package imagewriter
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%if 0%{?rhel_version} == 600
     %define dist el6
     %define breq qt-devel
     %define backend hal-devel
     %define qmake /usr/bin/qmake-qt4
     %define lrelease /usr/bin/lrelease-qt4
     %define definedbackend USEHAL

%if 0%{?fedora}
    %define breq qt4-devel
    %define backend udisks2
    %define qmake /usr/bin/qmake-qt4
    %define lrelease /usr/bin/lrelease-qt4
    %define definedbackend USEUDISKS2

%if 0%{?mandriva_version}
    %define breq libqt4-devel
    %define backend hal-devel
    %define qmake /usr/lib/qt4/bin/qmake
    %define lrelease /usr/lib/qt4/bin/lrelease
    %define definedbackend USEHAL

%if 0%{?suse_version}
    %define breq pkgconfig(Qt5DBus) pkgconfig(Qt5Gui) pkgconfig(Qt5Widgets) update-desktop-files
    %define qmake /usr/bin/qmake-qt5
    %define lrelease /usr/bin/lrelease-qt5

%if 0%{?suse_version} <= 1130
    %define backend hal-devel
    %define definedbackend USEHAL

%if 0%{?suse_version} == 1140 || 0%{?suse_version} == 1210
    %define backend udisks
    %define definedbackend USEUDISKS

%if 0%{?suse_version} >= 1220
    %define backend udisks2
    %define definedbackend USEUDISKS2

Name:           imagewriter
Version:        1.10.1432200249.1d253d9
Release:        0
Summary:        Utility for writing disk images to USB keys
License:        GPL-2.0-only
Group:          Hardware/Other
Source0:        imagewriter-%{version}.tar.xz
BuildRequires:  %{backend}
BuildRequires:  %{breq}
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  xz
Requires:       xdg-utils

A graphical utility for writing raw disk images & hybrid ISOs to USB keys.

%setup -q

# Create qmake cache file for building and use optflags.
cat > .qmake.cache <<EOF
make %{?_smp_mflags}

make %{?_smp_mflags} INSTALL_ROOT=%{buildroot} install
%if 0%{?suse_version}
    %suse_update_desktop_file imagewriter

%if 0%{?suse_version} >= 1140


%if 0%{?mandriva_version}

openSUSE Build Service is sponsored by