File nomacs.spec of Package nomacs

#
# spec file for package nomacs
#
# Copyright (c) 2015 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 http://bugs.opensuse.org/
#


Name:           nomacs
Version:        2.4.6
Release:        0
Summary:        Lightweight image viewer
License:        GPL-3.0+
Group:          Productivity/Graphics/Viewers
Url:            http://nomacs.org/
Source:         http://downloads.sf.net/%{name}/%{name}-%{version}-source.tar.bz2
# PATCH-FIX-OPENSUSE nomacs-qt5-build-fix.patch sor.alexei@meowr.ru -- Fix build with Qt5.
Patch0:         %{name}-qt5-build-fix.patch
BuildRequires:  cmake >= 2.6
BuildRequires:  dos2unix
BuildRequires:  gcc-c++
BuildRequires:  libqt5-linguist-devel
BuildRequires:  opencv-qt5-devel
BuildRequires:  pkg-config
BuildRequires:  quazip-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(exiv2)
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(libraw)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  pkgconfig(zlib)

%description
nomacs is a free image viewer, which is small, fast and able to handle the
most common image formats. Additionally it is possible to synchronize
multiple viewers. A synchronization of viewers running on the same
computer or via LAN is possible. It allows to compare images and spot the
differences (e.g. schemes of architects to show the progress).

%prep
%setup -q
%patch0 -p1
dos2unix Readme/*
find src -type f -name '*.cpp' | while read f; do
    # Fix encoding issues in nomacs with Qt5.
    dos2unix "$f" && \
      iconv -f iso-8859-2 -t utf-8 "$f" > "$f.new" && \
      mv -f "$f.new" "$f"
done

%build
%cmake \
  -DCMAKE_C_FLAGS='%{optflags} -fno-strict-aliasing'   \
  -DCMAKE_CXX_FLAGS='%{optflags} -fno-strict-aliasing' \
  -DENABLE_QT5=1                                       \
  -DQT_QMAKE_EXECUTABLE=%{_libdir}/qt5/bin/qmake
make %{?_smp_mflags}

%install
%cmake_install
install -Dm 0644 %{name}.appdata.xml \
  %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
%suse_update_desktop_file %{name}
%find_lang %{name} --with-qt

%post
%desktop_database_post

%postun
%desktop_database_postun

%files
%defattr(-,root,root)
%doc Readme/*
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%dir %{_datadir}/appdata/
%{_datadir}/appdata/%{name}.appdata.xml
%{_mandir}/man?/%{name}.?%{?ext_man}

%changelog
openSUSE Build Service is sponsored by