generate %doc statements

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-09-10 23:40:18 +02:00
parent 0dc9fc182e
commit 561280a0ea
No known key found for this signature in database
GPG key ID: 695714BD1BBC5F4C
2 changed files with 8 additions and 0 deletions

View file

@ -140,6 +140,7 @@ class Metadata(object):
self.name = None self.name = None
self.license = None self.license = None
self.license_file = None self.license_file = None
self.readme = None
self.description = None self.description = None
self.version = None self.version = None
self._targets = [] self._targets = []
@ -156,6 +157,7 @@ class Metadata(object):
self.name = md["name"] self.name = md["name"]
self.license = md["license"] self.license = md["license"]
self.license_file = md["license_file"] self.license_file = md["license_file"]
self.readme = md["readme"]
self.description = md.get("description") self.description = md.get("description")
self.version = md["version"] self.version = md["version"]
version = "={}".format(self.version) version = "={}".format(self.version)

View file

@ -137,6 +137,9 @@ which use %{crate} from crates.io.
{% if md.license_file is not none %} {% if md.license_file is not none %}
%license {{ md.license_file }} %license {{ md.license_file }}
{% endif %} {% endif %}
{% if md.readme is not none %}
%doc {{ md.readme }}
{% endif %}
{% for bin in bins %} {% for bin in bins %}
%{_bindir}/{{ bin.name }} %{_bindir}/{{ bin.name }}
{% endfor %} {% endfor %}
@ -147,6 +150,9 @@ which use %{crate} from crates.io.
{% if md.license_file is not none %} {% if md.license_file is not none %}
%license {{ md.license_file }} %license {{ md.license_file }}
{% endif %} {% endif %}
{% if md.readme is not none %}
%doc {{ md.readme }}
{% endif %}
%{cargo_registry}/%{crate}-%{version}/ %{cargo_registry}/%{crate}-%{version}/
{% endif %} {% endif %}