prometheus-node-exporter-lua: add dawn exporter
[feed/packages.git] / utils / pciutils / Makefile
1 #
2 # Copyright (C) 2007-2017 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:=pciutils
11 PKG_VERSION:=3.6.4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
16 PKG_HASH:=f67ff732976e2db2a5ccdf3960020796526ba6b05f6b1cdd24b7b206af706055
17
18 PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
19 PKG_LICENSE:=GPL-2.0
20 PKG_LICENSE_FILES:=COPYING
21
22 PKG_BUILD_PARALLEL:=1
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/pciutils
28 SECTION:=utils
29 CATEGORY:=Utilities
30 TITLE:=Linux PCI Utilities
31 URL:=http://mj.ucw.cz/pciutils.shtml
32 DEPENDS:=+libkmod +libpci
33 endef
34
35 define Package/pciutils/description
36 contains collection of programs for inspecting and manipulating configuration
37 of PCI devices
38 endef
39
40 define Package/libpci
41 SECTION:=libs
42 CATEGORY:=Libraries
43 TITLE:=Linux PCI Libraries
44 URL:=http://mj.ucw.cz/pciutils.shtml
45 endef
46
47
48 PCI_IDS_VER:=0.324
49 PCI_IDS_FILE:=pci.ids.$(PCI_IDS_VER)
50 define Download/pci_ids
51 FILE:=$(PCI_IDS_FILE)
52 URL_FILE:=pci.ids
53 URL:=@GITHUB/vcrhonek/hwdata/v$(PCI_IDS_VER)
54 HASH:=6dba287b4aaafb9582d6139eda22ee6580651b8557828b9598d99078a5f4217e
55 endef
56 $(eval $(call Download,pci_ids))
57
58 define Build/Prepare
59 $(call Build/Prepare/Default)
60 $(RM) $(PKG_BUILD_DIR)/pci.ids
61 $(CP) $(DL_DIR)/$(PCI_IDS_FILE) $(PKG_BUILD_DIR)/pci.ids
62 endef
63
64 TARGET_CFLAGS += $(FPIC)
65
66 MAKE_FLAGS += \
67 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
68 PREFIX="/usr" \
69 HOST="Linux" \
70 HWDB="no" \
71 ZLIB="no" \
72 SHARED="yes"
73
74 ifneq ($(CONFIG_USE_GLIBC),)
75 TARGET_LDFLAGS += -lresolv
76 endif
77
78 define Build/InstallDev
79 $(INSTALL_DIR) $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpci.so.3 \
81 $(PKG_INSTALL_DIR)/usr/lib/libpci.so
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
83 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
84 $(CP) $(PKG_BUILD_DIR)/lib/libpci.pc $(1)/usr/lib/pkgconfig
85 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libpci.pc
86 $(SED) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr/lib/pkgconfig/libpci.pc
87 $(INSTALL_DIR) $(1)/usr/include/pci
88 $(CP) $(foreach i,pci.h config.h header.h types.h, \
89 $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
90 endef
91
92 define Package/pciutils/install
93 $(INSTALL_DIR) $(1)/usr/sbin
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
95 $(INSTALL_DIR) $(1)/usr/share
96 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids $(1)/usr/share/
97 endef
98
99 define Package/libpci/install
100 $(INSTALL_DIR) $(1)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
102 endef
103
104
105 $(eval $(call BuildPackage,libpci))
106 $(eval $(call BuildPackage,pciutils))