File hotshots.spec of Package hotshots

#
# spec file for package hotshots
#
# Copyright (c) 2014 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/
#


Name:           hotshots
Version:        2.2.0
Release:        0
License:        GPL-2.0+
Summary:        Screenshot and Annotation Tool
Url:            https://sourceforge.net/projects/hotshots/
Group:          Productivity/Graphics/Other
Source0:        http://downloads.sourceforge.net/%{name}/HotShots-%{version}-src.zip
# PATCH-FIX-OPENSUSE hotshots-desktop.patch lazy.kent@opensuse.org -- fix desktop file
Patch0:         hotshots-desktop.patch
# PATCH-FIX-OPENSUSE hotshots-docs_path.patch lazy.kent@opensuse.org -- The program needs to display some docs. To avoid dupes add path to %%{_defaultdocdir}.
Patch1:         hotshots-docs_path.patch
BuildRequires:  ImageMagick
BuildRequires:  hicolor-icon-theme
BuildRequires:  libqxt-devel
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtNetwork)
BuildRequires:  pkgconfig(QtXml)
BuildRequires:  unzip
BuildRequires:  update-desktop-files
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(post):     shared-mime-info
Requires(postun):   shared-mime-info

%description
HotShots is an application for capturing screens and saving them in
a variety of image formats as well as adding annotations and graphical
data (arrows, lines, texts, ...).

%lang_package

%prep
%setup -qn HotShots-%{version}-src
%patch0 -p1
%patch1 -p1
sed -i 's/\r$//' *.txt

%build
cd build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
qmake \
    QMAKE_STRIP="true" \
    INSTALL_PREFIX=%{_prefix} \
    MYAPP_INSTALL_TRANS=%{_datadir}/%{name}/locale \
    MYAPP_INSTALL_DESKTOP=%{_datadir}/applications
make %{?_smp_mflags}

%install
pushd build
make INSTALL_ROOT=%{buildroot} install
popd
# Remove docs as we use hotshot-docs_path.patch.
rm -rf %{buildroot}%{_datadir}/%{name}/*.txt
# Remove pixmap. Install icons of various sizes into icons/hicolor.
rm -f %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -Dm 0644 res/%{name}.png \
    %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
for size in 96x96 64x64 48x48 32x32 22x22 16x16 ; do
    install -dm 0755 \
        %{buildroot}%{_datadir}/icons/hicolor/${size}/apps
    convert -strip -resize ${size} res/%{name}.png \
        %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
done
%find_lang %{name} --with-qt
%suse_update_desktop_file %{name}

%post
%desktop_database_post
%icon_theme_cache_post
%mime_database_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun

%files
%defattr(-,root,root,-)
%doc AUTHORS.txt Changelog.txt COPYING.txt CREDITS.txt FAQ.txt
%doc LICENSE.txt NEWS.txt README.txt TODO.txt
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.*
%{_datadir}/mime/packages/%{name}.xml
%doc %{_mandir}/man?/*

%files lang -f %{name}.lang
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/
%dir %{_datadir}/%{name}/locale/

%changelog
openSUSE Build Service is sponsored by