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