iscan-2.24.0

Opublikowany: 16.05.2010

EPSON Image Scan! dla Linuxa (zawierający wsparcie dla sane-epkowa).

Strona projektu: Image Scan for Linux

To jest ebuild dla ostatniej wersji programu EPSON Image scan dla Linuxa.

Przepisałem ebuild, który był dostępny w drzewie Gentoo Portage aby zainstalować ostatnią dostępną wersję programu Image Scan. Byłem zmuszony to zrobić, gdyż nie mogłem używać wersji dostępnej w głównym drzewie z powodu błędów naruszenia ochrony pamięci. Zgłosiłem raport błędu dotyczący tego problemu a także prośbę o aktualizację.

Aby wykorzystać ten ebuild wykonaj następujące polecenia w terminalu:

echo "=media-gfx/iscan-2.24.0" >> /etc/portage/package.keywords
emerge -av =media-gfx/iscan-2.24.0

Wyświetl kod źródłowy ebuilda
  1. # Copyright 1999-2009 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: changed to 2.23 /var/cvsroot/gentoo-x86/media-gfx/iscan/iscan-2.21.0.ebuild,v 1.5 2009/11/04 13:55:46 maekke Exp $
  4.  
  5. EAPI="2"
  6.  
  7. inherit eutils flag-o-matic autotools
  8.  
  9. SRC_REV="4" # revision used by upstream
  10.  
  11. # HINTS:
  12. # -> non-free modules are x86 and amd64 only
  13. # -> iscan frontend needs non-free modules
  14. # -> sane-epkowa should be usable on every arch
  15. # -> ${P}-${SRC_REV}.tar.gz (for gcc 3.2/3.3)
  16. # -> ${P}-${SRC_REV}.c2.tar.gz (for gcc 3.4 or later)
  17.  
  18. # FIXME:
  19. # Make jpeg/png optional. The problem is, that the configure script ignores --disable-*,
  20. # if the corresponding lib is found on the system.
  21. # Furthermore, iscan doesn't compile w/o libusb, this should be fixed somehow.
  22.  
  23. # feel free to add your arch, every non-x86
  24. # arch doesn't install any x86-only stuff.
  25. KEYWORDS="amd64 x86"
  26.  
  27. DESCRIPTION="EPSON Image Scan! for Linux (including sane-epkowa backend)"
  28. HOMEPAGE="http://www.avasys.jp/english/linux_e/dl_scan.html"
  29. SRC_URI="http://linux.avasys.jp/drivers/iscan/${PV}/${PN}_${PV}-${SRC_REV}.tar.gz"
  30. LICENSE="GPL-2 AVASYS"
  31. SLOT="0"
  32.  
  33. IUSE="X gimp jpeg png tiff"
  34. IUSE_LINGUAS="de es fr it ja ko nl pt zh_CN zh_TW"
  35.  
  36. for X in ${IUSE_LINGUAS}; do IUSE="${IUSE} linguas_${X}"; done
  37.  
  38. QA_TEXTRELS="usr/$(get_libdir)/iscan/lib*"
  39.  
  40. # Upstream ships broken sanity test
  41. RESTRICT="test"
  42.  
  43. RDEPEND="media-gfx/sane-backends
  44. >=sys-fs/udev-103
  45. >=dev-libs/libusb-0.1.12
  46. X? (
  47. >=x11-libs/gtk+-2.0
  48. gimp? ( media-gfx/gimp )
  49. png? ( media-libs/libpng )
  50. jpeg? ( media-libs/jpeg )
  51. tiff? ( media-libs/tiff )
  52. )"
  53.  
  54. DEPEND="${RDEPEND}
  55. X? ( sys-devel/gettext )"
  56.  
  57. usermap_to_udev() {
  58. echo '# udev rules file for iscan devices (udev >= 0.98)'
  59. echo '#'
  60. echo 'ACTION!="add", GOTO="iscan_rules_end"'
  61. echo 'SUBSYSTEM!="usb*", GOTO="iscan_rules_end"'
  62. echo 'KERNEL=="lp[0-9]*", GOTO="iscan_rules_end"'
  63. echo
  64.  
  65. sed -n -e '
  66. /^:model[[:space:]]*"[^"]/ {
  67. # Create model name string
  68. s|^:model[[:space:]]*"\([^"]\+\).*|# \1|
  69.  
  70. # Copy to hold buffer
  71. h
  72. }
  73. /^:usbid[[:space:]]*"0x[[:xdigit:]]\+"[[:space:]]*"0x[[:xdigit:]]\+"/ {
  74. # Append next line
  75. N
  76.  
  77. # Check status
  78. /\n:status[[:space:]]*:\(complete\|good\|untested\)/ {
  79. # Exchange with hold buffer
  80. x
  81.  
  82. # Print (model name string)
  83. p
  84.  
  85. # Exchange with hold buffer
  86. x
  87.  
  88. # Create udev command string
  89. s|^:usbid[[:space:]]*"0x\([[:xdigit:]]\+\)"[[:space:]]*"0x\([[:xdigit:]]\+\)".*|ATTRS{idVendor}=="\1", ATTRS{idProduct}=="\2", MODE="0660", GROUP="scanner"|
  90.  
  91. # Print (udev command string)
  92. p
  93. }
  94. }
  95. ' "${1}"
  96.  
  97. echo
  98. echo 'LABEL="iscan_rules_end"'
  99. }
  100.  
  101. src_prepare() {
  102. local i
  103.  
  104. # convert japanese docs to UTF-8
  105. if use linguas_ja; then
  106. for i in {NEWS,README}.ja non-free/*.ja.txt; do
  107. if [ -f "${i}" ]; then
  108. echo ">>> Converting ${i} to UTF-8"
  109. iconv -f eucjp -t utf8 -o "${i}~" "${i}" && mv -f "${i}~" "${i}" || rm -f "${i}~"
  110. fi
  111. done
  112. fi
  113.  
  114. # disable checks for gtk+
  115. if ! use X; then
  116. sed -i -e "s:PKG_CHECK_MODULES(GTK,.*):AC_DEFINE([HAVE_GTK_2], 0):g" \
  117. -e "s:\(PKG_CHECK_MODULES(GDK_IMLIB,.*)\):#\1:g" configure.ac
  118. fi
  119.  
  120. epatch "${FILESDIR}"/${PN}-2.23.0-drop-ltdl.patch
  121. epatch "${FILESDIR}"/${PN}-2.23.0-fix-g++-test.patch
  122. epatch "${FILESDIR}"/${PN}-2.23.0-noinst-stuff.patch
  123.  
  124. eautoreconf
  125. }
  126.  
  127. src_configure() {
  128. append-flags -D_GNU_SOURCE # needed for 'strndup'
  129. local myconf
  130.  
  131. if use X; then
  132. myconf="--enable-frontend
  133. $(use_enable gimp)
  134. $(use_enable jpeg)
  135. $(use_enable png)
  136. $(use_enable tiff)"
  137. else
  138. myconf="--disable-frontend --disable-gimp
  139. --disable-jpeg --disable-png --disable-tiff"
  140. fi
  141.  
  142. econf --disable-static ${myconf}
  143. }
  144.  
  145. src_install() {
  146. local MY_LIB="/usr/$(get_libdir)"
  147. emake DESTDIR="${D}" install || die "make install failed"
  148.  
  149. # install docs
  150. dodoc AUTHORS NEWS README doc/epkowa.desc
  151. use linguas_ja && dodoc NEWS.ja README.ja
  152.  
  153. # remove
  154. rm -f "${D}usr/lib/iscan/make-udev-rules"
  155.  
  156. # install USB hotplug stuff
  157. local USERMAP_FILE="doc/epkowa.desc"
  158. if [ -f ${USERMAP_FILE} ]; then
  159. dodir /etc/udev/rules.d
  160. usermap_to_udev ${USERMAP_FILE} \
  161. > "${D}etc/udev/rules.d/99-iscan.rules"
  162. else
  163. die "Can not find USB devices description file: ${USERMAP_FILE}"
  164. fi
  165.  
  166. # install sane config
  167. insinto /etc/sane.d
  168. doins backend/epkowa.conf
  169.  
  170. # link iscan so it is seen as a plugin in gimp
  171. if use X && use gimp; then
  172. local plugindir
  173. if [ -x /usr/bin/gimptool ]; then
  174. plugindir="$(gimptool --gimpplugindir)/plug-ins"
  175. elif [ -x /usr/bin/gimptool-2.0 ]; then
  176. plugindir="$(gimptool-2.0 --gimpplugindir)/plug-ins"
  177. else
  178. die "Can't find GIMP plugin directory."
  179. fi
  180. dodir "${plugindir}"
  181. dosym /usr/bin/iscan "${plugindir}"
  182. fi
  183.  
  184. # install desktop entry
  185. if use X; then
  186. make_desktop_entry iscan "Image Scan! for Linux ${PV}" scanner
  187. fi
  188. }
  189.  
  190. pkg_postinst() {
  191. local i
  192. local DLL_CONF="/etc/sane.d/dll.conf"
  193. local EPKOWA_CONF="/etc/sane.d/epkowa.conf"
  194.  
  195. elog
  196. if grep -q "^[ \t]*\<epkowa\>" ${DLL_CONF}; then
  197. elog "Please edit ${EPKOWA_CONF} to suit your needs."
  198. elif grep -q "\<epkowa\>" ${DLL_CONF}; then
  199. elog "Hint: to enable the backend, add 'epkowa' to ${DLL_CONF}"
  200. elog "Then edit ${EPKOWA_CONF} to suit your needs."
  201. else
  202. echo "epkowa" >> ${DLL_CONF}
  203. elog "A new entry 'epkowa' was added to ${DLL_CONF}"
  204. elog "Please edit ${EPKOWA_CONF} to suit your needs."
  205. fi
  206. }

Oto lista wszystkich wersji ebuilda iscan jakie możesz znaleźć w moim overlay'u: