Blob Blame History Raw
# Sphinx-generated HTML documentation is not suitable for packaging; see
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
#
# We can generate PDF documentation as a substitute.
%bcond_with doc_pdf

Name:           python-ncclient
Version:        0.6.15
Release:        2%{?dist}
Summary:        Python library for the NETCONF protocol

# The entire source is Apache-2.0, except:
#
# Unlicense:
# - The script versioneer.py (a vendored, amalgamated copy of
#   python3dist(versioneer) = 0.28 that is not packaged), and the file
#   ncclient/_version.py, which was generated by it
License:        Apache-2.0 AND Unlicense
URL:            https://github.com/ncclient/ncclient
Source:         %{url}/archive/v%{version}/ncclient-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  pyproject-rpm-macros

%global common_description %{expand:
ncclient is a Python library that facilitates client-side scripting and
application development around the NETCONF protocol. ncclient was developed by
Shikar Bhushan.net). It is now maintained by Leonidas Poulopoulos (@leopoul)
and Einar Nilsen-Nygaard (@einarnn).

Docs: http://ncclient.readthedocs.org

PyPI: https://pypi.python.org/pypi/ncclient}

%description %{common_description}


%package -n python3-ncclient
Summary:        %{summary}

%description -n python3-ncclient %{common_description}


%package doc
Summary:        Documentation and examples for python-ncclient

%if %{with doc_pdf}
BuildRequires:  make
BuildRequires:  python3-sphinx-latex
BuildRequires:  latexmk
%endif

%description doc
The python-ncclient-doc package contains detailed documentation and examples
for python-ncclient.


%prep
%autosetup -n ncclient-%{version}
%py3_shebang_fix examples

# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -r -i '/^(flake8|pytest-cov)\b/d' test-requirements.txt

# Loosen exact-version doc dependencies
sed -r -i 's/==/>=/' docs/requirements.txt
# Drop intersphinx mappings, since we can’t download remote inventories and
# can’t easily produce working hyperlinks from inventories in local
# documentation packages.
echo 'intersphinx_mapping.clear()' >> docs/conf.py


%generate_buildrequires
%pyproject_buildrequires -t %{?with_doc_pdf:docs/requirements.txt}


%build
%pyproject_wheel

%if %{with doc_pdf}
%make_build -C docs latex SPHINXOPTS='-j%{?_smp_build_ncpus}'
# There is an escaping problem we haven’t traced to its root cause. In the list
# of authors, “\and” is emitted, and then “\a” is interpreted as the backslash
# escape for the ASCII BEL (bell) character. This then breaks the LaTeX build.
# Find it and fix it after generating the LaTeX source and before building it.
sed -r -i 's/\x07nd/and/g' docs/build/latex/ncclient.tex
%make_build -C docs/build/latex LATEXMKOPTS='-quiet'
%endif


%install
%pyproject_install
%pyproject_save_files -l ncclient


%check
%tox

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


%files doc
%license LICENSE
%doc Changelog
%doc NOTICE
%doc README.md
%doc README.rst
%if %{with doc_pdf}
%doc docs/build/latex/ncclient.pdf
%endif
%doc examples/


%changelog
* Mon Dec 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.15-2
- Assert that %%pyproject_files contains a license file

* Fri Oct 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.15-1
- Update to 0.6.15 (close RHBZ#2244719)

* Fri Oct 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-14
- Remove obsolete rpmlintrc

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.13-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Tue Jul 11 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-12
- Use a trailing slash when listing directories in files lists

* Fri Jul 07 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-11
- Use new (rpm 4.17.1+) bcond style

* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.6.13-10
- Rebuilt for Python 3.12

* Fri Mar 17 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-8
- Don’t assume %%_smp_mflags is -j%%_smp_build_ncpus

* Mon Mar 06 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-7
- Rebuild with Unlicense-licensed versioneer

* Sat Mar 04 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-6
- Replace vendored versioneer.py for Python 3.12 (close RHBZ#2175185)

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.13-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Nov 24 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-4
- Update License to SPDX

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 0.6.13-2
- Rebuilt for Python 3.11

* Mon Apr 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.13-1
- Update to 0.6.13 (close RHBZ#2073846)

* Mon Apr 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-17
- Generate doc dependencies from requirements file

* Mon Apr 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-16
- Drop “forge” macros, since they don’t benefit us much

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.12-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Jan 07 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-14
- Drop intersphinx mappings

* Fri Dec 17 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-13
- Avoid generating several unnecessary BuildRequires

* Sat Nov 27 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-12
- Tweak a spec file comment

* Fri Nov 26 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-11
- Reduce LaTeX PDF build verbosity

* Thu Sep 30 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-10
- Generate PDF instead of HTML Sphinx documentation.

* Mon Sep 13 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-9
- Let pyproject-rpm-macros handle the license file

* Sun Sep 12 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-8
- Drop BR on pyproject-rpm-macros, now implied by python3-devel

* Sun Sep 12 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-7
- Reduce macro indirection in the spec file

* Tue Jul 27 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-6
- Use forgeautosetup macro

* Tue Jul 27 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-5
- Move %%generate_buildrequires after %%prep to make the spec file easier
  to follow

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.12-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.6.12-2
- Rebuilt for Python 3.10

* Sun May 30 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.12-1
- Update to 0.6.12

* Sat May 29 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.11-1
- Update to 0.6.11
- Drop upstreamed patches

* Tue Mar 16 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.10-2
- Patch out BR on deprecated python3-mock
- Patch out BR on deprecated python3-nose

* Tue Mar 16 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.10-1
- Update to 0.16.10
- Drop python-ncclient-0.6.9-shebangs.patch, now upstreamed
- Drop python3dist(setuptools) BR, redundant with pyproject-rpm-macros

* Tue Mar 02 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.9-2
- Rebuild for fixed RHBZ#1925963 in pyproject-rpm-macros-0-38
- Enable parallel Sphinx build

* Fri Jan  1 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.9-1
- Prepare for unretirement
- New upstream version 0.6.9
- Migrate from Python 2 to Python 3
- Use new macros for source URL and build/install/test sections, and drop old
  macros like python_provide
- Use generated Requires and BuildRequires
- Split documentation and examples into a separate -doc subpackage

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Jan 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.4.7-6
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.7-5
- Python 2 binary package renamed to python2-ncclient
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Tue Mar 08 2016 Ihar Hrachyshka <ihrachys@redhat.com> 0.4.7-1.el7
- Update to 0.4.7

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Dec  5 2014 Ihar Hrachyshka <ihrachys@redhat.com> - 0.4.2-2
- Added missing python-setuptools as a build dependency.
- Include documentation and examples.
- Run unit tests on build.
- Rebuild egg file.
- Added python2 macros needed for el6.
- Made python macros more specific (python -> python2).
- Made python2_sitelib file inclusion wildcard a bit more strict.

* Thu Dec  4 2014 Ihar Hrachyshka <ihrachys@redhat.com> - 0.4.2-1
- Updated to upstream 0.4.2 version

* Thu Aug  7 2014 Ihar Hrachyshka <ihrachys@redhat.com> - 0.4.1-1
- Initial package for Fedora