You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.6 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=pciutils
  9. PKG_VERSION:=3.6.2
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
  13. PKG_HASH:=db452ec986edefd88af0d222d22f6102f8030a8633fdfe846c3ae4bde9bb93f3
  14. PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_USE_MIPS16:=0
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/pciutils
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=Linux PCI Utilities
  25. URL:=http://mj.ucw.cz/pciutils.shtml
  26. DEPENDS:=+libkmod +libpci
  27. endef
  28. define Package/pciutils/description
  29. contains collection of programs for inspecting and manipulating configuration
  30. of PCI devices
  31. endef
  32. define Package/libpci
  33. SECTION:=libs
  34. CATEGORY:=Libraries
  35. TITLE:=Linux PCI Libraries
  36. URL:=http://mj.ucw.cz/pciutils.shtml
  37. DEPENDS:=
  38. endef
  39. PCI_IDS_VER:=0.319
  40. PCI_IDS_FILE:=pci.ids.$(PCI_IDS_VER)
  41. define Download/pci_ids
  42. FILE:=$(PCI_IDS_FILE)
  43. URL_FILE:=pci.ids
  44. URL:=@GITHUB/vcrhonek/hwdata/v$(PCI_IDS_VER)
  45. HASH:=54154a6955f550b110c6a216943dcd69ba6188e68b80bee6efbaa03ef0df0a5f
  46. endef
  47. $(eval $(call Download,pci_ids))
  48. define Build/Prepare
  49. $(call Build/Prepare/Default)
  50. $(RM) $(PKG_BUILD_DIR)/pci.ids
  51. $(CP) $(DL_DIR)/$(PCI_IDS_FILE) $(PKG_BUILD_DIR)/pci.ids
  52. endef
  53. TARGET_CFLAGS += $(FPIC)
  54. MAKE_FLAGS += \
  55. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  56. PREFIX="/usr" \
  57. HOST="Linux" \
  58. HWDB="no" \
  59. ZLIB="no" \
  60. SHARED="yes"
  61. ifneq ($(CONFIG_USE_GLIBC),)
  62. TARGET_LDFLAGS += -lresolv
  63. endif
  64. define Build/InstallDev
  65. $(INSTALL_DIR) $(1)/usr/lib
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpci.so.3 \
  67. $(PKG_INSTALL_DIR)/usr/lib/libpci.so
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  69. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  70. $(CP) $(PKG_BUILD_DIR)/lib/libpci.pc $(1)/usr/lib/pkgconfig
  71. $(INSTALL_DIR) $(1)/usr/include/pci
  72. $(CP) $(foreach i,pci.h config.h header.h types.h, \
  73. $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
  74. endef
  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 $(1)/usr/share/
  80. endef
  81. define Package/libpci/install
  82. $(INSTALL_DIR) $(1)/usr/lib
  83. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  84. endef
  85. $(eval $(call BuildPackage,libpci))
  86. $(eval $(call BuildPackage,pciutils))