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.3
Release: 0
License: GPL-2.0
BuildRequires: cups-devel
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.easysw.com/~mike/rasterview/rasterview-%{version}.tar.gz
Source1: cupsraster2ppm.c
Patch0: rv-makefile.diff
Patch1: rv-desktop.diff
Patch2: rv-missing_include.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-missing_include.diff
%patch2 -p1
# rv-maketestfiles.diff
%patch3 -p0
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
%config /etc/cups/*
%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