From b7ba195ebf85c2b7025a7d27e0623eb87f0be89b Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Feb 08 2023 02:42:00 +0000 Subject: templates: automatically apply patches with %autopatch It's recommended to use %autosetup to setup the build directory and automatically apply patches. For Go packages, %goprep is used instead of %autosetup. %goprep calls %setup under the hood like %autosetup does, but it doesn't apply patches. Let's add %autopatch to preform the second part so Go packagers don't resort to manual %patch calls. Hopefully, this will also prevent people from accidentally using deprecated %patchN syntax[1]. [1] https://github.com/rpm-software-management/rpm/blob/master/docs/manual/spec.md#patch-1 --- diff --git a/go2rpm/templates/profile2.spec b/go2rpm/templates/profile2.spec index 35f9ddf..ca0c1cc 100644 --- a/go2rpm/templates/profile2.spec +++ b/go2rpm/templates/profile2.spec @@ -92,6 +92,7 @@ BuildRequires: golang({{ req }}) %prep %goprep +%autopatch -p1 {% if generate_buildrequires %} %generate_buildrequires