-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
34 lines (30 loc) · 937 Bytes
/
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
RPM_OUTPUT_DIR ?=build
RPM_TOPDIR ?=$(abspath ./)
RPM_BUILDDIR ?=$(RPM_TOPDIR)
RPM_BUILDROOT ?=$(RPM_TOPDIR)
RPM_SOURCEDIR ?=$(RPM_TOPDIR)
RPM_SPECDIR ?=$(RPM_TOPDIR)
RPM_RPMDIR ?=$(RPM_TOPDIR)/$(RPM_OUTPUT_DIR)/rpms
RPM_SRCRPMDIR ?=$(RPM_TOPDIR)/$(RPM_OUTPUT_DIR)/srpms
RPM_SPECFILES ?=$(wildcard *.spec)
RPM_BUILDFLAGS ?=-ba
RPM_EXTRAFLAGS ?=
rpm-build:
$(strip \
rpmbuild $(RPM_BUILDFLAGS) \
--define "_topdir $(RPM_TOPDIR)" \
--define "_builddir $(RPM_BUILDDIR)" \
--define "_buildrootdir $(RPM_BUILDROOT)" \
--define "_rpmdir $(RPM_RPMDIR)" \
--define "_srcrpmdir $(RPM_SRCRPMDIR)" \
--define "_specdir $(RPM_SPECDIR)" \
--define "_sourcedir $(RPM_SOURCEDIR)" \
$(RPM_EXTRAFLAGS) \
$(RPM_SPECFILES) \
)
clean-rpms:
$(RM) -r '$(RPM_RPMDIR)' '$(RPM_SRCRPMDIR)'
if [ -d '$(RPM_OUTPUT_DIR)' ]; then rmdir --ignore-fail-on-non-empty '$(RPM_OUTPUT_DIR)'; fi
.PHONY: clean-rpms
clean: clean-rpms
rpm: rpm-build