diff --git a/conf2spec.py b/conf2spec.py index b34d599..415b33d 100644 --- a/conf2spec.py +++ b/conf2spec.py @@ -98,6 +98,14 @@ def generate_manual_build_requires(config): return config.get("manual_build_requires", "") +def generate_binary_files(config): + """If defined in config file, return binary_files. + If none were defined, return an empty string.""" + + return config["files"].get("binary_files", "") + + + def fill_in_template(config): """Return template rendered with data from config file.""" @@ -120,7 +128,7 @@ def fill_in_template(config): test=generate_check(config), license_files=" ".join(config["files"]["license_files"]), doc_files=" ".join(config["files"]["doc_files"]), - + binary_files=generate_binary_files(config), changelog_head=config["changelog"]["changelog_head"], changelog_msg=config["changelog"]["changelog_msg"], ) diff --git a/template.spec b/template.spec index 4c2436e..c37486e 100644 --- a/template.spec +++ b/template.spec @@ -24,11 +24,11 @@ Summary: %{summary} %prep -%autosetup -p1 -n {{module_name}}-%{version} +%autosetup -p1 -n {{name}}-%{version} %generate_buildrequires -%pyproject_buildrequires {{extra_build_requires}} +%pyproject_buildrequires{{extra_build_requires}} %build @@ -47,7 +47,8 @@ Summary: %{summary} %files -n python3-{{name}} -f %{pyproject_files} %doc {{doc_files}} %license {{license_files}} - +{% for bf in binary_files %}%{_bindir}/{{bf}} +{% endfor %} %changelog * {{changelog_head}} - {{version}}-{{release}}