%bcond_without check Summary: File Access Policy Analyzer Name: fapolicy-analyzer Version: 1.3.0 Release: 1%{?dist} SourceLicense: GPL-3.0-or-later # Apache-2.0 # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-3-Clause # ISC # ISC AND OpenSSL AND MIT # MIT # MIT OR Apache-2.0 # MIT OR X11 OR Apache-2.0 # MPL-2.0 # Unlicense OR MIT License: GPL-3.0-or-later AND Apache-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND OpenSSL AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (MIT OR X11 OR Apache-2.0) AND (Unlicense OR MIT) URL: https://github.com/ctc-oss/fapolicy-analyzer Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz # this tarball contains documentation used to generate help docs Source1: %{url}/releases/download/v%{version}/vendor-docs-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(pip) BuildRequires: python3dist(wheel) BuildRequires: python3dist(babel) BuildRequires: dbus-devel BuildRequires: gettext BuildRequires: itstool BuildRequires: desktop-file-utils BuildRequires: clang BuildRequires: audit-libs-devel BuildRequires: cargo-rpm-macros BuildRequires: python3dist(setuptools-rust) Requires: python3 Requires: python3-gobject Requires: python3-events Requires: python3-configargparse Requires: python3-more-itertools Requires: python3-rx Requires: python3-importlib-metadata Requires: python3-toml Requires: gtk3 Requires: gtksourceview3 Requires: gnome-icon-theme # runtime required for rendering user guide Requires: webkit2gtk3 Requires: mesa-dri-drivers %global module fapolicy_analyzer # pep440 versions handle dev and rc differently, so we call them out explicitly here %global module_version %{lua: v = string.gsub(rpm.expand("%{?version}"), "~dev", ".dev"); \ v = string.gsub(v, "~rc", "rc"); print(v) } %description Tools to assist with the configuration and management of fapolicyd. %prep %autosetup -n %{name} %cargo_prep # disable dev-tools crate sed -i '/tools/d' Cargo.toml # extract our doc sourcs tar xvzf %{SOURCE1} # our setup.py looks up the version from git describe # this overrides that check to use the RPM version echo %{module_version} > VERSION # capture build info scripts/build-info.py --os --time # enable the audit feature for 39 and up %if 0%{?fedora} >= 39 echo "audit" > FEATURES %endif %generate_buildrequires %cargo_generate_buildrequires -a %build # ensure standard Rust compiler flags are set export RUSTFLAGS="%{build_rustflags}" %{python3} setup.py compile_catalog -f %{python3} help build %{python3} setup.py bdist_wheel %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install %{py3_install_wheel %{module}-%{module_version}*%{_target_cpu}.whl} %{python3} help install --dest %{buildroot}/%{_datadir}/help install -D bin/%{name} %{buildroot}/%{_sbindir}/%{name} install -D data/%{name}.8 -t %{buildroot}/%{_mandir}/man8/ install -D data/config.toml -t %{buildroot}%{_sysconfdir}/%{name}/ desktop-file-install data/%{name}.desktop find locale -name %{name}.mo -exec cp --parents -rv {} %{buildroot}/%{_datadir} \; %find_lang %{name} --with-gnome %check desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop %files -n %{name} -f %{name}.lang %doc scripts/srpm/README %license LICENSE %license LICENSE.dependencies %{python3_sitearch}/%{module} %{python3_sitearch}/%{module}-%{module_version}* %attr(755,root,root) %{_sbindir}/%{name} %attr(644,root,root) %{_mandir}/man8/%{name}.8* %attr(755,root,root) %{_datadir}/applications/%{name}.desktop %config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/config.toml %ghost %attr(640,root,root) %verify(not md5 size mtime) %{_localstatedir}/log/%{name}/%{name}.log %changelog * Sat Feb 03 2024 John Wass 1.3.0-1 - New release