[Spice-devel] [PATCH v2 spice-streaming-agent] Add copr Makefile

Snir Sheriber ssheribe at redhat.com
Wed Feb 27 11:26:51 UTC 2019


This Makefile script is invoked by copr to build source rpm
See: https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm
---

Changes from v1 are script improvements and description 

---
 .copr/Makefile | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 .copr/Makefile

diff --git a/.copr/Makefile b/.copr/Makefile
new file mode 100644
index 0000000..0ae3bed
--- /dev/null
+++ b/.copr/Makefile
@@ -0,0 +1,21 @@
+# This Makefile script is invoked by copr to build source rpm
+# See: https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm
+
+PROTOCOL_GIT_REPO = https://gitlab.freedesktop.org/spice/spice-protocol
+BUILD = make automake autoconf autoconf-archive libtool xz git rpm-build
+
+srpm:
+	dnf install -y $(BUILD)
+
+	# get upstream spice protocol
+	git clone $(PROTOCOL_GIT_REPO)
+	cd spice-protocol && ./autogen.sh --prefix=/usr/ && make install
+
+	# get other dependencies for project excluding spice-protocol
+	dnf install -y `sed '/^BuildRequires:/!d; s/.*://; s/\bspice-protocol\b//; s/>.*//' *.spec.in`
+
+	# create source rpm
+	./autogen.sh
+	sed -i -E "s/(^Release:[[:space:]]*)([^%]*)/\1`date +'%Y%m%d%H%M.spice.nigthly'`/" *.spec
+	make dist
+	rpmbuild -bs *.spec --define "_sourcedir $$PWD" --define "_srcrpmdir $(outdir)"
-- 
2.19.1



More information about the Spice-devel mailing list