aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhwspeedy <ns@bigbear.dk>2024-03-04 07:30:19 +0100
committerhwspeedy <ns@bigbear.dk>2024-03-04 07:30:19 +0100
commit16b5b72b1c2e66009c25b1fd06488bee64af5fb7 (patch)
treee77fe1fd6e6636ff0d275553a5a3b909204db1f6
parent6d87ce5378d5727c2fa88669f61522f962a90a0d (diff)
PACKAGING Fedora source packaging fixed
-rw-r--r--CMakeLists.txt18
-rwxr-xr-xtools/create_fedora_source.sh31
2 files changed, 37 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c57bfba..10d75d58 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,6 +120,11 @@ if(DISTRO)
string(REGEX REPLACE "[.].*" "" DISTRO_BUILD_VER ${DISTRO})
set(CPACK_PACKAGE_VERSION "${HARDINFO2_VERSION}-${DISTRO_BUILD_VER}")
set(PACKAGE_DISTRO "${HARDINFO2_VERSION}-${DISTRO}")
+ if(${DISTRO_BUILD_VER} MATCHES "src")
+# SET(CPACK_RPM_USER_BINARY_SPECFILE "hardinfo.spec")
+ set(CPACK_PACKAGE_VERSION "${HARDINFO2_VERSION}")
+ set(PACKAGE_DISTRO "${HARDINFO2_VERSION}")
+ endif()
if(${HARDINFO2_GTK3})
else()
message(FATAL_ERROR "Distro-Building not supported with GTK2!!")
@@ -133,9 +138,9 @@ else()
set(PACKAGE_MAINTAINER "hwspeedy <hardinfo2@bigbear.dk>")
endif()
#Put it together
-string(REPLACE " " "_" CPACK_PACKAGE_FILE_NAME "hardinfo${PACKAGE_DELIMITER}${PACKAGE_DISTRO}${PACKAGE_ARCHITECTURE}")
+string(REPLACE " " "${PACKAGE_DELIMITER}" CPACK_PACKAGE_FILE_NAME "hardinfo${PACKAGE_DELIMITER}${PACKAGE_DISTRO}${PACKAGE_ARCHITECTURE}")
if(${RPM})
- string(REPLACE " " "_" CPACK_SOURCE_PACKAGE_FILE_NAME "hardinfo-${HARDINFO2_VERSION}")
+ string(REPLACE " " "-" CPACK_SOURCE_PACKAGE_FILE_NAME "hardinfo-${PACKAGE_DISTRO}")
else()
string(REPLACE " " "_" CPACK_SOURCE_PACKAGE_FILE_NAME "hardinfo-${HARDINFO2_VERSION}")
endif()
@@ -529,6 +534,7 @@ install(FILES pixmaps/hardinfo2.png
SET(CPACK_PACKAGE_NAME "hardinfo")
SET(CPACK_SOURCE_PACKAGE_NAME "hardinfo")
SET(CPACK_PACKAGE_HOMEPAGE_URL "https://www.hardinfo2.org")
+set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
if(${RPM})
SET(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;/.github/;.gitignore;.gitmodules;*.po.old;*~;*.mo;")
SET(CPACK_SOURCE_GENERATOR "RPM;TGZ")
@@ -542,11 +548,14 @@ else()
endif()
#RPM
+SET(CPACK_RPM_PACKAGE_DEBUG 1)
SET(CPACK_RPM_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
-SET(CPACK_RPM_PACKAGE_DESCRIPTION "Hardinfo2 is a small application that displays information about your hardware and operating system. It has online benchmarking to check your machine performance against other machines.")
+SET(CPACK_RPM_PACKAGE_DESCRIPTION "Hardinfo2 - System Information and Benchmark")
SET(CPACK_RPM_PACKAGE_RECOMMENDS "sysbench, udisks2, mesa-utils, lsscsi, lm-sensors, xdg-utils, iperf3")
SET(CPACK_RPM_PACKAGE_LICENSE "GPL2+")
SET(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/hardinfo2/hardinfo2")
+SET(CPACK_RPM_PACKAGE_URL "https://www.hardinfo2.org")
+SET(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-DDISTRO=1")
if(HARDINFO2_LIBSOUP3)
SET(PACKAGE_LS "libsoup (>=3.0)")
else()
@@ -561,7 +570,8 @@ SET(CPACK_RPM_PACKAGE_DEPENDS "libjson-glib-1.0-0, zlib, ${PACKAGE_LS}, ${PACKAG
#DEB
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
-SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Hardinfo2 is a small application that displays information about your hardware and operating system. It has online benchmarking to check your machine performance against other machines.")
+SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Hardinfo2 is a small application that displays information about your
+hardware and operating system. It has online benchmarking to check your machine performance against other machines.")
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "sysbench, udisks2, mesa-utils, lsscsi, lm-sensors, xdg-utils, iperf3")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/hardinfo2/hardinfo2")
if(HARDINFO2_LIBSOUP3)
diff --git a/tools/create_fedora_source.sh b/tools/create_fedora_source.sh
index 135ce9ed..3f5cba28 100755
--- a/tools/create_fedora_source.sh
+++ b/tools/create_fedora_source.sh
@@ -2,16 +2,31 @@
VERSION=2.0.12
cd ..
rm -rf build
+yum -y remove hardinfo
+rm -rf ~/rpmbuild
+
mkdir build
cd build
-cmake ..
+cmake -DDISTRO=src ..
make package_source
-cp ./_CPack_Packages/Linux-Source/RPM/SPECS/hardinfo.spec .
-mv hardinfo-$VERSION.tar.gz hardinfo-$VERSION.orig.tar.gz
-mv hardinfo-$VERSION-1.src.rpm hardinfo-$VERSION.src.rpm
-mv hardinfo.spec hardinfo-$VERSION.spec
+cp _CPackage_Packages/Linux-Source/RPM/SPECS/hardinfo.spec .
echo "Fedora Source Package Files ready in build:"
-ls -l hardinfo-$VERSION.*.tar.gz
-ls -l hardinfo-$VERSION.src.rpm
-ls -l hardinfo-$VERSION.spec
+ls -l hardinfo-$VERSION*.src.rpm
+ls -l hardinfo.spec
+
+sleep 3
+
+#checking
+fedpkg --release f39 lint
+
+#install src package
+rpm --nomd5 -i ./hardinfo-$VERSION-1.src.rpm
+
+#create package from srpm
+cd ~/rpmbuild/SPECS
+rpmbuild -ba hardinfo.spec
+
+echo "Fedora binary build from Source Package Files ready:"
+ls -l ~/rpmbuild/RPMS/*
+yum -y install ~/rpmbuild/RPMS/hardinfo-$VERSION*