File xv.spec of Package xv

# spec file for package xv
# Copyright (c) 2017 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

%if ! %{defined _distconfdir}
%define _distconfdir %{_prefix}%{_sysconfdir}
%define dousretc 1

Name:           xv
Version:        5.0.0
Release:        0
Summary:        GIF/TIFF/JPEG/PostScript Image Viewer
License:        SUSE-NonFree
Group:          Productivity/Graphics/Viewers
Source:         xv-3.10a-js-%{version}.tar.gz
Source2:        xsetbgimg
Source3:        xv.desktop
Source4:        xv.png
Source5:        xv-tests.tar.bz2
Patch0:         xv-3.10a.dif
Patch2:         xv-more-bmp-formats.patch
Patch3:         xv-3.10a-overflow.dif
BuildRequires:  cmake
BuildRequires:  dos2unix
BuildRequires:  groff
BuildRequires:  imake
BuildRequires:  pkgconfig(ice)
BuildRequires:  pkgconfig(jasper)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  pkgconfig(libwebp)
BuildRequires:  pkgconfig(sm)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xt)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  update-desktop-files
Provides:       xv300
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo %{_prefix}/X11R6)}

XV is an interactive image viewer for the X Window System. XV displays
images in GIF, JPEG, TIFF, PNG, PBM, PGM, PPM, X Window System bitmap,
Utah Raster Toolkit RLE, PDS/VICAR, Sun Rasterfile, BMP, PCX, IRIS RGB,
XPM, Targa, XWD, possibly PostScript, and PM formats on workstations
and terminals running the X Window System Version 11.

XV can also manipulate pictures. It can zoom in and out, rotate, and
flip them. It also provides a wide variety of operations to modify

It is one of the most famous programs for Linux.

The documentation can be found in %{_docdir}/xv/.

Please remember that this program has shareware status for commercial

%package doc
Summary:        Documentation about XV
Group:          Documentation/Other
Requires:       %{name} = %{version}
Provides:       %{name}:%{_docdir}/%{name}/README
BuildArch:      noarch

%description doc
The documentation about XV.

%setup -q -n xv-3.10a-js-%{version}
%patch -P2 -b .mbmp
%patch -P3 -b .ovf
%patch -P0 -b .p0

CFLAGS="%{optflags} -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -DDOCDIR=\\\"%{_docdir}/%{name}\\\""
export CFLAGS
%cmake -DCMAKE_C_COMPILER=gcc \
%make_build -O %{?_smp_mflags} V=1 CC=gcc

%make_install -C build V=1 CC=gcc MANSUF=1x
install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/xsetbgimg
if test -e src/docs/manuals/xvdocs.pdf ; then
 rm -vf src/docs/manuals/
if test -e src/docs/manuals/ ; then
 cp -p src/docs/manuals/
 dos2unix src/docs/manuals/
 touch -r src/docs/manuals/
%suse_update_desktop_file -i xv Graphics Viewer

%license src/COPYRIGHT
%exclude %doc %{_docdir}/%{name}/BUGS
%exclude %doc %{_docdir}/%{name}/CHANGELOG
%exclude %doc %{_docdir}/%{name}/CPMASK
%exclude %doc %{_docdir}/%{name}/IDEAS
%exclude %doc %{_docdir}/%{name}/README.FLmask
%exclude %doc %{_docdir}/%{name}/copyright.h
%doc src/docs/help
%if %{defined dousretc}
%dir %{_distconfdir}/
%dir %{_mandir}/fi/
%dir %{_mandir}/fi/man1/

%files doc
%dir %doc %{_docdir}/%{name}/
%exclude %{_docdir}/%{name}/help
%doc %{_docdir}/%{name}/*

openSUSE Build Service is sponsored by