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