diff --git a/python-nss-1.0.1.tar.bz2 b/python-nss-1.0.1.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..ba08b6202633c81ca000be666d78844ad496fc6f Binary files /dev/null and b/python-nss-1.0.1.tar.bz2 differ diff --git a/python-nss.spec b/python-nss.spec new file mode 100644 index 0000000000000000000000000000000000000000..bea561b28482cdae48bedfd6cb037346402ea2a0 --- /dev/null +++ b/python-nss.spec @@ -0,0 +1,91 @@ +Name: python-nss +Version: 1.0.1 +Release: 14 +Summary: Bindings the Python for Network Security Services(NSS) +License: MPLv2.0 or GPLv2+ or LGPLv2+ +URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Python_binding_for_NSS +Source0: https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/PYNSS_RELEASE_1_0_1/src/python-nss-%{version}.tar.bz2 +Patch0000: sphinx.patch +BuildRequires: gcc nspr-devel nss-devel python3-devel python3-sphinx + +%description +The python-nss provides Python bindings for Netscape Portable Runtime (NSPR)\ +and Network Security Services (NSS)\ +The NSS is a server applications and set of libraries supporting\ +security-enabled client and The Applications built with NSS can support SSL v2\ +and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3\ +certificates, and other security standards. Specific NSS implementations\ +have been FIPS-140 certified. + +%package -n python2-nss +Summary: Bindings the Python2 for Network Security Services(NSS) +BuildRequires: python2-devel python2-setuptools python2-sphinx +%{?python_provide:%python_provide python2-nss} +%description -n python2-nss +The python-nss provides Python bindings for Netscape Portable Runtime (NSPR)\ +and Network Security Services (NSS)\ +The NSS is a server applications and set of libraries supporting\ +security-enabled client and The Applications built with NSS can support SSL v2\ +and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3\ +certificates, and other security standards. Specific NSS implementations\ +have been FIPS-140 certified. + +%package -n python3-nss +Summary: Bindings the Python3 for Network Security Services(NSS) +BuildRequires: python3-devel python3-setuptools python3-sphinx +%{?python_provide:%python_provide python3-nss} +%description -n python3-nss +The python-nss provides Python bindings for Netscape Portable Runtime (NSPR)\ +and Network Security Services (NSS)\ +The NSS is a server applications and set of libraries supporting\ +security-enabled client and The Applications built with NSS can support SSL v2\ +and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3\ +certificates, and other security standards. Specific NSS implementations\ +have been FIPS-140 certified. + +%package help +Summary: The examples and API documentation +Provides: python-nss-doc = %{version}-%{release} +Obsoletes: python-nss-doc < %{version}-%{release} + +%description help +The examples and API documentation + +%prep +%autosetup -n python-nss-%{version} -p1 +rm -rf %{_builddir}/python2-python-nss-%{version}-%{release} +cp -a . %{_builddir}/python2-python-nss-%{version}-%{release} + +%build +cd %{_builddir}/python2-python-nss-%{version}-%{release} +%py2_build +cd - + +%py3_build +%{__python3} setup.py build_doc + +%install +cd %{_builddir}/python2-python-nss-%{version}-%{release} +%py2_install +cd - + +%py3_install +%{__python3} setup.py install_doc --docdir %{_docdir}/%{name}-%{version} --skip-build --root $RPM_BUILD_ROOT + +find $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version} -type f | xargs chmod a-x +chmod 0755 $RPM_BUILD_ROOT/%{python3_sitearch}/nss/*.so + +%files -n python2-nss +%{python2_sitearch}/* +%doc %{_docdir}/%{name}-%{version}/{LICENSE.gpl,LICENSE.lgpl,LICENSE.mpl} + +%files -n python3-nss +%{python3_sitearch}/* +%doc %{_docdir}/%{name}-%{version}/{LICENSE.gpl,LICENSE.lgpl,LICENSE.mpl} + +%files help +%doc %{_docdir}/%{name}-%{version}/{examples,test,api,ChangeLog,README} + +%changelog +* Mon Apr 20 2020 yaokai - 1.0.1-14 +- Package init diff --git a/sphinx.patch b/sphinx.patch new file mode 100644 index 0000000000000000000000000000000000000000..8feecbe6f17c3fa607a66386de0d5b12d234e656 --- /dev/null +++ b/sphinx.patch @@ -0,0 +1,344 @@ +diff -r d767ac371ee3 doc/sphinx/source/conf.py +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/doc/sphinx/source/conf.py Fri Jul 06 11:24:08 2018 -0400 +@@ -0,0 +1,163 @@ ++# -*- coding: utf-8 -*- ++# ++# Configuration file for the Sphinx documentation builder. ++# ++# This file does only contain a selection of the most common options. For a ++# full list see the documentation: ++# http://www.sphinx-doc.org/en/master/config ++ ++# -- Path setup -------------------------------------------------------------- ++ ++# If extensions (or modules to document with autodoc) are in another directory, ++# add these directories to sys.path here. If the directory is relative to the ++# documentation root, use os.path.abspath to make it absolute, like shown here. ++# ++# import os ++# import sys ++# sys.path.insert(0, os.path.abspath('.')) ++ ++ ++# -- Project information ----------------------------------------------------- ++ ++project = 'python-nss' ++copyright = '2018, John Dennis' ++author = 'John Dennis' ++ ++# The short X.Y version ++version = '' ++# The full version, including alpha/beta/rc tags ++release = '' ++ ++ ++# -- General configuration --------------------------------------------------- ++ ++# If your documentation needs a minimal Sphinx version, state it here. ++# ++# needs_sphinx = '1.0' ++ ++# Add any Sphinx extension module names here, as strings. They can be ++# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ++# ones. ++extensions = [ ++ 'sphinx.ext.autodoc', ++ 'sphinx.ext.autosummary', ++] ++ ++autodoc_default_flags = ['members'] ++autosummary_generate = True ++ ++# Add any paths that contain templates here, relative to this directory. ++templates_path = ['_templates'] ++ ++# The suffix(es) of source filenames. ++# You can specify multiple suffix as a list of string: ++# ++# source_suffix = ['.rst', '.md'] ++source_suffix = '.rst' ++ ++# The master toctree document. ++master_doc = 'index' ++ ++# The language for content autogenerated by Sphinx. Refer to documentation ++# for a list of supported languages. ++# ++# This is also used if you do content translation via gettext catalogs. ++# Usually you set "language" from the command line for these cases. ++language = None ++ ++# List of patterns, relative to source directory, that match files and ++# directories to ignore when looking for source files. ++# This pattern also affects html_static_path and html_extra_path . ++exclude_patterns = [] ++ ++# The name of the Pygments (syntax highlighting) style to use. ++pygments_style = 'sphinx' ++ ++ ++# -- Options for HTML output ------------------------------------------------- ++ ++# The theme to use for HTML and HTML Help pages. See the documentation for ++# a list of builtin themes. ++# ++html_theme = 'alabaster' ++ ++# Theme options are theme-specific and customize the look and feel of a theme ++# further. For a list of options available for each theme, see the ++# documentation. ++# ++# html_theme_options = {} ++ ++# Add any paths that contain custom static files (such as style sheets) here, ++# relative to this directory. They are copied after the builtin static files, ++# so a file named "default.css" will overwrite the builtin "default.css". ++html_static_path = ['_static'] ++ ++# Custom sidebar templates, must be a dictionary that maps document names ++# to template names. ++# ++# The default sidebars (for documents that don't match any pattern) are ++# defined by theme itself. Builtin themes are using these templates by ++# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', ++# 'searchbox.html']``. ++# ++# html_sidebars = {} ++ ++ ++# -- Options for HTMLHelp output --------------------------------------------- ++ ++# Output file base name for HTML help builder. ++htmlhelp_basename = 'python-nssdoc' ++ ++ ++# -- Options for LaTeX output ------------------------------------------------ ++ ++latex_elements = { ++ # The paper size ('letterpaper' or 'a4paper'). ++ # ++ # 'papersize': 'letterpaper', ++ ++ # The font size ('10pt', '11pt' or '12pt'). ++ # ++ # 'pointsize': '10pt', ++ ++ # Additional stuff for the LaTeX preamble. ++ # ++ # 'preamble': '', ++ ++ # Latex figure (float) alignment ++ # ++ # 'figure_align': 'htbp', ++} ++ ++# Grouping the document tree into LaTeX files. List of tuples ++# (source start file, target name, title, ++# author, documentclass [howto, manual, or own class]). ++latex_documents = [ ++ (master_doc, 'python-nss.tex', 'python-nss Documentation', ++ 'John Dennis', 'manual'), ++] ++ ++ ++# -- Options for manual page output ------------------------------------------ ++ ++# One entry per manual page. List of tuples ++# (source start file, name, description, authors, manual section). ++man_pages = [ ++ (master_doc, 'python-nss', 'python-nss Documentation', ++ [author], 1) ++] ++ ++ ++# -- Options for Texinfo output ---------------------------------------------- ++ ++# Grouping the document tree into Texinfo files. List of tuples ++# (source start file, target name, title, author, ++# dir menu entry, description, category) ++texinfo_documents = [ ++ (master_doc, 'python-nss', 'python-nss Documentation', ++ author, 'python-nss', 'One line description of project.', ++ 'Miscellaneous'), ++] ++ ++ ++# -- Extension configuration ------------------------------------------------- +diff -r d767ac371ee3 doc/sphinx/source/index.rst +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/doc/sphinx/source/index.rst Fri Jul 06 11:24:08 2018 -0400 +@@ -0,0 +1,43 @@ ++.. python-nss documentation master file, created by ++ sphinx-quickstart on Thu Jun 28 09:36:37 2018. ++ You can adapt this file completely to your liking, but it should at least ++ contain the root `toctree` directive. ++ ++Welcome to python-nss's documentation! ++====================================== ++ ++Sub-modules ++=========== ++ ++The functionality of python-nss is implemented in several sub-modules. ++Each sub-module focuses on related functions, classes and data. The ++bulk of NSS functionality (e.g. general cryptography) appears in the ++`nss.nss` module. You can detailed information on the module, it's ++data, it's classes and functions by following the link to the ++sub-module in the table below. You can also use the `Index` in the ++next section to jump directly to a specific item. ++ ++ ++.. autosummary:: ++ :toctree: generated ++ ++ nss.io ++ nss.ssl ++ nss.nss ++ nss.error ++ ++ ++Indices and tables ++================== ++ ++* :ref:`genindex` ++* :ref:`modindex` ++* :ref:`search` ++ ++.. automodule:: nss ++ :members: ++ ++.. toctree:: ++ :maxdepth: 2 ++ :caption: Contents: ++ +diff -r d767ac371ee3 setup.py +--- a/setup.py Tue Feb 28 18:24:19 2017 -0500 ++++ b/setup.py Fri Jul 06 11:24:08 2018 -0400 +@@ -15,21 +15,25 @@ + from distutils.util import subst_vars, change_root + from distutils.command.build_py import build_py as _build_py + from distutils.command.sdist import sdist as _sdist ++from sphinx.setup_command import BuildDoc as SphinxBuildDoc + ++name = 'python-nss' + version = "1.0.1" ++release = version + + doc_manifest = [ + [['include README LICENSE* doc/ChangeLog', + 'recursive-include doc *.py *.txt', +- 'prune doc/examples/pki'], ++ 'prune doc/examples/pki', ++ 'prune doc/sphinx'], + [('^doc/', '')], None], + [['recursive-include test run_tests setup_certs.py test_*.py util.py *.txt', + 'prune test/pki'], + None , None], + [['recursive-include lib *.py *.txt',], + [('^lib/', '')] , 'examples'], +- [['recursive-include build/doc/html *'], +- [('^build/doc/', 'api/')], None], ++ [['recursive-include build/sphinx/html *'], ++ [('^build/sphinx/', 'api/')], None], + ] + + def update_version(): +@@ -114,13 +118,13 @@ + user_options = [('docdir=', 'd', "directory root for documentation"), + ] + +- def has_epydoc (self): +- if find_executable('epydoc'): ++ def has_sphinx (self): ++ if find_executable('sphinx-build'): + return True + else: + return False + +- sub_commands = [('build_api_doc', has_epydoc), ++ sub_commands = [('build_sphinx', has_sphinx), + ] + + def initialize_options(self): +@@ -137,46 +141,15 @@ + + def run(self): + self.run_command('build') ++ # Add build directory to Python path so doc builder can import ++ # in-tree built modules ++ sys.path.insert(0, self.build_lib) + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) ++ # Remove the build directory from Python path ++ del sys.path[0] + + +-class BuildApiDoc(Command): +- description = 'generate the API documentation' +- user_options = [('docdir=', 'd', "directory root for documentation"), +- ('action=', 'a', "epydoc action (html, latex, dvi, ps, pdf, check, pickle"), +- ('htmldir', 'H', "directory to locate the API HTML files under"), +- ] +- +- def initialize_options(self): +- self.build_base = None +- self.build_lib = None +- self.docdir = None +- self.action = None +- self.htmldir = None +- +- def finalize_options(self): +- self.set_undefined_options('build', +- ('build_base', 'build_base'), +- ('build_lib', 'build_lib')) +- +- if self.action is None: +- self.action = 'html' +- +- if self.docdir is None: +- if self.action == 'html': +- self.docdir = change_root(self.get_finalized_command('build_doc').docdir, 'html') +- else: +- self.docdir = self.get_finalized_command('build_doc').docdir +- +- def run(self): +- prog = find_executable('epydoc') +- pkg_dirs = [change_root(self.build_lib, pkg) for pkg in self.distribution.packages] +- cmd = [prog, '-v', '--%s' % self.action, '--docformat', 'restructuredtext', '-o', self.docdir] +- #if self.verbose: cmd.append('-v') +- cmd.extend(pkg_dirs) +- self.mkpath(self.docdir) +- spawn(cmd) + + class InstallDoc(Command): + description = 'install documentation' +@@ -373,7 +346,7 @@ + + #bug_tracker = 'https://bugzilla.redhat.com/buglist.cgi?submit&component=python-nss&product=Fedora&classification=Fedora' + #bug_enter = 'https://bugzilla.redhat.com/enter_bug.cgi?component=python-nss&product=Fedora&classification=Fedora', +- setup(name = 'python-nss', ++ setup(name = name, + version = version, + description = 'Python bindings for Network Security Services (NSS) and Netscape Portable Runtime (NSPR)', + long_description = long_description, +@@ -393,12 +366,17 @@ + package_dir = {'nss':'src'}, + packages = ['nss'], + cmdclass = {'build_doc' : BuildDoc, +- 'build_api_doc' : BuildApiDoc, ++ 'build_sphinx' : SphinxBuildDoc, + 'install_doc' : InstallDoc, + 'build_py' : BuildPy, + 'sdist' : SDist, + }, +- ++ command_options={ ++ 'build_sphinx': { ++ 'project': ('setup.py', name), ++ 'version': ('setup.py', version), ++ 'release': ('setup.py', release), ++ 'source_dir': ('setup.py', 'doc/sphinx/source')}}, + ) + + return 0