4e34883
Name:           python-systemd
f95f84d
Version:        231
4e34883
Release:        1%{?dist}
4e34883
Summary:        Python module wrapping systemd functionality
4e34883
4e34883
License:        LGPLv2+
4e34883
URL:            https://github.com/systemd/python-systemd
ce361e1
#Source0:        https://github.com/systemd/python-systemd/archive/v%%{version}.tar.gz
ce361e1
# 'make dist' output from https://github.com/systemd/python-systemd/
ce361e1
Source0:        python-systemd-%{version}.tar.gz
4e34883
4e34883
BuildRequires:  systemd-devel
ce361e1
BuildRequires:  python2-devel
0bddc98
BuildRequires:  python3-devel
0bddc98
BuildRequires:  python3-sphinx
855cc9f
BuildRequires:  web-assets-devel
f95f84d
BuildRequires:  pytest
f95f84d
BuildRequires:  python3-pytest
4e34883
0bddc98
%global _docdir_fmt %{name}
0bddc98
0bddc98
%description
0bddc98
Python module for native access to the systemd facilities.
0bddc98
Functionality includes sending of structured messages to the journal
0bddc98
and reading journal files, querying machine and boot identifiers and a
0bddc98
lists of message identifiers provided by systemd. Other functionality
0bddc98
provided by libsystemd is also wrapped.
0bddc98
0bddc98
%package -n python2-systemd
0bddc98
Summary:        %{summary}
0bddc98
0bddc98
%{?python_provide:%python_provide python2-systemd}
4e34883
Provides:       systemd-python = %{version}-%{release}
4e34883
Provides:       systemd-python%{?_isa} = %{version}-%{release}
4e34883
Obsoletes:      systemd-python < 230
4e34883
0bddc98
%description -n python2-systemd
4e34883
Python module for native access to the systemd facilities.
4e34883
Functionality includes sending of structured messages to the journal
4e34883
and reading journal files, querying machine and boot identifiers and a
4e34883
lists of message identifiers provided by systemd. Other functionality
4e34883
provided by libsystemd is also wrapped.
4e34883
4e34883
This is the version for Python 2.
4e34883
4e34883
%package -n python3-systemd
4e34883
Summary:        %{summary}
4e34883
0bddc98
Requires:       js-jquery
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
4e34883
%description -n python3-systemd
4e34883
Python module for native access to the systemd facilities.
4e34883
Functionality includes sending of structured messages to the journal
4e34883
and reading journal files, querying machine and boot identifiers and a
4e34883
lists of message identifiers provided by systemd. Other functionality
4e34883
provided by libsystemd is also wrapped.
4e34883
4e34883
This is the version for Python 3.
4e34883
4e34883
%prep
4e34883
%autosetup
4e34883
4e34883
%build
ce361e1
make PYTHON=%{__python2} 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=%{__python2}
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
c0a337c
make PYTHON=%{__python2} check || :
c0a337c
make PYTHON=%{__python3} check || :
4e34883
0bddc98
%files -n python2-systemd
4e34883
%license LICENSE.txt
855cc9f
%doc %{_pkgdocdir}
4e34883
%{python2_sitearch}/*
4e34883
4e34883
%files -n python3-systemd
4e34883
%license LICENSE.txt
ce361e1
%doc %{_pkgdocdir}
4e34883
%{python3_sitearch}/*
4e34883
4e34883
%changelog
f95f84d
* Tue Oct 27 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@laptop> - 231-1
f95f84d
- Update to latest version
f95f84d
4e34883
* Mon Jul  6 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@laptop> - 230-1
4e34883
- Initial packaging