databag: add package
[feed/packages.git] / utils / hplip / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=hplip
9 PKG_VERSION:=3.21.6
10 PKG_RELEASE:=2
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=@SF/hplip
14 PKG_HASH:=cc3360d3d913684fb080db97a434b04be45e2cef23cc5bc4cbc5f64b0c5e7bca
15
16 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
17 PKG_LICENSE:=GPL-2.0 GPL-2.0-or-later
18 PKG_LICENSE_FILES:=COPYING LICENSE
19 PKG_CPE_ID:=cpe:/a:hp:linux_imaging_and_printing_project
20
21 PKG_BUILD_PARALLEL:=1
22 PKG_BUILD_DEPENDS:=libcups
23 PKG_FIXUP:=autoreconf
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/hplip/Default
28 SECTION:=utils
29 CATEGORY:=Utilities
30 TITLE:=HP Linux Imaging and Printing
31 URL:=https://sourceforge.net/projects/hplip/
32 endef
33
34 define Package/hplip/Default/description
35 HPLIP is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.
36 endef
37
38 define Package/hplip-common
39 $(call Package/hplip/Default)
40 TITLE+= (common files)
41 DEPENDS+=+libusb-1.0
42 endef
43
44 define Package/hplip-common/description
45 $(call Package/hplip/Default/description)
46
47 These are common files shared between subpackages
48 endef
49
50 define Package/hplip-sane
51 $(call Package/hplip/Default)
52 TITLE+= (scanner drivers)
53 DEPENDS+=+libsane +hplip-common
54 endef
55
56 define Package/hplip-sane/description
57 $(call Package/hplip/Default/description)
58
59 S.A.N.E backend for HP Scanners
60 endef
61
62 CONFIGURE_ARGS += \
63 --disable-gui-build \
64 --disable-network-build \
65 --disable-fax-build \
66 --disable-pp-build \
67 --disable-doc-build \
68 --disable-dbus-build \
69 --disable-hpijs-only-build \
70 --disable-hpcups-install \
71 --disable-hpps-install \
72 --disable-cups-drv-install \
73 --enable-lite-build
74
75 define Build/Install
76 mkdir -p $(PKG_INSTALL_DIR)/usr/share/sane
77 sed -n -e '/key="usb.product_id"/{s/.*int_outof="0x//;s/;0x/\n/g;s/".*//;p}' \
78 $(PKG_BUILD_DIR)/data/rules/20-hplip-devices.fdi | sort -u > \
79 $(PKG_INSTALL_DIR)/usr/share/sane/03f0-hplip.usbid
80 endef
81
82 define Package/hplip-common/install
83 $(INSTALL_DIR) $(1)/usr/lib
84 $(CP) $(PKG_BUILD_DIR)/.libs/libhpip.so* $(1)/usr/lib/
85 $(CP) $(PKG_BUILD_DIR)/.libs/libhpmud.so* $(1)/usr/lib/
86
87 $(INSTALL_DIR) $(1)/etc/hp
88 $(CP) $(PKG_BUILD_DIR)/hplip.conf $(1)/etc/hp/hplip.conf
89
90 $(INSTALL_DIR) $(1)/usr/share/hplip/data/models/
91 $(CP) $(PKG_BUILD_DIR)/data/models/models.dat $(1)/usr/share/hplip/data/models/
92 endef
93
94 define Package/hplip-sane/install
95 $(INSTALL_DIR) $(1)/usr/lib/sane
96 $(CP) $(PKG_BUILD_DIR)/.libs/libsane-hpaio.so* $(1)/usr/lib/sane
97
98 $(INSTALL_DIR) $(1)/etc/sane.d/dll.d/
99 $(INSTALL_DATA) ./files/hplib.conf $(1)/etc/sane.d/dll.d/hplib
100
101 $(INSTALL_DIR) $(1)/usr/share/sane
102 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/sane/03f0-hplip.usbid \
103 $(1)/usr/share/sane/03f0-hplip.usbid
104 endef
105
106 define Package/hplip-common/conffiles
107 /etc/hp/hplip.conf
108 endef
109
110 define Package/hplip-sane/conffiles
111 /etc/sane.d/dll.d/hplib
112 endef
113
114 $(eval $(call BuildPackage,hplip-common))
115 $(eval $(call BuildPackage,hplip-sane))