-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (42 loc) · 1.19 KB
/
Makefile
File metadata and controls
50 lines (42 loc) · 1.19 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
NAME = chelon
VERSION = 1.0.0
RELEASE = 2
.PHONY: all clean srpm rpm
all: rpm
# Create source tarball
tarball:
mkdir -p $(NAME)-$(VERSION)
cp -r server tools systemd config README.md $(NAME)-$(VERSION)/
tar czf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION)
rm -rf $(NAME)-$(VERSION)
# Create SRPM
srpm: tarball
mkdir -p ~/rpmbuild/{SOURCES,SPECS,SRPMS}
cp $(NAME)-$(VERSION).tar.gz ~/rpmbuild/SOURCES/
cp $(NAME).spec ~/rpmbuild/SPECS/
rpmbuild -bs ~/rpmbuild/SPECS/$(NAME).spec
# Build RPM
rpm: srpm
rpmbuild --rebuild ~/rpmbuild/SRPMS/$(NAME)-$(VERSION)-$(RELEASE)*.src.rpm
# Clean build artifacts
clean:
rm -f $(NAME)-$(VERSION).tar.gz
rm -rf $(NAME)-$(VERSION)
rm -rf ~/rpmbuild/BUILD/$(NAME)-$(VERSION)
rm -f ~/rpmbuild/RPMS/noarch/$(NAME)-$(VERSION)-$(RELEASE)*.rpm
rm -f ~/rpmbuild/SRPMS/$(NAME)-$(VERSION)-$(RELEASE)*.src.rpm
# Install dependencies (Fedora 43)
deps:
sudo dnf install -y \
python3 \
python3-flask \
python3-gnupg \
python3-pydantic \
gnupg2 \
rpm-build \
systemd
# Test the service locally (without RPM)
test-local:
@echo "Starting Chelon service locally on port 5050..."
@echo "Make sure GPG keys are imported first!"
cd server && python3 chelon-service.py