diff options
author | hwspeedy <ns@bigbear.dk> | 2024-03-12 16:55:38 +0100 |
---|---|---|
committer | hwspeedy <ns@bigbear.dk> | 2024-03-12 16:55:38 +0100 |
commit | f9ef43c08eb00c341a6224d13370aa2b96d3dd5d (patch) | |
tree | f1ded2d37efb2237d868161f8caa093f5de29242 /tools | |
parent | 0b4d13200106e9d8ef50e8c4d36f4d1bb256a0d6 (diff) |
FIX Updated package test scripts
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/create_debian_source.sh | 29 | ||||
-rwxr-xr-x | tools/create_fedora_source.sh | 31 | ||||
-rw-r--r-- | tools/hardinfo2.spec | 65 |
3 files changed, 86 insertions, 39 deletions
diff --git a/tools/create_debian_source.sh b/tools/create_debian_source.sh index bf840e13..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 @@ -11,22 +17,26 @@ cmake .. make package_source #rename cpack files mv hardinfo2_$VERSION*.deb hardinfo2-$VERSION.src.deb -mv hardinfo2_$VERSION*.tar.gz hardinfo2-$VERSION.tar.gz +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 -#FIXME ubuntu... -mv hardinfo2_$VERSION-Ubuntu-22.04_amd64 hardinfo2-$VERSION 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|#rep -v debmake |grep -v Maintainer >>control.fixed +grep -v Homepage control |grep -v Description|grep -v auto-gen|grep -v Section|grep -v debmake |grep -v Maintainer >>control.fixed echo "Homepage: https://hardinfo2.org">>control.fixed echo "Description: Hardinfo2 - System Information and Benchmark" >>control.fixed grep Recommends ../../cpacksrc/DEBIAN/control >>control.fixed @@ -38,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 @@ -57,13 +67,12 @@ 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.dsc @@ -73,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/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 + |