Commit 5a15cd3f authored by Frediano Ziglio's avatar Frediano Ziglio

build: Move to Meson to build RPM

Distribute SPEC file in tarball.
Change SPEC file to use Meson instead of Autoconf.
Add required dependencies.

Checks made:
- rpmlint
- rpmbuild from tarball
- mock from generated source RPM
Signed-off-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
Acked-by: Kevin Pouget's avatarKevin Pouget <kpouget@redhat.com>
parent 98108a09
......@@ -13,7 +13,6 @@ Makefile
Makefile.in
/aclocal.m4
/autom4te.cache
/build-aux/
/config.h
/config.h.in
/config.log
......
......@@ -4,7 +4,7 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- dnf install -y git make automake autoconf autoconf-archive libtool xz meson
- dnf install -y git make automake autoconf autoconf-archive libtool xz
# get dependencies from spec file
- dnf install -y `sed '/^BuildRequires:/!d; s/.*://; s/\bspice-protocol\b//; s/>.*//' spice-streaming-agent.spec.in`
- git clone ${CI_REPOSITORY_URL/spice-streaming-agent/spice-protocol}
......
#!/bin/bash
set -e
set -o pipefail
if ! test -d "$1"; then
echo "Source directory not provided" >&2
exit 1
fi
# add missing recorder files
(cd "$1" && ls -1 subprojects/spice-common/common/recorder/recorder.[ch] \
subprojects/spice-common/common/recorder/recorder_ring.[ch] | \
tar cf - -T -) | (cd "$MESON_DIST_ROOT" && exec tar xf -)
# remove possible subprojects SPEC files to avoid conflicts
find "$MESON_DIST_ROOT" -name \*.spec -type f -delete
cp spice-streaming-agent.spec "$MESON_DIST_ROOT/"
......@@ -11,6 +11,8 @@ project('spice-streaming-agent', 'c', 'cpp',
'cpp_std=gnu++11',
])
meson.add_dist_script('build-aux/meson-dist', meson.source_root())
#
# check for dependencies
......@@ -45,7 +47,11 @@ config_data = configuration_data()
#
# set up subprojects
#
spice_common = subproject('spice-common', default_options : ['generate-code=all'])
spice_common = subproject('spice-common',
default_options : [
'generate-code=all',
'smartcard=disabled',
])
spice_common_deps = [spice_common.get_variable('spice_common_client_dep')]
config_data.merge_from(spice_common.get_variable('spice_common_config_data'))
......
......@@ -15,6 +15,7 @@ BuildRequires: libdrm-devel
BuildRequires: libXrandr-devel
BuildRequires: gcc-c++
BuildRequires: diffutils
BuildRequires: meson
BuildRequires: gstreamer1-devel
BuildRequires: gstreamer1-plugins-base-devel
BuildRequires: pixman-devel
......@@ -47,17 +48,14 @@ agent plugins.
%setup -q
%build
%configure --enable-tests --with-udevrulesdir=%{_udevrulesdir}
make %{?_smp_mflags} V=1
%meson -Dunittests=enabled -Dudevrulesdir=%{_udevrulesdir}
%meson_build
%check
make check
%meson_test
%install
make install DESTDIR=%{buildroot} V=1
if test -d "%{buildroot}/%{_libdir}/%{name}/plugins"; then
find %{buildroot}/%{_libdir}/%{name}/plugins -name '*.la' -delete
fi
%meson_install
%post
semanage fcontext -a -t xserver_exec_t %{_bindir}/spice-streaming-agent 2>/dev/null || :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment