Blob Blame History Raw
# Cannot run tests at the moment since the release tarball is
# missing test/ and test/
%bcond_without tests

%global forgeurl

%global _description %{expand:
odML (open metadata Markup Language) is a file format for storing 
arbitrary metadata. The underlying data model offers a way to 
store metadata in a structured human- and machine-readable way.
Well organized metadata management is a key component to 
guarantee reproducibility of experiments and to track provenance
of performed analyses.


python-odml is the python library for reading and writing odml
metadata files. It is a registered research resource with the

Name:           python-odml
Version:        1.5.4
Release:        %autorelease
Summary:        File-format to store metadata in an organized way
# spdx
License:        BSD-4-Clause

URL:            %forgeurl
Source0:        %forgesource

BuildArch:      noarch

# Docs are no longer included
# They are available online:
Obsoletes:      %{name}-doc < %{version}

%description %_description

%package -n python3-odml
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  help2man

%if %{with tests}
BuildRequires:  python3-pytest
BuildRequires:  python3-lxml
BuildRequires:  python3-pyyaml
BuildRequires:  python3-owl_rl
BuildRequires:  python3-docopt

%description -n python3-odml %_description


touch test/



%pyproject_save_files -l odml

for binary in "odmlconvert" "odmlconversion"  "odmltordf"  "odmlview"
    echo "Generating man page for ${binary// /-/}"
    PYTHONPATH="$PYTHONPATH:%{buildroot}/%{python3_sitelib}/" PATH="$PATH:%{buildroot}/%{_bindir}/" help2man --no-info --no-discard-stderr --name="${binary}" --version-string="${binary} %{version}" --output="${binary// /-}.1" "${binary}"
    cat "${binary// /-}.1"
    install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D "${binary// /-}.1"

%if %{with tests}
  # test_version_converter needs an internet connection, therefore disabled
  %pytest --deselect test/

%files -n python3-odml -f %{pyproject_files}