-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (70 loc) · 2.47 KB
/
Makefile
File metadata and controls
81 lines (70 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Makefile for COPR builds
# This downloads the binaries from the releases directory
# Extract version from spec file if not provided
VERSION ?= $(shell grep "^%define version" rhtlc.spec | awk '{print $$3}')
OUTDIR ?= $(CURDIR)
.PHONY: srpm
srpm:
@echo "========================================="
@echo "Building RHTLC SRPM"
@echo "Version: $(VERSION)"
@echo "Output directory: $(OUTDIR)"
@echo "========================================="
@echo ""
# Download binaries from releases directory
@echo "Downloading CLI binary..."
curl -f -L -o rhtlc-linux-x86_64 \
https://github.com/RedHatTraining/rhtlc-copr/raw/main/releases/$(VERSION)/rhtlc-linux-x86_64
@echo "Downloading GUI binary..."
curl -f -L -o rhtlc-gui-linux-x86_64 \
https://github.com/RedHatTraining/rhtlc-copr/raw/main/releases/$(VERSION)/rhtlc-gui-linux-x86_64
# Verify downloads
@test -f rhtlc-linux-x86_64 || (echo "ERROR: CLI binary not found"; exit 1)
@test -f rhtlc-gui-linux-x86_64 || (echo "ERROR: GUI binary not found"; exit 1)
@echo ""
@echo "Downloaded files:"
@ls -lh rhtlc-linux-x86_64 rhtlc-gui-linux-x86_64
@echo ""
# Build SRPM
@echo "Building SRPM with rpmbuild..."
rpmbuild -bs \
--define "_sourcedir $(CURDIR)" \
--define "_srcrpmdir $(OUTDIR)" \
rhtlc.spec
@echo ""
@echo "========================================="
@echo "SRPM build completed!"
@echo "========================================="
@ls -lh $(OUTDIR)/*.src.rpm
.PHONY: sources
sources:
@echo "Downloading sources..."
@echo "Version: $(VERSION)"
curl -f -L -o rhtlc-linux-x86_64 \
https://github.com/RedHatTraining/rhtlc-copr/raw/main/releases/$(VERSION)/rhtlc-linux-x86_64
curl -f -L -o rhtlc-gui-linux-x86_64 \
https://github.com/RedHatTraining/rhtlc-copr/raw/main/releases/$(VERSION)/rhtlc-gui-linux-x86_64
@echo "Sources downloaded"
.PHONY: clean
clean:
rm -f rhtlc-linux-x86_64
rm -f rhtlc-gui-linux-x86_64
rm -f *.src.rpm
.PHONY: help
help:
@echo "RHTLC RPM Build Makefile"
@echo ""
@echo "Targets:"
@echo " srpm - Build source RPM (default for COPR)"
@echo " sources - Download binaries from releases directory"
@echo " clean - Remove downloaded files and built SRPMs"
@echo " help - Show this help message"
@echo ""
@echo "Variables:"
@echo " VERSION - Version to build (auto-detected from spec file)"
@echo " OUTDIR - Output directory (default: current directory)"
@echo ""
@echo "Examples:"
@echo " make srpm"
@echo " make srpm VERSION=3.4.3"
@echo " make srpm OUTDIR=/tmp"