From 740ec7d1036f4a22879233a698387236546fa3f9 Mon Sep 17 00:00:00 2001 From: Spencer Lingard Date: Fri, 31 Jul 2020 10:05:51 -0400 Subject: [PATCH] rpkg: Use %setup in %prep, add version to tarball By automatically generating the name of the source tarball, an rpkg macro is no longer needed for the setup macro in %prep. --- mlxbf-bfscripts.spec.rpkg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mlxbf-bfscripts.spec.rpkg b/mlxbf-bfscripts.spec.rpkg index 4429400..adfaaa0 100644 --- a/mlxbf-bfscripts.spec.rpkg +++ b/mlxbf-bfscripts.spec.rpkg @@ -14,7 +14,7 @@ BuildArch: noarch # cd bfscripts # git checkout {{{ v=$(git describe --tags); if grep -q -- '-g' <<<"$v"; then printf $(git rev-parse HEAD); else printf "$v"; fi }}} # rpkg spec --sources -Source: {{{ git_dir_pack dir_name=bfscripts source_name=mlxbf-bfscripts.tar.gz }}} +Source: {{{ name=$(rpmspec -q --qf "%{name}-%{version}\n" mlxbf-bfscripts.spec.rpkg); git_dir_pack dir_name="$name" source_name="$name".tar.gz }}} BuildRequires: systemd-rpm-macros BuildRequires: python3-devel @@ -37,8 +37,7 @@ Requires: systemd Useful scripts for managing Mellanox BlueField hardware. %prep -# Note: source generated by rpkg, see Source -{{{ git_dir_setup_macro dir_name=bfscripts }}} +%setup pathfix.py -pni "%{__python3} %{py3_shbang_opts}" mlx-mkbfb %build