From 1a9b46180fa1e796f2ed0bf965141490900ec77e Mon Sep 17 00:00:00 2001 From: "jakob.stendahl" Date: Mon, 17 Jun 2024 09:08:15 +0200 Subject: Don't use the tg alias by default, add fedora build script --- packaging/package-fedora.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 packaging/package-fedora.sh (limited to 'packaging/package-fedora.sh') diff --git a/packaging/package-fedora.sh b/packaging/package-fedora.sh new file mode 100755 index 0000000..d91c018 --- /dev/null +++ b/packaging/package-fedora.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -x + +DIST=fc40 +ARCH=x86_64 +RPMBUILD=rpmbuild +BUILDROOT=${HOME}/rpmbuild/ +SPECFILE=packaging/FEDORA/textgraph.spec +SOURCEDIR=$(pwd) +VERSION=$(awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2) }' Cargo.toml) +BUILDROOT_SPECFILE="${BUILDROOT}/SPECS/textgraph.spec" + +rpmdev-setuptree + +echo "Making tarball" +tarwd=$(dirname "${SOURCEDIR}") +tarfile=$(basename "${SOURCEDIR}") +tar -czf "textgraph-${VERSION}.tar.gz" -C "${tarwd}" --transform "s|${tarfile}|textgraph-${VERSION}|" ${tarfile} +cp "textgraph-${VERSION}.tar.gz" "${BUILDROOT}/SOURCES/textgraph-${VERSION}.tar.gz" + +echo "Copy specfile" +cp "${SPECFILE}" "${BUILDROOT_SPECFILE}" + + +echo "Install dependencies" +sudo dnf builddep "${BUILDROOT_SPECFILE}" + +echo "Running spmbuild" +rpmbuild -ba "${BUILDROOT_SPECFILE}" \ + --define "package_version ${VERSION}" \ + --define "package_release 1.${DIST}" + + -- cgit v1.2.3