-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
55 lines (47 loc) · 1.11 KB
/
Makefile
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
UBLUE_ROOT := $(UBLUE_ROOT)
TARGET := ublue-update
SOURCE_DIR := $(UBLUE_ROOT)/$(TARGET)
RPMBUILD := $(UBLUE_ROOT)/rpmbuild
ifeq ($(GITHUB_REF),)
export GITHUB_REF := refs/tags/v1.0.0+$(shell git rev-parse --short HEAD)
endif
all: build
build:
flake8 src
black --check src
python3 -m build
spec: output
rpkg spec --outdir $(PWD)/output
build-rpm:
rpkg local --outdir $(PWD)/output
output:
mkdir -p output
# Phony targets - utilities and helpers
.PHONY: format
format:
black src
.PHONY: dnf-install
dnf-install:
dnf install -y output/noarch/*.rpm
.PHONY: builder-image
builder-image:
podman build -t $(TARGET):builder -f Containerfile.builder .
.PHONY: builder-exec
builder-exec:
podman run --rm -it \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
-e DISPLAY \
-e DBUS_SESSION_BUS_ADDRESS \
-e XDG_RUNTIME_DIR \
--ipc host \
-v "/tmp/.X11-unix:/tmp/.X11-unix" \
-v /var/run/dbus:/var/run/dbus \
-v /run/user/1000/bus:/run/user/1000/bus \
-v /run/dbus:/run/dbus \
-v "${XDG_RUNTIME_DIR}:${XDG_RUNTIME_DIR}" \
--security-opt label=disable \
$(TARGET):builder
.PHONY: clean
clean:
rm -rf $(UBLUE_ROOT)