File rasterview.spec of Package rasterview
#
# spec file for package rasterview
#
# Copyright (c) 2011 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/
#
# norootforbuild
Name: rasterview
Version: 1.4.1
Release: 0
License: GPL-2.0
# SLE12 needs special BuildRequires.
# For suse_version values see https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
%if 0%{?suse_version} == 1315
# For SLE12 by default CUPS 1.7.5 is provided and alternatively CUPS 1.5.4 is provided in the "legacy" module.
# For SLE12 build it with traditional CUPS 1.5.4 to ensure it works on SLE12 both with CUPS 1.7.5 and CUPS 1.5.4
# because libcups and libcupsimage in CUPS 1.7.5 are backward compatible with CUPS 1.5.4 so that applications
# that have been built with CUPS 1.5.4 also work under CUPS 1.7.5 but the libraries in CUPS 1.7.5 provide
# some additional functions so that applications that have been built with CUPS 1.7.5 and use those
# additional functions would not work under CUPS 1.7.5.
# Only in the Printing project for SLE12 use cups154-ddk (a sub package of the cups154-SLE12 source package):
BuildRequires: cups154-devel
%else
# Anything what is not SLE12 (i.e. SLE11 and all openSUSE versions) have "normal" BuildRequires:
BuildRequires: cups-devel
%endif
BuildRequires: fltk-devel
BuildRequires: fontconfig-devel
BuildRequires: gcc-c++
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
BuildRequires: update-desktop-files
BuildRequires: xorg-x11-devel
URL: http://www.easysw.com/~mike/rasterview/index.html
Group: Hardware/Printing
Summary: CUPS/PWG Raster File Viewer
Source0: http://www.msweet.org/files/project7/rasterview-%{version}.tar.gz
Source1: cupsraster2ppm.c
Patch0: rv-makefile.diff
Patch1: rv-desktop.diff
Patch3: rv-maketestfiles.diff
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
RasterView is a CUPS/PWG raster file viewer
for CUPS 1.2 and higher. It basically lets you
look at the raster data produced by any of the
standard CUPS RIP filters (imagetoraster and
pstoraster are used on all platforms; cgimagetoraster
and cgpdftoraster are used on Mac OS X). RasterView
is useful to either test those filters without a
printer, or look at the data that is being sent from
these filters to your raster printer driver.
cupsraster2ppm is a converter to the PPM image format.
Project home page:
http://www.easysw.com/~mike/rasterview/index.html
%prep
%setup -q -n rasterview-%{version}
# rv-makefile.diff
%patch0 -p0
# rv-desktop.diff
%patch1 -p0
# rv-maketestfiles.diff
%patch3 -p0
# Source1: cupsraster2ppm.c
cp %{S:1} .
%build
# Set our preferred architecture-specific flags for the compiler and linker:
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
./configure --prefix=%{_prefix} --exec-prefix=%{_prefix}
make
make cupsraster2ppm
%install
make BUILDROOT=%{buildroot} install install-desktop
# needed to survive an ERROR about translations on SLE_11_SP1
%suse_update_desktop_file %{buildroot}%{_datadir}/applications/rasterview.desktop
# create the test dir
%__install -d -m 755 %{buildroot}%{_datadir}/rasterview/test
# install the test files
%__install -m 644 test/* %{buildroot}%{_datadir}/rasterview/test/
# install the ppd
%__install -m 644 -D test/rasterview.ppd %{buildroot}/etc/cups/ppd/rasterview.ppd
%files
%defattr(-,root,root)
%{_bindir}/*
%doc README
%dir %{_datadir}/icons/hicolor/
%dir %{_datadir}/icons/hicolor/128x128/
%dir %{_datadir}/icons/hicolor/128x128/apps/
%dir %{_datadir}/icons/hicolor/48x48/
%dir %{_datadir}/icons/hicolor/48x48/apps/
%dir %{_datadir}/icons/hicolor/32x32/
%dir %{_datadir}/icons/hicolor/32x32/apps/
%dir %{_datadir}/mimelnk/
%dir %{_datadir}/mimelnk/application/
%dir %{_datadir}/mimelnk/image/
%dir %{_datadir}/rasterview/
%dir %{_datadir}/rasterview/test/
%{_datadir}/icons/hicolor/128x128/apps/rasterview.png
%{_datadir}/icons/hicolor/48x48/apps/rasterview.png
%{_datadir}/icons/hicolor/32x32/apps/rasterview.png
%{_datadir}/mimelnk/application/vnd.cups-raster.desktop
%{_datadir}/mimelnk/image/pwg-raster.desktop
%{_datadir}/applications/rasterview.desktop
%{_datadir}/rasterview/test/*
%attr(755,root,root) %{_datadir}/rasterview/test/*.sh
%dir %attr(755,root,lp) %{_sysconfdir}/cups/ppd
%config %{_sysconfdir}/cups/ppd/rasterview.ppd
%post
touch --no-create /usr/share/icons/hicolor
if test -x /usr/bin/gtk-update-icon-cache
then /usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor
fi
if test -x /usr/bin/update-desktop-database
then /usr/bin/update-desktop-database &>/dev/null
fi
# exit successfully in any case:
exit 0
%postun
touch --no-create /usr/share/icons/hicolor
if test -x /usr/bin/gtk-update-icon-cache
then /usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor
fi
if test -x /usr/bin/update-desktop-database
then /usr/bin/update-desktop-database &>/dev/null
fi
# exit successfully in any case:
exit 0
%changelog