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