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

Marc-André Lureau marcandre.lureau at gmail.com
Tue Aug 27 19:49:41 UTC 2019


Hi

On Tue, Aug 27, 2019 at 6:27 PM Snir Sheriber <ssheribe at redhat.com> wrote:
>
> This will let copr to generate srpm using the .copr/Makefile script

Do we really want to maintain that kind of distro things upstream? Do
we need it?

What does it bring that gitlab CI doesn't have?

>
> 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

When is the build actually triggered? Is copr monitoring the git
repository? Is there a hook somewhere in gitlab to trigger the build?

> +
> +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
> +       # 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
> +       ninja -C build dist
> +       rpmbuild -bs ./build/*spec --define "_sourcedir $$PWD/build/meson-dist/" --define "_srcrpmdir $(outdir)"

Too much hacks for my taste here.

> --
> 2.21.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



-- 
Marc-André Lureau


More information about the Spice-devel mailing list