aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rwxr-xr-xtools/create_debian_source.sh46
-rwxr-xr-xtools/create_fedora_source.sh2
3 files changed, 43 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 10d75d58..c0eaa76e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -534,8 +534,8 @@ 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_PACKAGING_INSTALL_PREFIX "/usr")
SET(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;/.github/;.gitignore;.gitmodules;*.po.old;*~;*.mo;")
SET(CPACK_SOURCE_GENERATOR "RPM;TGZ")
SET(CPACK_GENERATOR "RPM")
@@ -570,8 +570,7 @@ 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 - System Information and Benchmark")
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_debian_source.sh b/tools/create_debian_source.sh
index ca199a3a..6171a438 100755
--- a/tools/create_debian_source.sh
+++ b/tools/create_debian_source.sh
@@ -1,26 +1,50 @@
#!/bin/bash
-VERSION=2.0.12
+VERSION=$(cat ../CMakeLists.txt |grep set\(HARDINFO2_VERSION|cut -d '"' -f 2)
cd ..
rm -rf build
+sudo apt -y remove hardinfo
+
mkdir build
cd build
-cmake ..
+cmake -DDISTRO=src ..
make package_source
+#rename cpack file
+mv hardinfo-$VERSION.deb hardinfo-$VERSION.src.deb
+
+#extract CPack source package
+mkdir cpacksrc
+dpkg-deb -R hardinfo-$VERSION.src.deb cpacksrc
+
+#extract source
tar -xzf hardinfo-$VERSION.tar.gz
cd hardinfo-$VERSION
debmake
+#fixup
+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
+echo "Homepage: https://hardinfo2.org">>control.fixed
+echo "Description: Hardinfo2 - System Information and Benchmark" >>control.fixed
+grep Recommends ../../cpacksrc/DEBIAN/control >>control.fixed
+grep Section ../../cpacksrc/DEBIAN/control >>control.fixed
+rm -f control
+mv control.fixed control
+cd ..
+
+#create debian tar.gz
tar -czf ../hardinfo-$VERSION.debian.tar.gz debian
cd ..
+#rename cpack file
mv hardinfo-$VERSION.tar.gz hardinfo-$VERSION.orig.tar.gz
-mv hardinfo-$VERSION.deb hardinfo-$VERSION.src.deb
+#create dsc
echo "Format: 3.0 (quilt)
Source: hardinfo
Binary: hardinfo
Architecture: any
-Version: $VERSION
-Maintainer: hwspeedy <hardinfo2@bigbear.dk>
-Homepage: https://hardinfo2.org
+Version: $VERSION">./hardinfo-$VERSION.dsc
+grep Maintainer ./cpacksrc/DEBIAN/control >>./hardinfo-$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
@@ -38,3 +62,13 @@ 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
+
+#build from source
+sudo apt install debhelper
+cd hardinfo-$VERSION
+debuild -b -uc -us
+
+#test package
+ls ../hardinfo_*.deb
+sudo apt -y install ../hardinfo_*.deb
+apt info hardinfo
diff --git a/tools/create_fedora_source.sh b/tools/create_fedora_source.sh
index 3f5cba28..e6f851f5 100755
--- a/tools/create_fedora_source.sh
+++ b/tools/create_fedora_source.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-VERSION=2.0.12
+VERSION=$(cat ../CMakeLists.txt |grep set\(HARDINFO2_VERSION|cut -d '"' -f 2)
cd ..
rm -rf build
yum -y remove hardinfo