From bf98acfbae5f09e38385064d9e5c72cabe3b2dd5 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Tue, 5 Jun 2018 14:16:52 +0300 Subject: [PATCH 1/4] Add possibility to disable doc build for Fedora by global _without_doc macro --- pyp2rpm/templates/fedora.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyp2rpm/templates/fedora.spec b/pyp2rpm/templates/fedora.spec index bfd7832c..9a0d26a9 100644 --- a/pyp2rpm/templates/fedora.spec +++ b/pyp2rpm/templates/fedora.spec @@ -4,6 +4,9 @@ {%- if data.srcname %} %global srcname {{ data.srcname }} {%- endif %} +{%- if data.sphinx_dir %} +%global with_doc %{!?_without_doc:1}%{?_without_doc:0} +{%- endif %} Name: {{ data.pkg_name|macroed_pkg_name(data.srcname) }} Version: {{ data.version }} @@ -32,10 +35,12 @@ Summary: %{summary} {{ data.description|truncate(400)|wordwrap }} {% endfor -%} {%- if data.sphinx_dir %} +%if 0%{?with_doc} %package -n {{ data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(None, True) }}-doc Summary: {{ data.name }} documentation %description -n {{ data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(None, True) }}-doc Documentation for {{ data.name }} +%endif {%- endif %} %prep @@ -50,10 +55,12 @@ rm -rf %{pypi_name}.egg-info %py{{ pv }}_build {%- endfor %} {%- if data.sphinx_dir %} +%if 0%{?with_doc} # generate html docs PYTHONPATH=${PWD} {{ "sphinx-build"|script_name_for_python_version(data.base_python_version, False, True) }} {{ data.sphinx_dir }} html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} +%endif {%- endif %} %install @@ -118,11 +125,13 @@ rm -rf %{buildroot}%{_bindir}/* {%- endif %} {% endfor %} {%- if data.sphinx_dir %} +%if 0%{?with_doc} %files -n {{ data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(None, True) }}-doc %doc html {%- if data.doc_license %} %license {{data.doc_license|join(' ')}} {%- endif %} +%endif {% endif %} %changelog * {{ data.changelog_date_packager }} - {{ data.version }}-1 From 151dbcaafca3e80424d667408fc32f687badb0ba Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Tue, 5 Jun 2018 14:46:19 +0300 Subject: [PATCH 2/4] Use bcond conditions for doc generation --- pyp2rpm/templates/fedora.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pyp2rpm/templates/fedora.spec b/pyp2rpm/templates/fedora.spec index 9a0d26a9..a2a324d6 100644 --- a/pyp2rpm/templates/fedora.spec +++ b/pyp2rpm/templates/fedora.spec @@ -5,7 +5,11 @@ %global srcname {{ data.srcname }} {%- endif %} {%- if data.sphinx_dir %} -%global with_doc %{!?_without_doc:1}%{?_without_doc:0} +%if 0%{?_without_doc} +%bcond_with doc +%else +%bcond_without doc +%endif {%- endif %} Name: {{ data.pkg_name|macroed_pkg_name(data.srcname) }} @@ -35,7 +39,7 @@ Summary: %{summary} {{ data.description|truncate(400)|wordwrap }} {% endfor -%} {%- if data.sphinx_dir %} -%if 0%{?with_doc} +%if %{with doc} %package -n {{ data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(None, True) }}-doc Summary: {{ data.name }} documentation %description -n {{ data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(None, True) }}-doc @@ -55,7 +59,7 @@ rm -rf %{pypi_name}.egg-info %py{{ pv }}_build {%- endfor %} {%- if data.sphinx_dir %} -%if 0%{?with_doc} +%if %{with doc} # generate html docs PYTHONPATH=${PWD} {{ "sphinx-build"|script_name_for_python_version(data.base_python_version, False, True) }} {{ data.sphinx_dir }} html # remove the sphinx-build leftovers @@ -125,7 +129,7 @@ rm -rf %{buildroot}%{_bindir}/* {%- endif %} {% endfor %} {%- if data.sphinx_dir %} -%if 0%{?with_doc} +%if %{with doc} %files -n {{ data.pkg_name|macroed_pkg_name(data.srcname)|name_for_python_version(None, True) }}-doc %doc html {%- if data.doc_license %} From 17b96809aebcc003a4eeb8d5eb0366e867a37f64 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Tue, 5 Jun 2018 14:58:17 +0300 Subject: [PATCH 3/4] Leave single bcond_without for doc --- pyp2rpm/templates/fedora.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyp2rpm/templates/fedora.spec b/pyp2rpm/templates/fedora.spec index a2a324d6..abd0a2a4 100644 --- a/pyp2rpm/templates/fedora.spec +++ b/pyp2rpm/templates/fedora.spec @@ -5,11 +5,7 @@ %global srcname {{ data.srcname }} {%- endif %} {%- if data.sphinx_dir %} -%if 0%{?_without_doc} -%bcond_with doc -%else %bcond_without doc -%endif {%- endif %} Name: {{ data.pkg_name|macroed_pkg_name(data.srcname) }} From 9ac94aa9223e1a3a5815b545765ad9646c106fe6 Mon Sep 17 00:00:00 2001 From: dsilakov Date: Fri, 12 Jul 2019 10:17:25 +0300 Subject: [PATCH 4/4] Create .codenotary --- .codenotary | 1 + 1 file changed, 1 insertion(+) create mode 100644 .codenotary diff --git a/.codenotary b/.codenotary new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.codenotary @@ -0,0 +1 @@ +