File qpxtool.spec of Package qpxtool

#
# spec file for package qpxtool
#
# Copyright (c) 2013 SUSE LINUX Products 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 http://bugs.opensuse.org/
#


%define major 0

Name:           qpxtool
Version:        0.7.2
Release:        0
License:        GPL-2.0+
Summary:        CD/DVD Drive Quality Testsuite
Url:            http://qpxtool.sourceforge.net
Group:          Productivity/Multimedia/CD/Record
Source0:        http://downloads.sourceforge.net/qpxtool/%{name}-%{version}.tar.bz2
# PATCH-FIX-OPENSUSE qpxtool-0.7.2-optflags.patch lazy.kent@opensuse.org -- use optimization flags and don't strip binaries
Patch0:         qpxtool-0.7.2-optflags.patch
# PATCH-FIX-UPSTREAM qpxtool-0.7.2-configure_png.patch sf#3597215 lazy.kent@opensuse.org -- fix linker options
Patch1:         qpxtool-0.7.2-configure_png.patch
# PATCH-FIX-UPSTREAM qpxtool-0.7.2-no_return.patch sf#3597217 lazy.kent@opensuse.org -- fix no-return-in-nonvoid-function error
Patch2:         qpxtool-0.7.2-no_return.patch
# PATCH-FIX-UPSTREAM qpxtool-0.7.0-libpng15.patch sf#3597216 -- fix build against libpng15
Patch3:         qpxtool-0.7.0-libpng15.patch
BuildRequires:  ImageMagick
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtNetwork)
BuildRequires:  pkgconfig(QtSql)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
QPxTool is the linux way to get full control over your CD/DVD drives.
It is the Open Source Solution which intends to give you access to all
available Quality Checks (Q-Checks) on written and blank media, that are
available for your drive. This will help you to find the right media and
the optimized writing speed for your hardware, which will increase
the chance for a long data lifetime.

%package gui
Summary:        QPxTool Front-end
Group:          Productivity/Multimedia/CD/Record
Requires:       %{name} = %{version}

%description gui
Qt4 GUI for the package QPxTool.

%package -n libqpx%{major}
Summary:        QPxTool Libraries
Group:          System/Libraries

%description -n libqpx%{major}
Libraries for the package QPxTool.

%package -n libqpx-devel
Summary:        QPxTool Development Files
Group:          Development/Libraries/C and C++
Requires:       libqpx%{major} = %{version}

%description -n libqpx-devel
QPxTool libraries and header files.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3

%build
export OPTFLAGS="%{optflags} -fno-strict-aliasing"
./configure \
    --prefix=%{_prefix} \
    --libdir=%{_libdir} \
    --mandir=%{_mandir}
make %{?_smp_mflags}

%install
%make_install
rm -f %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -Dm 0644 gui/images/q.png \
    %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
for size in 48x48 32x32 22x22 16x16 ; do
    install -dm 0755 \
        %{buildroot}%{_datadir}/icons/hicolor/${size}/apps
    convert -resize ${size} gui/images/q.png \
        %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
done
%suse_update_desktop_file -i -r %{name} AudioVideo CD Qt

%post -n libqpx%{major} -p /sbin/ldconfig

%postun -n libqpx%{major} -p /sbin/ldconfig

%post gui
%icon_theme_cache_post

%postun gui
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README TODO status.html SupportedDevices
%{_bindir}/qscand
%attr(0750,root,cdrom) %{_sbindir}/pxfw
%attr(0750,root,cdrom) %{_bindir}/cdvdcontrol
%attr(0750,root,cdrom) %{_bindir}/f1tattoo
%attr(0750,root,cdrom) %{_bindir}/qscan
%attr(0750,root,cdrom) %{_bindir}/readdvd
%{_libdir}/%{name}/
%doc %{_mandir}/man?/*

%files gui
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.*

%files -n libqpx%{major}
%defattr(-,root,root,-)
%{_libdir}/*.so.*

%files -n libqpx-devel
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README TODO status.html SupportedDevices
%{_includedir}/%{name}/
%{_libdir}/*.so

%changelog