summaryrefslogtreecommitdiff
path: root/tools/create_debian_source.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/create_debian_source.sh')
-rwxr-xr-xtools/create_debian_source.sh77
1 files changed, 57 insertions, 20 deletions
diff --git a/tools/create_debian_source.sh b/tools/create_debian_source.sh
index a267d1f9..3c7ae780 100755
--- a/tools/create_debian_source.sh
+++ b/tools/create_debian_source.sh
@@ -1,38 +1,75 @@
#!/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
+sudo apt -y remove hardinfo2
+
mkdir build
cd build
-cmake ..
+cmake -DDISTRO=src ..
make package_source
-tar -xzf hardinfo-$VERSION.tar.gz
-cd hardinfo-$VERSION
+#rename cpack file
+mv hardinfo2-$VERSION.deb hardinfo2-$VERSION.src.deb
+
+#extract CPack source package
+mkdir cpacksrc
+dpkg-deb -R hardinfo2-$VERSION.src.deb cpacksrc
+
+#extract source
+tar -xzf hardinfo2-$VERSION.tar.gz
+cd hardinfo2-$VERSION
debmake
-tar -czf ../hardinfo-$VERSION.debian.tar.gz debian
+#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 ..
-mv hardinfo-$VERSION.tar.gz hardinfo-$VERSION.orig.tar.gz
+#create debian tar.gz
+tar -czf ../hardinfo2-$VERSION.debian.tar.gz debian
+cd ..
+#rename cpack file
+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
-Maintainer: hwspeedy <hardinfo2@bigbear.dk>
-Homepage: https://hardinfo2.org
+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), libjson-glib-dev, zlib1g-dev, libsoup2.4-dev, libgtk-3-dev
+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.*.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 hardinfo2-$VERSION
+debuild -b -uc -us
+
+#test package
+ls ../hardinfo_*.deb
+sudo apt -y install ../hardinfo2_*.deb
+apt info hardinfo2