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.

90 lines
3.0 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=hwinfo
  3. PKG_VERSION:=21.71
  4. PKG_RELEASE:=3
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://codeload.github.com/openSUSE/hwinfo/tar.gz/$(PKG_VERSION)?
  7. PKG_HASH:=c4c573eb15cbc10103f5044b485d7e4ff941500ed559743a1c98e6a6deb0ebda
  8. PKG_LICENSE:=GPL-2.0-or-later
  9. PKG_LICENSE_FILES:=COPYING
  10. PKG_MAINTAINER:=Alberto Bursi <bobafetthotmail@gmail.com>
  11. PKG_BUILD_DEPENDS:= hwinfo/host
  12. include $(INCLUDE_DIR)/package.mk
  13. include $(INCLUDE_DIR)/host-build.mk
  14. # Execute in host build directory
  15. HOST_MAKE_FLAGS += -C $(HOST_BUILD_DIR)
  16. define Host/Configure
  17. # copy uuid.h to another location in host build dir as that's where this package expects it
  18. $(INSTALL_DIR) $(STAGING_DIR_HOST)/include/uuid/
  19. $(CP) $(STAGING_DIR_HOST)/include/e2fsprogs/uuid/uuid.h $(STAGING_DIR_HOST)/include/uuid/uuid.h
  20. endef
  21. define Host/Compile
  22. # Build using host compiler and let it generate the files we need
  23. # CFLAGS, CPPFLAGS & LDFLAGS need to be passed with CC because they are being ingored
  24. CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(HOST_LDFLAGS)" $(MAKE) $(HOST_MAKE_FLAGS)
  25. endef
  26. define Host/Install
  27. $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/hwinfo
  28. $(CP) $(HOST_BUILD_DIR)/src/isdn/cdb/isdn_cdb $(STAGING_DIR_HOST)/share/hwinfo/
  29. $(CP) $(HOST_BUILD_DIR)/src/isdn/cdb/mk_isdnhwdb $(STAGING_DIR_HOST)/share/hwinfo/
  30. $(CP) $(HOST_BUILD_DIR)/src/ids/check_hd $(STAGING_DIR_HOST)/share/hwinfo/
  31. endef
  32. define Build/Configure
  33. # Fetch prebuilt files from host build dir
  34. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/isdn/cdb/
  35. $(CP) $(STAGING_DIR_HOST)/share/hwinfo/isdn_cdb $(PKG_BUILD_DIR)/src/isdn/cdb/
  36. $(CP) $(STAGING_DIR_HOST)/share/hwinfo/mk_isdnhwdb $(PKG_BUILD_DIR)/src/isdn/cdb/
  37. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/ids/
  38. $(CP) $(STAGING_DIR_HOST)/share/hwinfo/check_hd $(PKG_BUILD_DIR)/src/ids/
  39. # Set copied files modtime to one day in the future
  40. # to prevent rebuilding them
  41. perl -e 'utime(time() + 86400, time() + 86400, $$$$ARGV[0])' \
  42. $(PKG_BUILD_DIR)/src/isdn/cdb/isdn_cdb
  43. perl -e 'utime(time() + 86400, time() + 86400, $$$$ARGV[0])' \
  44. $(PKG_BUILD_DIR)/src/isdn/cdb/mk_isdnhwdb
  45. perl -e 'utime(time() + 86400, time() + 86400, $$$$ARGV[0])' \
  46. $(PKG_BUILD_DIR)/src/ids/check_hd
  47. endef
  48. define Package/hwinfo
  49. SECTION:=utils
  50. CATEGORY:=Utilities
  51. TITLE:=probe the hardware present in the system
  52. URL:=https://github.com/openSUSE/hwinfo
  53. DEPENDS:= +libuuid
  54. endef
  55. define Package/hwinfo/description
  56. hwinfo/libhd are used to probe for the hardware present in the system.
  57. It can be used to generate a system overview log which can be later
  58. used for support.
  59. This project provides a hardware probing library libhd.so and a
  60. command line tool hwinfo using it. A major project using this library
  61. is YaST, the SUSE installation tool.
  62. endef
  63. define Package/hwinfo/install
  64. $(INSTALL_DIR) $(1)/usr/bin
  65. $(CP) $(PKG_BUILD_DIR)/hwinfo $(1)/usr/bin/
  66. $(INSTALL_DIR) $(1)/usr/lib
  67. $(CP) $(PKG_BUILD_DIR)/src/libhd.so* $(1)/usr/lib/
  68. endef
  69. $(eval $(call BuildPackage,hwinfo))
  70. $(eval $(call HostBuild))