|
|
|
@@ -12,9 +12,9 @@ SHELL = /bin/bash
|
|
|
|
|
SPECFILE = $(addsuffix .spec, $(PKG_NAME))
|
|
|
|
|
|
|
|
|
|
SRPMVERS = $(shell [ ! -f $(SPECFILE) ] || rpmspec -D '_vendor clr' --srpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}\n' $(SPECFILE))
|
|
|
|
|
SRPMFILE = results/$(SRPMVERS).src.rpm
|
|
|
|
|
SRPMFILE = results/srpm/$(SRPMVERS).src.rpm
|
|
|
|
|
|
|
|
|
|
LATEST_RPMS = $(shell [ ! -s results/build.log ] || for r in `egrep 'Wrote.*/RPMS/.*.rpm' results/build.log | sed 's/.*\///'` ; do echo "results/$$r"; done)
|
|
|
|
|
LATEST_RPMS = $(shell [ ! -s results/logs/build.log ] || for r in `egrep 'Wrote.*/RPMS/.*.rpm' results/logs/build.log | sed 's/.*\///;s/.*debuginfo/debuginfo\/&/'` ; do echo "results/$$r"; done)
|
|
|
|
|
RPMS ?= $(LATEST_RPMS)
|
|
|
|
|
|
|
|
|
|
WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo )
|
|
|
|
@@ -91,18 +91,24 @@ prebuild-checks:
|
|
|
|
|
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options.
|
|
|
|
|
build: prebuild-checks configemail $(SPECFILE) upstream $(SRPMFILE)
|
|
|
|
|
$(MOCK) $(SRPMFILE) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
|
|
|
|
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
|
|
|
|
|
@perl $(TOPLVL)/projects/common/count.pl results/build.log &> testresults
|
|
|
|
|
mkdir -p results/logs results/debuginfo
|
|
|
|
|
mv results/*.log results/logs
|
|
|
|
|
-mv results/*-debuginfo*.rpm results/debuginfo/
|
|
|
|
|
@perl $(TOPLVL)/projects/common/logcheck.pl results/logs/build.log
|
|
|
|
|
@perl $(TOPLVL)/projects/common/count.pl results/logs/build.log &> testresults
|
|
|
|
|
@$(MAKE) checkblacklist
|
|
|
|
|
|
|
|
|
|
#help build-nocheck: Same as 'make build', but do not run the package's test suite.
|
|
|
|
|
build-nocheck: configemail $(SPECFILE) upstream $(SRPMFILE)
|
|
|
|
|
$(MOCK) $(SRPMFILE) --nocheck --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
|
|
|
|
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
|
|
|
|
|
@perl $(TOPLVL)/projects/common/count.pl results/build.log &> testresults
|
|
|
|
|
mkdir -p results/logs results/debuginfo
|
|
|
|
|
mv results/*.log results/logs
|
|
|
|
|
-mv results/*-debuginfo*.rpm results/debuginfo/
|
|
|
|
|
@perl $(TOPLVL)/projects/common/logcheck.pl results/logs/build.log
|
|
|
|
|
@perl $(TOPLVL)/projects/common/count.pl results/logs/build.log &> testresults
|
|
|
|
|
@$(MAKE) checkblacklist
|
|
|
|
|
|
|
|
|
|
fmvpatches: results/build.log
|
|
|
|
|
fmvpatches: results/logs/build.log
|
|
|
|
|
@perl $(TOPLVL)/projects/common/fmvpatches.pl $(PKG_NAME)
|
|
|
|
|
|
|
|
|
|
#help rootshell: Puts you in a root shell at the top of your build root.
|
|
|
|
@@ -117,7 +123,7 @@ shell:
|
|
|
|
|
.PHONY: $(SRPMFILE)
|
|
|
|
|
$(SRPMFILE): $(SPECFILE) $(__allsources) localreponotice
|
|
|
|
|
@$(MAKE) spdxcheck
|
|
|
|
|
$(MOCK) --buildsrpm --source=./ --spec=$(SPECFILE) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
|
|
|
|
$(MOCK) --buildsrpm --source=./ --spec=$(SPECFILE) --result=results/srpm/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
|
|
|
|
|
|
|
|
|
# Do a git fetch and a git rebase to apply local commits on top of latest
|
|
|
|
|
# commits from the remote. A git fetch/rebase is used rather than a git pull so
|
|
|
|
@@ -155,7 +161,7 @@ pullrebase:
|
|
|
|
|
#help to autospec.
|
|
|
|
|
#help For more information, see the project at https://github.com/clearlinux/autospec
|
|
|
|
|
autospec: pullrebase localreponotice
|
|
|
|
|
rm -f results/*src.rpm
|
|
|
|
|
rm -f results/srpm/*src.rpm
|
|
|
|
|
@if [ -e $(SPECFILE) ] && ! grep -q "# Generated by: autospec.py" $(SPECFILE) ; then \
|
|
|
|
|
echo "Specfile already exists and was not created by autospec.py! Aborting."; \
|
|
|
|
|
exit 1; \
|
|
|
|
@@ -287,6 +293,10 @@ koji: prekoji-checks kojidef
|
|
|
|
|
echo "Error: Must be on the master branch to submit to koji" >&2; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi; \
|
|
|
|
|
if ! git diff --quiet HEAD ${SPECFILE}; then \
|
|
|
|
|
echo "Error: All changes to ${SPECFILE} must be committed first" >&2; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi; \
|
|
|
|
|
if git rev-parse --verify --quiet origin/master > /dev/null; then \
|
|
|
|
|
git pull --rebase; \
|
|
|
|
|
fi
|
|
|
|
@@ -317,7 +327,7 @@ rekoji-nowait:
|
|
|
|
|
$(MAKE) KOJI_NOWAIT="--nowait --background" rekoji
|
|
|
|
|
|
|
|
|
|
logcheck:
|
|
|
|
|
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
|
|
|
|
|
@perl $(TOPLVL)/projects/common/logcheck.pl results/logs/build.log
|
|
|
|
|
|
|
|
|
|
$(TOPLVL)/repo:
|
|
|
|
|
@echo "Creating local RPM repository $(TOPLVL)/repo"
|
|
|
|
@@ -327,8 +337,8 @@ $(TOPLVL)/repo:
|
|
|
|
|
#help repoadd: Adds locally-built RPMs for this package to the local RPM
|
|
|
|
|
#help repository. If this repository does not yet exist, it is created and
|
|
|
|
|
#help enabled.
|
|
|
|
|
repoadd: results/build.log $(TOPLVL)/repo
|
|
|
|
|
@if [ -z "`grep '^Wrote: .*$(shell basename $(SRPMFILE))$$' results/build.log`" ]; then \
|
|
|
|
|
repoadd: results/logs/build.log $(TOPLVL)/repo
|
|
|
|
|
@if [ -z "`grep '^Wrote: .*$(shell basename $(SRPMFILE))$$' results/logs/build.log`" ]; then \
|
|
|
|
|
echo "You have not yet succesfully built this release yet"; exit 1; \
|
|
|
|
|
fi
|
|
|
|
|
@if [ -f .repo-index ]; then \
|
|
|
|
@@ -420,3 +430,6 @@ drop-abandoned: $(SPECFILE)
|
|
|
|
|
|
|
|
|
|
# Define site local common targets in a separate makefile
|
|
|
|
|
-include $(TOPLVL)/projects/common/Makefile.common.site_local
|
|
|
|
|
|
|
|
|
|
# Include optional extended makefiles from individual package repos
|
|
|
|
|
-include Makefile.custom
|
|
|
|
|