[Spice-devel] [PATCH spice-gtk 2/2] Add copr builds integration

Frediano Ziglio fziglio at redhat.com
Tue Aug 27 19:17:30 UTC 2019


> 
> This will let copr to generate srpm using the .copr/Makefile script
> 
> Signed-off-by: Snir Sheriber <ssheribe at redhat.com>
> ---
>  .copr/Makefile | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 .copr/Makefile
> 
> diff --git a/.copr/Makefile b/.copr/Makefile
> new file mode 100644
> index 0000000..db297fb
> --- /dev/null
> +++ b/.copr/Makefile
> @@ -0,0 +1,29 @@
> +# 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 = meson gcc xz git rpm-build
> +
> +srpm:
> +	dnf install -y $(BUILD)
> +
> +	# get upstream spice protocol
> +	git clone $(PROTOCOL_GIT_REPO)
> +	cd spice-protocol && meson -Dprefix=/usr/ build && ninja -C build install
> +	rm -rf spice-protocol
> +
> +	# get other dependencies for project excluding spice-protocol
> +	dnf install -y `sed '/^BuildRequires:/!d; s/.*://; s/\bspice-protocol\b//;
> s/>.*//' *.spec.in`
> +
> +	# do not use commit id for version
> +	git fetch --tags
> +	git describe --abbrev=0 | sed 's/v//' > .tarball-version

Maybe adding a "--match=v\*" to git describe to avoid other tags beside the
ones starting with "v" ?

> +	# create source rpm
> +	meson --buildtype=release build
> +	# Meson does not update submodules recursively
> +	git submodule update --init --recursive
> +	# this fix an issue with Meson dist
> +	if ! test -r ../spice-common.git; then DIR=`basename "$$PWD"`; ln -s
> "$$DIR/.git/modules/spice-common" ../spice-common.git; fi
> +	rm -rf meson-dist

Sure you don't want build/meson-dist instead?

> +	ninja -C build dist
> +	rpmbuild -bs ./build/*spec --define "_sourcedir $$PWD/build/meson-dist/"
> --define "_srcrpmdir $(outdir)"

I would use *.spec, I know *spec works too, just a bit more specific.

Frediano


More information about the Spice-devel mailing list