File python-systemd.spec of Package python-systemd

# spec file for package python-systemd
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

Name:           python-systemd
Version:        231
Release:        0
Summary:        Python wrappers for systemd functionality
License:        LGPL-2.1+
Group:          Development/Languages/Python
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  python-Sphinx
BuildRequires:  python-devel
BuildRequires:  python-pytest
BuildRequires:  python-setuptools
BuildRequires:  systemd-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%package doc
Summary:        Documentation for %name
Group:          Documentation
Requires:       %name = %version

Python module for native access to the systemd facilities. Functionality is seperated into a number of modules:
* systemd.journal supports sending of structured messages to the journal and reading journal files,
* systemd.daemon wraps parts of libsystemd useful for writing daemons and socket activation,
* systemd.id128 provides functions for querying machine and boot identifiers and a lists of message identifiers provided by systemd,
* systemd.login wraps parts of libsystemd used to query logged in users and available seats and machines.

%description doc
Documentation and help files for %name

%setup -q

make %{?_smp_mflags} build
make sphinx-html
%{__rm} -r build/html/.buildinfo build/html/.doctrees build/html/_sources

%fdupes %{buildroot}/%{python_sitearch}

# run doc-tests only when socket is available
test -f /run/systemd/journal/stdout || sed -i 's/--doctest[^ ]*//g' pytest.ini
make %{?_smp_mflags} check || :

%doc LICENSE.txt

%files doc
%doc build/html