From f2f2f13b1c34408d60f61d7cdfe437b4408f7d31 Mon Sep 17 00:00:00 2001 From: Echo Date: Sun, 12 Apr 2026 23:47:57 +0000 Subject: [PATCH] Fix build-rpm.sh: create source tarball from current directory with correct version --- build-rpm.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) mode change 100755 => 100644 build-rpm.sh diff --git a/build-rpm.sh b/build-rpm.sh old mode 100755 new mode 100644 index 7be989a..ca711d4 --- a/build-rpm.sh +++ b/build-rpm.sh @@ -23,12 +23,20 @@ fi # Setup RPM build directory structure mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} -# Copy source files -echo "Preparing source files..." +# Create source tarball (required by %autosetup in spec file) +echo "Creating source tarball..." +VERSION="1.0.0" +tar -czf ~/rpmbuild/SOURCES/linux-patch-api-${VERSION}.tar.gz \ + --exclude='target' \ + --exclude='.git' \ + --exclude='releases' \ + --exclude='.github' \ + --exclude='debian' \ + . + +# Copy spec file +echo "Preparing spec file..." cp linux-patch-api.spec ~/rpmbuild/SPECS/ -cp -r target/release/linux-patch-api ~/rpmbuild/SOURCES/ 2>/dev/null || cargo build --release -cp -r configs ~/rpmbuild/SOURCES/ -cp -r debian ~/rpmbuild/SOURCES/ # Build RPM echo "Building RPM package..."