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