b17be1f
%bcond_with kde
b17be1f
%bcond_with mpv
b17be1f
b17be1f
Name:           qimgv
1cded17
Version:        1.0.3
9ec1289
Release:        %autorelease
225a314
Summary:        Image viewer. Fast, easy to use. Optional video support
b17be1f
b17be1f
License:        GPLv3+
b17be1f
URL:            https://github.com/easymodo/qimgv
1cded17
Source0:        %{url}/archive/v%{version}-alpha/%{name}-%{version}-alpha.tar.gz
6520033
4c83bb4
# Add AppData installation via Cmake and update manifest
4c83bb4
# https://github.com/easymodo/qimgv/pull/408
4c83bb4
Patch0:         https://github.com/easymodo/qimgv/pull/408.patch
b17be1f
6520033
BuildRequires:  cmake >= 3.13
b17be1f
BuildRequires:  desktop-file-utils
da791d1
BuildRequires:  gcc-c++ >= 9
b17be1f
BuildRequires:  libappstream-glib
b17be1f
BuildRequires:  ninja-build
5394a23
BuildRequires:  opencv-devel
da791d1
b17be1f
BuildRequires:  cmake(exiv2)
b17be1f
BuildRequires:  cmake(Qt5Concurrent)
1cded17
BuildRequires:  cmake(Qt5Core) >= 5.12
da791d1
BuildRequires:  cmake(Qt5Svg)
b17be1f
BuildRequires:  cmake(Qt5Widgets)
b17be1f
%if %{with kde}
b17be1f
BuildRequires:  cmake(KF5WindowSystem)
b17be1f
%endif
b17be1f
%if %{with mpv}
b17be1f
BuildRequires:  pkgconfig(mpv)
b17be1f
%endif
6520033
b17be1f
Requires:       hicolor-icon-theme
b17be1f
b17be1f
%description
225a314
Image viewer. Fast, easy to use. Optional video support.
b17be1f
b17be1f
Key features:
b17be1f
225a314
  * Simple UI
da791d1
  * Fast
da791d1
  * Easy to use
225a314
  * Fully configurable, including themes, shortcuts
225a314
  * High quality scaling
da791d1
  * Basic image editing: Crop, Rotate and Resize
da791d1
  * Ability to quickly copy / move images to different folders
da791d1
  * Experimental video playback via libmpv
225a314
  * Folder view mode
da791d1
  * Ability to run shell scripts
b17be1f
b17be1f
b17be1f
%if %{with mpv}
b17be1f
%package        freeworld
b17be1f
Summary:        Video support for %{name}
b17be1f
b17be1f
Requires:       %{name}%{?_isa} = %{version}-%{release}
b17be1f
b17be1f
%description    freeworld
b17be1f
Video support for %{name}.
b17be1f
%endif
b17be1f
b17be1f
b17be1f
%prep
1cded17
%autosetup -n %{name}-%{version}-alpha -p1
b17be1f
b17be1f
# Remove bundled translations because it doesn't work anyway with current Qt ver
b17be1f
sed -e '/translations/d' -i qimgv/resources.qrc
b17be1f
b17be1f
# Use default for Fedora build flags
b17be1f
sed -e 's/ -O3//g' -i CMakeLists.txt
b17be1f
b17be1f
b17be1f
%build
2357be8
%cmake \
2357be8
    -G Ninja \
b17be1f
    -DVIDEO_SUPPORT:BOOL=%{?with_mpv:ON}%{!?with_mpv:OFF} \
b17be1f
    -DKDE_SUPPORT:BOOL=%{?with_kde:ON}%{!?with_kde:OFF} \
5394a23
    -DOPENCV_SUPPORT=ON \
2357be8
%ninja_build -C %{_vpath_builddir}
b17be1f
b17be1f
b17be1f
%install
2357be8
%ninja_install -C %{_vpath_builddir}
b17be1f
b17be1f
b17be1f
%check
2357be8
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.xml
b17be1f
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
b17be1f
b17be1f
b17be1f
%files
b17be1f
%license LICENSE
b17be1f
%doc README.md
b17be1f
%{_bindir}/%{name}
b17be1f
%{_datadir}/applications/*.desktop
b17be1f
%{_datadir}/icons/hicolor/*/*/*.png
b17be1f
%{_datadir}/icons/hicolor/scalable/*/*.svg
b17be1f
%{_metainfodir}/*.xml
b17be1f
b17be1f
%if %{with mpv}
b17be1f
%files freeworld
b17be1f
%{_libdir}/lib%{name}_player_mpv.so*
b17be1f
%endif
b17be1f
b17be1f
b17be1f
%changelog
9ec1289
%autochangelog