Use parallel make to build packages

Parallelize build of dependencies SRPMs and all
binary RPMs.

Implements: blueprint parallel-build
Change-Id: Ieed5aa199e325524390327b823ce3fef0b801f4a
This commit is contained in:
Alessio Ababilov
2013-06-24 16:23:08 +04:00
parent 963eb3f2e7
commit 7cba1cd48d
7 changed files with 136 additions and 57 deletions

View File

@@ -0,0 +1,33 @@
SRC_REPO_DIR := $SRC_REPO_DIR
LOGS_DIR := $LOGS_DIR
RPMBUILD := rpmbuild
RPMBUILD_FLAGS := $RPMBUILD_FLAGS
#raw
YUM_BUILDDEP := yum-builddep
YUM_BUILDDEP_FLAGS := -q -y
REPO_NAME := $(shell basename $(SRC_REPO_DIR))
BUILDDEP_MARK := builddep-$(REPO_NAME).mark
MARKS := $(foreach archive,$(shell (cd $(SRC_REPO_DIR) && echo *src.rpm)),$(archive).mark)
all: $(MARKS)
# NOTE(aababilov): yum-builddep is buggy and can fail when several
# package names are given, so, pass them one by one
$(BUILDDEP_MARK):
@echo "Installing build requirements for $(REPO_NAME)"
@for pkg in $(SRC_REPO_DIR)/*; do \
$(YUM_BUILDDEP) $(YUM_BUILDDEP_FLAGS) $$pkg; \
done &> $(LOGS_DIR)/yum-builddep-$(REPO_NAME).log
@touch "$@"
@echo "Build requirements are installed"
%.mark: $(SRC_REPO_DIR)/% $(BUILDDEP_MARK)
@$(RPMBUILD) $(RPMBUILD_FLAGS) -- $< &> $(LOGS_DIR)/rpmbuild-$*.log
@touch "$@"
@echo "$* is processed"
#end raw

View File

@@ -0,0 +1,17 @@
DOWNLOADS_DIR := $DOWNLOADS_DIR
LOGS_DIR := $LOGS_DIR
PY2RPM := $PY2RPM
PY2RPM_FLAGS := $PY2RPM_FLAGS
#raw
MARKS := $(foreach archive,$(shell ls $(DOWNLOADS_DIR)),$(archive).mark)
all: $(MARKS)
%.mark: $(DOWNLOADS_DIR)/%
@$(PY2RPM) $(PY2RPM_FLAGS) -- $^ &> $(LOGS_DIR)/py2rpm-$*.log
@touch "$@"
@echo "$* is processed"
#end raw