Merge pull request #4868 from nxhack/CVE-2017-1000250
[feed/packages.git] / utils / pciutils / Makefile
1 #
2 # Copyright (C) 2007-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:=pciutils
11 PKG_VERSION:=3.5.2
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
16 PKG_HASH:=3a99141a9f40528d0a0035665a06dc37ddb1ae341658e51b50a76ecf86235efc
17 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
18
19 PKG_LICENSE:=GPL-2.0
20 PKG_LICENSE_FILES:=COPYING
21
22 PKG_USE_MIPS16:=0
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 +zlib
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 PCI_IDS_REV:=91cfa8a0c994634ba9a4a8639aa2ac6dff8453b9
41 PCI_IDS_FILE:=pci.ids.$(PCI_IDS_REV)
42 define Download/pci_ids
43 FILE:=$(PCI_IDS_FILE)
44 URL_FILE:=pci.ids
45 URL:=@GITHUB/pciutils/pciids/$(PCI_IDS_REV)
46 HASH:=798528092d1c58eeac99c6505033ec4ce8fe3e19d7e0c41b06790d58753a89b6
47 endef
48 $(eval $(call Download,pci_ids))
49
50 define Build/Prepare
51 $(call Build/Prepare/Default)
52 $(RM) $(PKG_BUILD_DIR)/pci.ids
53 $(CP) $(DL_DIR)/$(PCI_IDS_FILE) $(PKG_BUILD_DIR)/pci.ids
54 endef
55
56 MAKE_FLAGS += \
57 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
58 PREFIX="/usr" \
59 HOST="Linux" \
60 HWDB="no" \
61 ZLIB="yes"
62
63 ifneq ($(CONFIG_USE_GLIBC),)
64 TARGET_LDFLAGS += -lresolv
65 endif
66
67 define Build/InstallDev
68 $(INSTALL_DIR) $(1)/usr/lib
69 $(CP) $(PKG_BUILD_DIR)/lib/libpci.a $(1)/usr/lib
70 $(INSTALL_DIR) $(1)/usr/include/pci
71 $(CP) $(foreach i,pci.h config.h header.h types.h, \
72 $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
73 endef
74
75 define Package/pciutils/install
76 $(INSTALL_DIR) $(1)/usr/sbin
77 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
78 $(INSTALL_DIR) $(1)/usr/share
79 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids.gz $(1)/usr/share/
80 endef
81
82 $(eval $(call BuildPackage,pciutils))