File simple-viewer-gl.spec of Package simple-viewer-gl
%define realname simple-viewer-gl
%define srcext tar.bz2
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: 2.90
Release: wiz%{?extraver:0.}1%{?dist}
License: GPL-2.0
Group: Productivity/Graphics/Viewers
URL: https://bitbucket.org/andreyu/simple-viewer-gl
Summary: Simple Viewer GL - simple and tiny image viewer based on OpenGL
# Install-time parameters
Provides: sviewgl = %{version}
# Build-time parameters
BuildRequires: cmake >= 2.6 pkgconfig
BuildRequires: gcc-c++
BuildRequires: pkgconfig(gl)
BuildRequires: libglfw-devel >= 3.0
BuildRequires: freetype2-devel
BuildRequires: libpng-devel
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: giflib-devel
BuildRequires: zlib-devel
BuildRequires: libwebp-devel
BuildRequires: liblcms2-devel
BuildRequires: imlib2-devel
BuildRequires: libXcursor-devel
BuildRequires: pkgconfig(libexif)
BuildRequires: pkgconfig(OpenEXR) pkgconfig(IlmBase)
BuildRequires: pkgconfig(IlmBase)
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
BuildRoot: %{_tmppath}/%{name}-root
Source: %{realname}-%{version}%{?extraver}.%{srcext}
%description
The primary goal for writing Simple Viewer GL is to create an image viewer,
which only has the most basic features required for fast image viewing. It has
some vi-like key bindings and works nicely with tiling window managers (such as
Ion3 and Notion).
Supported formats:
PNG, JPEG, PSD, GIF, TIFF, TARGA, ICO, BMP, PNM, DDS, BMP, XWD,
SCR (ZX-Spectrum screen), XPM, WebP, OpenEXR.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
%build
APP_VERSION=%{version}
APP_VERSION_MINOR=${APP_VERSION#*.}
APP_VERSION_MAJOR=${APP_VERSION%.${APP_VERSION_MINOR}}
APP_VERSION_MINOR=${APP_VERSION_MINOR%%.*}
APP_VERSION_RELEASE=${APP_VERSION#${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.}
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS_RELEASE="%{optflags} %{?gcc_lto}" \
-DCMAKE_C_FLAGS_RELEASE="%{optflags} %{?gcc_lto}" \
-DCMAKE_EXE_LINKER_FLAGS_RELEASE="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}" \
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}" \
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto} -shared" \
-DCMAKE_SKIP_RPATH=YES \
-DAPP_VERSION_MAJOR=${APP_VERSION_MAJOR} \
-DAPP_VERSION_MINOR=${APP_VERSION_MINOR} \
-DAPP_VERSION_RELEASE=${APP_VERSION_RELEASE}
%{__make} %{?_smp_mflags}
%install
%{__install} -D -m0755 build/sviewgl %{buildroot}%{_bindir}/sviewgl
%{__install} -D -m0644 sviewgl.desktop %{buildroot}%{_datadir}/applications/sviewgl.desktop
%{__install} -D -m0644 res/Icon-32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/sviewgl.png
%if 0%{?suse_version}
%suse_update_desktop_file -G 'Simple image viewer' sviewgl
%endif
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc Copying.txt README.md config.example
%{_bindir}/sviewgl
%{_datadir}/applications/sviewgl.desktop
%{_datadir}/icons/hicolor/32x32/apps/sviewgl.png
%changelog