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.

105 lines
2.5 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:=3
  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. endef
  38. PCI_IDS_VER:=0.324
  39. PCI_IDS_FILE:=pci.ids.$(PCI_IDS_VER)
  40. define Download/pci_ids
  41. FILE:=$(PCI_IDS_FILE)
  42. URL_FILE:=pci.ids
  43. URL:=@GITHUB/vcrhonek/hwdata/v$(PCI_IDS_VER)
  44. HASH:=6dba287b4aaafb9582d6139eda22ee6580651b8557828b9598d99078a5f4217e
  45. endef
  46. $(eval $(call Download,pci_ids))
  47. define Build/Prepare
  48. $(call Build/Prepare/Default)
  49. $(RM) $(PKG_BUILD_DIR)/pci.ids
  50. $(CP) $(DL_DIR)/$(PCI_IDS_FILE) $(PKG_BUILD_DIR)/pci.ids
  51. endef
  52. TARGET_CFLAGS += $(FPIC)
  53. MAKE_FLAGS += \
  54. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  55. PREFIX="/usr" \
  56. HOST="Linux" \
  57. HWDB="no" \
  58. ZLIB="no" \
  59. SHARED="yes"
  60. ifneq ($(CONFIG_USE_GLIBC),)
  61. TARGET_LDFLAGS += -lresolv
  62. endif
  63. define Build/InstallDev
  64. $(INSTALL_DIR) $(1)/usr/lib
  65. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpci.so.3 \
  66. $(PKG_INSTALL_DIR)/usr/lib/libpci.so
  67. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  68. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  69. $(CP) $(PKG_BUILD_DIR)/lib/libpci.pc $(1)/usr/lib/pkgconfig
  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. define Package/pciutils/install
  75. $(INSTALL_DIR) $(1)/usr/sbin
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
  77. $(INSTALL_DIR) $(1)/usr/share
  78. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids $(1)/usr/share/
  79. endef
  80. define Package/libpci/install
  81. $(INSTALL_DIR) $(1)/usr/lib
  82. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  83. endef
  84. $(eval $(call BuildPackage,libpci))
  85. $(eval $(call BuildPackage,pciutils))