Hello community,

here is the log from the commit of package rust-packaging for openSUSE:Factory 
checked in at 2019-08-30 14:41:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rust-packaging (Old)
 and      /work/SRC/openSUSE:Factory/.rust-packaging.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rust-packaging"

Fri Aug 30 14:41:40 2019 rev:5 rq:727052 version:10

Changes:
--------
--- /work/SRC/openSUSE:Factory/rust-packaging/rust-packaging.changes    
2019-05-21 10:37:15.715208767 +0200
+++ /work/SRC/openSUSE:Factory/.rust-packaging.new.7948/rust-packaging.changes  
2019-08-30 14:41:41.957419143 +0200
@@ -1,0 +2,11 @@
+Thu Aug 29 10:13:27 UTC 2019 - Thomas Bechtold <[email protected]>
+
+- update to version 10
+  * Translate '-or-later' and '+' license suffixes properly
+  * Check /usr/lib/os-release in addition to /etc/os-release
+  * Prettify summary and description automatically
+  * Use %{expand:…} for %description to avoid escaping of newlines
+  * Add '--suffix' option for "compat" packages
+  * Implement option to skip building of crates (aka fast/bootstrap build)
+
+-------------------------------------------------------------------
--- /work/SRC/openSUSE:Factory/rust-packaging/rust-srpm-macros.changes  
2019-05-21 10:37:15.815208702 +0200
+++ 
/work/SRC/openSUSE:Factory/.rust-packaging.new.7948/rust-srpm-macros.changes    
    2019-08-30 14:41:42.105419128 +0200
@@ -1,0 +2,11 @@
+Thu Aug 29 10:14:50 UTC 2019 - Thomas Bechtold <[email protected]>
+
+- update to version 10
+  * Translate '-or-later' and '+' license suffixes properly
+  * Check /usr/lib/os-release in addition to /etc/os-release
+  * Prettify summary and description automatically
+  * Use %{expand:…} for %description to avoid escaping of newlines
+  * Add '--suffix' option for "compat" packages
+  * Implement option to skip building of crates (aka fast/bootstrap build)
+
+-------------------------------------------------------------------

Old:
----
  rust2rpm-9.tar.xz

New:
----
  rust2rpm-10.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rust-packaging.spec ++++++
--- /var/tmp/diff_new_pack.edZqPj/_old  2019-08-30 14:41:43.121419024 +0200
+++ /var/tmp/diff_new_pack.edZqPj/_new  2019-08-30 14:41:43.125419023 +0200
@@ -1,6 +1,7 @@
 #
 # spec file for package rust-packaging
 #
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 # Copyright (c) 2017 Red Hat, Inc., Raleigh, North Carolina, United States of 
America.
 # Copyright (c) 2017, 2019 Igor Gnatenko <[email protected]>.
 # Copyright (c) 2019 Neal Gompa <[email protected]>.
@@ -14,17 +15,18 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %bcond_without check
 
 Name:           rust-packaging
-Version:        9
+Version:        10
 Release:        0
 Summary:        RPM macros for building Rust packages on various architectures
-Group:          Development/Languages/Rust
 License:        MIT
+Group:          Development/Languages/Rust
 URL:            https://pagure.io/fedora-rust/rust2rpm
 Source0:        
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
 # PATCH-FIX-OPENSUSE 0001-macros-Remove-Cargo.toml.orig.patch -- Remove 
Cargo.toml.orig
@@ -34,11 +36,11 @@
 ExclusiveArch:  %{rust_arches} noarch
 
 # gawk is needed for stripping dev-deps in macro, 4.1.0 is needed for inplace 
feature
+Requires:       cargo
 Requires:       gawk >= 4.1.0
 Requires:       python3-rust2rpm = %{version}-%{release}
-Requires:       rust-srpm-macros = %{version}
 Requires:       rust
-Requires:       cargo
+Requires:       rust-srpm-macros = %{version}
 
 %description
 The package provides macros for building projects in Rust
@@ -50,15 +52,15 @@
 BuildRequires:  python3-devel
 BuildRequires:  python3-setuptools
 %if %{with check}
-BuildRequires:  python3-pytest
 BuildRequires:  cargo
+BuildRequires:  python3-pytest
 BuildRequires:  python3-semantic_version
 %endif
 Requires:       cargo
-Requires:       python3-semantic_version
-Requires:       python3-setuptools
 Requires:       python3-Jinja2
 Requires:       python3-requests
+Requires:       python3-semantic_version
+Requires:       python3-setuptools
 Requires:       python3-tqdm
 Provides:       rust2rpm = %{version}-%{release}
 %{?python_provide:%python_provide python3-rust2rpm}
@@ -74,7 +76,6 @@
 sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=C.UTF-8 \1|" 
data/cargo.attr data/macros.cargo
 sed -i -e '/# Generated by/s/$/-%{version}-%{release}/' 
rust2rpm/templates/main.spec
 
-
 %build
 %py3_build
 

++++++ rust-srpm-macros.spec ++++++
--- /var/tmp/diff_new_pack.edZqPj/_old  2019-08-30 14:41:43.145419021 +0200
+++ /var/tmp/diff_new_pack.edZqPj/_new  2019-08-30 14:41:43.149419021 +0200
@@ -1,6 +1,7 @@
 #
 # spec file for package rust-srpm-macros
 #
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 # Copyright (c) 2017 Red Hat, Inc., Raleigh, North Carolina, United States of 
America.
 # Copyright (c) 2017, 2019 Igor Gnatenko <[email protected]>.
 # Copyright (c) 2019 Neal Gompa <[email protected]>.
@@ -14,15 +15,16 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 Name:           rust-srpm-macros
-Version:        9
+Version:        10
 Release:        0
 Summary:        RPM macros for building Rust source packages
-Group:          Development/Languages/Rust
 License:        MIT
+Group:          Development/Languages/Rust
 URL:            https://pagure.io/fedora-rust/rust2rpm
 Source0:        
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
 

++++++ rust2rpm-9.tar.xz -> rust2rpm-10.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/data/macros.cargo 
new/rust2rpm-10/data/macros.cargo
--- old/rust2rpm-9/data/macros.cargo    2019-05-05 09:11:32.000000000 +0200
+++ new/rust2rpm-10/data/macros.cargo   2019-06-16 17:14:52.000000000 +0200
@@ -49,27 +49,35 @@
 }
 
 %cargo_generate_buildrequires(af:) \
-%{__cargo_inspector} -BR %{__cargo_parse_opts %{-a} %{-f:-f%{-f*}}} Cargo.toml 
\
-%if %{with check} \
-%{__cargo_inspector} -TR Cargo.toml \
+%if ! 0%{?__cargo_skip_build} \
+  %{__cargo_inspector} -BR %{__cargo_parse_opts %{-a} %{-f:-f%{-f*}}} 
Cargo.toml \
+  %if %{with check} \
+    %{__cargo_inspector} -TR Cargo.toml \
+  %endif \
 %endif
 
-%cargo_build(naf:) %{shrink:\
-%{__cargo} build                                   \
-  %{__cargo_common_opts}                           \
-  --release                                        \
-  %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
-  %*                                               \
-}
+%cargo_build(naf:) \
+%if ! 0%{?__cargo_skip_build} \
+  %{shrink:\
+    %{__cargo} build                                   \
+      %{__cargo_common_opts}                           \
+      --release                                        \
+      %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
+      %*                                               \
+  } \
+%endif
 
-%cargo_test(naf:) %{shrink:\
-%{__cargo} test                                    \
-  %{__cargo_common_opts}                           \
-  --release                                        \
-  --no-fail-fast                                   \
-  %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
-  %*                                               \
-}
+%cargo_test(naf:) \
+%if ! 0%{?__cargo_skip_build} \
+  %{shrink:\
+    %{__cargo} test                                    \
+      %{__cargo_common_opts}                           \
+      --release                                        \
+      --no-fail-fast                                   \
+      %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
+      %*                                               \
+  } \
+%endif
 
 %cargo_install(t:naf:) (\
 set -eu                                                             \
@@ -88,15 +96,18 @@
   %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps}                        \
   echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json  \
 fi \
-if %__cargo_is_bin; then                                            \
-  %{shrink:%{__cargo} install                                       \
-    %{__cargo_common_opts}                                          \
-    --path .                                                        \
-    %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}                \
-    %*                                                              \
-  }\
-  %{__rm} %{buildroot}%{_prefix}/.crates.toml                       \
-fi \
+%if ! %__cargo_skip_build \
+  if %__cargo_is_bin; then                                          \
+    %{shrink:\
+      %{__cargo} install                                            \
+        %{__cargo_common_opts}                                      \
+        --path .                                                    \
+        %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}}            \
+        %*                                                          \
+    } \
+    %{__rm} %{buildroot}%{_prefix}/.crates.toml                     \
+  fi \
+%endif \
 )
 
 %__cargo_feature_from_name(n:) %{lua:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/data/macros.rust-srpm 
new/rust2rpm-10/data/macros.rust-srpm
--- old/rust2rpm-9/data/macros.rust-srpm        2019-05-05 09:11:32.000000000 
+0200
+++ new/rust2rpm-10/data/macros.rust-srpm       2019-06-16 17:14:52.000000000 
+0200
@@ -37,3 +37,19 @@
 \
     print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. 
version .. '.crate')
 }
+
+# If crate not in _build_crates and _module_build is set, we should skip the 
build
+%__cargo_skip_build %{lua:
+local crate = rpm.expand('%{crate}')
+local build_crate = false
+for w in rpm.expand('%{?_build_crates}'):gmatch('%S+') do
+  if w == crate then
+    build_crate = true
+    break
+  end
+end
+if (rpm.expand('%{defined _module_build}') ~= '0' and not build_crate) then
+  print(1)
+else
+  print(0)
+end}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/rust2rpm/__init__.py 
new/rust2rpm-10/rust2rpm/__init__.py
--- old/rust2rpm-9/rust2rpm/__init__.py 2019-05-05 09:11:32.000000000 +0200
+++ new/rust2rpm-10/rust2rpm/__init__.py        2019-06-16 17:14:52.000000000 
+0200
@@ -1,2 +1,4 @@
 from .metadata import *
 from . import licensing
+
+__version__ = '10'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/rust2rpm/__main__.py 
new/rust2rpm-10/rust2rpm/__main__.py
--- old/rust2rpm-9/rust2rpm/__main__.py 2019-05-05 09:11:32.000000000 +0200
+++ new/rust2rpm-10/rust2rpm/__main__.py        2019-06-16 17:14:52.000000000 
+0200
@@ -17,7 +17,7 @@
 import requests
 import tqdm
 
-from . import Metadata, licensing
+from . import Metadata, licensing, __version__
 from .metadata import normalize_deps
 
 DEFAULT_EDITOR = "vi"
@@ -34,8 +34,11 @@
     lstrip_blocks=True)
 
 def get_default_target():
-    # TODO: add fallback for /usr/lib/os-release
-    with open("/etc/os-release") as os_release_file:
+    try:
+        os_release_file = open('/etc/os-release')
+    except FileNotFoundError:
+        os_release_file = open('/usr/lib/os-release')
+    with os_release_file:
         conf = configparser.ConfigParser()
         conf.read_file(itertools.chain(["[os-release]"], os_release_file))
         os_release = conf["os-release"]
@@ -219,6 +222,8 @@
                                      
formatter_class=argparse.RawTextHelpFormatter)
     parser.add_argument("--show-license-map", action="store_true",
                         help="Print license mappings and exit")
+    parser.add_argument("--translate-license", action="store_true",
+                        help="Print mapping for specified license and exit")
     parser.add_argument("--no-auto-changelog-entry", action="store_true",
                         help="Do not generate a changelog entry")
     parser.add_argument("-", "--stdout", action="store_true",
@@ -234,6 +239,8 @@
                         help="Activate all available features")
     parser.add_argument("--dynamic-buildrequires", action="store_true",
                         help="Use dynamic BuildRequires feature")
+    parser.add_argument("--suffix", action="store",
+                        help="Package suffix")
     parser.add_argument("crate", help="crates.io name\n"
                                       "path/to/local.crate\n"
                                       "path/to/project/",
@@ -245,6 +252,13 @@
         licensing.dump_sdpx_to_fedora_map(sys.stdout)
         return
 
+    if args.translate_license:
+        license, comments = licensing.translate_license(args.target, 
args.crate)
+        if comments:
+            print(comments)
+        print(license)
+        return
+
     if args.crate is None:
         parser.error("required crate/path argument missing")
 
@@ -262,6 +276,7 @@
         patch_file = None
 
     kwargs = {}
+    kwargs["generator_version"] = __version__
     kwargs["crate"] = crate
     kwargs["target"] = args.target
     kwargs["all_features"] = args.all_features
@@ -326,7 +341,15 @@
 
     kwargs["distconf"] = conf[args.target]
 
-    spec_file = f"rust-{metadata.name}.spec"
+    if args.suffix is not None:
+        if metadata.name[-1].isdigit():
+            suffix = f'-{args.suffix}'
+        else:
+            suffix = args.suffix
+    else:
+        suffix = ""
+    kwargs["pkg_suffix"] = suffix
+    spec_file = f"rust-{metadata.name}{suffix}.spec"
     spec_contents = template.render(md=metadata, patch_file=patch_file, 
**kwargs)
     if args.stdout:
         print(f"# {spec_file}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/rust2rpm/licensing.py 
new/rust2rpm-10/rust2rpm/licensing.py
--- old/rust2rpm-9/rust2rpm/licensing.py        2019-05-05 09:11:32.000000000 
+0200
+++ new/rust2rpm-10/rust2rpm/licensing.py       2019-06-16 17:14:52.000000000 
+0200
@@ -35,18 +35,24 @@
         elif tag.upper() == 'AND':
             final.append('and')
         else:
-            mapped = spdx_to_fedora_map().get(tag, None)
+            if tag.endswith('+'):
+                key = tag[:-1] + '-or-later'
+                fulltag = f'{tag} ({key})'
+            else:
+                key = fulltag = tag
+
+            mapped = spdx_to_fedora_map().get(key, None)
             if mapped is None:
-                comments += f'# FIXME: Upstream uses unknown SPDX tag {tag}!'
+                comments += f'# FIXME: Upstream uses unknown SPDX tag 
{fulltag}!'
                 final.append(tag)
             elif mapped == '':
-                comments += f"# FIXME: Upstream SPDX tag {tag} not listed in 
Fedora's good licenses list.\n"
+                comments += f"# FIXME: Upstream SPDX tag {fulltag} not listed 
in Fedora's good licenses list.\n"
                 comments += "# FIXME: This package might not be allowed in 
Fedora!\n"
                 final.append(tag)
             else:
                 final.append(mapped)
                 if mapped != tag:
-                    print(f'Upstream license tag {tag} translated to {mapped}',
+                    print(f'Upstream license tag {fulltag} translated to 
{mapped}',
                           file=_sys.stderr)
     return (' '.join(final), comments or None)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/rust2rpm/metadata.py 
new/rust2rpm-10/rust2rpm/metadata.py
--- old/rust2rpm-9/rust2rpm/metadata.py 2019-05-05 09:11:32.000000000 +0200
+++ new/rust2rpm-10/rust2rpm/metadata.py        2019-06-16 17:14:52.000000000 
+0200
@@ -3,6 +3,7 @@
 import collections
 import copy
 import json
+import re
 import subprocess
 
 import semantic_version as semver
@@ -116,11 +117,44 @@
         self.license = None
         self.license_file = None
         self.readme = None
-        self.description = None
+        self._description = None
+        self._summary = None
         self.targets = set()
         self.dependencies = {}
         self.dev_dependencies = set()
 
+    @property
+    def description(self):
+        return self._description
+
+    @property
+    def summary(self):
+        return self._summary
+
+    @description.setter
+    def description(self, description):
+        # https://salsa.debian.org/rust-team/debcargo/blob/master/src/crates.rs
+        # get_summary_description()
+        if description is None:
+            self._description = self._summary = None
+            return
+        description = description.replace('\n\n', '\r').replace('\n', ' 
').replace('\r', '\n').strip()
+        description = 
re.sub(rf'^(?:{self.name}|This(?:\s+\w+)?)(?:\s*,|\s+is|\s+provides)\s+', '', 
description, flags=re.I)
+        description = re.sub(r'^(?:a|an|the)\s+', '', description, flags=re.I)
+        description = f'{description[0].upper()}{description[1:]}'
+        if description[-1] != '.':
+            description = f'{description}.'
+
+        p1 = description.find('.')
+        p2 = description.find('\n')
+        if p2 != -1:
+            p = min(p1, p2)
+        else:
+            p = p1
+
+        self._description = description
+        self._summary = description[:p]
+
     @classmethod
     def from_json(cls, metadata):
         md = metadata
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/rust2rpm/spdx_to_fedora.csv 
new/rust2rpm-10/rust2rpm/spdx_to_fedora.csv
--- old/rust2rpm-9/rust2rpm/spdx_to_fedora.csv  2019-05-05 09:11:32.000000000 
+0200
+++ new/rust2rpm-10/rust2rpm/spdx_to_fedora.csv 2019-06-16 17:14:52.000000000 
+0200
@@ -138,18 +138,16 @@
 GL2PS License,GL2PS,GL2PS,,,
 Glulxe License,Glulxe,Glulxe,,,
 GNU Affero General Public License v3.0,AGPL-3.0,AGPLv3,Affero General Public 
License 3.0,,
+GNU Affero General Public License v3.0 or 
later,AGPL-3.0-or-later,AGPLv3+,Affero General Public License 3.0 or later,,
 GNU Free Documentation License v1.1,GFDL-1.1,,,This specific version not on 
Fedora list,
 GNU Free Documentation License v1.2,GFDL-1.2,,,This specific version not on 
Fedora list,
 GNU Free Documentation License v1.3,GFDL-1.3,GFDL,,,
-GNU General Public License v1.0 only,GPL-1.0,GPLv1,,"For “or later” add + to 
SPDX or Fedora short identifier: 
-SPDX: GPL-1.0+ 
-Fedora: GPLv1+ or GPL+",
-GNU General Public License v2.0 only,GPL-2.0,GPLv2,,"For “or later” add + to 
SPDX or Fedora short identifier: 
-SPDX: GPL-2.0+ 
-Fedora: GPLv2+",
-GNU General Public License v3.0 only,GPL-3.0,GPLv3,,"For “or later” add + to 
SPDX or Fedora short identifier: 
-SPDX: GPL-3.0+ 
-Fedora: GPLv3+",
+GNU General Public License v1.0 only,GPL-1.0,GPLv1,,,
+GNU General Public License v1.0 or later,GPL-1.0-or-later,GPLv1+,,,
+GNU General Public License v2.0 only,GPL-2.0,GPLv2,,,
+GNU General Public License v2.0 or later,GPL-2.0-or-later,GPLv2+,,,
+GNU General Public License v3.0 only,GPL-3.0,GPLv3,,,
+GNU General Public License v3.0 or later,GPL-3.0-or-later,GPLv3+,,,
 GNU Lesser General Public License v2.1 only,LGPL-2.1,LGPLv2,,,
 GNU Lesser General Public License v3.0 only,LGPL-3.0,LGPLv3,,,
 GNU Library General Public License v2 only,LGPL-2.0,LGPLv2,,,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/rust2rpm/templates/main.spec 
new/rust2rpm-10/rust2rpm/templates/main.spec
--- old/rust2rpm-9/rust2rpm/templates/main.spec 2019-05-05 09:11:32.000000000 
+0200
+++ new/rust2rpm-10/rust2rpm/templates/main.spec        2019-06-16 
17:14:52.000000000 +0200
@@ -1,8 +1,12 @@
 {% include target ~ "-header.spec.inc" ignore missing %}
-# Generated by rust2rpm
+# Generated by rust2rpm {{ generator_version }}
 %bcond_without check
+{% set only_main = False %}
 {% if not include_main %}
 %global debug_package %{nil}
+{% elif not include_devel %}
+  {% set only_main = True %}
+%global __cargo_skip_build 0
 {% endif %}
 
 %global crate {{ md.name }}
@@ -10,14 +14,13 @@
 %global real_crate {{ crate }}
 {% endif %}
 
-Name:           rust-%{crate}
+Name:           rust-%{crate}{{ pkg_suffix }}
 Version:        {{ md.version }}
 Release:        {{ pkg_release }}
 {% if md.description is none %}
 Summary:        # FIXME
 {% else %}
-{% set description_lines = md.description.split("\n") %}
-Summary:        {{ description_lines|join(" ")|trim }}
+Summary:        {{ md.summary }}
 {% endif %}
 {% if rust_group is defined %}
 Group:          {{ rust_group }}
@@ -40,41 +43,57 @@
 {% endif %}
 
 ExclusiveArch:  %{rust_arches}
+{% if not only_main %}
+%if %{__cargo_skip_build}
+BuildArch:      noarch
+%endif
+{% endif %}
 
 BuildRequires:  rust-packaging
 {% if not generate_buildrequires %}
-{% if not all_features %}
-{% set buildrequires = normalize_deps(md.requires("default", 
resolve=True))|sort %}
-{% else %}
-{% set buildrequires = normalize_deps(md.all_dependencies)|sort %}
-{% set cargo_args = " -a" %}
-{% endif %}
-{% for req in buildrequires %}
+  {% if not all_features %}
+    {% set buildrequires = normalize_deps(md.requires("default", 
resolve=True))|sort %}
+  {% else %}
+    {% set buildrequires = normalize_deps(md.all_dependencies)|sort %}
+    {% set cargo_args = " -a" %}
+  {% endif %}
+  {% set testrequires = normalize_deps(md.dev_dependencies)|sort %}
+  {% set has_buildrequires = (buildrequires + testrequires)|length > 0 %}
+  {% if has_buildrequires and not only_main %}
+%if ! %{__cargo_skip_build}
+  {% endif %}
+  {% for req in buildrequires %}
 BuildRequires:  {{ req }}
-{% endfor %}
-{% set testrequires = normalize_deps(md.dev_dependencies)|sort %}
-{% if testrequires|length > 0 %}
+  {% endfor %}
+  {% if testrequires|length > 0 %}
 %if %{with check}
-  {% for req in testrequires %}
+    {% for req in testrequires %}
 BuildRequires:  {{ req }}
-  {% endfor %}
+    {% endfor %}
 %endif
-{% endif %}
-{% for req in to_list(distconf.get("buildrequires"))|sort %}
+  {% endif %}
+  {% for req in to_list(distconf.get("buildrequires"))|sort %}
 BuildRequires:  {{ req }}
-{% endfor %}
+  {% endfor %}
+  {% if has_buildrequires and not only_main %}
+%endif
+  {% endif %}
 {% endif %}
 
-%global _description \
+%global _description %{expand:
 {% if md.description is none %}
 %{summary}.
-{% else %}
-{{ md.description|wordwrap(wrapstring="\\\n")|trim }}
-{% endif %}
+{%- else %}
+{{ md.description|wordwrap }}
+{%- endif %}
+}
 
 %description %{_description}
 
 {% if include_main %}
+  {% if not only_main %}
+%if ! %{__cargo_skip_build}
+  {% endif %}
 %package     -n %{crate}
 Summary:        %{summary}
   {% if rust_group is defined %}
@@ -96,6 +115,9 @@
   {% for bin in bins %}
 %{_bindir}/{{ bin.name }}
   {% endfor %}
+  {% if not only_main %}
+%endif
+  {% endif %}
 
 {% endif -%}
 
@@ -183,6 +205,7 @@
 %endif
 
 %changelog
-{% if auto_changelog_entry %}
+{%- if auto_changelog_entry %}
+
   {% include target ~ "-changelog.spec.inc" %}
 {% endif %}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rust2rpm-9/setup.py new/rust2rpm-10/setup.py
--- old/rust2rpm-9/setup.py     2019-05-05 09:11:32.000000000 +0200
+++ new/rust2rpm-10/setup.py    2019-06-16 17:14:52.000000000 +0200
@@ -1,8 +1,17 @@
 from setuptools import setup
 
+def read_version(path):
+    with open(path, 'rt') as f:
+        for line in f:
+            if line.startswith('__version__'):
+                return line.split("'")[1]
+        raise IOError
+
+version = read_version('rust2rpm/__init__.py')
+
 ARGS = dict(
     name="rust2rpm",
-    version="9",
+    version=version,
     description="Convert Rust crates to RPM",
     license="MIT",
     keywords="rust cargo rpm",
@@ -35,13 +44,14 @@
     author_email="[email protected]",
     url="https://pagure.io/fedora-rust/rust2rpm";,
     classifiers=[
-        "Development Status :: 3 - Alpha",
+        "Development Status :: 4 - Beta",
         "Intended Audience :: Developers",
         "License :: OSI Approved :: MIT License",
         "Operating System :: POSIX :: Linux",
         "Programming Language :: Python :: 3 :: Only",
         "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
         "Topic :: Software Development :: Build Tools",
         "Topic :: System :: Software Distribution",
         "Topic :: Utilities",


Reply via email to