diff --git a/README.rst b/README.rst index 599664c..d105376 100644 --- a/README.rst +++ b/README.rst @@ -147,6 +147,7 @@ Variables included: * ``configure`` * ``prep_prepend`` * ``build_prepend`` + * ``make_prepend`` * ``install_prepend`` * ``install_append`` @@ -262,6 +263,14 @@ build_prepend placed in the resulting ``.spec``, and is used for situations where fine-grained control is required. +make_prepend + Additional actions that should take place directly after the + configuring step and before the ``%make`` macro or equivalent. If + autospec is creating AVX2, AVX-512 or 32-bit, these actions will be + repeated for each of those builds, before their respective make + steps. This will be placed in the resulting ``.spec``, and is used + for situations where fine-grained control is required. + install_prepend Additional actions that should take place directly after ``%install`` but before the ``%make_install`` macro (or equivalent). diff --git a/autospec/config.py b/autospec/config.py index 8541857..a3ca602 100644 --- a/autospec/config.py +++ b/autospec/config.py @@ -50,6 +50,7 @@ install_macro = "%make_install" disable_static = "--disable-static" prep_prepend = [] build_prepend = [] +make_prepend = [] install_prepend = [] install_append = [] patches = [] @@ -549,6 +550,7 @@ def parse_config_files(path, bump, filemanager, version): global disable_static global prep_prepend global build_prepend + global make_prepend global install_prepend global install_append global patches @@ -814,6 +816,7 @@ def parse_config_files(path, bump, filemanager, version): prep_prepend = read_conf_file(os.path.join(path, "prep_prepend")) if os.path.isfile(os.path.join(path, "prep_append")): os.rename(os.path.join(path, "prep_append"), os.path.join(path, "build_prepend")) + make_prepend = read_conf_file(os.path.join(path, "make_prepend")) build_prepend = read_conf_file(os.path.join(path, "build_prepend")) install_prepend = read_conf_file(os.path.join(path, "install_prepend")) if os.path.isfile(os.path.join(path, "make_install_append")): @@ -843,6 +846,7 @@ def load_specfile(specfile): specfile.disable_static = disable_static specfile.prep_prepend = prep_prepend specfile.build_prepend = build_prepend + specfile.make_prepend = make_prepend specfile.install_prepend = install_prepend specfile.install_append = install_append specfile.patches = patches diff --git a/autospec/git.py b/autospec/git.py index a8b9b25..f8dc898 100644 --- a/autospec/git.py +++ b/autospec/git.py @@ -51,6 +51,7 @@ def commit_to_git(path): call("git add %s.tmpfiles" % tarball.name, check=False, stderr=subprocess.DEVNULL, cwd=path) call("git add prep_prepend", check=False, stderr=subprocess.DEVNULL, cwd=path) call("git add build_prepend", check=False, stderr=subprocess.DEVNULL, cwd=path) + call("git add make_prepend", check=False, stderr=subprocess.DEVNULL, cwd=path) call("git add install_prepend", check=False, stderr=subprocess.DEVNULL, cwd=path) call("git add install_append", check=False, stderr=subprocess.DEVNULL, cwd=path) call("git add series", check=False, stderr=subprocess.DEVNULL, cwd=path) diff --git a/autospec/specfiles.py b/autospec/specfiles.py index dd9609d..5c0cef6 100644 --- a/autospec/specfiles.py +++ b/autospec/specfiles.py @@ -76,6 +76,7 @@ class Specfile(object): self.cmake_srcdir = ".." self.prep_prepend = [] self.build_prepend = [] + self.make_prepend = [] self.install_prepend = [] self.install_append = [] self.excludes = [] @@ -378,6 +379,11 @@ class Specfile(object): make """ + if self.make_prepend: + self._write_strip("## make_prepend content") + for line in self.make_prepend: + self._write_strip("{}\n".format(line)) + self._write_strip("## make_prepend end") if build32: self._write_strip("make {}{}{}".format(config.parallel_build, self.extra_make, self.extra32_make)) else: