1
0

Makefile 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. #
  2. # Copyright (C) 2006-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=sane-backends
  9. PKG_VERSION:=1.0.25
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://fossies.org/linux/misc \
  13. https://alioth.debian.org/frs/download.php/file/4146/
  14. PKG_MD5SUM:=f9ed5405b3c12f07c6ca51ee60225fe7
  15. PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
  16. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  17. PKG_LICENSE_FILES:=COPYING LICENSE
  18. PKG_FIXUP:=autoreconf
  19. PKG_REMOVE_FILES:=aclocal.m4
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. SANE_BACKENDS:=
  23. define Package/sane-backends/Default
  24. TITLE:=Scanner Access Now Easy
  25. URL:=http://www.sane-project.org/
  26. endef
  27. define Package/sane-backends/Default/description
  28. SANE (Scanner Access Now Easy) is a universal scanner interface.
  29. endef
  30. define Package/sane-backends
  31. $(call Package/sane-backends/Default)
  32. SECTION:=utils
  33. CATEGORY:=Utilities
  34. TITLE+= (drivers)
  35. DEPENDS:=+ALL:sane-backends-all
  36. endef
  37. define Package/sane-backends/description
  38. $(call Package/sane-backends/Default/description)
  39. .
  40. This
  41. endef
  42. define Package/sane-backends/config
  43. menu "Select SANE backends"
  44. depends on PACKAGE_sane-backends
  45. config PACKAGE_sane-backends-all
  46. depends on PACKAGE_sane-backends
  47. prompt "Include all SANE backends (sane-backends-all)"
  48. comment "Backends"
  49. $(foreach backend,$(SANE_BACKENDS), \
  50. $(eval \
  51. $(call Package/Default)
  52. $(call Package/sane-$(backend))
  53. )\
  54. config PACKAGE_sane-$(backend)
  55. prompt "$(TITLE)"
  56. $(foreach config_dep,\
  57. $(filter @%,
  58. $(foreach v, $(DEPENDS), $(if $(findstring :,$v),,$v))
  59. ),\
  60. depends on $(strip $(subst @,,$(config_dep)))
  61. )
  62. )
  63. endmenu
  64. endef
  65. # returns conditional dependency on sane backend
  66. # 1: backend name
  67. #
  68. # If there is no config deps on $(1), returns +sane-$(1).
  69. # Otherwise, +(CONFIG1&&CONFIG2&&..):sane-$(1)
  70. define SaneBackendDependency
  71. $(eval \
  72. $(call Package/Default)
  73. $(call Package/sane-$(1))
  74. FILTER_CONFIG:=$$(strip \
  75. $$(foreach config_dep, \
  76. $$(filter @%, \
  77. $$(foreach v, \
  78. $$(DEPENDS), \
  79. $$(if $$(findstring :,$$v),,$$v) \
  80. ) \
  81. ), \
  82. $$(subst @,,$$(config_dep)) \
  83. ) \
  84. )
  85. ifneq (,$$(FILTER_CONFIG))
  86. FILTER_CONFIG:=($$(subst $$(space),&&,$$(FILTER_CONFIG))):
  87. endif
  88. ) \
  89. +$(FILTER_CONFIG)sane-$(1)
  90. endef
  91. define Package/sane-backends-all
  92. $(call Package/sane-backends/Default)
  93. SECTION:=utils
  94. CATEGORY:=Utilities
  95. TITLE+= (all backends)
  96. DEPENDS:=$(foreach backend,$(SANE_BACKENDS),$(strip $(call SaneBackendDependency,$(backend))))
  97. HIDDEN:=1
  98. endef
  99. define Package/sane-backends-all/description
  100. $(call Package/sane-backends/Default/description)
  101. .
  102. Metapackage for selecting all SANE Backends
  103. endef
  104. define Package/sane-daemon
  105. $(call Package/sane-backends/Default)
  106. SECTION:=utils
  107. CATEGORY:=Utilities
  108. DEPENDS:=+libsane
  109. TITLE+= (network daemon)
  110. endef
  111. define Package/sane-daemon/description
  112. $(call Package/sane-backends/Default/description)
  113. This package contains the SANE daemon.
  114. endef
  115. define Package/libsane
  116. $(call Package/sane-backends/Default)
  117. SECTION:=libs
  118. CATEGORY:=Libraries
  119. DEPENDS:=+libusb-compat
  120. TITLE+= (libraries)
  121. endef
  122. define Package/libsane/description
  123. $(call Package/sane-backends/Default/description)
  124. This package contains the SANE shared libraries.
  125. endef
  126. define Package/sane-frontends
  127. $(call Package/sane-backends/Default)
  128. SECTION:=utils
  129. CATEGORY:=Utilities
  130. DEPENDS:=+libsane +libjpeg +libpng
  131. TITLE+= (frontends)
  132. endef
  133. define Package/sane-frontends/description
  134. $(call Package/sane-backends/Default/description)
  135. This package contains the SANE frontends.
  136. endef
  137. TARGET_LDFLAGS += \
  138. -Wl,-rpath-link $(STAGING_DIR)/usr/lib \
  139. -Wl,-rpath-link $(PKG_BUILD_DIR)/backend/.libs
  140. CONFIGURE_ARGS+= \
  141. --enable-shared \
  142. --enable-static \
  143. --disable-translations \
  144. --disable-latex \
  145. --without-gphoto2 \
  146. --without-snmp
  147. CONFIGURE_VARS+= \
  148. ac_cv_func_mmap_fixed_mapped="yes" \
  149. define Build/Configure
  150. mkdir -p $(PKG_BUILD_DIR)/backend/.libs
  151. $(Build/Configure/Default)
  152. endef
  153. define Package/libsane/install
  154. $(INSTALL_DIR) $(1)/usr/lib/sane/
  155. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.so.* $(1)/usr/lib/
  156. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sane/libsane-dll.so.* $(1)/usr/lib/sane/
  157. $(INSTALL_DIR) $(1)/etc/sane.d/dll.d
  158. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/dll.conf $(1)/etc/sane.d/
  159. endef
  160. define Package/libsane/conffiles
  161. /etc/sane.d/dll.conf
  162. endef
  163. define Package/sane-daemon/install
  164. $(INSTALL_DIR) $(1)/etc/sane.d
  165. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/saned.conf $(1)/etc/sane.d/
  166. $(INSTALL_DIR) $(1)/usr/sbin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  168. $(INSTALL_DIR) $(1)/etc/xinetd.d
  169. $(CP) ./files/xinet.d_sane-port $(1)/etc/xinetd.d/sane-port
  170. endef
  171. define Package/sane-daemon/conffiles
  172. /etc/sane.d/saned.conf
  173. /etc/xinetd.d/sane-port
  174. endef
  175. define Package/sane-frontends/install
  176. $(INSTALL_DIR) $(1)/usr/bin
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  178. endef
  179. define Package/sane-backends-all/install
  180. /bin/true
  181. endef
  182. define Build/InstallDev
  183. $(INSTALL_DIR) $(1)/usr/include
  184. $(CP) $(PKG_INSTALL_DIR)/usr/include/sane $(1)/usr/include/
  185. $(INSTALL_DIR) $(1)/usr/lib
  186. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.{a,so*} $(1)/usr/lib/
  187. endef
  188. # 1: short name
  189. # 2: description
  190. # 3: dependencies on other packages
  191. define SaneBackend
  192. SANE_BACKENDS+= $(1)
  193. define Package/sane-$(1)
  194. $(call Package/sane-backends/Default)
  195. TITLE:=SANE backend (sane-$(1)) for $(2)
  196. DEPENDS+= +libsane $(3)
  197. HIDDEN:=1
  198. endef
  199. define Package/sane-$(1)/description
  200. $(call Package/sane-backends/Default/description)
  201. .
  202. This package contains the SANE backend for $(2).
  203. endef
  204. define Package/sane-$(1)/install
  205. if [ -f "$(PKG_INSTALL_DIR)/etc/sane.d/$(1).conf" ]; then \
  206. $(INSTALL_DIR) $$(1)/etc/sane.d ; \
  207. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/$(1).conf $$(1)/etc/sane.d/; \
  208. fi
  209. $(INSTALL_DIR) $$(1)/usr/lib/sane
  210. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sane/libsane-$(1).so.* $$(1)/usr/lib/sane/
  211. if [ -d "$(PKG_INSTALL_DIR)/usr/share/sane/$(1)" ]; then \
  212. $(INSTALL_DIR) $$(1)/usr/share/sane/ ; \
  213. $(CP) -a $(PKG_INSTALL_DIR)/usr/share/sane/$(1) $$(1)/usr/share/sane/ ; \
  214. fi
  215. endef
  216. define Package/sane-$(1)/conffiles
  217. /etc/sane.d/$(1).conf
  218. endef
  219. $$(eval $$(call BuildPackage,sane-$(1)))
  220. endef
  221. $(eval $(call BuildPackage,libsane))
  222. $(eval $(call BuildPackage,sane-daemon))
  223. $(eval $(call SaneBackend,abaton,Abaton flatbed scanners))
  224. $(eval $(call SaneBackend,agfafocus,AGFA Focus flatbed scanners))
  225. $(eval $(call SaneBackend,apple,Apple flatbed scanners))
  226. $(eval $(call SaneBackend,artec,Artec flatbed scanners))
  227. $(eval $(call SaneBackend,artec_eplus48u,Artec E+ 48U and re-badged models))
  228. $(eval $(call SaneBackend,as6e,Artec AS6E parallel port interface scanner))
  229. $(eval $(call SaneBackend,avision,Avision and Avision OEM scanners and possibly more flatbed and film scanners))
  230. $(eval $(call SaneBackend,bh,Bell+Howell Copiscan II series document scanners))
  231. $(eval $(call SaneBackend,canon,Canon SCSI scanners))
  232. $(eval $(call SaneBackend,canon630u,the Canon 630u USB flatbed scanner))
  233. $(eval $(call SaneBackend,canon_dr,Canon DR-series scanners))
  234. # Depends on libieee1284
  235. #$(eval $(call SaneBackend,canon_pp,Canon CanoScan Parallel Port flatbed scanners,+libieee1284))
  236. $(eval $(call SaneBackend,cardscan,Corex CardScan usb scanners))
  237. $(eval $(call SaneBackend,coolscan,Nikon film-scanners))
  238. $(eval $(call SaneBackend,coolscan2,Nikon Coolscan film scanners))
  239. $(eval $(call SaneBackend,coolscan3,Nikon Coolscan film scanners))
  240. $(eval $(call SaneBackend,dc210,Kodak DC210 Digital Camera,+libjpeg))
  241. $(eval $(call SaneBackend,dc240,Kodak DC240 Digital Camera,+libjpeg))
  242. $(eval $(call SaneBackend,dc25,Kodak DC20/DC25 Digital Cameras))
  243. $(eval $(call SaneBackend,dell1600n_net,Dell 1600n,+libtiff))
  244. $(eval $(call SaneBackend,dmc,Polaroid Digital Microscope Camera))
  245. $(eval $(call SaneBackend,epjitsu,Epson-based Fujitsu USB scanners))
  246. $(eval $(call SaneBackend,epson,EPSON scanners))
  247. $(eval $(call SaneBackend,epsonds,EPSON scanners,+libjpeg)) ####
  248. $(eval $(call SaneBackend,epson2,EPSON scanners))
  249. $(eval $(call SaneBackend,fujitsu,Fujitsu flatbed and ADF scanners))
  250. $(eval $(call SaneBackend,genesys,GL646 GL841 GL843 GL847 and GL124 based USB flatbed scanners))
  251. #$(eval $(call SaneBackend,gphoto2,digital cameras supported by gphoto2,+libjpeg))
  252. $(eval $(call SaneBackend,gt68xx,GT-68XX based USB flatbed scanners))
  253. $(eval $(call SaneBackend,hp,HP ScanJet scanners))
  254. $(eval $(call SaneBackend,hp3500,Hewlett-Packard ScanJet 3500 series scanners))
  255. $(eval $(call SaneBackend,hp3900,RTS8822 chipset based scanners,+libtiff))
  256. $(eval $(call SaneBackend,hp4200,Hewlett-Packard 4200 scanners))
  257. $(eval $(call SaneBackend,hp5400,Hewlett-Packard 54XX scanners))
  258. $(eval $(call SaneBackend,hp5590,Hewlett-Packard 4500C/4570C/5500C/5550C/5590/7650 Workgroup/Document scanners))
  259. $(eval $(call SaneBackend,hpljm1005,Hewlett-Packard LaserJet M1005 MFP Scanner))
  260. # Depends on libieee1284
  261. #$(eval $(call SaneBackend,hpsj5s,HP ScanJet 5S sheet-fed scanner,+libieee1284))
  262. $(eval $(call SaneBackend,hs2p,Ricoh SCSI flatbed/ADF scanners))
  263. $(eval $(call SaneBackend,ibm,IBM and Ricoh SCSI flatbed scanners))
  264. $(eval $(call SaneBackend,kodak,big Kodak flatbed and ADF scanners))
  265. $(eval $(call SaneBackend,kodakaio,Kodak aio printer / scanners))
  266. $(eval $(call SaneBackend,kvs20xx,Panasonic KV-S20xxC USB/SCSI ADF scanners))
  267. $(eval $(call SaneBackend,kvs40xx,Panasonic KV-S40xxC USB/SCSI ADF scanners))
  268. $(eval $(call SaneBackend,kvs1025,Panasonic KV-S102xC USB ADF scanners))
  269. $(eval $(call SaneBackend,leo,LEO Technologies scanners))
  270. $(eval $(call SaneBackend,lexmark,Lexmark X1100/X1200 Series scanners))
  271. $(eval $(call SaneBackend,ma1509,Mustek BearPaw 1200F USB scanner))
  272. $(eval $(call SaneBackend,magicolor,KONICA MINOLTA magicolor scanners))
  273. $(eval $(call SaneBackend,matsushita,Panasonic KV-SS high speed scanners))
  274. $(eval $(call SaneBackend,microtek,Microtek scanners))
  275. $(eval $(call SaneBackend,microtek2,Microtek scanners with SCSI-2 command set))
  276. $(eval $(call SaneBackend,mustek,Mustek SCSI flatbed scanners and some other devices))
  277. # Depends on libieee1284
  278. #$(eval $(call SaneBackend,mustek_pp,Mustek parallel port flatbed scanners,+libieee1284))
  279. $(eval $(call SaneBackend,mustek_usb,Mustek USB flatbed scanners))
  280. $(eval $(call SaneBackend,mustek_usb2,SQ113 based USB flatbed scanners))
  281. $(eval $(call SaneBackend,nec,NEC scanners))
  282. $(eval $(call SaneBackend,net,network backend))
  283. $(eval $(call SaneBackend,niash,scanners based on the NIASH chipset))
  284. $(eval $(call SaneBackend,p5,the Primax PagePartner))
  285. $(eval $(call SaneBackend,pie,PIE Devcom and AdLib SCSI flatbed scanners))
  286. $(eval $(call SaneBackend,pieusb,PIE Devcom and AdLib SCSI flatbed scanners)) #####
  287. $(eval $(call SaneBackend,pixma,Canon Multi-Function Printers and CanoScan Scanners))
  288. $(eval $(call SaneBackend,plustek,LM983[1/2/3] based USB flatbed scanners))
  289. $(eval $(call SaneBackend,plustek_pp,Plustek parallel port flatbed scanners))
  290. $(eval $(call SaneBackend,qcam,Connectix QuickCam cameras,@(TARGET_x86||TARGET_x86_64)))
  291. $(eval $(call SaneBackend,ricoh,Ricoh flatbed scanners))
  292. $(eval $(call SaneBackend,rts8891,rts8891 based scanners))
  293. $(eval $(call SaneBackend,s9036,Siemens 9036 flatbed scanners))
  294. $(eval $(call SaneBackend,sceptre,SCEPTRE scanners))
  295. $(eval $(call SaneBackend,sharp,SHARP scanners))
  296. $(eval $(call SaneBackend,sm3600,Microtek scanners with M011 USB chip))
  297. $(eval $(call SaneBackend,sm3840,Microtek scanners with SCAN08 USB chip))
  298. $(eval $(call SaneBackend,snapscan,AGFA SnapScan flatbed scanners))
  299. $(eval $(call SaneBackend,sp15c,Fujitsu ScanPartner 15C flatbed scanner))
  300. $(eval $(call SaneBackend,st400,Siemens ST/Highscan flatbed scanners))
  301. $(eval $(call SaneBackend,stv680,STV680 cameras))
  302. $(eval $(call SaneBackend,tamarack,Tamarack flatbed scanners))
  303. $(eval $(call SaneBackend,teco1,TECO / RELISYS scanners))
  304. $(eval $(call SaneBackend,teco2,TECO / RELISYS scanners))
  305. $(eval $(call SaneBackend,teco3,TECO / RELISYS scanners))
  306. $(eval $(call SaneBackend,test,testing frontends))
  307. $(eval $(call SaneBackend,u12,Plustek USB flatbed scanners based on older parport designs))
  308. $(eval $(call SaneBackend,umax,UMAX scanners))
  309. $(eval $(call SaneBackend,umax1220u,the UMAX Astra 1220U and similar scanners))
  310. $(eval $(call SaneBackend,umax_pp,Umax Astra parallel port flatbed scanners))
  311. $(eval $(call SaneBackend,v4l,Video for Linux API,+libv4l +libjpeg))
  312. $(eval $(call SaneBackend,xerox_mfp,Xerox Phaser 3200MFP device))
  313. $(eval $(call BuildPackage,sane-backends))
  314. $(eval $(call BuildPackage,sane-backends-all))
  315. $(eval $(call BuildPackage,sane-frontends))