File meson.spec of Package meson

#
# spec file
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define _name   mesonbuild
%{!?vim_data_dir:%global vim_data_dir %{_datadir}/vim}
Name:           meson
Version:        0.56.2
Release:        0
Summary:        Python-based build system
License:        Apache-2.0
Group:          Development/Tools/Building
URL:            https://mesonbuild.com/
Source:         https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz
Source2:        meson.keyring
Patch1:         meson-suse-ify-macros.patch
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  python3-base
BuildRequires:  python3-setuptools
Requires:       python3-setuptools
BuildArch:      noarch
Requires:       ninja >= 1.8.2
Requires:       python3-base
# meson-gui was last used in openSUSE Leap 42.1.
Provides:       meson-gui = %{version}
Obsoletes:      meson-gui < %{version}

%description
Meson is a build system designed to optimise programmer productivity.
It aims to do this by providing support for software development
tools and practices, such as unit tests, coverage reports, Valgrind,
CCache and the like. Supported languages include C, C++, Fortran,
Java, Rust. Build definitions are written in a non-turing complete
Domain Specific Language.

%package vim
Summary:        Vim support for meson.build files
Group:          Productivity/Text/Editors
Requires:       vim
Supplements:    (vim and %{name})
BuildArch:      noarch

%description vim
Meson is a build system designed to optimise programmer productivity.
It aims to do this by providing support for software development
tools and practices, such as unit tests, coverage reports, Valgrind,
CCache and the like. Supported languages include C, C++, Fortran,
Java, Rust. Build definitions are written in a non-turing complete
Domain Specific Language.

This package provides support for meson.build files in Vim.

%prep
%setup -q -n meson-%{version}
%patch1 -p1

%build
%python3_build

%install
%python3_install
%fdupes %{buildroot}%{python3_sitelib}

install -Dpm 0644 data/macros.meson \
  %{buildroot}%{_rpmconfigdir}/macros.d/macros.meson

install -Dpm 0644 data/syntax-highlighting/vim/ftdetect/meson.vim \
  -t %{buildroot}%{vim_data_dir}/site/ftdetect/
install -Dpm 0644 data/syntax-highlighting/vim/indent/meson.vim \
  -t %{buildroot}%{vim_data_dir}/site/indent/
install -Dpm 0644 data/syntax-highlighting/vim/syntax/meson.vim \
  -t %{buildroot}%{vim_data_dir}/site/syntax/

%files
%license COPYING
%{_bindir}/meson
%{python3_sitelib}/%{_name}/
%{python3_sitelib}/meson-*
%dir %{_datadir}/polkit-1/
%dir %{_datadir}/polkit-1/actions/
%{_datadir}/polkit-1/actions/com.mesonbuild.install.policy
%{_rpmconfigdir}/macros.d/macros.meson
%{_mandir}/man1/meson.1%{?ext_man}

%files vim
%doc data/syntax-highlighting/vim/README
%dir %{vim_data_dir}/
%dir %{vim_data_dir}/site/
%dir %{vim_data_dir}/site/ftdetect/
%dir %{vim_data_dir}/site/indent/
%dir %{vim_data_dir}/site/syntax/
%{vim_data_dir}/site/ftdetect/meson.vim
%{vim_data_dir}/site/indent/meson.vim
%{vim_data_dir}/site/syntax/meson.vim

%changelog

openSUSE Build Service is sponsored by