Fix build-rpm.sh: create source tarball from current directory with correct version
This commit is contained in:
18
build-rpm.sh
Executable file → Normal file
18
build-rpm.sh
Executable file → Normal file
@ -23,12 +23,20 @@ fi
|
|||||||
# Setup RPM build directory structure
|
# Setup RPM build directory structure
|
||||||
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
|
||||||
# Copy source files
|
# Create source tarball (required by %autosetup in spec file)
|
||||||
echo "Preparing source files..."
|
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 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
|
# Build RPM
|
||||||
echo "Building RPM package..."
|
echo "Building RPM package..."
|
||||||
|
|||||||
Reference in New Issue
Block a user