File xsane.spec of Package xsane

#
# spec file for package xsane (Version 0.995)
#
# Copyright (c) 2008 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:           xsane
BuildRequires:  gimp-devel libgphoto2-devel liblcms-devel libtiff-devel sane-backends update-desktop-files
License:        GPL v2 or later
Group:          Hardware/Scanner
# Require the SANE base system in sane-backends explicitely to be on the safe side
# because whatever third-party scanner driver package (e.g. a third-party Iscan RPM)
# could provide libsane.so.1 by accident via RPM Autoreqprov, see our iscan-free.spec
# and iscan.spec how to exclude libsane from the provide-list of Autoreqprov.
# Require xdg-utils because Patch101 sets the DEFAULT_BROWSER to "xdg-open"
# to get the right browser launched for KDE and Gnome users.
Requires:       sane-backends, xdg-utils
# Provide the RPM capability "gimp-2.0-scanner-plugin" which is also provided by
# the sane-frontends RPM so that the gimp RPM can recommend "gimp-2.0-scanner-plugin"
# so that either of xsane or sane-frontends are sufficient to be installed.
Provides:       gimp-2.0-scanner-plugin
AutoReqProv:    on
Summary:        A GTK-Based Graphical Scanning Front-End for SANE
Version:        0.995
Release:        131
Url:            http://www.xsane.org/
# URL for Source0: http://www.xsane.org/download/xsane-0.995.tar.gz
Source0:        xsane-%{version}.tar.bz2
# Source1 is the primary source for the suse_update_desktop_file stuff
Source1:        %name.desktop
# Source2 is an icon file for xsane (needed by xsane.desktop)
# It is the 32x32 scanner.png from the kdelibs3-3.3.0 package.
# I don't want to have kdelibs3 in neededforbuild because xsane doesn't need KDE stuff for build
Source2:        scanner_32x32.png
# Patch100... is SUSE specific stuff:
# Patch100 suppresses the disclaimer of warranty and liability dialog
# and adds a modification note and adds a openSUSE Bugzilla URL
# to make the change obvious for the user and direct bug reports to us:
Patch100:       no-eula.patch
# Patch101 sets DEFAULT_BROWSER "xdg-open" in xsane.h
# to get the right browser launched for KDE and Gnome users:
Patch101:       xdg-open-as-default-browser.patch
# Patch102 removes the items in the help menue regarding backend documentation
# because the referred files do not exist (dead URLs in sane-backends-doc.html):
Patch102:       remove-non-working-help.patch
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
XSane does not support any scanners itself. XSane uses the SANE library
to talk to scanners that are supported by SANE.

XSane is designed for acquiring images with scanners (there are other
devices like cameras and video devices supported by SANE, but XSane is
not designed for that purpose). You can scan to file, make a photocopy,
create a fax, and start XSane from the GIMP as a GIMP plug-in.

XSane may not work correctly or you may not be able to take full
advantage of all functions if you do not configure XSane correctly. See
the documentation at /usr/share/sane/xsane/doc/sane-xsane-doc.html.

The XSane home page is http://www.xsane.org/.



Authors:
--------
    Oliver Rauch <Oliver.Rauch@xsane.org>

%prep
# Be quiet when unpacking:
%setup -q
# Patch100 suppresses the disclaimer of warranty and liability dialog
# and adds a modification note and adds a openSUSE Bugzilla URL
# to make the change obvious for the user and direct bug reports to us:
%patch100
# Patch101 sets DEFAULT_BROWSER "xdg-open" in xsane.h
# to get the right browser launched for KDE and Gnome users:
%patch101
# Patch102 removes the items in the help menue regarding backend documentation
# because the referred files do not exist (dead URLs in sane-backends-doc.html):
%patch102

%build
%{?suse_update_config:%{suse_update_config -f}}
# Set our preferred architecture-specific flags for the compiler and linker:
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
# See /usr/lib/rpm/suse_macros regarding our RPM macros (e.g. sysconfdir is /etc):
./configure --prefix=%{_prefix} \
            --exec-prefix=%{_prefix} \
            --sysconfdir=%{_sysconfdir} \
            --mandir=%{_mandir} \
            --enable-gimp  
make

%install
# rpmlint reports: install-no-mkdir-buildroot
# Don't clean the buildroot in install, because that's anyway already done by rpm:
#rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{_prefix} \
     exec_prefix=$RPM_BUILD_ROOT%{_prefix} \
     sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} \
     mandir=$RPM_BUILD_ROOT%{_mandir} \
     install
# Create GIMP plugin link:
mkdir -p $RPM_BUILD_ROOT%{_libdir}/gimp/2.0/plug-ins
ln -sf %{_bindir}/xsane $RPM_BUILD_ROOT%{_libdir}/gimp/2.0/plug-ins/xsane
# Desktop menue entry stuff:
install -d -m755 $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/pixmaps/scanner_32x32.png
%suse_update_desktop_file -i %{name} Graphics Scanning

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc xsane*
%{_bindir}/xsane
%{_datadir}/sane/xsane/
%{_datadir}/locale/*/LC_MESSAGES/xsane.mo
%{_mandir}/man1/xsane.1.gz
%{_libdir}/gimp/2.0/plug-ins/xsane
%{_datadir}/applications/%name.desktop
%{_datadir}/pixmaps/scanner_32x32.png

%changelog
* Thu Sep 04 2008 jsmeix@suse.de
- Provide the RPM capability "gimp-2.0-scanner-plugin" which is
  also provided by the sane-frontends RPM so that the gimp RPM
  can recommend "gimp-2.0-scanner-plugin" so that either of xsane
  or sane-frontends are sufficient to be installed
  (see Novell/Suse Bugzilla bnc#422558).
* Tue Mar 11 2008 jsmeix@suse.de
- Enhanced and re-enabled no-eula.patch:
  It suppresses the disclaimer of warranty and liability dialog
  and adds a modification note and adds a openSUSE Bugzilla URL
  to make the change obvious for the user and direct bug reports
  to us (see Novell/Suse Bugzilla bnc#183725).
- xdg-open-as-default-browser.patch sets DEFAULT_BROWSER xdg-open
  to get the right browser launched for KDE and Gnome users to
  show the XSane documentation. Therefore xdg-utils is required.
- remove-non-working-help.patch removes the items in the help
  menue regarding backend documentation because the referred
  files do not exist (dead URLs with "sane-<backend>-doc.html"
  in sane-backends-doc.html).
* Wed Nov 28 2007 jsmeix@suse.de
- Updated to version 0.995:
  Several layout changes.
  Multiple mail receivers are allowed in email mode.
  Scanning and conversion speed is increased.
- Disabled no-eula.patch to be on the safe side because of
  comment 12 in Novell/Suse Bugzilla bnc#183725.
  until there is a final decission regarding the issue.
* Fri Nov 02 2007 ro@suse.de
- Removed liblcms from BuildRequires because liblcms-devel
  requires it via RPM dependency.
* Thu Oct 25 2007 mauro@suse.de
- no-eula.patch suppresses the disclaimer of warranty and
  liability (see Novell/Suse Bugzilla bnc#183725).
* Wed Jul 04 2007 jsmeix@suse.de
- Added liblcms and liblcms-devel to BuildRequires to enable
  LCMS (color management) support.
* Mon Mar 05 2007 jsmeix@suse.de
- Updated to version 0.994 (a bugfix release for 0.993):
  Fixed crash when no ICC/ICM profile was defined.
  Fixed PostScript output which did not work for printing.
* Mon Feb 26 2007 jsmeix@suse.de
- Updated to version 0.993 (this is a beta-test release):
  12 bits/channel support for PostScript.
  Usage of new gtk_file_chooser.
  Added browse function for project directories.
  Correct handling when mail is not accepted by the mailserver.
  A lot of color management improvements (CMS still in
  beta test): Embedded profiles for PostScript and PDF,
  convert to sRGB, convert to working color space.
* Wed Jan 31 2007 jsmeix@suse.de
- Package 'sane' was renamed to 'sane-backends'.
  Adapted it so that it works with 'sane-backends'
* Wed Jan 31 2007 ro@suse.de
- GNOME moved to /usr therefore the GIMP plugin link was
  changed accordingly
* Fri Jan 26 2007 jsmeix@suse.de
- Updated to version 0.992:
  Some bugs and compiler warnings have been fixed.
  New rudimentary color management support.
  This version may crash or produce unexpected results,
  especially with color management enabled.
* Thu Dec 07 2006 jsmeix@suse.de
- Changed /usr/X11R6/bin/xsane to /usr/bin/xsane
  (see Suse bugzilla bnc##224882).
* Sat Oct 28 2006 meissner@suse.de
- buildrequires: libgphoto2-devel
* Tue Sep 05 2006 aj@suse.de
- Cleanup BuildRequires.
* Fri Jul 14 2006 jsmeix@suse.de
- Updated to version 0.991:
  This version contains some bugfixes (in particular for the
  multipage mode which was introduced in version 0.99).
- Removed obsolete BuildRequires for hp-officeJet.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Jan 10 2006 jsmeix@suse.de
- Updated to version 0.99
* Tue Jan 03 2006 jsmeix@suse.de
- Updated to version 0.98b
* Wed Nov 23 2005 jsmeix@suse.de
- Updated to version 0.98a
* Mon Jan 24 2005 jsmeix@suse.de
- Updated to version 0.97
  This version contains some bugfixes.
* Mon Nov 22 2004 jsmeix@suse.de
- Added scanner_32x32.png as icon file for xsane.desktop.
* Wed Nov 17 2004 jsmeix@suse.de
- Updated to version 0.96
  This version contains several bugfixes and improvements,
  especially for the fax mode and the email mode.
* Mon Aug 16 2004 jsmeix@suse.de
- Updated to version 0.95 (has gimp-2.0.x support included)
* Wed Jul 21 2004 jsmeix@suse.de
- Added libieee1284 as needed for build because sane is needed
  to build xsane and as sane has now libieee1284 support it is
  also needed to build xsane.
* Tue Mar 23 2004 jsmeix@suse.de
- gimp plugins are now in .../2.0/...
* Mon Feb 23 2004 ro@suse.de
- update to 0.92
- build with gtk2 stuff
- added patch from debian maintainer to support gimp2
- gettext stuff doesn't work yet
* Sat Jan 10 2004 adrian@suse.de
- build as user
* Mon Nov 10 2003 ro@suse.de
- use net-snmp instead of ucdsnmp
* Fri Aug 15 2003 adrian@suse.de
- add desktop file
* Tue Jul 29 2003 coolo@suse.de
- use %%find_lang
* Mon Jun 30 2003 freitag@suse.de
- fixed 64bit libpath problem with gimp plugin
* Fri Jun 06 2003 freitag@suse.de
- update to version 0.91
* Mon Feb 03 2003 freitag@suse.de
- added libtiff for tiff support again.
* Mon Feb 03 2003 ro@suse.de
- blow up neededforbuild again to make it build
* Fri Jan 24 2003 freitag@suse.de
- update to version 0.90
  cleaned up neededforbuild a bit, removed gimp etc.
  added libgphoto, now required for SANE
* Thu Oct 31 2002 freitag@suse.de
- update to version 0.89
* Tue Oct 22 2002 ro@suse.de
- added pkgconfig and libusb to neededforbuild
* Tue Sep 17 2002 ro@suse.de
- removed bogus self-provides
* Sat Jul 27 2002 adrian@suse.de
- fix neededforbuild
* Wed Jul 17 2002 freitag@suse.de
- update to version 0.87
* Wed May 08 2002 freitag@suse.de
- update to version 0.86
  small bugfixing and functional updates
* Wed Apr 24 2002 freitag@suse.de
- update to v. 0.85
  changed default help browser to konqueror since that is the
  SuSE default browser.
* Fri Feb 01 2002 ro@suse.de
- changed neededforbuild <libpng> to <libpng-devel-packages>
* Thu Jan 24 2002 egmont@suselinux.hu
- fixed URL
* Thu Jan 10 2002 freitag@suse.de
- update to v. 0.83
* Mon Nov 12 2001 freitag@suse.de
- update to version 0.80, which provides a build-in viewer to see
  the scan results immediately, some bugfixes and new and
  updated translations: cs, de, fr, ja, ru, tr
* Sat Sep 15 2001 kukuk@suse.de
- Remove netscape from requires
* Fri Aug 31 2001 ro@suse.de
- added <hp-officeJet> to neededforbuild (for sane)
* Wed Aug 22 2001 freitag@suse.de
- update to version 0.79, which include:
  * (still experimental) email functionality improved
  * preview improvement
  * medium selection for negatives
  * security enhancement when xsane is running with suid=root
* Fri Jun 29 2001 freitag@suse.de
- update to version 0.78
* Tue Apr 24 2001 egger@suse.de
- Updated to version 0.75.
- Use BuildRooting
- Use better paths for data.
- Should fix bug 7088.
* Mon Apr 02 2001 freitag@suse.de
- update to version 0.74, source in bzip2-format.
* Mon Mar 05 2001 freitag@suse.de
- update to version 0.72
* Thu Jan 18 2001 freitag@suse.de
- update to version 0.70 to fix a bug with gimp plugin mode.
* Mon Dec 18 2000 freitag@suse.de
- update to version 0.67
* Fri Dec 08 2000 freitag@suse.de
- update to version 0.64
* Mon Nov 06 2000 freitag@suse.de
- changed License/Copyright in spec-File
* Thu Nov 02 2000 freitag@suse.de
- update to version 0.62
  neededforbuild needs gimp-devel, not gimp-dev
* Wed Nov 01 2000 egger@suse.de
- Updated specfile to new long packagenames.
- Reworked specfile.
- Probably needs some more work; I'm taking care of that.
* Mon Sep 25 2000 ro@suse.de
- make it compile
* Tue Sep 19 2000 egger@suse.de
- Use -p for makedir.
- Buildproofed on i386.
* Tue Sep 05 2000 egger@suse.de
- update to version 0.61
* Wed Jun 07 2000 freitag@suse.de
- update to version 0.57
* Sat Mar 04 2000 ro@suse.de
- removed libgimp from neededforbuild
* Mon Feb 28 2000 freitag@suse.de
- inserted group tag
* Mon Feb 14 2000 freitag@suse.de
- update to version 0.55
* Mon Jan 10 2000 freitag@suse.de
- update to version 0.49
* Tue Oct 26 1999 freitag@suse.de
- initial verison 0.40