From 5194fbf73097ba870ff363b14c9ec0b4fcacd65e Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Tue, 26 Nov 2024 17:24:39 +0300 Subject: [PATCH] import lshw-B.02.20-4.el10 --- .gitignore | 1 + .lshw.metadata | 1 + SOURCES/lshw-B.02.18-scandir.patch | 26 + SOURCES/lshw-B.02.20-cmake.patch | 1164 ++++++++++++++++++++++++++++ SOURCES/lshw-gtk.1 | 160 ++++ SPECS/lshw.spec | 385 +++++++++ 6 files changed, 1737 insertions(+) create mode 100644 .gitignore create mode 100644 .lshw.metadata create mode 100644 SOURCES/lshw-B.02.18-scandir.patch create mode 100644 SOURCES/lshw-B.02.20-cmake.patch create mode 100644 SOURCES/lshw-gtk.1 create mode 100644 SPECS/lshw.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa199e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/lshw-B.02.20.tar.gz diff --git a/.lshw.metadata b/.lshw.metadata new file mode 100644 index 0000000..be6eb6d --- /dev/null +++ b/.lshw.metadata @@ -0,0 +1 @@ +8dc76d4452bfe8ed6f5b246ad14af22c9c2d2ed5 SOURCES/lshw-B.02.20.tar.gz diff --git a/SOURCES/lshw-B.02.18-scandir.patch b/SOURCES/lshw-B.02.18-scandir.patch new file mode 100644 index 0000000..27c64b7 --- /dev/null +++ b/SOURCES/lshw-B.02.18-scandir.patch @@ -0,0 +1,26 @@ +diff --git a/src/core/abi.cc b/src/core/abi.cc +index 76c664c..b5bd9c9 100644 +--- a/src/core/abi.cc ++++ b/src/core/abi.cc +@@ -36,13 +36,15 @@ bool scan_abi(hwNode & system) + struct dirent **namelist; + + n = scandir(".", &namelist, selectfile, alphasort); +- for(i=0; id_name); +- free(namelist[i]); ++ if (n > 0) { ++ for(i=0; id_name); ++ free(namelist[i]); ++ } ++ if(namelist) ++ free(namelist); + } +- if(namelist) +- free(namelist); + } + + popd(); diff --git a/SOURCES/lshw-B.02.20-cmake.patch b/SOURCES/lshw-B.02.20-cmake.patch new file mode 100644 index 0000000..523cf20 --- /dev/null +++ b/SOURCES/lshw-B.02.20-cmake.patch @@ -0,0 +1,1164 @@ +From ea934d3d3bd86b366b2ad4fea16600c0e0476c74 Mon Sep 17 00:00:00 2001 +From: Terje Rosten +Date: Sun, 7 Jan 2024 15:23:24 +0100 +Subject: [PATCH] cmakeify + +--- + CMakeLists.txt | 43 +++++ + Makefile | 20 --- + README.md | 53 +++--- + lshw.spec.in | 64 ++------ + src/CMakeLists.txt | 104 ++++++++++++ + src/Makefile | 152 ------------------ + src/core/Makefile | 83 ---------- + src/core/{config.h => config.h.in} | 28 +--- + src/core/db.cc | 8 + + src/core/dump.cc | 2 +- + src/core/version.h | 2 + + src/gui/CMakeLists.txt | 74 +++++++++ + src/gui/Makefile | 62 ------- + .../{gtk-lshw.desktop => gtk-lshw.desktop.in} | 7 +- + src/gui/integration/lshw-gui.in | 5 + + .../integration/org.ezix.lshw.gui.policy.in | 20 +++ + src/gui/stock.c | 1 + + src/gui/support.c | 144 ----------------- + src/po/CMakeLists.txt | 16 ++ + src/po/Makefile | 23 --- + 20 files changed, 337 insertions(+), 574 deletions(-) + create mode 100644 CMakeLists.txt + delete mode 100644 Makefile + create mode 100644 src/CMakeLists.txt + delete mode 100644 src/Makefile + delete mode 100644 src/core/Makefile + rename src/core/{config.h => config.h.in} (50%) + create mode 100644 src/gui/CMakeLists.txt + delete mode 100644 src/gui/Makefile + rename src/gui/integration/{gtk-lshw.desktop => gtk-lshw.desktop.in} (51%) + create mode 100644 src/gui/integration/lshw-gui.in + create mode 100644 src/gui/integration/org.ezix.lshw.gui.policy.in + delete mode 100644 src/gui/support.c + create mode 100644 src/po/CMakeLists.txt + delete mode 100644 src/po/Makefile + +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..d076f2b +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,43 @@ ++cmake_minimum_required(VERSION 3.0) ++ ++project(lshw) ++set(VERSION "B.02.20") ++ ++find_package(Git) ++ ++if(EXISTS "${PROJECT_SOURCE_DIR}/.git" AND "${MAKE_RELEASE}" STREQUAL "") ++ if(GIT_FOUND) ++ execute_process( ++ COMMAND ${GIT_EXECUTABLE} describe --tags ++ OUTPUT_VARIABLE DESCRIBE_TAG ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ string(REGEX MATCH "B.[0-9]+.[0-9]+[-][0-9]+" VERSION ${DESCRIBE_TAG}) ++ string(REPLACE "-" "." VERSION ${VERSION}) ++ endif() ++endif() ++ ++message("-- lshw: ${VERSION}") ++ ++option(GUI "Enable GUI application (${PROJECT_NAME}-gtk)" ON) ++option(HWDATA "Install hwdata files" ON) ++option(SQLITE "Enable SQLite support" OFF) ++option(ZLIB "Enable zlib support" OFF) ++option(NOLOGO "Don't install vendor logos" OFF) ++option(STATIC "Do a static (will disable other features)" OFF) ++option(POLICYKIT "Install PolicyKit file and pfexec wrapper" OFF) ++ ++include(GNUInstallDirs) ++set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE STRING "Install prefix") ++set(DATADIR "${CMAKE_INSTALL_FULL_DATADIR}") ++set(PROJECT_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}") ++set(SBINDIR "${CMAKE_INSTALL_FULL_SBINDIR}") ++set(MANDIR "${CMAKE_INSTALL_FULL_MANDIR}") ++set(LOCALEDIR "${CMAKE_INSTALL_FULL_LOCALEDIR}") ++ ++configure_file( ++ "${PROJECT_SOURCE_DIR}/lshw.spec.in" ++ "${PROJECT_BINARY_DIR}/lshw.spec") ++ ++add_subdirectory(src) ++add_subdirectory(src/po) ++add_subdirectory(src/gui) +diff --git a/Makefile b/Makefile +deleted file mode 100644 +index b1be8b3..0000000 +--- a/Makefile ++++ /dev/null +@@ -1,20 +0,0 @@ +-PACKAGENAME = lshw +-VERSION?= $(shell git describe --tags | cut -d - -f 1,2 | tr - .) +-export PACKAGENAME +- +-all clean install snapshot gui install-gui static: +- +$(MAKE) -C src $@ +- +-version.cpe: .version +- echo -n cpe:/a:ezix:$(PACKAGENAME): > $@ +- cat $^ >> $@ +- +-.PHONY: $(PACKAGENAME).spec +- +-$(PACKAGENAME).spec: $(PACKAGENAME).spec.in +- cat $^ | sed -e s/\@VERSION\@/$(VERSION)/g > $@ +- +-release: $(PACKAGENAME).spec +- git archive --prefix=$(PACKAGENAME)-$(VERSION)/ -o $(PACKAGENAME)-$(VERSION).tar HEAD +- tar --transform s!^!$(PACKAGENAME)-$(VERSION)/! -rf $(PACKAGENAME)-$(VERSION).tar $^ +- gzip -f $(PACKAGENAME)-$(VERSION).tar +diff --git a/README.md b/README.md +index 0c610f5..8ef71f6 100644 +--- a/README.md ++++ b/README.md +@@ -15,27 +15,29 @@ Installation + 1. Requirements + - Linux 2.4.x, 2.6.x, 3.x or 4.x (2.2.x might work, though) + - a PA-RISC-, Alpha-, IA-64- (Itanium-), PowerPC-, ARM- or x86- based machine ++ - cmake, GNU make or Ninja + - an ANSI (or close enough to ANSI compliance) C++ compiler (tested with g++ 2.95.4 and 3.x) + - for the (optional) GTK+ graphical user interface, you will need a + complete GTK+ development environment (gtk3-devel on RedHat/Fedora derivatives) ++ - for optional SQLite feature install SQLite ++ - for optional zlib feature install zlib and gzip + +- 2. To compile it, just use: ++ 2. Use cmake options to decide feature set: ++ - -DGUI=OFF - disable graphical user interface version og lshw ++ - -DZLIB=ON - enable reading of gzipped datafiles ++ - -DSQLITE=ON - enable SQLite support ++ - -DPOLICYKIT=ON - enable PolicyKit integration ++ - -DNOLOGO=ON - don't install logos with copyright + +- $ make ++ 3. Do configuration and build by + +- To compile with zlib support (see below), use: +- +- $ make ZLIB=1 +- +- 3. If you want to build the optional GUI, do: +- +- $ make +- $ make gui ++ $ mkdir build && cd build ++ $ cmake .. -GNinja ++ $ ninja-build + + 4. If you want to install the result, do: + +- $ make install +- $ make install-gui ++ $ ninja-build install + + Getting help + ------------ +@@ -61,12 +63,27 @@ If compiled with zlib support, lshw will look for `file`.gz first, then for `fil + + Statically-linked and/or compressed binaries can be built by using + +- $ make static +- ++ $ mkdir build && cd build ++ $ cmake .. -DSTATIC=ON ++ $ ninja + or +- +- $ make compressed +- +-in the `src/` directory ++ $ mkdir build && cd build ++ $ cmake .. -GNinja ++ $ ninja compressed + + Building compressed binaries requires `upx` (cf. https://upx.github.io/). ++ ++Release management and data files maintenance ++--------------------------------------------- ++ ++Create release tarball, ++ ++ 1. Edit CMakeLists.txt to set version ++ 2. Run ++ $ mkdir build && cd build ++ $ cmake .. -DMAKE_RELEASE=ON ++ $ make release ++ ++Update hwdata files: ++ ++ $ make refresh_hwdata +diff --git a/lshw.spec.in b/lshw.spec.in +index b3b636f..3a6f9eb 100644 +--- a/lshw.spec.in ++++ b/lshw.spec.in +@@ -7,9 +7,11 @@ Version: @VERSION@ + Release: 2 + Source: http://www.ezix.org/software/files/%{name}-%{version}.tar.gz + URL: http://lshw.ezix.org/ +-License: GPL ++License: GPLv2 + Group: Applications/System +-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ++BuildRequires: gcc ++BuildRequires: gcc-c++ ++BuildRequires: cmake + + %global debug_package %{nil} + +@@ -39,7 +41,7 @@ lshw (Hardware Lister) is a small tool to provide detailed information on + the hardware configuration of the machine. It can report exact memory + configuration, firmware version, mainboard configuration, CPU version + and speed, cache configuration, bus speed, etc. on DMI-capable x86s +- systems and on some PowerPC machines (PowerMac G4 is known to work). ++systems and on some PowerPC machines (PowerMac G4 is known to work). + + This package provides a graphical user interface to display hardware + information. +@@ -54,61 +56,29 @@ http://lshw.ezix.org/ + %setup -q + + %build +-%{__make} %{?_smp_mflags} \ +- PREFIX="%{_prefix}" \ +- SBINDIR="%{_sbindir}" \ +- MANDIR="%{_mandir}" \ +- DATADIR="%{_datadir}" \ +- VERSION="%{version}" \ +- all +-%if %{!?_without_gui:1}0 +-%{__make} %{?_smp_mflags} \ +- PREFIX="%{_prefix}" \ +- SBINDIR="%{_sbindir}" \ +- MANDIR="%{_mandir}" \ +- DATADIR="%{_datadir}" \ +- VERSION="%{version}" \ +- gui +-%endif ++mkdir build && cd build ++%cmake .. %{?_without_gui:-DGUI=OFF} ++make %{?_smp_mflags} VERBOSE=1 + + %install +-%{__rm} -rf "%{buildroot}" +- +-%{__make} \ +- DESTDIR="%{buildroot}" \ +- PREFIX="%{_prefix}" \ +- SBINDIR="%{_sbindir}" \ +- MANDIR="%{_mandir}" \ +- DATADIR="%{_datadir}" \ +- INSTALL="%{__install} -p" \ +- install +-%if %{!?_without_gui:1}0 +-%{__make} \ +- DESTDIR="%{buildroot}" \ +- PREFIX="%{_prefix}" \ +- SBINDIR="%{_sbindir}" \ +- MANDIR="%{_mandir}" \ +- DATADIR="%{_datadir}" \ +- INSTALL="%{__install} -p" \ +- install-gui +-%endif +- +-%clean +-%{__rm} -rf %{buildroot} ++cd build ++make install DESTDIR=%{buildroot} + + %files +-%defattr(-,root,root, 0555) +-%doc README.md COPYING docs/TODO docs/Changelog docs/lshw.xsd ++%license COPYING ++%doc docs/TODO docs/Changelog docs/lshw.xsd + %{_sbindir}/lshw +-%doc %{_mandir}/man?/* ++%{_mandir}/man?/* + %{_datadir}/lshw/ + %{_datadir}/locale/*/*/* + + %if %{!?_without_gui:1}0 + %files gui +-%defattr(-,root,root, 0555) +-%doc COPYING ++%license COPYING + %{_sbindir}/gtk-lshw ++%{_datadir}/appdata/gtk-lshw.appdata.xml ++%{_datadir}/applications/gtk-lshw.desktop ++%{_datadir}/pixmaps/gtk-lshw.svg + %endif + + %changelog +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100644 +index 0000000..09e2774 +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,104 @@ ++if(STATIC) ++ set(ZLIB OFF) ++ set(SQLITE OFF) ++endif() ++ ++find_package(PkgConfig) ++ ++# SQLite support ++if(SQLITE) ++ pkg_check_modules(SQLITE3 sqlite3) ++ if(SQLITE3_FOUND) ++ message("-- Enabling SQLite support") ++ else() ++ message(FATAL_ERROR "SQLite not found, install lib or disable feature: -DSQLITE=OFF") ++ endif() ++else() ++ message("-- SQLite support disabled") ++endif() ++ ++# zlib support ++if(ZLIB) ++ find_program(GZIP gzip "Path to gzip application") ++ if(NOT GZIP) ++ message(FATAL_ERROR "gzip program not found, install gzip or disable zlib support: -DZLIB=OFF") ++ endif() ++ pkg_check_modules(Z zlib) ++ if(Z_FOUND) ++ message("-- Enabling zlib support") ++ else() ++ message(FATAL_ERROR "zlib not found, install lib or disable feature: -DZLIB=OFF") ++ endif() ++else() ++ message("-- zlib support disabled") ++endif() ++ ++if(ERROR) ++ message(FATAL_ERROR "Configuration failed") ++endif() ++ ++# Some special targets, compress, refresh_hwdata and release ++add_custom_target(compressed ++ COMMAND upx -9 -o lshw-compress lshw ++ COMMENT "Creating upx compressed binary") ++add_dependencies(compressed lshw) ++ ++add_custom_target(refresh_hwdata ++ COMMAND wget -N http://pciids.sourceforge.net/pci.ids ++ COMMAND wget -N http://www.linux-usb.org/usb.ids ++ COMMAND wget -N http://standards-oui.ieee.org/oui/oui.txt ++ COMMAND wget -O manuf.txt http://anonsvn.wireshark.org/wireshark/trunk/manuf ++ COMMAND wget -N https://git.fedorahosted.org/cgit/hwdata.git/plain/pnp.ids ++ COMMAND wget -N http://www-pc.uni-regensburg.de/hardware/TECHNIK/PCI_PNP/pnpid.txt ++ WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/src" ++ COMMENT "Updating hwdata files from upstream location") ++ ++set(TARNAME ${PROJECT_NAME}-${VERSION}) ++add_custom_target(release ++ COMMAND ${GIT_EXECUTABLE} archive --prefix=${TARNAME}/ ++ -o ${PROJECT_BINARY_DIR}/${TARNAME}.tar HEAD ++ COMMAND mv ${PROJECT_BINARY_DIR}/lshw.spec ${PROJECT_SOURCE_DIR}/lshw.spec ++ COMMAND tar --owner=0 --group=0 ++ --transform s,lshw.spec,${TARNAME}/lshw.spec, ++ -rf ${PROJECT_BINARY_DIR}/${TARNAME}.tar lshw.spec ++ COMMAND gzip ${PROJECT_BINARY_DIR}/${TARNAME}.tar ++ COMMAND rm ${PROJECT_SOURCE_DIR}/lshw.spec ++ WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" ++ COMMENT "Creating release tarball") ++ ++configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/core/config.h.in" ++ "${PROJECT_BINARY_DIR}/config.h") ++ ++include_directories("${PROJECT_BINARY_DIR}") ++include_directories("${CMAKE_CURRENT_SOURCE_DIR}/core") ++ ++file(GLOB DATAFILES "pci.ids" "pnp.ids" "usb.ids" "manuf.txt" "oui.txt" "pnpid.txt") ++ ++file(GLOB SOURCES "core/*.cc") ++add_library(core ${SOURCES}) ++add_executable(lshw lshw.cc) ++ ++if(STATIC) ++ set_target_properties(lshw PROPERTIES LINK_FLAGS "-static" ) ++endif() ++ ++target_link_libraries(lshw ${SQLITE3_LIBRARIES} ${Z_LIBRARIES} core resolv) ++ ++if(NOT ZLIB) ++ if(HWDATA) ++ install(FILES ${DATAFILES} DESTINATION ${PROJECT_DATADIR}) ++ endif() ++else() ++ foreach(DATAFILE ${DATAFILES}) ++ get_filename_component(FILE ${DATAFILE} NAME) ++ add_custom_command( ++ OUTPUT ${FILE}.gz ++ COMMAND ${GZIP} -c ${DATAFILE} > ${FILE}.gz) ++ add_custom_target(${FILE} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.gz) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.gz DESTINATION ${PROJECT_DATADIR}) ++ endforeach() ++endif() ++ ++install(FILES lshw.1 DESTINATION ${MANDIR}/man1 COMPONENT doc) ++install(TARGETS lshw DESTINATION sbin) +diff --git a/src/Makefile b/src/Makefile +deleted file mode 100644 +index ac726d0..0000000 +--- a/src/Makefile ++++ /dev/null +@@ -1,152 +0,0 @@ +-PACKAGENAME:=lshw +-export PACKAGENAME +-VERSION?= $(shell git describe --tags --long | cut -d - -f 1,2 | tr - .) +- +-SQLITE?=0 +-ZLIB?=0 +- +-DESTDIR?=/ +-PREFIX?=/usr +-SBINDIR=$(PREFIX)/sbin +-MANDIR=$(PREFIX)/share/man +-DATADIR=$(PREFIX)/share +-INSTALL?=install -p +-STRIP?=strip +-GZIP?=gzip -9 +-export DESTDIR +-export PREFIX +-export SBINDIR +-export MANDIR +-export DATADIR +-export SQLITE +-export ZLIB +- +-CXX?=$(CROSS_COMPILE)c++ +-PKG_CONFIG ?= pkg-config +-INCLUDES=-I./core/ +-ifneq ($(NO_VERSION_CHECK), 1) +-REMOTE_VERSION_CHECK?=-DREMOTE_VERSION_CHECK +-endif +-DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" -DVERSION=\"$(VERSION)\" $(REMOTE_VERSION_CHECK) +-CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) +-ifeq ($(SQLITE), 1) +- CXXFLAGS+= -DSQLITE $(shell $(PKG_CONFIG) --cflags sqlite3) +-endif +-ifeq ($(ZLIB), 1) +- CXXFLAGS+= -DZLIB $(shell $(PKG_CONFIG) --cflags zlib) +-endif +-LDFLAGS+=-L./core/ -g +-ifneq ($(shell $(LD) --help 2| grep -- --as-needed), ) +- LDFLAGS+= -Wl,--as-needed +-endif +-LDSTATIC=-static +-LIBS+=-llshw +-ifneq ($(NO_VERSION_CHECK), 1) +-LIBS+=-lresolv +-endif +-ifeq ($(SQLITE), 1) +- LIBS+= $(shell $(PKG_CONFIG) --libs sqlite3) +-endif +-ifeq ($(ZLIB), 1) +- LIBS+= $(shell $(PKG_CONFIG) --libs zlib) +-endif +- +-export CXXFLAGS +-export LIBS +-export LDFLAGS +- +-ifeq ($(ZLIB), 1) +-DATAFILES = pci.ids.gz usb.ids.gz oui.txt.gz manuf.txt.gz pnp.ids.gz pnpid.txt.gz +-else +-DATAFILES = pci.ids usb.ids oui.txt manuf.txt pnp.ids pnpid.txt +-endif +- +-all: $(PACKAGENAME) $(PACKAGENAME).1 $(DATAFILES) +- +-.cc.o: +- $(CXX) $(CXXFLAGS) -c $< -o $@ +- +-%.gz: % +- $(GZIP) -c $< > $@ +- +-.PHONY: core +-core: +- +make -C core all +- +-$(PACKAGENAME): core $(PACKAGENAME).o +- $(CXX) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS) +- +-.PHONY: po +-po: +- +make -C po all +- +-.PHONY: gui +-gui: core +- +make -C gui all +- +-.PHONY: nologo +-nologo: +- cp -f gui/artwork/nologo/* gui/artwork/ +- +-.PHONY: static +-static: $(PACKAGENAME)-static +- +-$(PACKAGENAME)-static: core core/lib$(PACKAGENAME).a $(PACKAGENAME).o +- $(CXX) $(LDSTATIC) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS) +- $(STRIP) $@ +- +-.PHONY: compressed +-compressed: $(PACKAGENAME)-compressed +- +-$(PACKAGENAME)-compressed: $(PACKAGENAME)-static +- upx -9 -o $@ $< +- +-$(PACKAGENAME).1: $(PACKAGENAME).sgml +- docbook2man $< +- +-pci.ids: +- wget http://pciids.sourceforge.net/pci.ids +- +-usb.ids: +- wget http://www.linux-usb.org/usb.ids +- +-oui.txt: +- wget http://standards.ieee.org/regauth/oui/oui.txt +- +-manuf.txt: +- wget -O $@ http://anonsvn.wireshark.org/wireshark/trunk/manuf +- +-pnp.ids: +- wget https://git.fedorahosted.org/cgit/hwdata.git/plain/pnp.ids +- +-pnpid.txt: +- wget http://www-pc.uni-regensburg.de/hardware/TECHNIK/PCI_PNP/pnpid.txt +- +-install: all +- $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR) +- $(INSTALL) -m 0755 $(PACKAGENAME) $(DESTDIR)/$(SBINDIR) +- $(INSTALL) -d -m 0755 $(DESTDIR)/$(MANDIR)/man1 +- $(INSTALL) -m 0644 $(PACKAGENAME).1 $(DESTDIR)/$(MANDIR)/man1 +- $(INSTALL) -d -m 0755 $(DESTDIR)/$(DATADIR)/$(PACKAGENAME) +- $(INSTALL) -m 0644 $(DATAFILES) $(DESTDIR)/$(DATADIR)/$(PACKAGENAME) +- make -C po install +- +-install-gui: gui +- $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR) +- $(INSTALL) -m 0755 gui/gtk-$(PACKAGENAME) $(DESTDIR)/$(SBINDIR) +- $(INSTALL) -d -m 0755 $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)/artwork +- $(INSTALL) -d -m 0755 $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)/ui +- $(INSTALL) -m 0644 gui/*.ui $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)/ui +- $(INSTALL) -m 0644 gui/artwork/*.svg $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)/artwork +- +-clean: +- rm -f $(PACKAGENAME).o $(PACKAGENAME) $(PACKAGENAME)-static $(PACKAGENAME)-compressed +- rm -f $(addsuffix .gz,$(DATAFILES)) +- make -C core clean +- make -C gui clean +- +-depend: +- @makedepend -Y $(SRCS) 2> /dev/null > /dev/null +- +- +-# DO NOT DELETE +diff --git a/src/core/Makefile b/src/core/Makefile +deleted file mode 100644 +index 5035062..0000000 +--- a/src/core/Makefile ++++ /dev/null +@@ -1,83 +0,0 @@ +-PACKAGENAME?=lshw +- +-CXX?=$(CROSS_COMPILE)c++ +-INCLUDES= +-ifneq ($(NO_VERSION_CHECK), 1) +-REMOTE_VERSION_CHECK?=-DREMOTE_VERSION_CHECK +-endif +-DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" $(REMOTE_VERSION_CHECK) +-CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) +-LDFLAGS= +-LDSTATIC= +-LIBS= +- +-OBJS = hw.o main.o print.o mem.o dmi.o device-tree.o cpuinfo.o osutils.o pci.o version.o cpuid.o ide.o cdrom.o pcmcia-legacy.o scsi.o s390.o disk.o spd.o network.o isapnp.o pnp.o fb.o options.o usb.o sysfs.o display.o heuristics.o parisc.o cpufreq.o partitions.o blockio.o lvm.o ideraid.o pcmcia.o volumes.o mounts.o smp.o abi.o jedec.o dump.o fat.o virtio.o vio.o nvme.o mmc.o input.o sound.o graphics.o +-ifeq ($(SQLITE), 1) +- OBJS+= db.o +-endif +-SRCS = $(OBJS:.o=.cc) +- +-all: lib$(PACKAGENAME).a +- +-.cc.o: +- $(CXX) $(CXXFLAGS) -c $< -o $@ +- +-lib$(PACKAGENAME).a: $(OBJS) +- $(AR) rs $@ $^ +- +-install: all +- +-clean: +- rm -f $(OBJS) lib$(PACKAGENAME).a +- +-depend: +- @makedepend -Y $(SRCS) 2> /dev/null > /dev/null +- +- +-# DO NOT DELETE +- +-hw.o: hw.h osutils.h version.h config.h options.h heuristics.h +-main.o: hw.h print.h version.h options.h mem.h dmi.h cpuinfo.h cpuid.h +-main.o: device-tree.h pci.h pcmcia.h pcmcia-legacy.h ide.h scsi.h spd.h +-main.o: network.h isapnp.h fb.h usb.h sysfs.h display.h parisc.h cpufreq.h +-main.o: ideraid.h mounts.h smp.h abi.h s390.h virtio.h pnp.h vio.h +-print.o: print.h hw.h options.h version.h osutils.h config.h +-mem.o: version.h config.h mem.h hw.h sysfs.h +-dmi.o: version.h config.h dmi.h hw.h osutils.h +-device-tree.o: version.h device-tree.h hw.h osutils.h +-cpuinfo.o: version.h cpuinfo.h hw.h osutils.h +-osutils.o: version.h osutils.h +-pci.o: version.h config.h pci.h hw.h osutils.h options.h +-version.o: version.h config.h +-cpuid.o: version.h cpuid.h hw.h +-ide.o: version.h cpuinfo.h hw.h osutils.h cdrom.h disk.h heuristics.h +-cdrom.o: version.h cdrom.h hw.h partitions.h +-pcmcia-legacy.o: version.h pcmcia-legacy.h hw.h osutils.h +-scsi.o: version.h mem.h hw.h cdrom.h disk.h osutils.h heuristics.h sysfs.h +-disk.o: version.h disk.h hw.h osutils.h heuristics.h partitions.h +-spd.o: version.h spd.h hw.h osutils.h +-network.o: version.h config.h network.h hw.h osutils.h sysfs.h options.h +-network.o: heuristics.h +-isapnp.o: version.h isapnp.h hw.h pnp.h +-pnp.o: version.h pnp.h hw.h sysfs.h osutils.h +-fb.o: version.h fb.h hw.h +-options.o: version.h options.h osutils.h +-usb.o: version.h usb.h hw.h osutils.h heuristics.h options.h +-sysfs.o: version.h sysfs.h hw.h osutils.h +-display.o: display.h hw.h +-heuristics.o: version.h sysfs.h hw.h osutils.h +-parisc.o: version.h device-tree.h hw.h osutils.h heuristics.h +-cpufreq.o: version.h hw.h osutils.h +-partitions.o: version.h partitions.h hw.h blockio.h lvm.h volumes.h osutils.h +-blockio.o: version.h blockio.h osutils.h +-lvm.o: version.h lvm.h hw.h blockio.h osutils.h +-ideraid.o: version.h cpuinfo.h hw.h osutils.h cdrom.h disk.h heuristics.h +-pcmcia.o: version.h pcmcia.h hw.h osutils.h sysfs.h +-volumes.o: version.h volumes.h hw.h blockio.h lvm.h osutils.h +-mounts.o: version.h mounts.h hw.h osutils.h +-smp.o: version.h smp.h hw.h osutils.h +-abi.o: version.h abi.h hw.h osutils.h +-jedec.o: jedec.h +-s390.o: hw.h sysfs.h disk.h s390.h +-virtio.o: version.h hw.h sysfs.h disk.h virtio.h +-vio.o: version.h hw.h sysfs.h vio.h +diff --git a/src/core/config.h b/src/core/config.h.in +similarity index 50% +rename from src/core/config.h +rename to src/core/config.h.in +index 69023fd..ca25a5f 100644 +--- a/src/core/config.h ++++ b/src/core/config.h.in +@@ -13,27 +13,15 @@ + #define N_(String) gettext_noop (String) + #endif + +-#ifndef PACKAGE +-#define PACKAGE "lshw" +-#endif +- +-#ifndef PREFIX +-#define PREFIX "/usr" +-#endif +- +-#ifndef SBINDIR +-#define SBINDIR PREFIX"/sbin" +-#endif ++#define PACKAGE "@PROJECT_NAME@" ++#define VERSION "@VERSION@" + +-#ifndef DATADIR +-#define DATADIR PREFIX"/share/lshw" +-#endif ++#define SBINDIR "@SBINDIR@" ++#define DATADIR "@DATADIR@" ++#define MANDIR "@MANDIR@" ++#define LOCALEDIR "@LOCALEDIR@" + +-#ifndef MANDIR +-#define MANDIR PREFIX"/share/man" +-#endif ++#cmakedefine SQLITE 1 ++#cmakedefine ZLIB 1 + +-#ifndef LOCALEDIR +-#define LOCALEDIR PREFIX"/share/locale" +-#endif + #endif +diff --git a/src/core/db.cc b/src/core/db.cc +index d080295..f85c85b 100644 +--- a/src/core/db.cc ++++ b/src/core/db.cc +@@ -1,6 +1,12 @@ ++ + #include + #include + #include ++ ++#include "config.h" ++ ++#ifdef SQLITE ++ + #include + + #include "db.h" +@@ -419,3 +425,5 @@ value statement::operator[](const string & i) const + { + return column(i); + } ++ ++#endif /* SQLITE */ +diff --git a/src/core/dump.cc b/src/core/dump.cc +index 6bc9674..f22f0fb 100644 +--- a/src/core/dump.cc ++++ b/src/core/dump.cc +@@ -1,5 +1,5 @@ +-#include "dump.h" + #include "version.h" ++#include "dump.h" + #include "osutils.h" + + #include +diff --git a/src/core/version.h b/src/core/version.h +index 91e039a..5cecdda 100644 +--- a/src/core/version.h ++++ b/src/core/version.h +@@ -1,6 +1,8 @@ + #ifndef _VERSION_H_ + #define _VERSION_H_ + ++#include "config.h" ++ + #if defined(__GNUC__) || defined(__INTEL_COMPILER) + #define __ID(string) __asm__(".ident\t\"" string "\"") + #else +diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt +new file mode 100644 +index 0000000..ddc4aab +--- /dev/null ++++ b/src/gui/CMakeLists.txt +@@ -0,0 +1,74 @@ ++if(NOT GUI OR STATIC) ++ message("-- gtk-${PROJECT_NAME} disabled") ++ return() ++endif() ++ ++find_package(PkgConfig) ++pkg_check_modules(GTK3 REQUIRED gtk+-3.0 gmodule-2.0) ++ ++set(GTK_SOURCES ++ callbacks.c ++ gtk-lshw.c ++ stock.c ++ engine.cc ++ print-gui.cc ++) ++ ++include_directories("${PROJECT_BINARY_DIR}") ++include_directories("${PROJECT_SOURCE_DIR}/src/core") ++ ++include_directories("${GTK3_INCLUDE_DIRS}") ++link_directories("${GTK3_LIBRARY_DIRS}") ++ ++add_executable(gtk-lshw ${GTK_SOURCES}) ++target_link_libraries(gtk-lshw ${SQLITE3_LIBRARIES} ${Z_LIBRARIES} ${GTK3_LIBRARIES} core resolv) ++install(TARGETS gtk-lshw DESTINATION sbin) ++ ++if(POLICYKIT) ++ set(desktop_exec ${CMAKE_INSTALL_FULL_BINDIR}/lshw-gui) ++ configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/integration/org.ezix.lshw.gui.policy.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/org.ezix.lshw.gui.policy") ++ configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/integration/lshw-gui.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/lshw-gui") ++else() ++ set(desktop_exec ${CMAKE_INSTALL_FULL_SBINDIR}/gtk-lshw) ++endif() ++ ++configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/integration/gtk-lshw.desktop.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/gtk-lshw.desktop") ++configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/artwork/logo.svg" ++ "${CMAKE_CURRENT_BINARY_DIR}/gtk-lshw.svg") ++ ++file(GLOB LOGOS "artwork/*.svg") ++file(GLOB NOLOGOS "artwork/nologo/*.svg") ++ ++if(NOLOGO) ++ install(FILES ${NOLOGOS} DESTINATION ${PROJECT_DATADIR}/artwork) ++ foreach(LOGO ${LOGOS}) ++ get_filename_component(BASENAME ${LOGO} NAME) ++ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/artwork/nologo/${BASENAME}") ++ list(REMOVE_ITEM LOGOS ${LOGO}) ++ endif() ++ endforeach() ++endif() ++ ++install(FILES ${LOGOS} DESTINATION ${PROJECT_DATADIR}/artwork) ++install(FILES gtk-lshw.ui DESTINATION ${PROJECT_DATADIR}/ui) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gtk-lshw.desktop ++ DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications) ++install(FILES integration/gtk-lshw.appdata.xml DESTINATION ++ ${CMAKE_INSTALL_FULL_DATADIR}/appdata) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gtk-lshw.svg DESTINATION ++ ${CMAKE_INSTALL_FULL_DATADIR}/pixmaps) ++ ++ ++if(POLICYKIT) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.ezix.lshw.gui.policy ++ DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/polkit-1/actions) ++ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lshw-gui ++ DESTINATION bin) ++endif() +diff --git a/src/gui/Makefile b/src/gui/Makefile +deleted file mode 100644 +index cc2d168..0000000 +--- a/src/gui/Makefile ++++ /dev/null +@@ -1,62 +0,0 @@ +-PACKAGENAME?=lshw +- +-CXX?=$(CROSS_COMPILE)c++ +-PKG_CONFIG ?= pkg-config +-CC?=$(CROSS_COMPILE)cc +-STRIP?=strip +-OBJCOPY?=objcopy +- +-DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" +-GTKINCLUDES=$(shell $(PKG_CONFIG) gtk+-3.0 --cflags) +-INCLUDES=-I../core $(GTKINCLUDES) +-CXXFLAGS=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) +-ifeq ($(SQLITE), 1) +- CXXFLAGS+= -DSQLITE $(shell $(PKG_CONFIG) --cflags sqlite3) +-endif +-CFLAGS=$(CXXFLAGS) -g $(DEFINES) +-GTKLIBS=$(shell $(PKG_CONFIG) gtk+-3.0 gmodule-2.0 --libs) +-LIBS+=-L../core -llshw -lresolv $(GTKLIBS) +-ifeq ($(SQLITE), 1) +- LIBS+= $(shell $(PKG_CONFIG) --libs sqlite3) +-endif +-LDFLAGS= +-ifneq ($(shell $(LD) --help 2| grep -- --as-needed), ) +- LDFLAGS+= -Wl,--as-needed +-endif +- +-OBJS = gtk-lshw.o callbacks.o engine.o print-gui.o stock.o +-SRCS = $(OBJS:.o=.c) +- +-all: gtk-$(PACKAGENAME) +- +-.cc.o: +- $(CXX) $(CXXFLAGS) -c $< -o $@ +- +-.c.o: +- $(CC) $(CFLAGS) -c $< -o $@ +- +-.PHONY: icon +-icon: gtk-$(PACKAGENAME) artwork/logo.svg +- $(OBJCOPY) --add-section .icon=artwork/logo.svg gtk-$(PACKAGENAME) +- +-interface.c: gtk-lshw.glade gtk-lshw.gladep +- glade-2 -w gtk-lshw.glade +- +-gtk-$(PACKAGENAME): $(OBJS) ../core/liblshw.a +- $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS) +- +-install: all +- $(STRIP) gtk-$(PACKAGENAME) +- +-clean: +- rm -f $(OBJS) gtk-$(PACKAGENAME) gtk-lshw.glade.bak gtk-lshw.gladep.bak callbacks.c.bak callbacks.h.bak Makefile.bak +- +-depend: +- @makedepend -Y $(SRCS) 2> /dev/null > /dev/null +- +- +-# DO NOT DELETE +- +-gtk-lshw.o: stock.h engine.h +-callbacks.o: callbacks.h support.h engine.h +-stock.o: stock.h +diff --git a/src/gui/integration/gtk-lshw.desktop b/src/gui/integration/gtk-lshw.desktop.in +similarity index 51% +rename from src/gui/integration/gtk-lshw.desktop +rename to src/gui/integration/gtk-lshw.desktop.in +index 4df1c7c..7124c27 100644 +--- a/src/gui/integration/gtk-lshw.desktop ++++ b/src/gui/integration/gtk-lshw.desktop.in +@@ -3,10 +3,9 @@ Name=LSHW + Comment=HardWare LiSter + Comment[fr]=Listeur de matériel + Comment[es]=Listar equipamiento +-Categories=Application;System;X-Red-Hat-Base;X-Fedora; +-Icon=/usr/share/lshw/artwork/logo.svg +-Exec=/usr/bin/gtk-lshw ++Categories=GTK;System; ++Icon=gtk-lshw ++Exec=@desktop_exec@ + Type=Application + Terminal=false + Encoding=UTF-8 +-X-Desktop-File-Install-Version=0.10 +diff --git a/src/gui/integration/lshw-gui.in b/src/gui/integration/lshw-gui.in +new file mode 100644 +index 0000000..ac0823b +--- /dev/null ++++ b/src/gui/integration/lshw-gui.in +@@ -0,0 +1,5 @@ ++#! /bin/bash ++ ++/usr/bin/pkexec @CMAKE_INSTALL_FULL_SBINDIR@/gtk-lshw ++ ++ +diff --git a/src/gui/integration/org.ezix.lshw.gui.policy.in b/src/gui/integration/org.ezix.lshw.gui.policy.in +new file mode 100644 +index 0000000..cba4189 +--- /dev/null ++++ b/src/gui/integration/org.ezix.lshw.gui.policy.in +@@ -0,0 +1,20 @@ ++ ++ ++ ++ lshw ++ http://ezix.org/project/wiki/HardwareLiSter ++ ++ Hardware Lister (lshw) - list hardware information ++ Authentication is required to run lshw-gui ++ lshw-gui ++ ++ no ++ no ++ auth_admin_keep ++ ++ @CMAKE_INSTALL_FULL_SBINDIR@/gtk-lshw ++ true ++ ++ +diff --git a/src/gui/stock.c b/src/gui/stock.c +index c3159b8..db2e981 100644 +--- a/src/gui/stock.c ++++ b/src/gui/stock.c +@@ -1,3 +1,4 @@ ++#include "config.h" + #include "stock.h" + #include + #include +diff --git a/src/gui/support.c b/src/gui/support.c +deleted file mode 100644 +index 7dc3c78..0000000 +--- a/src/gui/support.c ++++ /dev/null +@@ -1,144 +0,0 @@ +-/* +- * DO NOT EDIT THIS FILE - it is generated by Glade. +- */ +- +-#ifdef HAVE_CONFIG_H +-# include +-#endif +- +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-#include "support.h" +- +-GtkWidget* +-lookup_widget (GtkWidget *widget, +- const gchar *widget_name) +-{ +- GtkWidget *parent, *found_widget; +- +- for (;;) +- { +- if (GTK_IS_MENU (widget)) +- parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); +- else +- parent = widget->parent; +- if (!parent) +- parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); +- if (parent == NULL) +- break; +- widget = parent; +- } +- +- found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), +- widget_name); +- if (!found_widget) +- g_warning ("Widget not found: %s", widget_name); +- return found_widget; +-} +- +-static GList *pixmaps_directories = NULL; +- +-/* Use this function to set the directory containing installed pixmaps. */ +-void +-add_pixmap_directory (const gchar *directory) +-{ +- pixmaps_directories = g_list_prepend (pixmaps_directories, +- g_strdup (directory)); +-} +- +-/* This is an internally used function to find pixmap files. */ +-static gchar* +-find_pixmap_file (const gchar *filename) +-{ +- GList *elem; +- +- /* We step through each of the pixmaps directory to find it. */ +- elem = pixmaps_directories; +- while (elem) +- { +- gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data, +- G_DIR_SEPARATOR_S, filename); +- if (g_file_test (pathname, G_FILE_TEST_EXISTS)) +- return pathname; +- g_free (pathname); +- elem = elem->next; +- } +- return NULL; +-} +- +-/* This is an internally used function to create pixmaps. */ +-GtkWidget* +-create_pixmap (GtkWidget *widget, +- const gchar *filename) +-{ +- gchar *pathname = NULL; +- GtkWidget *pixmap; +- +- if (!filename || !filename[0]) +- return gtk_image_new (); +- +- pathname = find_pixmap_file (filename); +- +- if (!pathname) +- { +- g_warning ("Couldn't find pixmap file: %s", filename); +- return gtk_image_new (); +- } +- +- pixmap = gtk_image_new_from_file (pathname); +- g_free (pathname); +- return pixmap; +-} +- +-/* This is an internally used function to create pixmaps. */ +-GdkPixbuf* +-create_pixbuf (const gchar *filename) +-{ +- gchar *pathname = NULL; +- GdkPixbuf *pixbuf; +- GError *error = NULL; +- +- if (!filename || !filename[0]) +- return NULL; +- +- pathname = find_pixmap_file (filename); +- +- if (!pathname) +- { +- g_warning ("Couldn't find pixmap file: %s", filename); +- return NULL; +- } +- +- pixbuf = gdk_pixbuf_new_from_file (pathname, &error); +- if (!pixbuf) +- { +- fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", +- pathname, error->message); +- g_error_free (error); +- } +- g_free (pathname); +- return pixbuf; +-} +- +-/* This is used to set ATK action descriptions. */ +-void +-glade_set_atk_action_description (AtkAction *action, +- const gchar *action_name, +- const gchar *description) +-{ +- gint n_actions, i; +- +- n_actions = atk_action_get_n_actions (action); +- for (i = 0; i < n_actions; i++) +- { +- if (!strcmp (atk_action_get_name (action, i), action_name)) +- atk_action_set_description (action, i, description); +- } +-} +- +diff --git a/src/po/CMakeLists.txt b/src/po/CMakeLists.txt +new file mode 100644 +index 0000000..de2f5c8 +--- /dev/null ++++ b/src/po/CMakeLists.txt +@@ -0,0 +1,16 @@ ++include(FindGettext) ++ ++if (GETTEXT_FOUND) ++ file(GLOB POTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.po") ++ string(REPLACE ".po" " " LANGS ${POTFILES}) ++ message(STATUS "gettext found: ${LANGS}") ++ string(REPLACE " " ";" LANGS ${LANGS}) ++ foreach(LANG ${LANGS}) ++ GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES ${LANG}.po) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo" ++ DESTINATION "${CMAKE_INSTALL_FULL_LOCALEDIR}/${LANG}/LC_MESSAGES" ++ RENAME "${PROJECT_NAME}.mo") ++ endforeach() ++else() ++ message("-- gettext not found") ++endif() +diff --git a/src/po/Makefile b/src/po/Makefile +deleted file mode 100644 +index 1d5b138..0000000 +--- a/src/po/Makefile ++++ /dev/null +@@ -1,23 +0,0 @@ +-PACKAGENAME?=lshw +- +-LANGUAGES = ca es fr +-SRCS = $(LANGUAGES:=.po) +-CATALOGS = $(LANGUAGES:=.mo) +- +-all: $(PACKAGENAME).pot $(CATALOGS) +- +-POTFILES: +- find .. -name \*.cc > $@ +- find .. -name \*.c >> $@ +- +-$(PACKAGENAME).pot: POTFILES +- xgettext -F --no-wrap --indent --keyword=_ --keyword=N_ -d $(PACKAGENAME) -o $@ -f POTFILES +- +-%.mo: %.po +- msgfmt -v -o $@ $^ +- +-install: $(CATALOGS) +- $(foreach i, $(LANGUAGES), install -D $(i).mo $(DESTDIR)/$(DATADIR)/locale/$(i)/LC_MESSAGES/$(PACKAGENAME).mo ;) +- +-clean: +- rm -f $(CATALOGS) $(PACKAGENAME).pot +-- +2.40.1 + diff --git a/SOURCES/lshw-gtk.1 b/SOURCES/lshw-gtk.1 new file mode 100644 index 0000000..9dae191 --- /dev/null +++ b/SOURCES/lshw-gtk.1 @@ -0,0 +1,160 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "LSHW-GTK 1" +.TH LSHW-GTK 1 "2007-12-05" "perl v5.8.8" "User Contributed Perl Documentation" +.SH "NAME" +lshw\-gtk \- list hardware (GTK version) +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +lshw is a small tool to extract detailed information on the hardware +configuration of the machine. It can report exact memory +configuration, firmware version, mainboard configuration, +\&\s-1CPU\s0 version +and speed, cache configuration, bus speed, etc. on +DMI-capable x86 or \s-1IA\-64\s0 +systems and on some PowerPC +machines (PowerMac G4 is known to work). +.PP +It currently supports \s-1DMI\s0 (x86 and \s-1IA\-64\s0 only), OpenFirmware device tree (PowerPC only), +\&\s-1PCI/AGP\s0, \s-1CPUID\s0 (x86), \s-1IDE/ATA/ATAPI\s0, \s-1PCMCIA\s0 (only tested on x86), \s-1SCSI\s0 and \s-1USB\s0. +.SH "NOTES" +.IX Header "NOTES" +lshw-gtk must be run as super user or it will only report +.SH "COPYING" +.IX Header "COPYING" +lshw is distributed under the \s-1GNU\s0 \s-1GENERAL\s0 \s-1PUBLIC\s0 \s-1LICENSE\s0 (\s-1GPL\s0) version 2. +.SH "AUTOR" +.IX Header "AUTOR" +lshw is maintained by Lyonel Vincent +. +.SH "OTHER INFO" +.IX Header "OTHER INFO" +The webpage for lshw is at http://ezix.org/software/lshw.html diff --git a/SPECS/lshw.spec b/SPECS/lshw.spec new file mode 100644 index 0000000..d50340e --- /dev/null +++ b/SPECS/lshw.spec @@ -0,0 +1,385 @@ +%undefine __cmake_in_source_build + +%bcond_without gui + +Summary: Hardware lister +Name: lshw +Version: B.02.20 +Release: 4%{?dist} +License: GPL-2.0-only +URL: http://ezix.org/project/wiki/HardwareLiSter +Source0: http://www.ezix.org/software/files/lshw-%{version}.tar.gz +Source1: https://salsa.debian.org/openstack-team/third-party/lshw/raw/debian/stein/debian/patches/lshw-gtk.1 +Patch1: lshw-B.02.18-scandir.patch +Patch2: lshw-B.02.20-cmake.patch +BuildRequires: cmake +BuildRequires: desktop-file-utils +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: gettext +%if %{with gui} +BuildRequires: gtk3-devel >= 3.24 +BuildRequires: libappstream-glib +%endif +BuildRequires: ninja-build +BuildRequires: python3-devel +BuildRequires: sqlite-devel +Requires: hwdata +%description +lshw is a small tool to provide detailed informaton on the hardware +configuration of the machine. It can report exact memory +configuration, firmware version, mainboard configuration, CPU version +and speed, cache configuration, bus speed, etc. on DMI-capable x86 +systems and on some PowerPC machines (PowerMac G4 is known to work). + +Information can be output in plain text, XML or HTML. + +%if %{with gui} +%package gui +Summary: Graphical hardware lister +Requires: polkit +Requires: %{name} = %{version}-%{release} +%description gui +Graphical frontend for the hardware lister (lshw) tool. If desired, +hardware information can be saved to file in plain, XML or HTML +format. +%endif + +%prep +%autosetup -p1 + +%build +%if %{with gui} +%global gui_config -DGUI=ON +%else +%global gui_config -DGUI=OFF +%endif + +%cmake -DNOLOGO=ON -DHWDATA=OFF -DPOLICYKIT=ON -DSQLITE=ON -DBUILD_SHARED_LIBS=OFF %{gui_config} -GNinja +%cmake_build + +%install +%cmake_install +%if %{with gui} +install -m0644 -D %{SOURCE1} %{buildroot}%{_mandir}/man1/lshw-gui.1 +ln -s gtk-lshw %{buildroot}%{_sbindir}/lshw-gui +%endif +# translations seems borken, remove for now +#find_lang %{name} +rm -rf %{buildroot}%{_datadir}/locale/*/ + +%check +%if %{with gui} +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml +%endif + +# check json output is valid +%{_vpath_builddir}/src/lshw -json \ + -disable usb -disable pcmcia -disable isapnp \ + -disable ide -disable scsi -disable dmi -disable memory \ + -disable cpuinfo 2>/dev/null | %{__python3} -m json.tool + +#files -f %{name}.lang +%files +%license COPYING +%doc README.md +%{_mandir}/man1/lshw.1* +%{_sbindir}/lshw + +%if %{with gui} +%files gui +%license COPYING +%{_bindir}/lshw-gui +%{_sbindir}/gtk-lshw +%{_sbindir}/lshw-gui +%{_mandir}/man1/lshw-gui.1* +%dir %{_datadir}/lshw +%{_datadir}/lshw/artwork +%dir %{_datadir}/lshw/ui +%{_datadir}/lshw/ui/gtk-lshw.ui +%{_datadir}/pixmaps/gtk-lshw.svg +%{_datadir}/applications/gtk-lshw.desktop +%{_datadir}/appdata/gtk-lshw.appdata.xml +%{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy +%endif + +%changelog +* Tue Nov 26 2024 MSVSphere Packaging Team - B.02.20-4 +- Rebuilt for MSVSphere 10 + +* Mon Jun 24 2024 Troy Dawson - B.02.20-4 +- Bump release for June 2024 mass rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - B.02.20-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - B.02.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 06 2024 Terje Rosten - B.02.20-1 +- B.02.20 +- Remove all upstream patches + +* Tue Aug 08 2023 Terje Rosten - B.02.19.2-13 +- Use SPDX licence + +* Thu Jul 20 2023 Fedora Release Engineering - B.02.19.2-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Apr 05 2023 Terje Rosten - B.02.19.2-11 +- Use modern macros + +* Tue Apr 04 2023 Yaakov Selkowitz - B.02.19.2-10 +- Update to upstream commit 76afbaaf40e + +* Thu Jan 19 2023 Fedora Release Engineering - B.02.19.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - B.02.19.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sun Jun 19 2022 Stewart Smith - B.02.19.2-7 +- Make GUI an optional bcond +- Disable remote DNS lookup on 'lshw -version' + +* Thu Jan 20 2022 Fedora Release Engineering - B.02.19.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - B.02.19.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - B.02.19.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - B.02.19.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Apr 24 2020 Terje Rosten - B.02.19.2-2 +- Add patch from openSUSE to fix rhbz#1822455 + +* Tue Mar 24 2020 Terje Rosten - B.02.19.2-1 +- B.02.19.2 + +* Wed Jan 29 2020 Fedora Release Engineering - B.02.18-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - B.02.18-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue May 28 2019 Terje Rosten - B.02.18-21 +- Update to commit 6cc0581 +- Rebase cmake patch on top 6cc0581 +- Add NVME patch from PR#45 + +* Sat May 25 2019 Terje Rosten - B.02.18-20 +- Add lshw-gui man page (from Debian, thanks!) + +* Fri Feb 01 2019 Fedora Release Engineering - B.02.18-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - B.02.18-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - B.02.18-17 +- Rebuilt for Python 3.7 + +* Mon Apr 02 2018 Terje Rosten - B.02.18-16 +- Update to commit 20cda77 +- Convert to cmake build system + +* Thu Feb 08 2018 Terje Rosten - B.02.18-15 +- Fix JSON issue (rhbz#1543320) + +* Thu Feb 08 2018 Fedora Release Engineering - B.02.18-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Jan 26 2018 Terje Rosten - B.02.18-13 +- Fix date +- Need gettext + +* Fri Jan 26 2018 Terje Rosten - B.02.18-12 +- Update to commit d05baa7 + +* Mon Aug 28 2017 Terje Rosten - B.02.18-11 +- Prefer lshw-gui in lshw-gui context + +* Sun Aug 13 2017 Terje Rosten - B.02.18-10 +- Add AppData bz#1476498 + +* Thu Aug 03 2017 Fedora Release Engineering - B.02.18-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - B.02.18-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon May 15 2017 Fedora Release Engineering - B.02.18-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - B.02.18-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Aug 24 2016 Terje Rosten - B.02.18-5 +- Modify lshw gui wrapper to fix bz#1368404 + +* Thu Aug 11 2016 Terje Rosten - B.02.18-4 +- Add patches to fix sysconf/long_bit issue and crash (bz#1342792) + +* Wed May 18 2016 Terje Rosten - B.02.18-3 +- Add patch to fix crash (bz#1332486) + +* Mon Apr 25 2016 Terje Rosten - B.02.18-2 +- Date fix + +* Mon Apr 25 2016 Terje Rosten - B.02.18-1 +- B.02.18 + +* Thu Feb 04 2016 Fedora Release Engineering - B.02.17-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - B.02.17-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat May 02 2015 Kalev Lember - B.02.17-5 +- Rebuilt for GCC 5 C++11 ABI change + +* Sun Aug 17 2014 Fedora Release Engineering - B.02.17-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - B.02.17-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Sep 30 2013 Terje Rosten - B.02.17-2 +- Add patch to fix segfault in scan fat code + +* Thu Sep 26 2013 Terje Rosten - B.02.17-1 +- B.02.17 + +* Sat Aug 03 2013 Fedora Release Engineering - B.02.16-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Sun Jun 09 2013 Terje Rosten - B.02.16-8 +- Rename macro + +* Sun Jun 09 2013 Terje Rosten - B.02.16-7 +- Fix desktop file (bz #953684) +- Remove broken translations (bz #905896) +- Add vendor macro + +* Fri Apr 26 2013 Jon Ciesla - B.02.16-6 +- Drop desktop vendor tag. + +* Thu Feb 14 2013 Fedora Release Engineering - B.02.16-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - B.02.16-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue May 08 2012 Terje Rosten - B.02.16-3 +- Switch from consolehelper to PolicyKit (bz #502730) + +* Tue Feb 28 2012 Fedora Release Engineering - B.02.16-2 +- Rebuilt for c++ ABI breakage + +* Sun Jan 29 2012 Terje Rosten - B.02.16-1 +- B.02.16 + +* Fri Jan 13 2012 Fedora Release Engineering - B.02.15-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Oct 17 2011 Terje Rosten - B.02.15-3 +- Own all dirs + +* Tue Feb 08 2011 Fedora Release Engineering - B.02.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sun Nov 21 2010 Terje Rosten - B.02.15-1 +- B.02.15 +- Remove patches now upstream +- Build with sqlite support + +* Sun Sep 05 2010 Terje Rosten - B.02.14-5 +- Add patch to fix build with gcc-4.5 + +* Sun Sep 05 2010 Terje Rosten - B.02.14-4 +- Add patch to fix ext4 issue + +* Sat Jul 25 2009 Fedora Release Engineering - B.02.14-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed May 06 2009 Adam Jackson - B.02.14-2 +- Requires: hwdata +- Drop redundant copies of pci.ids and friends, since we'll pick up the + copies in hwdata at runtime + +* Sun Mar 1 2009 Terje Rosten - B.02.14-1 +- B.02.14 +- Drop gcc43 patch now upstream + +* Wed Feb 25 2009 Fedora Release Engineering - B.02.13-4 +- rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Aug 13 2008 Terje Rosten - B.02.13-3 +- rebuild + +* Wed Aug 13 2008 Terje Rosten - B.02.13-2 +- proper patch macro + +* Wed Aug 13 2008 Terje Rosten - B.02.13-1 +- B.02.13 +- remove patches now upstream +- add new gcc43 patch + +* Tue Apr 15 2008 Terje Rosten - B.02.12.01-5 +- rebuild + +* Tue Apr 15 2008 Terje Rosten - B.02.12.01-4 +- add patch to fix bz #442501 + +* Mon Feb 11 2008 Terje Rosten - B.02.12.01-3 +- add patch to build with gcc-4.3 + +* Sat Feb 09 2008 Terje Rosten - B.02.12.01-2 +- rebuild + +* Mon Nov 5 2007 Terje Rosten - B.02.12.01-1 +- B.02.12.01 +- Replace trademark icons + +* Tue Aug 14 2007 Terje Rosten - B.02.11.01-3 +- Move desktop and pam config to files +- Simplify build + +* Tue Aug 07 2007 Terje Rosten - B.02.11.01-2 +- Remove trademarks + +* Mon Aug 06 2007 Terje Rosten - B.02.11.01-1 +- B.02.11.01 + +* Sun Aug 05 2007 Terje Rosten - B.02.11-3 +- Move artwork to gui subpackage +- Implement consolehelper support + +* Sat Aug 04 2007 Terje Rosten - B.02.11-2 +- License is GPLv2 (only) +- Fix ui %%description + +* Wed Aug 01 2007 Terje Rosten - B.02.11-1 +- Follow upstream version scheme + +* Wed Jul 25 2007 Terje Rosten - 2.11-1 +- 2.11 + +* Wed Jun 27 2007 Terje Rosten - 2.10-2 +- minor fixes +- add patch to avoid stripping +- add desktop file +- strip changelog +- move from sbin to bin +- new url + +* Wed Feb 14 2007 Dag Wieers - 2.10-1 - 4876+/dag +- Updated to release B.02.10. + +* Tue Dec 21 2004 Dag Wieers - 2.0-1 +- Initial package. (using DAR) +