diff --git a/.codenotary b/.codenotary new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.codenotary @@ -0,0 +1 @@ + diff --git a/pyp2rpm/templates/fedora.spec b/pyp2rpm/templates/fedora.spec index bfd7832c..abd0a2a4 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 %} +%bcond_without doc +{%- 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 %{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 %{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 %{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