Skip to content

Commit

Permalink
copr: add .copr/Makefile for building in COPR system
Browse files Browse the repository at this point in the history
This is considered the flexible way to build in COPR and it meets our
needs to match the setuptools_scm versionoing scheme we've already been
using for a while.  Hackily reuse the container build.sh script for
generating the srpm.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
  • Loading branch information
phlogistonjohn committed Apr 17, 2023
1 parent 9008ebc commit 08c86c2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .copr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@


SELF=$(lastword $(MAKEFILE_LIST))
ROOT_DIR=$(abspath $(dir $(SELF))/..)
SKIP_DEPS=

outdir:=/var/tmp/copr-tmp-outdir
spec:=extras/python-sambacc.spec

.PHONY: srpm
srpm: sys_deps py_deps
mkdir -p $(outdir)
git fetch --tags
SAMBACC_SRPM_ONLY=yes \
SAMBACC_BUILD_DIR=$(ROOT_DIR) \
SAMBACC_DIST_PREFIX=$(outdir)/.dist \
SAMBACC_DISTNAME=copr \
SAMBACC_BUILD_TASKS="task_py_build task_rpm_build" \
./tests/container/build.sh
cp $(outdir)/.dist/copr/SRPMS/*.rpm $(outdir)


.PHONY: sys_deps
sys_deps:
ifeq ($(SKIP_DEPS),yes)
@echo "Skipping sys deps"
else
dnf install -y python3-pip git
endif


.PHONY: py_deps
py_deps:
ifeq ($(SKIP_DEPS),yes)
@echo "Skipping py deps"
else
pip install build
endif

0 comments on commit 08c86c2

Please sign in to comment.