generated from unkin/rpmbuild-template
- version 1.0.2 - setup gitea actions workflows
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Makefile for building and packaging ProxLB as an RPM
|
||||
|
||||
VERSION=1.0.2
|
||||
REPO_URL=https://github.com/gyptazy/ProxLB.git
|
||||
BUILD_DIR=/workspace/build
|
||||
PACKAGE_DIR=workspace/packages
|
||||
REPO_DIR=/workspace/ProxLB
|
||||
|
||||
.PHONY: all clean download prepare build package
|
||||
|
||||
# Default target
|
||||
all: download prepare build package
|
||||
|
||||
# Clone the repository if not already cloned
|
||||
download:
|
||||
@if [ ! -d "$(REPO_DIR)" ]; then \
|
||||
echo "Cloning repository..."; \
|
||||
git clone $(REPO_URL) $(REPO_DIR); \
|
||||
fi
|
||||
|
||||
# Prepare directories
|
||||
prepare: download
|
||||
mkdir -p $(PACKAGE_DIR)
|
||||
mkdir -p $(BUILD_DIR)
|
||||
cd $(REPO_DIR) && git checkout v$(VERSION)
|
||||
|
||||
# Build the project
|
||||
build: prepare
|
||||
cd $(BUILD_DIR) && cmake $(REPO_DIR)/packaging
|
||||
|
||||
# Package the project
|
||||
package: build
|
||||
cd $(BUILD_DIR) && cpack -G RPM .
|
||||
cp $(BUILD_DIR)/*.rpm $(PACKAGE_DIR)
|
||||
|
||||
# Clean up build and package directories
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) $(PACKAGE_DIR)
|
||||
rm -rf $(REPO_DIR)
|
||||
Reference in New Issue
Block a user