aboutsummaryrefslogtreecommitdiff
path: root/tools/create_fedora_source.sh
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2024-04-22 19:04:44 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2024-04-22 19:04:44 -0300
commit92787ae0c9bb15c7841d10654ef7a2e595664d99 (patch)
tree15450b2b4454094fc8571ae4932310a229e7519d /tools/create_fedora_source.sh
parent522813da585389c158c6a84e688bc9f53daea38d (diff)
New upstream version 2.0.14preupstream/2.0.14pre
Diffstat (limited to 'tools/create_fedora_source.sh')
-rwxr-xr-xtools/create_fedora_source.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/create_fedora_source.sh b/tools/create_fedora_source.sh
new file mode 100755
index 00000000..6dc1f860
--- /dev/null
+++ b/tools/create_fedora_source.sh
@@ -0,0 +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 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
+ls -l hardinfo2.spec
+
+sleep 3
+
+#install src package
+sudo rpm --nomd5 -i ./hardinfo2-$VERSION-1.$DIST.src.rpm
+
+#create package from srpm
+cd ~/rpmbuild/SPECS
+rpmbuild -ba hardinfo2.spec
+
+echo "Fedora binary build from Source Package Files ready:"
+ls -l ~/rpmbuild/RPMS/$ARCH/*
+sudo yum -y install ~/rpmbuild/RPMS/$ARCH/hardinfo2-$VERSION*
+yum info hardinfo2