summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check_license.sh48
-rwxr-xr-xtools/create_debian_source.sh32
-rwxr-xr-xtools/create_fedora_source.sh31
-rwxr-xr-xtools/git_latest_release.sh4
-rwxr-xr-xtools/git_unstable_master.sh4
-rw-r--r--tools/hardinfo2.spec65
6 files changed, 145 insertions, 39 deletions
diff --git a/tools/check_license.sh b/tools/check_license.sh
new file mode 100755
index 00000000..794fd7bb
--- /dev/null
+++ b/tools/check_license.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+cd ..
+rm -rf build
+mkdir build
+cd build
+
+licensecheck -r .. | grep '\.c: \|\.h: ' >licenses_all.txt
+
+echo "LGPL2.0+ & GPL2+:"
+cat licenses_all.txt| grep 'hardinfo2/util.c'
+echo ""
+
+echo "LGPL2.0+:"
+cat licenses_all.txt| grep 'hardinfo2/gg_strescape.c\|deps/uber-graph/uber-frame-source.\|deps/update-graph/uber-timeout-interval'
+echo ""
+
+echo "GPL2.0+:"
+cat licenses_all.txt| grep -v 'hardinfo2/gg_strescape.c\|hardinfo2/util.c\|deps/uber-graph/uber-frame-source.\|deps/update-graph/uber-timeout-interval' | grep 'General Public License v2.0 or later\|GNU Library General Public License v2 or later'
+echo ""
+
+echo "LGPL2.1+:"
+cat licenses_all.txt| grep 'GNU Lesser General Public License v2.1 or later'
+echo ""
+
+echo "LGPL2.1:"
+cat licenses_all.txt| grep -v 'GNU Lesser General Public License v2.1 or later' | grep 'GNU Lesser General Public License, Version 2.1'
+echo ""
+
+echo "GPL3.0+:"
+cat licenses_all.txt| grep 'General Public License v3.0 or later'
+echo ""
+
+echo "No copyright:"
+cat licenses_all.txt| grep '*No copyright*'
+echo ""
+
+#remaining licenses
+echo "Others:"
+cat licenses_all.txt| grep 'Lesser General Public License v2.0 or later' \
+ | grep -v 'hardinfo2/gg_strescape.c\|hardinfo2/util.c\|deps/uber-graph/uber-frame-source.\|deps/update-graph/uber-timeout-interval' \
+ | grep -v 'General Public License v2.0 or later\|GNU Library General Public License v2 or later' \
+ | grep -v 'GNU Lesser General Public License v2.1 or later' \
+ | grep -v 'GNU Lesser General Public License, Version 2.1' \
+ | grep -v 'General Public License v3.0 or later' \
+ | grep -v '*No copyright*'
+
+echo ""
diff --git a/tools/create_debian_source.sh b/tools/create_debian_source.sh
index 3c7ae780..c6bbf7ce 100755
--- a/tools/create_debian_source.sh
+++ b/tools/create_debian_source.sh
@@ -1,5 +1,11 @@
#!/bin/bash
+#tool script used by project maintainer to test debian releases
+# WIP - needs maintainer to create .dsc and debian directory - current takes from CPack
+
VERSION=$(cat ../CMakeLists.txt |grep set\(HARDINFO2_VERSION|cut -d '"' -f 2)
+ARCH=$(uname -m)
+if [ $ARCH=="x86_64" ]; then ARCH=amd64; fi
+
cd ..
rm -rf build
sudo apt -y remove hardinfo
@@ -7,20 +13,27 @@ sudo apt -y remove hardinfo2
mkdir build
cd build
-cmake -DDISTRO=src ..
+cmake ..
make package_source
-#rename cpack file
-mv hardinfo2-$VERSION.deb hardinfo2-$VERSION.src.deb
+#rename cpack files
+mv hardinfo2_$VERSION*.deb hardinfo2-$VERSION.src.deb
+rm hardinfo2_$VERSION*.tar.gz
#extract CPack source package
mkdir cpacksrc
dpkg-deb -R hardinfo2-$VERSION.src.deb cpacksrc
+#create source package (NOTE: We use github tags as release-$VERSION)
+cd ../..
+tar -czf hardinfo2-$VERSION.tar.gz hardinfo2 --transform s/hardinfo2/hardinfo2-$VERSION/
+mv hardinfo2-$VERSION.tar.gz hardinfo2/build/
+cd hardinfo2/build
+
#extract source
tar -xzf hardinfo2-$VERSION.tar.gz
cd hardinfo2-$VERSION
debmake
-#fixup
+#fixup source from cpack - FIXME
cd debian
grep Maintainer ../../cpacksrc/DEBIAN/control >control.fixed
grep -v Homepage control |grep -v Description|grep -v auto-gen|grep -v Section|grep -v debmake |grep -v Maintainer >>control.fixed
@@ -35,7 +48,7 @@ cd ..
#create debian tar.gz
tar -czf ../hardinfo2-$VERSION.debian.tar.gz debian
cd ..
-#rename cpack file
+#rename source file
mv hardinfo2-$VERSION.tar.gz hardinfo2-$VERSION.orig.tar.gz
#create dsc
@@ -54,14 +67,13 @@ Package-List:
hardinfo2 deb x11 optional arch=any
Checksums-Sha1:" >./hardinfo2-$VERSION.dsc
sha1sum hardinfo2-$VERSION.*.tar.gz >>./hardinfo2-$VERSION.dsc
-echo "Checksums-Sha256:">>./hardinfo-$VERSION.dsc
+echo "Checksums-Sha256:">>./hardinfo2-$VERSION.dsc
sha256sum hardinfo2-$VERSION.*.tar.gz >>./hardinfo2-$VERSION.dsc
echo "Files:">>./hardinfo2-$VERSION.dsc
md5sum hardinfo2-$VERSION.*.tar.gz >>./hardinfo2-$VERSION.dsc
echo "Debian Source Package Files ready in build:"
-ls -l hardinfo2-$VERSION.src.deb
-ls -l hardinfo2-$VERSION.*.tar.gz
+ls -l hardinfo2-$VERSION*.tar.gz
ls -l hardinfo2-$VERSION.dsc
#build from source
@@ -70,6 +82,6 @@ cd hardinfo2-$VERSION
debuild -b -uc -us
#test package
-ls ../hardinfo_*.deb
-sudo apt -y install ../hardinfo2_*.deb
+ls ../hardinfo2_*.deb
+sudo apt -y install ../hardinfo2_$VERSION-1_$ARCH.deb
apt info hardinfo2
diff --git a/tools/create_fedora_source.sh b/tools/create_fedora_source.sh
index 6dc1f860..eff6b190 100755
--- a/tools/create_fedora_source.sh
+++ b/tools/create_fedora_source.sh
@@ -1,7 +1,8 @@
#!/bin/bash
+#tool script used by project maintainer to test fedora/redhat releases
+
VERSION=$(cat ../CMakeLists.txt |grep set\(HARDINFO2_VERSION|cut -d '"' -f 2)
ARCH=$(uname -m)
-DIST=$(uname -r|cut -d '.' -f 4)
#clean and prep
yum -y install ninja-build
@@ -9,25 +10,29 @@ cd ..
rm -rf build
sudo yum -y remove hardinfo2
rm -rf ~/rpmbuild
-
-#build source
mkdir build
-cd build
-cmake -DDISTRO=src ..
-#fix for local build
-cat ../tools/hardinfo2.spec |grep -v Patch|sed '/URL:/c\URL: ./'|sed '/Source0:/c\Source0: hardinfo2-%{version}.tar.gz' |sed 's/hardinfo2-release/hardinfo2/g' >./hardinfo2.spec
-make package_source
-cp -f ../tools/hardinfo2.spec .
-
-echo "Fedora Source Package Files ready in build:"
-ls -l hardinfo2-$VERSION*.src.rpm
+#create source package
+cd ..
+tar -czf hardinfo2-release-$VERSION.tar.gz hardinfo2 --transform s/hardinfo2/hardinfo2-release-$VERSION/
+mv hardinfo2-release-$VERSION.tar.gz hardinfo2/build/
+cd hardinfo2/build
+wget https://src.fedoraproject.org/rpms/hardinfo2/raw/rawhide/f/hardinfo2.spec
+cp hardinfo2.spec ../tools/
+cat hardinfo2.spec |grep -v Patch|sed '/URL:/c\URL: ./'|sed '/Source0:/c\Source0: hardinfo2-release-%{version}.tar.gz' |sed '/Version:/c\Version: '"$VERSION"'' >./hardinfo2.spec
+
+echo "Fedora/redhat Source Package Files ready in build:"
+ls -l hardinfo2-release-$VERSION*.tar.gz
ls -l hardinfo2.spec
sleep 3
#install src package
-sudo rpm --nomd5 -i ./hardinfo2-$VERSION-1.$DIST.src.rpm
+mkdir ~/rpmbuild
+mkdir ~/rpmbuild/SPECS
+mkdir ~/rpmbuild/SOURCES
+cp hardinfo2.spec ~/rpmbuild/SPECS/
+cp hardinfo2-release-$VERSION.tar.gz ~/rpmbuild/SOURCES/
#create package from srpm
cd ~/rpmbuild/SPECS
diff --git a/tools/git_latest_release.sh b/tools/git_latest_release.sh
new file mode 100755
index 00000000..c2a265dd
--- /dev/null
+++ b/tools/git_latest_release.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+echo "Changing to latest git release..."
+git pull
+git checkout $(curl -s https://hardinfo2.org/github/?latest_git_release)
diff --git a/tools/git_unstable_master.sh b/tools/git_unstable_master.sh
new file mode 100755
index 00000000..66642a2d
--- /dev/null
+++ b/tools/git_unstable_master.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+echo "Changing to unstable master..."
+git checkout master
+git pull
diff --git a/tools/hardinfo2.spec b/tools/hardinfo2.spec
index 8f235f64..3aaa440d 100644
--- a/tools/hardinfo2.spec
+++ b/tools/hardinfo2.spec
@@ -1,13 +1,28 @@
+%if 0%{?rhel} <= 8
+%undefine __cmake_in_source_build
+%undefine __cmake3_in_source_build
+%endif
+
Name: hardinfo2
-Version: 2.0.12
+Version: 2.0.15
Release: %autorelease
Summary: System Information and Benchmark for Linux Systems
# most of the source code is GPL-2.0-or-later license, except:
-# includes/blowfish.h - LGPL-2.1-or-later
-# includes/loadgraph.h - LGPL-2.0-only
+
+# hardinfo2/gg_key_file_parse_string_as_value.c: LGPL-2.1-or-later
+# includes/blowfish.h: LGPL-2.1-or-later
# deps/uber-graph/g-ring.c: LGPL-2.1-or-later
# deps/uber-graph/g-ring.h: LGPL-2.1-or-later
+# modules/benchmark/blowfish.c: LGPL-2.1-or-later
+
+# hardinfo2/gg_strescape.c: LGPL-2.0-or-later
+# hardinfo2/util.c: GPL-2.0-or-later AND LGPL-2.0-or-later
+# deps/uber-graph/uber-frame-source.c: LGPL-2.0-or-later
+# deps/uber-graph/uber-frame-source.h: LGPL-2.0-or-later
+# deps/uber-graph/uber-timeout-interval.c: LGPL-2.0-or-later
+# deps/uber-graph/uber-timeout-interval.h: LGPL-2.0-or-later
+
# deps/uber-graph/uber-graph.c: GPL-3.0-or-later
# deps/uber-graph/uber-graph.h: GPL-3.0-or-later
# deps/uber-graph/uber-heat-map.c: GPL-3.0-or-later
@@ -25,16 +40,20 @@ Summary: System Information and Benchmark for Linux Systems
# deps/uber-graph/uber-window.c: GPL-3.0-or-later
# deps/uber-graph/uber-window.h: GPL-3.0-or-later
# deps/uber-graph/uber.h: GPL-3.0-or-later
-# modules/benchmark/blowfish.c - LGPL-2.1-or-later
-License: GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-only AND GPL-3.0-or-later
+
+# includes/loadgraph.h: LGPL-2.1-only
+# shell/loadgraph.c: LGPL-2.1-only
+
+License: GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-only
URL: https://github.com/hardinfo2/hardinfo2
Source0: %{url}/archive/release-%{version}/hardinfo2-release-%{version}.tar.gz
-Patch0: https://github.com/hardinfo2/hardinfo2/pull/14.patch
-
BuildRequires: gcc-c++
+%if 0%{?rhel} < 8
+BuildRequires: cmake3
+%else
BuildRequires: cmake
-BuildRequires: ninja-build
+%endif
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(cairo)
@@ -46,11 +65,11 @@ BuildRequires: pkgconfig(libsoup-2.4)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(x11)
+BuildRequires: zlib-devel
BuildRequires: desktop-file-utils
-Obsoletes: hardinfo
-
+%if 0%{?rhel} >= 8 || 0%{?fedora}
Recommends: lm_sensors
Recommends: sysbench
Recommends: lsscsi
@@ -59,6 +78,7 @@ Recommends: dmidecode
Recommends: udisks2
Recommends: xdg-utils
Recommends: iperf3
+%endif
%description
Hardinfo2 is based on hardinfo, which have not been released >10 years.
@@ -76,22 +96,28 @@ Features include:
%autosetup -p1 -n hardinfo2-release-%{version}
%build
-%cmake \
- -GNinja \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-
+%if 0%{?rhel} < 8
+%cmake3 -DCMAKE_BUILD_TYPE=Release
+%cmake3_build
+%else
+%cmake -DCMAKE_BUILD_TYPE=Release
%cmake_build
+%endif
%install
+%if 0%{?rhel} < 8
+%cmake3_install
+%else
%cmake_install
+%endif
%find_lang %{name}
%check
-desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
+desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%files -f %{name}.lang
-%license
+%license LICENSE
%doc README.md
%{_bindir}/hardinfo2
%dir %{_libdir}/hardinfo2
@@ -101,6 +127,7 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
%{_libdir}/hardinfo2/modules/devices.so
%{_libdir}/hardinfo2/modules/network.so
%{_datadir}/applications/hardinfo2.desktop
+%dir %{_datadir}/hardinfo2
%{_datadir}/hardinfo2/*.ids
%{_datadir}/hardinfo2/benchmark.data
%{_datadir}/hardinfo2/*.json
@@ -109,4 +136,10 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
%{_mandir}/man1/hardinfo2.1*
%changelog
+%if %{defined autochangelog}
%autochangelog
+%else
+* Mon May 01 2023 RH Container Bot <rhcontainerbot@fedoraproject.org>
+- Placeholder changelog for envs that are not autochangelog-ready
+%endif
+