From d05607a61097787b0450c4f705e7c587f21b90d6 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jul 22 2019 09:39:12 +0000 Subject: [PATCH 1/2] python: recommend %{expand:} trick to avoid duplicating description Also fix "an python". --- diff --git a/guidelines/modules/ROOT/examples/python-example.spec b/guidelines/modules/ROOT/examples/python-example.spec index 9eee928..aae8769 100644 --- a/guidelines/modules/ROOT/examples/python-example.spec +++ b/guidelines/modules/ROOT/examples/python-example.spec @@ -11,16 +11,18 @@ Source0: %{pypi_source} BuildArch: noarch -%description -An python module which provides a convenient example. +%global _description %{expand: +A python module which provides a convenient example. This is the +rest of of the description that provides more details.} + +%description %_description %package -n python3-%{srcname} Summary: %{summary} BuildRequires: python3-devel %{?python_provide:%python_provide python3-%{srcname}} -%description -n python3-%{srcname} -An python module which provides a convenient example. +%description -n python3-%{srcname} %_description %prep %autosetup -n %{srcname}-%{version} diff --git a/guidelines/modules/ROOT/pages/Python_Appendix.adoc b/guidelines/modules/ROOT/pages/Python_Appendix.adoc index 15ee40d..03cdd40 100644 --- a/guidelines/modules/ROOT/pages/Python_Appendix.adoc +++ b/guidelines/modules/ROOT/pages/Python_Appendix.adoc @@ -51,16 +51,17 @@ Source0: %pypi_source BuildArch: noarch -%description -An python module which provides a convenient example. +%global _description %{expand: +A python module which provides a convenient example.} + +%description %_description %package -n python2-%{srcname} Summary: %{summary} BuildRequires: python2-devel %{?python_provide:%python_provide python2-%{srcname}} -%description -n python2-%{srcname} -An python module which provides a convenient example. +%description -n python2-%{srcname} %_description %package -n python3-%{srcname} @@ -68,8 +69,7 @@ Summary: %{summary} BuildRequires: python3-devel %{?python_provide:%python_provide python3-%{srcname}} -%description -n python3-%{srcname} -An python module which provides a convenient example. +%description -n python3-%{srcname} %_description %prep @@ -210,10 +210,10 @@ Source0: %pypi_source BuildArch: noarch +%global _description %{expand: +A python module which provides a convenient example.} -%description -An python module which provides a convenient example. - +%description %_description %if %{with python2} %package -n python2-%{srcname} @@ -221,8 +221,7 @@ Summary: %{summary} BuildRequires: python2-devel %{?python_provide:%python_provide python2-%{srcname}} -%description -n python2-%{srcname} -An python module which provides a convenient example. +%description -n python2-%{srcname} %_description %endif @@ -231,8 +230,7 @@ Summary: %{summary} BuildRequires: python3-devel %{?python_provide:%python_provide python3-%{srcname}} -%description -n python3-%{srcname} -An python module which provides a convenient example. +%description -n python3-%{srcname} %_description %prep From 2688bb0791254d84e4de2c2f87d90876667bb6aa Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jul 22 2019 09:39:12 +0000 Subject: [PATCH 2/2] python: move BuildRequires to the top Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1727491#c5. Having BR:python3-devel in the python3 subpackage section made sense when python3 was optional. Now python packages are generally expected to have one binary package, and the python3 BRs should be at the top of the file. --- diff --git a/guidelines/modules/ROOT/examples/python-example.spec b/guidelines/modules/ROOT/examples/python-example.spec index aae8769..c1cc49d 100644 --- a/guidelines/modules/ROOT/examples/python-example.spec +++ b/guidelines/modules/ROOT/examples/python-example.spec @@ -9,6 +9,8 @@ License: MIT URL: https://pypi.python.org/pypi/example Source0: %{pypi_source} +BuildRequires: python3-devel +#BuildRequires: ... BuildArch: noarch %global _description %{expand: @@ -19,7 +21,6 @@ rest of of the description that provides more details.} %package -n python3-%{srcname} Summary: %{summary} -BuildRequires: python3-devel %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} %_description