File iscan-free.spec of Package iscan-free
#
# spec file for package iscan-free (Version 2.10.0.1)
#
# Copyright (c) 2009 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: iscan-free
BuildRequires: e2fsprogs-devel esound-devel gcc-c++ gdk-pixbuf-devel gimp-devel gnome-common libgphoto2-devel libjpeg-devel libxml-devel openssl-devel popt-devel sane-backends update-desktop-files
Url: http://www.avasys.jp/english/linux_e/index.html
License: GPL v2 or later ; LGPL v2.1 or later
Group: Hardware/Scanner
AutoReqProv: on
Summary: Free Image Scan Version with epkowa Driver for Epson Scanners
# How to make Source0:
# Get the matching source from the iscan package (iscan_2.10.0-1.tar.bz2)
# Unpack it:
# tar -xjvf iscan_2.10.0-1.tar.bz2
# Remove only the really non-free files:
# rm iscan-2.10.0/non-free/libesmod-i386*.so iscan-2.10.0/non-free/EAPL.*.txt
# The remaining file filter.hh and the Makefiles are free software.
# The proprietary binary-only i386-only libesmod library is needed only
# to make the /usr/bin/iscan frontend and the EAPL.*.txt license files
# apply only to this libesmod library.
# By using "configure --disable-frontend" it builds without the frontend
# (i.e. without the non-free libesmod library).
# Pack the remaining free sources:
# tar -cjvf iscan-free_2.10.0-1.tar.bz2 iscan-2.10.0/*
Source0: iscan-free_2.10.0-1.tar.bz2
# A README regarding the changes of the free version:
Source1: README
Patch1: libltdl.patch
# Patch3 replaces fixed HZ compile-time value by sysconf(_SC_CLK_TCK) runtime value:
Patch3: replace-HZ-by-sysconf_SC_CLK_TCK.patch
# Patch4 applies fixes for GCC 4.3 (see http://en.opensuse.org/GCC_4.3_Transition):
Patch4: fixes-for-GCC43.patch
# Patch5 fixes GCC 4.4 and glibc 2.10 issues,
# see http://udrepper.livejournal.com/20948.html
Patch5: fixes-for-GCC44-glibc_2.10.patch
# Patch10 changes the "sane-epkowa" man page so that those models are removed
# which require a non-free binary-only i386-only plugin. To determine those models use
# egrep '^:model|^:comment' doc/epkowa.desc | grep -B1 'non-free' | grep '^:model'
Patch10: adapt-man-for-free.patch
# Have Epson Avasys' release number at the end of the SUSE package Version:
Version: 2.10.0.1
Release: 86
# See the post and triggerin sections what is pre-required:
PreReq: coreutils, /bin/grep, /bin/sed
Requires: sane-backends
# Either iscan-free or iscan can be installed.
# If iscan replaces iscan-free, proprietary software becomes installed.
# If iscan-free replaces iscan, some scanner models do no longer work (see README).
# Therefore real "Conflicts" (and not "Obsoletes" which does a silent replacement):
Conflicts: iscan
# Used to exclude libsane from the provide-list which is made by Autoreqprov:
%define my_provides /tmp/my-provides
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Skip testing devel dependencies required by libtool .la files by the following comment:
# skip-check-libtool-deps
%prep
# Be quiet when unpacking.
# The directory in the Source0 archive is different because
# the package name is different and Version has the Epson Avasys' release number at the end:
%setup -q -n iscan-2.10.0
# Get the README regarding the changes of the free version:
cp %{SOURCE1} .
%patch1
# Patch3 replaces fixed HZ compile-time value by sysconf(_SC_CLK_TCK) runtime value:
%patch3
# Patch4 applies fixes for GCC 4.3:
%patch4
# Patch5 fixes GCC 4.4 and glibc 2.10 issues:
%patch5
# Remove those models from the man page which require a non-free plugin:
%patch10
# Distinguish the no longer supported models in the description file
# but do not remove them because otherwise they would be no longer shown in YaST
# when the package iscan-free is installed because the 'triggerin' section
# replaces the description file and from this file YaST will re-build its database
# using /usr/lib/YaST2/bin/create_scanner_database which tests if a comment
# contains 'requires DFSG non-free' and if yes it sets the package name
# in the YaST database to iscan (otherwise to iscan-free) so that YaST can
# test and install the right package even for the no longer supported models:
grep -q 'requires DFSG non-free' doc/epkowa.desc || exit 1
sed -i -e '/requires DFSG non-free/s/^:comment[[:space:]][[:space:]]*"/:comment "unsupported by the iscan-free package<br>/' doc/epkowa.desc
sed -i -e 's/requires DFSG non-free/requires DFSG non-free plugin in the iscan-proprietary-drivers package:/' doc/epkowa.desc
%build
rm -f m4/libtool.m4
autoreconf -fi
# Set our preferred architecture-specific flags for the compiler and linker:
# If -D_GNU_SOURCE is not set, the prototype for strndup in /usr/include/string.h is skipped.
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fno-strict-aliasing"
# See /usr/lib/rpm/suse_macros regarding our RPM macros (e.g. sysconfdir is /etc).
# enable-jpeg and enable-png is used in Epson Avasys' iscan.spec file.
# By using disable-frontend it builds without the frontend (i.e. without the non-free stuff):
%configure --disable-static \
--with-pic \
--enable-jpeg \
--enable-png \
--disable-frontend
%{__make} %{?jobs:-j%jobs}
%install
make install DESTDIR=${RPM_BUILD_ROOT}
# Install the backend's config file:
install -d %{buildroot}%{_sysconfdir}/sane.d/
install -m 644 backend/epkowa.conf %{buildroot}%{_sysconfdir}/sane.d/
# Install the backend's description file:
install -d %{buildroot}%{_datadir}/iscan/
# Change the manufacturer name to the same as in SANE's epson.desc file.
grep -q '^:mfg[[:space:]][[:space:]]*"EPSON"' doc/epkowa.desc || exit 1
sed -e 's|^:mfg[[:space:]][[:space:]]*"EPSON".*|:mfg "Epson"|' doc/epkowa.desc >%{buildroot}%{_datadir}/iscan/epkowa.desc
# Install the USB usermap file (list of USB manufacturer and model IDs)
# and the matching hotplug script under /usr/share/iscan
# and move the installed /usr/lib/iscan/make-udev-rules away
# because we do not use any of them because our udev uses our resmgr to grant USB access
# and resmgr does it without hotplug or usermap stuff.
install -m 644 utils/hotplug/iscan.usermap %{buildroot}%{_datadir}/iscan/
install -m 755 utils/hotplug/iscan-device %{buildroot}%{_datadir}/iscan/
mv %{buildroot}%{_libdir}/iscan/make-udev-rules %{buildroot}%{_datadir}/iscan/
# Remove the installed man page for the "iscan" frontend because it is not included in this package:
rm %{buildroot}%{_mandir}/man1/iscan.1
# Exclude libsane from the provide-list which is made by Autoreqprov:
cat << EOF > %{my_provides}
grep -v %{_libdir}/sane | %{__find_provides}
EOF
chmod 755 %{my_provides}
%define __find_provides %{my_provides}
%find_lang iscan
find %{buildroot} -type f -name "*.la" -exec %{__rm} -fv {} +
%post
/sbin/ldconfig
%triggerin -- sane-backends
# The package sane-backends can be updated or installed after iscan-free.
# In this case trigger to add the backend "epkowa" to /etc/sane.d/dll.conf if it is not there.
# Note that this is also run when only iscan-free is installed or updated
# and therefore the test that /etc/sane.d/dll.conf exists and is writable.
if test -w /etc/sane.d/dll.conf
then grep -q 'epkowa' /etc/sane.d/dll.conf || echo -e '# The epkowa backend is provided by the iscan-free package:\n#epkowa' >>/etc/sane.d/dll.conf
fi
# Save the sane-backends package backend description file and
# copy the iscan-free package description file to the sane-backends package location
# but don't overwrite epkowa.desc.sane when it already exists:
if test -f /usr/share/sane/descriptions-external/epkowa.desc -a ! -f /usr/share/sane/descriptions-external/epkowa.desc.sane
then mv /usr/share/sane/descriptions-external/epkowa.desc /usr/share/sane/descriptions-external/epkowa.desc.sane
fi
if test -d /usr/share/sane/descriptions-external/
then cp -p /usr/share/iscan/epkowa.desc /usr/share/sane/descriptions-external/
fi
exit 0
%postun
/sbin/ldconfig
# If the package was removed (but not if it was updated)
# then remove the epkowa lines in /etc/sane.d/dll.conf
# Note that sane-backends may not be installed (see triggerin)
# and therefore the test that /etc/sane.d/dll.conf exists and is writable.
[ "$1" = "0" -a -w /etc/sane.d/dll.conf ] && sed -i -e '/epkowa/d' /etc/sane.d/dll.conf
# Restore the sane-backends package backend description file:
if test -f /usr/share/sane/descriptions-external/epkowa.desc.sane
then mv -f /usr/share/sane/descriptions-external/epkowa.desc.sane /usr/share/sane/descriptions-external/epkowa.desc
fi
exit 0
%files -f iscan.lang
%defattr(-,root,root)
%doc COPYING COPYING.LIB AUTHORS NEWS
%doc README
%dir %{_sysconfdir}/sane.d
%config %{_sysconfdir}/sane.d/epkowa.conf
%dir %{_libdir}/sane
%{_libdir}/sane/libsane-epkowa.so*
%{_datadir}/iscan/
%{_mandir}/man5/sane-epkowa.5.gz
%description
This version of the Image Scan for Linux software contains only free
software. The proprietary binary-only i386-only "libesint*" driver
libraries are available in the separate package
iscan-proprietary-drivers.
The "esfw*.bin" firmware files are available in the separate package
iscan-firmware.
The proprietary binary-only i386-only "libesmod" library is removed
from this package. It is required by the "/usr/bin/iscan" front-end.
This package is built without the front-end.
This package contains only the epkowa back-end for SANE, which compiles
and runs natively even on non-i386 platforms. For documentation, see
"man sane-epkowa".
Drawbacks:
The free version of the epkowa back-end cannot work for those scanners
that require proprietary binary-only i386-only libraries, available in
the separate package iscan-proprietary-drivers. At the moment, those
scanners are the following models:
Perfection 1250 / GT-7200U, Perfection 1250 PHOTO, Perfection 1260 /
GT-7300U, Perfection 1260 PHOTO, Perfection 2480 PHOTO / GT-F500,
Perfection 2580 PHOTO / GT-F550, Perfection 3170 PHOTO / GT-9400UF,
Perfection 3490 PHOTO / GT-F520, Perfection 3590 PHOTO / GT-F570,
Perfection 4180 PHOTO / GT-F600, Perfection 4490 PHOTO / GT-X750,
Perfection V10 / GT-S600, Perfection V100 PHOTO / GT-F650, Perfection
V200 PHOTO / GT-F670, Perfection V350 PHOTO / GT-F700, Stylus CX4300,
Stylus CX4400, Stylus CX5500, Stylus CX5600, Stylus DX4400.
Those models do not work with the free iscan version. They require the
original iscan package and the iscan-proprietary-drivers package, which
are only available for i386-compatible platforms.
Some scanners require proprietary firmware files that are available in
the package iscan-firmware. At the moment, those scanners are the
following models:
Perfection 2480 PHOTO / GT-F500, Perfection 2580 PHOTO / GT-F550,
Perfection 3170 PHOTO / GT-9400UF, Perfection 3490 PHOTO / GT-F520,
Perfection 3590 PHOTO / GT-F570, Perfection 4180 PHOTO / GT-F600,
Perfection 4490 PHOTO / GT-X750, Perfection V10 / GT-S600, Perfection
V100 PHOTO / GT-F650, Perfection V200 PHOTO / GT-F670, Perfection V350
PHOTO / GT-F700.
The front-end /usr/bin/iscan was removed because it requires the
proprietary binary-only i386-only "libesmod" library. This should cause
no problem because the back-end epkowa runs now natively even on
non-i386 platforms so that all the usual front-ends (like scanimage,
xscanimage, xsane, and kooka) can be used even on non-i386 platforms.
Authors:
--------
Noriyuki Sasaki
Peter J. Schretlen
Olaf Meeuwissen
Narihiro Matsukuma
Ross Boylan
Tobias Kramer
Dirk O. Siebnich
%changelog