Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codenotary
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

9 changes: 9 additions & 0 deletions pyp2rpm/templates/fedora.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
{%- if data.srcname %}
%global srcname {{ data.srcname }}
{%- endif %}
{%- if data.sphinx_dir %}
%bcond_without doc
Copy link
Member

@hroncok hroncok Jun 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just keep this line; the if/else part is not needed at all.

{%- endif %}

Name: {{ data.pkg_name|macroed_pkg_name(data.srcname) }}
Version: {{ data.version }}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down