python-systemd/python-systemd.spec
Miro Hrončok 0366b42171 BuildRequire python3-setuptools explicitly
They were only transitively brought by sphinx -> babel -> setuptools.

    + make PYTHON=/usr/bin/python3 build
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python-systemd-235/setup.py", line 2, in <module>
        from setuptools import setup, Extension
    ModuleNotFoundError: No module named 'setuptools'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'
    /bin/sh: line 1: git: command not found
    /usr/bin/python3 setup.py build_ext
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python-systemd-235/setup.py", line 2, in <module>
        from setuptools import setup, Extension
    ModuleNotFoundError: No module named 'setuptools'
    make: *** [Makefile:35: build] Error 1
2023-02-28 17:05:56 +01:00

79 lines
2.2 KiB
RPMSpec

Name: python-systemd
Version: 235
Release: %autorelease
Summary: Python module wrapping libsystemd functionality
License: LGPLv2+
URL: https://github.com/systemd/python-systemd
Source0: https://github.com/systemd/python-systemd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: make
BuildRequires: gcc
BuildRequires: systemd-devel
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-sphinx
BuildRequires: web-assets-devel
BuildRequires: python3-pytest
%global _description %{expand:
Python module for native access to the libsystemd facilities. Functionality
includes sending of structured messages to the journal and reading journal
files, querying machine and boot identifiers and a lists of message identifiers
provided by systemd. Other functionality provided the library is also wrapped.}
%description %_description
%package -n python3-systemd
Summary: %{summary}
%{?python_provide:%python_provide python3-systemd}
Provides: systemd-python3 = %{version}-%{release}
Provides: systemd-python3%{?_isa} = %{version}-%{release}
Obsoletes: systemd-python3 < 230
Recommends: %{name}-doc
%description -n python3-systemd %_description
%package doc
Summary: HTML documentation for %{name}
Requires: js-jquery
%description doc
%{summary}.
%prep
%autosetup -p1
sed -i 's/py\.test/pytest/' Makefile
%build
make PYTHON=%{__python3} build
make PYTHON=%{__python3} SPHINX_BUILD=sphinx-build-3 sphinx-html
rm -r build/html/.buildinfo build/html/.doctrees
%install
%make_install PYTHON=%{__python3}
mkdir -p %{buildroot}%{_pkgdocdir}
cp -rv build/html %{buildroot}%{_pkgdocdir}/
ln -vsf %{_jsdir}/jquery/latest/jquery.min.js %{buildroot}%{_pkgdocdir}/html/_static/jquery.js
cp -p README.md NEWS %{buildroot}%{_pkgdocdir}/
%check
# if the socket is not there, skip doc tests
test -f /run/systemd/journal/stdout || \
sed -i 's/--doctest[^ ]*//g' pytest.ini
make PYTHON=%{__python3} check
%files -n python3-systemd
%license LICENSE.txt
%doc %{_pkgdocdir}
%exclude %{_pkgdocdir}/html
%{python3_sitearch}/systemd/
%{python3_sitearch}/systemd_python*.egg-info
%files doc
%doc %{_pkgdocdir}/html
%changelog
%autochangelog