From 5d07c9f56539eedbdd5e0a7757c6a7c2f0c36977 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Mon, 15 Oct 2018 14:53:23 -0400 Subject: [PATCH] spec: Add indentation of conditionals So, this is a hack to somewhat help legibility. RPM allows leading spaces of `%directives` but not of e.g. `BuildRequires` and `ExclusiveArch`, so this looks a bit more awkward than it should. But overall I think it still helps with making sense of all the nested conditionals. --- rpm-ostree.spec | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/rpm-ostree.spec b/rpm-ostree.spec index b6058f4..6d57c02 100644 --- a/rpm-ostree.spec +++ b/rpm-ostree.spec @@ -2,13 +2,13 @@ # Note the Rust sources are in the tarball using cargo-vendor. # For RHEL > 7 we need the toolset. %if 0%{?fedora} >= 28 || 0%{?rhel} > 7 -%bcond_without rust -%if 0%{?rhel} > 7 -%define rusttoolset_version rust-toolset-1.26 -%define rusttoolset scl enable %{rusttoolset_version} -- -%endif + %bcond_without rust + %if 0%{?rhel} > 7 + %define rusttoolset_version rust-toolset-1.26 + %define rusttoolset scl enable %{rusttoolset_version} -- + %endif %else -%bcond_with rust + %bcond_with rust %endif Summary: Hybrid image/package system @@ -23,22 +23,23 @@ License: LGPLv2+ URL: https://github.com/projectatomic/rpm-ostree %if %{with rust} -%if !%{defined rust_arches} -# It's not defined yet in the base CentOS7 root -%define rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x -%endif # defined rust_arches + %if !%{defined rust_arches} + # It's not defined yet in the base CentOS7 root + %define rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x + %endif # defined rust_arches ExclusiveArch: %{rust_arches} -%if %{defined rusttoolset_version} + %if %{defined rusttoolset_version} BuildRequires: %{rusttoolset_version}-cargo -%else -# This one is only in Fedora, we're not actually using it right now -# but we may in the future. -%if 0%{?fedora} >= 28 + %else + # This one is only in Fedora, we're not actually using it right now + # but we may in the future. + %if 0%{?fedora} >= 28 BuildRequires: rust-packaging -%endif + %endif BuildRequires: cargo -%endif # defined rusttoolset_version + %endif # defined rusttoolset_version %endif # with_rust + # For the autofiles bits below BuildRequires: /usr/bin/python3 # We always run autogen.sh