File sane-frontends.spec of Package sane-frontends

# spec file for package sane-frontends (Version 1.0.14)
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
# Please submit bugfixes or comments via

# norootforbuild

Name:           sane-frontends
BuildRequires:  cups-libs
BuildRequires:  gimp-devel
BuildRequires:  libgphoto2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  sane-backends-devel
BuildRequires:  update-desktop-files
License:        GNU General Public License (GPL)
Group:          Hardware/Scanner
Autoreqprov:    on
Summary:        SANE-frontends xscanimage, xcam, and scanadf
Version:        1.0.14
Release:        56
# URL for Source0:
Source0:        sane-frontends-%{version}.tar.bz2
# Patch0 to set the correct docdir for the frontends
# at the moment this patch is not needed because nothing is written to $(prefix)/doc/sane
# except what is installed "manually" in the install section
Patch0:         sane-frontends-docdir.dif
# Fix "... is used uninitialized ..." warnings:
Patch1:         fix-uninitialized-variables.diff
# Fix "array subscript out of range" error:
Patch2:         fix-buffer-overflow.diff
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         /sbin/ldconfig
Requires:       sane-backends

xscanimage is a graphical scanner frontend for SANE. It can be invoked
either directly from the command-line or through the GIMP image
manipulation program.

xcam is a graphical camera frontend for SANE.

scanadf is a command-line frontend for SANE to control a scanner with
an automatic document feeder (ADF).

%setup -q
# Patch0 to set the correct docdir for the frontends
%patch0 -p0
# Fix "... is used uninitialized ..." warnings:
# Fix "array subscript out of range" error:

export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
./configure --prefix=%{_prefix} \
            --exec-prefix=%{_prefix} \
            --sysconfdir=%{_sysconfdir} \
            --libdir=%{_libdir} \
            --sbindir=%{_sbindir} \
            --mandir=%{_mandir} \

# Create GIMP plugin link (see "man xscanimage"):
install -d %{buildroot}%{_libdir}/gimp/2.0/plug-ins
ln -s %{_bindir}/xscanimage %{buildroot}%{_libdir}/gimp/2.0/plug-ins/xscanimage
# Install frontend specific documentation:
install -d $RPM_BUILD_ROOT/%{_defaultdocdir}/sane-frontends
# Avoid install's default permissions rwxr-xr-x by setting explicite permissions:
install -m 644 AUTHORS COPYING Changelog INSTALL NEWS PROBLEMS README $RPM_BUILD_ROOT/%{_defaultdocdir}/sane-frontends

exit 0

exit 0

%dir %{_datadir}/sane
%doc %{_mandir}/man1/scanadf.1.gz
%doc %{_mandir}/man1/xcam.1.gz
%doc %{_mandir}/man1/xscanimage.1.gz
%doc %{_defaultdocdir}/sane-frontends