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