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