aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorhwspeedy <ns@bigbear.dk>2024-03-05 23:58:35 +0100
committerhwspeedy <ns@bigbear.dk>2024-03-05 23:58:35 +0100
commit6cd9f88975bcfbd87c114033be1b2d33dca247c0 (patch)
treee4a35a92b985d46a874077f1eae3f71b321d7d0d /tools
parent7ad2ff9d0a72c550aa9eb45ec5d57aeab22d438c (diff)
Packaging updated test of packaging reflecting packagename=hardinfo2
Diffstat (limited to 'tools')
-rwxr-xr-xtools/create_debian_source.sh45
-rwxr-xr-xtools/create_fedora_source.sh33
-rw-r--r--tools/hardinfo.spec60
-rw-r--r--tools/hardinfo2.spec112
4 files changed, 153 insertions, 97 deletions
diff --git a/tools/create_debian_source.sh b/tools/create_debian_source.sh
index e4a3085a..3c7ae780 100755
--- a/tools/create_debian_source.sh
+++ b/tools/create_debian_source.sh
@@ -3,21 +3,22 @@ VERSION=$(cat ../CMakeLists.txt |grep set\(HARDINFO2_VERSION|cut -d '"' -f 2)
cd ..
rm -rf build
sudo apt -y remove hardinfo
+sudo apt -y remove hardinfo2
mkdir build
cd build
cmake -DDISTRO=src ..
make package_source
#rename cpack file
-mv hardinfo-$VERSION.deb hardinfo-$VERSION.src.deb
+mv hardinfo2-$VERSION.deb hardinfo2-$VERSION.src.deb
#extract CPack source package
mkdir cpacksrc
-dpkg-deb -R hardinfo-$VERSION.src.deb cpacksrc
+dpkg-deb -R hardinfo2-$VERSION.src.deb cpacksrc
#extract source
-tar -xzf hardinfo-$VERSION.tar.gz
-cd hardinfo-$VERSION
+tar -xzf hardinfo2-$VERSION.tar.gz
+cd hardinfo2-$VERSION
debmake
#fixup
cd debian
@@ -32,43 +33,43 @@ mv control.fixed control
cd ..
#create debian tar.gz
-tar -czf ../hardinfo-$VERSION.debian.tar.gz debian
+tar -czf ../hardinfo2-$VERSION.debian.tar.gz debian
cd ..
#rename cpack file
-mv hardinfo-$VERSION.tar.gz hardinfo-$VERSION.orig.tar.gz
+mv hardinfo2-$VERSION.tar.gz hardinfo2-$VERSION.orig.tar.gz
#create dsc
echo "Format: 3.0 (quilt)
-Source: hardinfo
-Binary: hardinfo
+Source: hardinfo2
+Binary: hardinfo2
Architecture: any
-Version: $VERSION">./hardinfo-$VERSION.dsc
-grep Maintainer ./cpacksrc/DEBIAN/control >>./hardinfo-$VERSION.dsc
+Version: $VERSION">./hardinfo2-$VERSION.dsc
+grep Maintainer ./cpacksrc/DEBIAN/control >>./hardinfo2-$VERSION.dsc
echo "Homepage: https://hardinfo2.org
Standards-Version: 4.1.3
Vcs-Browser: https://salsa.debian.org/hwspeedy/hardinfo2
Vcs-Git: https://salsa.debian.org/hwspeedy/hardinfo2.git
Build-Depends: cmake, debhelper (>= 11)
Package-List:
- hardinfo deb x11 optional arch=any
-Checksums-Sha1:" >./hardinfo-$VERSION.dsc
-sha1sum hardinfo-$VERSION.*.tar.gz >>./hardinfo-$VERSION.dsc
+ 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
-sha256sum hardinfo-$VERSION.*.tar.gz >>./hardinfo-$VERSION.dsc
-echo "Files:">>./hardinfo-$VERSION.dsc
-md5sum hardinfo-$VERSION.*.tar.gz >>./hardinfo-$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 hardinfo-$VERSION.src.deb
-ls -l hardinfo-$VERSION.*.tar.gz
-ls -l hardinfo-$VERSION.dsc
+ls -l hardinfo2-$VERSION.src.deb
+ls -l hardinfo2-$VERSION.*.tar.gz
+ls -l hardinfo2-$VERSION.dsc
#build from source
sudo apt install debhelper
-cd hardinfo-$VERSION
+cd hardinfo2-$VERSION
debuild -b -uc -us
#test package
ls ../hardinfo_*.deb
-sudo apt -y install ../hardinfo_*.deb
-apt info hardinfo
+sudo apt -y install ../hardinfo2_*.deb
+apt info hardinfo2
diff --git a/tools/create_fedora_source.sh b/tools/create_fedora_source.sh
index 2b68e698..6dc1f860 100755
--- a/tools/create_fedora_source.sh
+++ b/tools/create_fedora_source.sh
@@ -1,36 +1,39 @@
#!/bin/bash
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
cd ..
rm -rf build
-sudo yum -y remove hardinfo
+sudo yum -y remove hardinfo2
rm -rf ~/rpmbuild
+#build source
mkdir build
cd build
cmake -DDISTRO=src ..
-cp ../tools/hardinfo.spec .
+#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 _CPack_Packages/Linux-Source/RPM/SPECS/hardinfo.spec .
+
+cp -f ../tools/hardinfo2.spec .
echo "Fedora Source Package Files ready in build:"
-ls -l hardinfo-$VERSION*.src.rpm
-ls -l hardinfo.spec
+ls -l hardinfo2-$VERSION*.src.rpm
+ls -l hardinfo2.spec
-#exit
sleep 3
-#checking
-#fedpkg --release f39 lint
-
#install src package
-sudo rpm --nomd5 -i ./hardinfo-$VERSION-1.src.rpm
-#cp -r ../tools/hardinfo.spec ~/rpmbuild/SPECS/
+sudo rpm --nomd5 -i ./hardinfo2-$VERSION-1.$DIST.src.rpm
#create package from srpm
cd ~/rpmbuild/SPECS
-rpmbuild -ba hardinfo.spec
+rpmbuild -ba hardinfo2.spec
echo "Fedora binary build from Source Package Files ready:"
-ls -l ~/rpmbuild/RPMS/*
-sudo yum -y install ~/rpmbuild/RPMS/hardinfo-$VERSION*
-yum info hardinfo
+ls -l ~/rpmbuild/RPMS/$ARCH/*
+sudo yum -y install ~/rpmbuild/RPMS/$ARCH/hardinfo2-$VERSION*
+yum info hardinfo2
diff --git a/tools/hardinfo.spec b/tools/hardinfo.spec
deleted file mode 100644
index eadcd5f6..00000000
--- a/tools/hardinfo.spec
+++ /dev/null
@@ -1,60 +0,0 @@
-# Restore old style debuginfo creation for rpm >= 4.14.
-%undefine _debugsource_packages
-%undefine _debuginfo_subpackages
-
-# -*- rpm-spec -*-
-BuildRoot: %_topdir/hardinfo-2.0.12
-Summary: hardinfo2 built using CMake
-Name: hardinfo
-Version: 2.0.12
-Release: 1
-License: GPL2+
-Group: unknown
-Vendor: Humanity
-
-Source: hardinfo-2.0.12.tar.gz
-
-
-
-
-%define debug_package %{nil}
-
-%define _rpmdir %_topdir/RPMS
-%define _srcrpmdir %_topdir/SRPMS
-%define _rpmfilename hardinfo-2.0.12.rpm
-%define _unpackaged_files_terminate_build 0
-
-
-
-
-
-%description
-Hardinfo2 - System Information and Benchmark
-
-# This is a shortcutted spec file generated by CMake RPM generator
-# we skip _install step because CPack does that for us.
-# We do only save CPack installed tree in _prepr
-# and then restore it in build.
-%prep
-%setup -c
-
-
-%build
-mkdir cpack_rpm_build_dir
-cd cpack_rpm_build_dir
-'/usr/bin/cmake' ../hardinfo-2.0.12
-make %{?_smp_mflags}
-
-#p build
-
-%install
-
-cd cpack_rpm_build_dir
-cpack -G RPM
-mv *.rpm %_rpmdir
-
-%clean
-
-%changelog
-* Sun Jul 4 2010 Eric Noulard <eric.noulard@gmail.com> - 2.0.12-1
- Generated by CPack RPM (no Changelog file were provided)
diff --git a/tools/hardinfo2.spec b/tools/hardinfo2.spec
new file mode 100644
index 00000000..8f235f64
--- /dev/null
+++ b/tools/hardinfo2.spec
@@ -0,0 +1,112 @@
+Name: hardinfo2
+Version: 2.0.12
+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
+# deps/uber-graph/g-ring.c: LGPL-2.1-or-later
+# deps/uber-graph/g-ring.h: LGPL-2.1-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
+# deps/uber-graph/uber-heat-map.h: GPL-3.0-or-later
+# deps/uber-graph/uber-label.c: GPL-3.0-or-later
+# deps/uber-graph/uber-label.h: GPL-3.0-or-later
+# deps/uber-graph/uber-line-graph.c: GPL-3.0-or-later
+# deps/uber-graph/uber-line-graph.h: GPL-3.0-or-later
+# deps/uber-graph/uber-range.c: GPL-3.0-or-later
+# deps/uber-graph/uber-range.h: GPL-3.0-or-later
+# deps/uber-graph/uber-scale.c: GPL-3.0-or-later
+# deps/uber-graph/uber-scale.h: GPL-3.0-or-later
+# deps/uber-graph/uber-scatter.c: GPL-3.0-or-later
+# deps/uber-graph/uber-scatter.h: GPL-3.0-or-later
+# 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
+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++
+BuildRequires: cmake
+BuildRequires: ninja-build
+
+BuildRequires: pkgconfig(gtk+-3.0)
+BuildRequires: pkgconfig(cairo)
+BuildRequires: pkgconfig(cairo-png)
+BuildRequires: pkgconfig(gthread-2.0)
+BuildRequires: pkgconfig(gmodule-export-2.0)
+# BuildRequires: pkgconfig(libsoup-3.0)
+BuildRequires: pkgconfig(libsoup-2.4)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(json-glib-1.0)
+BuildRequires: pkgconfig(x11)
+
+BuildRequires: desktop-file-utils
+
+Obsoletes: hardinfo
+
+Recommends: lm_sensors
+Recommends: sysbench
+Recommends: lsscsi
+Recommends: glx-utils
+Recommends: dmidecode
+Recommends: udisks2
+Recommends: xdg-utils
+Recommends: iperf3
+
+%description
+Hardinfo2 is based on hardinfo, which have not been released >10 years.
+Hardinfo2 is the reboot that was needed.
+
+Hardinfo2 offers System Information and Benchmark for Linux Systems. It is able
+to obtain information from both hardware and basic software. It can benchmark
+your system and compare to other machines online.
+
+Features include:
+- Report generation (in either HTML or plain text)
+- Online Benchmarking - compare your machine against other machines
+
+%prep
+%autosetup -p1 -n hardinfo2-release-%{version}
+
+%build
+%cmake \
+ -GNinja \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+
+%cmake_build
+
+%install
+%cmake_install
+
+%find_lang %{name}
+
+%check
+desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
+
+%files -f %{name}.lang
+%license
+%doc README.md
+%{_bindir}/hardinfo2
+%dir %{_libdir}/hardinfo2
+%dir %{_libdir}/hardinfo2/modules
+%{_libdir}/hardinfo2/modules/benchmark.so
+%{_libdir}/hardinfo2/modules/computer.so
+%{_libdir}/hardinfo2/modules/devices.so
+%{_libdir}/hardinfo2/modules/network.so
+%{_datadir}/applications/hardinfo2.desktop
+%{_datadir}/hardinfo2/*.ids
+%{_datadir}/hardinfo2/benchmark.data
+%{_datadir}/hardinfo2/*.json
+%{_datadir}/hardinfo2/pixmaps/
+%{_datadir}/icons/hicolor/256x256/apps/hardinfo2.png
+%{_mandir}/man1/hardinfo2.1*
+
+%changelog
+%autochangelog