Package SPEC file into Meson distribution file

Put final SPEC file in GIT repository directly to avoid having
to bump Meson version to use distribution script. To avoid
having incoherent version numbers check the versions from CI.
Remove 'c' as project language, project don't need to compile
any files.
Meson however needs C compiler even if is not used so add to package
requirements.
Update CI to build RPM from package directly.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This commit is contained in:
Frediano Ziglio 2020-03-06 15:01:50 +00:00
parent 33946522aa
commit e3dcbcb72f
3 changed files with 13 additions and 15 deletions

View File

@ -1,7 +1,7 @@
image: fedora:latest
variables:
DEPS_COMMON: git libtool make redhat-rpm-config
DEPS_COMMON: git gcc redhat-rpm-config
meson ninja-build gtk-doc glib2-devel
gettext gettext-devel bzip2 rpmlint rpm-build
@ -10,9 +10,15 @@ before_script:
fedora:
script:
# build project and distribution
- meson --buildtype=release build-default
- ninja -C build-default
- ninja -C build-default dist
- rpmlint -o "NetworkEnabled False" build-default/spice-protocol.spec
- mkdir -p ~/rpmbuild/SOURCES && cp build-default/meson-dist/spice-protocol*.tar.xz ~/rpmbuild/SOURCES/
- rpmbuild -ba build-default/spice-protocol.spec
# check SPEC file
- rpmlint -o "NetworkEnabled False" spice-protocol.spec
# check the SPEC version and project (in meson.build) are the same
- "VER_SPEC=$(sed '/^Version:/!d; s/.*: \\+//' < spice-protocol.spec)"
- "VER_PROJECT=$(sed '/version/ { s/.*'\\''\\(.*\\)'\\''.*/\\1/; q }; d' < meson.build)"
- "test \"x$VER_SPEC\" = \"x$VER_PROJECT\""
# build RPM from tarball generate
- rpmbuild -ta build-default/meson-dist/spice-protocol*.tar.xz

View File

@ -1,7 +1,7 @@
#
# project definition
#
project('spice-protocol', 'c',
project('spice-protocol',
version : '0.14.2',
license : 'BSD',
meson_version : '>= 0.41.0')
@ -23,12 +23,3 @@ pkgconfig.generate(name : meson.project_name(),
subdirs : 'spice-1',
install_dir : pkgconfig_dir,
variables : 'datadir=@0@'.format(join_paths('${prefix}', datadir)))
#
# spice-protocol.spec
#
config_data = configuration_data()
config_data.set ('VERSION', meson.project_version())
configure_file(input : 'spice-protocol.spec.in',
output : 'spice-protocol.spec',
configuration : config_data)

View File

@ -1,5 +1,5 @@
Name: spice-protocol
Version: @VERSION@
Version: 0.14.2
Release: 1%{?dist}
Summary: Spice protocol header files
Group: Development/Libraries
@ -8,6 +8,7 @@ License: BSD and LGPLv2+
URL: https://www.spice-space.org
Source0: https://www.spice-space.org/download/releases/%{name}-%{version}.tar.xz
BuildArch: noarch
BuildRequires: meson gcc
%description
Header files describing the spice protocol