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.

89 lines
3.0 KiB

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