diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 100644
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1,164 @@
+# Revision history for cabal2spec
+
+## 2.9.0 (2026-11-18)
+
+- Generated spec files now wrap every reference to profiling packages in
+  `%if %{with ghc_prof}`: the `-prof` build dependencies, including those
+  of the test suite; the `-prof` sub-package; and its `%files` section.
+  Packages now build even when profiling is disabled.
+- Emit `%bcond_with ghc_prof`, so that profiling can be enabled with
+  `--with ghc_prof`. Without this declaration, the option had no effect.
+- Generated spec files require `ghc-rpm-macros >= 2.9.2`.
+- Stop excluding dependencies on `ghc-bignum`. Since GHC 9.14, `base` no
+  longer depends on it, so `ghc-base-devel` doesn't pull it in any more,
+  and packages that use it need an explicit `ghc-ghc-bignum` dependency.
+- Always generate `%autosetup -p1`, so that adding a patch only requires
+  declaring it.
+- Escape every `%` in `Summary:` and `%description` as `%%`, so that rpm
+  shows the text literally instead of trying to expand macros.
+- Mark license files that appear among the documentation files with
+  `%license` instead of `%doc`.
+- Use `LicenseRef-SUSE-Public-Domain` for public domain packages.
+- Match the output of the current `spec-cleaner` more closely:
+  * Use the new SUSE copyright header ("SUSE LLC and contributors").
+  * Refer to `%pkg_name` without braces in `Name:`, `pkgver`,
+    `%ghc_fix_rpath`, and the `-doc` and `-prof` sub-package definitions.
+  * Define `pkgver` after the `Release:` tag.
+  * Emit `ExcludeArch:` after the unconditional build dependencies.
+  * Sort the `-prof` build dependencies and the `Requires:` of the
+    `-devel` package.
+  * List `Requires:` before `BuildArch:` in the `-doc` sub-package.
+  * Collapse consecutive blank lines in descriptions.
+
+## 2.8.2 (2026-11-15)
+
+- Revert the `%{with ghc_prof}` guards that were accidentally added in 2.8.1.
+  This change requires a major version bump and should not have landed in 2.8.x.
+
+## 2.8.1 (2026-11-15): DEPRECATED on hackage.haskell.org
+
+- Support Cabal 3.16.x and 3.18.x.
+- Wrap all references to profiling packages in `%if %{with ghc_prof}`.
+
+## 2.8.0 (2025-07-23)
+
+- Support Cabal 3.12 and later, which uses the new `SymbolicPath` type.
+
+## 2.7.1 (2024-03-26)
+
+- Support GHC 9.8.x.
+
+## 2.7.0 (2023-03-30)
+
+- Adapt the generated spec files to the new `ghc-rpm-macros` for GHC 9.4.x:
+  libraries get separate `-doc` and `-prof` sub-packages, and the
+  build dependencies list both `-devel` and `-prof` packages.
+- Name the `-doc` and `-prof` sub-packages explicitly
+  (`ghc-%{pkg_name}-doc`, `ghc-%{pkg_name}-prof`). This fixes packages
+  whose primary package is an executable that also provides a library.
+- Don't generate `-doc` and `-prof` sub-packages for packages that have
+  no library.
+- List the package's actual license files in the `-doc` sub-package
+  instead of a hard-coded `LICENSE`.
+- Exclude `ghc-bignum` (not `bignum`) from the dependencies, because it
+  ships with the compiler.
+- Build Haddock documentation for packages with internal sub-libraries,
+  and stop emitting the unused `has_internal_sub_libraries` define.
+
+## 2.6.4 (2023-02-02)
+
+- Build with Cabal 3.6 and 3.8.
+
+## 2.6.3 (2022-02-04)
+
+- Add `ExcludeArch: %{ix86}`, because Haskell packages are not built
+  for 32-bit x86 any more.
+- Use `https` for the openSUSE Bugzilla URL in the spec file header.
+- Build with Cabal 3.4 and 3.6.
+
+## 2.6.2 (2020-08-18)
+
+- Use `%autosetup` in the `%prep` phase.
+
+## 2.6.1 (2020-06-09)
+
+- Change the copyright holder in the spec file header to "SUSE LLC".
+- Map the `pq` system library to `postgresql-server-devel`.
+
+## 2.6 (2020-04-01)
+
+- Support Cabal 3.2.x.
+
+## 2.5 (2020-01-28)
+
+- Require `base >= 4.8`. (This release fixes the version number of 2.4.2,
+  which should have been a major bump.)
+
+## 2.4.2 (2020-01-26)
+
+- New `--copyright-year` flag to set the year in the spec file header.
+  `createSpecFile` and `cabal2spec` take an extra argument for it.
+
+## 2.4.1 (2020-01-10)
+
+- Support GHC 8.10.x and Cabal 3.1.x.
+
+## 2.4 (2019-10-24)
+
+- Stop emitting `Group:` tags, because openSUSE no longer supports them.
+
+## 2.3 (2019-09-06)
+
+- Require Cabal 3.0.x.
+
+## 2.2.2.1 (2019-01-16)
+
+- No user-visible changes.
+
+## 2.2.2 (2018-09-23)
+
+- Ignore test suites that aren't buildable when collecting test
+  dependencies.
+
+## 2.2.1 (2018-07-19)
+
+- Fix the command-line tool, which ignored the `--compiler` and
+  `--platform` flags.
+
+## 2.2.0 (2018-07-17)
+
+- New `--enable-tests` flag to run the test suite by default
+  (`%bcond_without tests`).
+
+## 2.1.1 (2018-05-23)
+
+- Replace `[` and `]` in `%files` entries with `?` so that rpm doesn't
+  read them as glob character classes (e.g. pandoc's
+  `[Content_Types].xml`).
+- Add system library mappings for `odbc` and `snappy`.
+- Match the output of `spec-cleaner` more closely.
+
+## 2.1 (2018-04-18)
+
+- Support internal sub-libraries.
+- Use SPDX license identifiers.
+- Mark license files with `%license`.
+- Don't run Haddock for libraries that expose no modules.
+- Match the output of `spec-cleaner` more closely.
+
+## 2.0.2 (2018-03-12)
+
+- Require Cabal 2.2.x.
+- Fix the command-line handling of Cabal flags (`--flag`).
+- Only consider buildable components when collecting dependencies.
+- Add a system library mapping for `gsl`.
+
+## 2.0.1 (2018-03-05)
+
+- Sort all `%files` lists alphabetically.
+- Add a system library mapping for `re2`.
+
+## 2.0.0 (2018-01-25)
+
+- First release as a standalone package, with a command-line tool and a
+  library.
diff --git a/cabal2spec.cabal b/cabal2spec.cabal
--- a/cabal2spec.cabal
+++ b/cabal2spec.cabal
@@ -1,5 +1,5 @@
 name:               cabal2spec
-version:            2.8.2
+version:            2.9.0
 synopsis:           Convert Cabal files into rpm spec files
 description:        Convert
                     Cabal files into a
@@ -18,7 +18,8 @@
 category:           Distribution
 homepage:           https://github.com/peti/cabal2spec
 build-type:         Simple
-extra-source-files: README.md
+extra-source-files: ChangeLog.md
+                    README.md
                     test/golden-test-cases/*.cabal
                     test/golden-test-cases/*.spec.golden
 cabal-version:      >= 1.10
diff --git a/src/Cabal2Spec.hs b/src/Cabal2Spec.hs
--- a/src/Cabal2Spec.hs
+++ b/src/Cabal2Spec.hs
@@ -4,7 +4,7 @@
 
 import Control.Monad
 import Data.Char
-import Data.List ( delete, nub, sort, (\\), inits, intersect, isPrefixOf, groupBy )
+import Data.List ( delete, nub, partition, sort, (\\), inits, intersect, isPrefixOf, groupBy )
 import Data.Time.Clock
 import Data.Time.Format
 import Distribution.Compiler
@@ -71,8 +71,9 @@
 
 createSpecFile :: FilePath -> PackageDescription -> ForceBinary -> RunTests -> FlagAssignment -> Maybe CopyrightYear -> IO ()
 createSpecFile specFile pkgDesc forceBinary runTests flagAssignment copyrightYear = do
-  let deps :: [String]
-      deps = map showDevelDep deps' ++ map showProfDep deps'
+  let develDeps, profDeps :: [String]
+      develDeps = map showDevelDep deps'
+      profDeps = sort $ map showProfDep deps'
       deps' :: [String]
       selfdep :: Bool
       (deps', selfdep) = buildDependencies pkgDesc name
@@ -109,9 +110,7 @@
       padding hdr = replicate (14 - length hdr) ' ' ++ " "
       putNewline = hPutStrLn h ""
       put = hPutStrLn h
-      putDef v s = put $ unlines [ "%global" +-+ v +-+ s
-                                 , "%global pkgver %{pkg_name}-%{version}"
-                                 ]
+      putDef v s = put $ "%global" +-+ v +-+ s
       ghcPkg = if binlib then "-n ghc-%{name}" else ""
       ghcPkgDevel = if binlib then "-n ghc-%{name}-devel" else "devel"
 
@@ -122,7 +121,7 @@
     put "#"
     put $ "# spec file for package " ++ pkgname
     put "#"
-    put $ "# Copyright (c) " ++ year ++ " SUSE LLC"
+    put $ "# Copyright (c) " ++ year ++ " SUSE LLC and contributors"
     put "#"
     put "# All modifications and additions to the file contributed by third parties"
     put "# remain the property of their copyright owners, unless otherwise agreed"
@@ -154,6 +153,9 @@
   when hasLib $
     putDef "pkg_name" name
 
+  -- Declare the conditional so that "--with ghc_prof" can enable profiling.
+  -- Without this declaration, that option has no effect on %{with ghc_prof}.
+  put "%bcond_with ghc_prof"
   unless (null testsuiteDeps) $
     if runTests
        then put "%bcond_without tests"
@@ -161,31 +163,42 @@
 
   let version = packageVersion pkg
       revision = show $ maybe (0::Int) read (lookup "x-revision" (customFieldsPD pkgDesc))
-  putHdr "Name" (if binlib then "%{pkg_name}" else basename)
+  putHdr "Name" (if binlib then "%pkg_name" else basename)
   putHdr "Version" (display version)
   putHdr "Release" "0"
-  putHdr "Summary" summary
+  when hasLib $
+    putDef "pkgver" "%pkg_name-%{version}"
+  putHdr "Summary" (escapeMacros summary)
   putHdr "License" $ either (show . pretty) showLicense (licenseRaw pkgDesc)
   putHdr "URL" $ "https://hackage.haskell.org/package/" ++ pkg_name
   putHdr "Source0" $ "https://hackage.haskell.org/package/" ++ pkg_name ++ "-%{version}/" ++ pkg_name ++ "-%{version}.tar.gz"
   when (revision /= "0") $
     putHdr "Source1" $ "https://hackage.haskell.org/package/" ++ pkg_name ++ "-%{version}/revision/" ++ revision ++ ".cabal#/" ++ pkg_name ++ ".cabal"
-  putHdr "ExcludeArch" "%{ix86}"
 
-  let fixedDeps = ["ghc-Cabal-devel", "ghc-rpm-macros"]
-  let alldeps = sort $ nub $ fixedDeps ++ deps ++ tools ++ clibs ++ pkgcfgs ++ ["pkgconfig" | not (null pkgcfgs)]
-  let extraTestDeps = sort $ testsuiteDeps \\ deps
-  unless (null $ alldeps ++ extraTestDeps) $ do
-    mapM_ (putHdr "BuildRequires") alldeps
-    unless (null extraTestDeps) $ do
-      put "%if %{with tests}"
-      mapM_ (putHdr "BuildRequires") extraTestDeps
+  let fixedDeps = ["ghc-Cabal-devel", "ghc-rpm-macros >= 2.9.2"]
+  let unconditialDeps = sort $ nub $ fixedDeps ++ develDeps ++ tools ++ clibs ++ pkgcfgs ++ ["pkgconfig" | not (null pkgcfgs)]
+  let extraTestDevelDeps = sort $ map showDevelDep testsuiteDeps \\ develDeps
+      extraTestProfDeps = sort $ map showProfDep testsuiteDeps \\ profDeps
+
+  mapM_ (putHdr "BuildRequires") unconditialDeps
+  putHdr "ExcludeArch" "%{ix86}"
+  unless (null profDeps) $ do
+    put "%if %{with ghc_prof}"
+    mapM_ (putHdr "BuildRequires") profDeps
+    put "%endif"
+  unless (null extraTestDevelDeps && null extraTestProfDeps) $ do
+    put "%if %{with tests}"
+    mapM_ (putHdr "BuildRequires") extraTestDevelDeps
+    unless (null extraTestProfDeps) $ do
+      put "%if %{with ghc_prof}"
+      mapM_ (putHdr "BuildRequires") extraTestProfDeps
       put "%endif"
+    put "%endif"
 
   putNewline
 
   put "%description"
-  mapM_ put descLines
+  mapM_ (put . escapeMacros) descLines
 
   let wrapGenDesc = wordwrap (79 - max 0 (length pkgname - length pkg_name))
 
@@ -198,37 +211,38 @@
       put $ wrapGenDesc $ "This package provides the Haskell" +-+ pkg_name +-+ "shared library."
     put $ "%package" +-+ ghcPkgDevel
     putHdr "Summary" $ "Haskell" +-+ pkg_name +-+ "library development files"
-    putHdr "Requires" $ (if binlib then "ghc-%{name}" else "%{name}") +-+ "= %{version}-%{release}"
-    putHdr "Requires" "ghc-compiler = %{ghc_version}"
-    unless (null $ clibs ++ pkgcfgs) $
-      mapM_ (putHdr "Requires") $ sort (clibs ++ pkgcfgs ++ ["pkgconfig" | not (null pkgcfgs)])
+    mapM_ (putHdr "Requires") $ sort $
+      [ (if binlib then "ghc-%{name}" else "%{name}") +-+ "= %{version}-%{release}"
+      , "ghc-compiler = %{ghc_version}"
+      ] ++ clibs ++ pkgcfgs ++ ["pkgconfig" | not (null pkgcfgs)]
     putHdr "Requires(post)" "ghc-compiler = %{ghc_version}"
     putHdr "Requires(postun)" "ghc-compiler = %{ghc_version}"
     putNewline
     put $ "%description" +-+ ghcPkgDevel
     put $ wrapGenDesc $ "This package provides the Haskell" +-+ pkg_name +-+ "library development files."
     put $ unlines
-        [ "%package -n ghc-%{pkg_name}-doc"
+        [ "%package -n ghc-%pkg_name-doc"
         , "Summary:        Haskell %{pkg_name} library documentation"
-        , "BuildArch:      noarch"
         , "Requires:       ghc-filesystem"
+        , "BuildArch:      noarch"
         , ""
-        , "%description -n ghc-%{pkg_name}-doc"
+        , "%description -n ghc-%pkg_name-doc"
         , "This package provides the Haskell %{pkg_name} library documentation."
         , ""
-        , ""
-        , "%package -n ghc-%{pkg_name}-prof"
+        , "%if %{with ghc_prof}"
+        , "%package -n ghc-%pkg_name-prof"
         , "Summary:        Haskell %{pkg_name} profiling library"
-        , "Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}"
-        , "Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)"
+        , "Requires:       ghc-%pkg_name-devel = %{version}-%{release}"
+        , "Supplements:    (ghc-%pkg_name-devel and ghc-prof)"
         , ""
-        , "%description -n ghc-%{pkg_name}-prof"
+        , "%description -n ghc-%pkg_name-prof"
         , "This package provides the Haskell %{pkg_name} profiling library."
+        , "%endif"
         , ""
         ]
 
   put "%prep"
-  put $ "%autosetup" ++ (if pkgname /= name then " -n %{pkg_name}-%{version}" else "")
+  put $ "%autosetup -p1" ++ (if pkgname /= name then " -n %{pkg_name}-%{version}" else "")
   when (revision /= "0") $
     put $ "cp -p %{SOURCE1}" +-+ pkg_name ++ ".cabal"
   putNewline
@@ -245,7 +259,7 @@
   put $ "%ghc_" ++ pkgType ++ "_install"
 
   when selfdep $
-    put $ "%ghc_fix_rpath" +-+ "%{pkg_name}-%{version}"
+    put $ "%ghc_fix_rpath" +-+ "%pkg_name-%{version}"
 
   -- TODO: getSymbolicPath should not be used like this
   let licensefiles = map getSymbolicPath (licenseFiles pkgDesc)
@@ -275,6 +289,12 @@
     putInstallScript
 
   let license_macro = "%license"
+      (licenseDocs, otherDocs) = partition looksLikeLicense (sort docs)
+      looksLikeLicense f = any (`isPrefixOf` map toLower f) ["licen", "copying"]
+      putDocs = do
+        mapM_ (\ l -> put $ license_macro +-+ l) licenseDocs
+        unless (null otherDocs) $
+          put $ "%doc" +-+ unwords otherDocs
   let execs :: [String]
       execs = sort $ map (unUnqualComponentName . exeName) $ filter isBuildable $ executables pkgDesc
 
@@ -291,8 +311,7 @@
     -- Add the license file to the main package only if it wouldn't
     -- otherwise be empty.
     mapM_ (\ l -> put $ license_macro +-+ l) (sort licensefiles)
-    unless (null docs) $
-      put $ "%doc" +-+ unwords (sort docs)
+    putDocs
     mapM_ (\ p -> put $ "%{_bindir}/" ++ (if p == name then "%{name}" else p)) (sort execs)
     listDataFiles
     putNewline
@@ -307,13 +326,14 @@
     unless hasExecPkg listDataFiles
     putNewline
     put $ "%files" +-+ ghcPkgDevel +-+ develFiles
-    unless (null docs) $
-      put $ "%doc" +-+ unwords (sort docs)
+    putDocs
     putNewline
-    put "%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files"
+    put "%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files"
     mapM_ (\ l -> put $ license_macro +-+ l) licensefiles
     putNewline
-    put "%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files"
+    put "%if %{with ghc_prof}"
+    put "%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files"
+    put "%endif"
     putNewline
 
   put "%changelog"
@@ -347,7 +367,7 @@
 showLicense BSD3 = "BSD-3-Clause"
 showLicense BSD4 = "BSD-4-Clause"
 showLicense MIT = "MIT"
-showLicense PublicDomain = "SUSE-Public-Domain"
+showLicense PublicDomain = "LicenseRef-SUSE-Public-Domain"
 showLicense AllRightsReserved = "SUSE-NonFree"
 showLicense OtherLicense = "Unknown"
 showLicense (UnknownLicense l) = "Unknown" +-+ l
@@ -381,8 +401,13 @@
     -- from http://stackoverflow.com/questions/930675/functional-paragraphs
     -- using split would be: map unlines . (Data.List.Split.splitWhen null)
     paragraphs :: [String] -> [String]
-    paragraphs = map (unlines . filter (not . null)) . groupBy (const $ not . null)
+    paragraphs = filter (not . null) . map (unlines . filter (not . null)) . groupBy (const $ not . null)
 
+-- | rpm expands macros in the @Summary@ and @%description@, so we escape every @%@
+-- as @%%@ to have rpm show the text literally.
+escapeMacros :: String -> String
+escapeMacros = concatMap (\c -> if c == '%' then "%%" else [c])
+
 rstrip :: (Char -> Bool) -> String -> String
 rstrip p = reverse . dropWhile p . reverse
 
@@ -405,7 +430,7 @@
 s +-+ t = s ++ " " ++ t
 
 excludedPkgs :: PackageDescription -> String -> Bool
-excludedPkgs pkgDesc = flip notElem (subLibs ++ ["ghc-prim", "integer-gmp", "ghc-bignum"])
+excludedPkgs pkgDesc = flip notElem (subLibs ++ ["ghc-prim", "integer-gmp"])
   where
     subLibs :: [String]
     subLibs = [ unUnqualComponentName ln | l <- subLibraries pkgDesc, LSubLibName ln <- [libName l] ]
@@ -490,9 +515,8 @@
 testsuiteDependencies :: PackageDescription -- ^pkg description
                       -> String             -- ^self
                       -> [String]           -- ^depends
-testsuiteDependencies pkgDesc self = map showDevelDep deps ++ map showProfDep deps
-  where deps = delete self . filter (excludedPkgs pkgDesc) . nub . map depName $
-                 concatMap targetBuildDepends (filter buildable (map testBuildInfo (testSuites pkgDesc)))
+testsuiteDependencies pkgDesc self = delete self . filter (excludedPkgs pkgDesc) . nub . map depName $
+    concatMap targetBuildDepends (filter buildable (map testBuildInfo (testSuites pkgDesc)))
 
 badDescription :: String -> Bool
 badDescription s = null s
diff --git a/test/golden-test-cases/ChasingBottoms.spec.golden b/test/golden-test-cases/ChasingBottoms.spec.golden
--- a/test/golden-test-cases/ChasingBottoms.spec.golden
+++ b/test/golden-test-cases/ChasingBottoms.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ChasingBottoms
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name ChasingBottoms
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.3.1.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        For testing partial and infinite values
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-syb-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-syb-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-array-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-array-prof
 %endif
+%endif
 
 %description
 Do you ever feel the need to test code involving bottoms (e.g. calls to the
@@ -146,26 +150,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -190,9 +195,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENCE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/Clipboard.spec.golden b/test/golden-test-cases/Clipboard.spec.golden
--- a/test/golden-test-cases/Clipboard.spec.golden
+++ b/test/golden-test-cases/Clipboard.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package Clipboard
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name Clipboard
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        2.3.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        System clipboard interface
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-X11-devel
-BuildRequires:  ghc-X11-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-unix-devel
-BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-utf8-string-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-X11-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-utf8-string-prof
+%endif
 
 %description
 /Clipboard/ is a library for easily interfacing with the system clipboard with
@@ -79,26 +81,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -122,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/FenwickTree.spec.golden b/test/golden-test-cases/FenwickTree.spec.golden
--- a/test/golden-test-cases/FenwickTree.spec.golden
+++ b/test/golden-test-cases/FenwickTree.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package FenwickTree
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,25 +17,27 @@
 
 
 %global pkg_name FenwickTree
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Data structure for fast query and update of cumulative sums
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-template-haskell-prof
+%endif
 
 %description
 Fenwick trees are a O(log N) data structure for updating cumulative sums.
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/GPipe-GLFW.spec.golden b/test/golden-test-cases/GPipe-GLFW.spec.golden
--- a/test/golden-test-cases/GPipe-GLFW.spec.golden
+++ b/test/golden-test-cases/GPipe-GLFW.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package GPipe-GLFW
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name GPipe-GLFW
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.4.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        GLFW OpenGL context creation for GPipe
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-GLFW-b-devel
-BuildRequires:  ghc-GLFW-b-prof
 BuildRequires:  ghc-GPipe-devel
-BuildRequires:  ghc-GPipe-prof
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-stm-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-GLFW-b-prof
+BuildRequires:  ghc-GPipe-prof
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-stm-prof
+%endif
 
 %description
 GPipe-GLFW is a utility library to enable the use of GLFW as the OpenGL window
@@ -63,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/GenericPretty.spec.golden b/test/golden-test-cases/GenericPretty.spec.golden
--- a/test/golden-test-cases/GenericPretty.spec.golden
+++ b/test/golden-test-cases/GenericPretty.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package GenericPretty
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name GenericPretty
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A generic, derivable, haskell pretty printer
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-pretty-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 GenericPretty is a Haskell library that supports automatic derivation of pretty
@@ -82,26 +84,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -125,9 +128,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/HPDF.spec.golden b/test/golden-test-cases/HPDF.spec.golden
--- a/test/golden-test-cases/HPDF.spec.golden
+++ b/test/golden-test-cases/HPDF.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package HPDF
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,45 +17,49 @@
 
 
 %global pkg_name HPDF
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.4.10
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generation of PDF documents
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-errors-devel
-BuildRequires:  ghc-errors-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-errors-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-zlib-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HTF-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-HTF-prof
 %endif
+%endif
 
 %description
 A PDF library with support for several pages, page transitions, outlines,
@@ -80,26 +84,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -126,9 +131,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc NEWS.txt README.txt TODO.txt changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/HTF.spec.golden b/test/golden-test-cases/HTF.spec.golden
--- a/test/golden-test-cases/HTF.spec.golden
+++ b/test/golden-test-cases/HTF.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package HTF
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,82 +17,86 @@
 
 
 %global pkg_name HTF
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.13.2.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        The Haskell Test Framework
 License:        LGPL-2.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-Diff-devel
-BuildRequires:  ghc-Diff-prof
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cpphs-devel
-BuildRequires:  ghc-cpphs-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-haskell-src-devel
-BuildRequires:  ghc-haskell-src-prof
 BuildRequires:  ghc-lifted-base-devel
-BuildRequires:  ghc-lifted-base-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-old-time-devel
-BuildRequires:  ghc-old-time-prof
 BuildRequires:  ghc-pretty-devel
-BuildRequires:  ghc-pretty-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-regex-compat-devel
-BuildRequires:  ghc-regex-compat-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-devel
-BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-xmlgen-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Diff-prof
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cpphs-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-haskell-src-prof
+BuildRequires:  ghc-lifted-base-prof
+BuildRequires:  ghc-monad-control-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-old-time-prof
+BuildRequires:  ghc-pretty-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-regex-compat-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-unix-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-xmlgen-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-aeson-pretty-devel
-BuildRequires:  ghc-aeson-pretty-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-temporary-devel
-BuildRequires:  ghc-temporary-prof
 BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-pretty-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-temporary-prof
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The Haskell Test Framework (/HTF/ for short) lets you define unit tests
@@ -126,33 +130,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -174,9 +179,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog README.md TODO.org
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/HTTP.spec.golden b/test/golden-test-cases/HTTP.spec.golden
--- a/test/golden-test-cases/HTTP.spec.golden
+++ b/test/golden-test-cases/HTTP.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package HTTP
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,63 +17,67 @@
 
 
 %global pkg_name HTTP
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        4000.3.9
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A library for client-side HTTP
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-time-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
-BuildRequires:  ghc-conduit-extra-prof
-BuildRequires:  ghc-conduit-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-httpd-shed-devel
-BuildRequires:  ghc-httpd-shed-prof
 BuildRequires:  ghc-pureMD5-devel
-BuildRequires:  ghc-pureMD5-prof
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-wai-devel
+BuildRequires:  ghc-warp-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-conduit-extra-prof
+BuildRequires:  ghc-conduit-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-httpd-shed-prof
+BuildRequires:  ghc-pureMD5-prof
+BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-prof
-BuildRequires:  ghc-warp-devel
 BuildRequires:  ghc-warp-prof
 %endif
+%endif
 
 %description
 The HTTP package supports client-side web programming in Haskell. It lets you
@@ -129,26 +133,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -175,9 +180,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/Hclip.spec.golden b/test/golden-test-cases/Hclip.spec.golden
--- a/test/golden-test-cases/Hclip.spec.golden
+++ b/test/golden-test-cases/Hclip.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package Hclip
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name Hclip
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        3.0.0.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A small cross-platform library for reading and modifying the system clipboard
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-strict-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-strict-prof
+%endif
 
 %description
 A small cross-platform library for reading and modifying the system clipboard.
@@ -67,26 +69,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -108,9 +111,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/MissingH.spec.golden b/test/golden-test-cases/MissingH.spec.golden
--- a/test/golden-test-cases/MissingH.spec.golden
+++ b/test/golden-test-cases/MissingH.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package MissingH
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,61 +17,65 @@
 
 
 %global pkg_name MissingH
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.4.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Large utility library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-hslogger-devel
-BuildRequires:  ghc-hslogger-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-old-locale-devel
-BuildRequires:  ghc-old-locale-prof
 BuildRequires:  ghc-old-time-devel
-BuildRequires:  ghc-old-time-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-regex-compat-devel
-BuildRequires:  ghc-regex-compat-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-hslogger-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-old-locale-prof
+BuildRequires:  ghc-old-time-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-regex-compat-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-errorcall-eq-instance-devel
-BuildRequires:  ghc-errorcall-eq-instance-prof
 BuildRequires:  ghc-testpack-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-errorcall-eq-instance-prof
 BuildRequires:  ghc-testpack-prof
 %endif
+%endif
 
 %description
 MissingH is a library of all sorts of utility functions for Haskell
@@ -94,26 +98,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -140,9 +145,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc TODO examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ObjectName.spec.golden b/test/golden-test-cases/ObjectName.spec.golden
--- a/test/golden-test-cases/ObjectName.spec.golden
+++ b/test/golden-test-cases/ObjectName.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ObjectName
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name ObjectName
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Explicitly handled object names
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This tiny package contains the class ObjectName, which corresponds to the
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/Only.spec.golden b/test/golden-test-cases/Only.spec.golden
--- a/test/golden-test-cases/Only.spec.golden
+++ b/test/golden-test-cases/Only.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package Only
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name Only
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        The 1-tuple type or single-value "collection"
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 This package provides the canonical anonymous 1-tuple type missing from Haskell
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -95,9 +98,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/QuasiText.spec.golden b/test/golden-test-cases/QuasiText.spec.golden
--- a/test/golden-test-cases/QuasiText.spec.golden
+++ b/test/golden-test-cases/QuasiText.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package QuasiText
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name QuasiText
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.2.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A QuasiQuoter for Text
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-haskell-src-meta-devel
-BuildRequires:  ghc-haskell-src-meta-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-th-lift-instances-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-haskell-src-meta-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-th-lift-instances-prof
+%endif
 
 %description
 A QuasiQuoter for interpolating values into Text strings.
@@ -61,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/QuickCheck.spec.golden b/test/golden-test-cases/QuickCheck.spec.golden
--- a/test/golden-test-cases/QuickCheck.spec.golden
+++ b/test/golden-test-cases/QuickCheck.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package QuickCheck
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,35 @@
 
 
 %global pkg_name QuickCheck
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        2.10.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Automatic testing of Haskell programs
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-tf-random-devel
-BuildRequires:  ghc-tf-random-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-tf-random-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 QuickCheck is a library for random testing of program properties.
@@ -80,26 +82,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -126,9 +129,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README changelog examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ReadArgs.spec.golden b/test/golden-test-cases/ReadArgs.spec.golden
--- a/test/golden-test-cases/ReadArgs.spec.golden
+++ b/test/golden-test-cases/ReadArgs.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ReadArgs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,33 @@
 
 
 %global pkg_name ReadArgs
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.2.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Simple command line argument parsing
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-system-filepath-devel
-BuildRequires:  ghc-system-filepath-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-system-filepath-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 ReadArgs provides the 'readArgs' IO action, which lets you tell the compiler to
@@ -101,26 +105,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -146,9 +151,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/SHA.spec.golden b/test/golden-test-cases/SHA.spec.golden
--- a/test/golden-test-cases/SHA.spec.golden
+++ b/test/golden-test-cases/SHA.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package SHA
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name SHA
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.6.4.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Implementations of the SHA suite of message digest functions
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-test-framework-devel
-BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 This library implements the SHA suite of message digest functions, according to
@@ -71,26 +75,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -115,9 +120,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/Strafunski-StrategyLib.spec.golden b/test/golden-test-cases/Strafunski-StrategyLib.spec.golden
--- a/test/golden-test-cases/Strafunski-StrategyLib.spec.golden
+++ b/test/golden-test-cases/Strafunski-StrategyLib.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package Strafunski-StrategyLib
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name Strafunski-StrategyLib
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        5.0.0.10
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library for strategic programming
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-syb-devel
-BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This is a version of the StrategyLib library originally shipped with
@@ -63,26 +65,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +107,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/accelerate-fftw.spec.golden b/test/golden-test-cases/accelerate-fftw.spec.golden
--- a/test/golden-test-cases/accelerate-fftw.spec.golden
+++ b/test/golden-test-cases/accelerate-fftw.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package accelerate-fftw
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name accelerate-fftw
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Accelerate frontend to the FFTW library (Fourier transform)
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-accelerate-devel
 BuildRequires:  ghc-accelerate-io-devel
+BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-carray-devel
+BuildRequires:  ghc-fft-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-storable-complex-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-accelerate-io-prof
 BuildRequires:  ghc-accelerate-prof
-BuildRequires:  ghc-base-devel
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-carray-devel
 BuildRequires:  ghc-carray-prof
-BuildRequires:  ghc-fft-devel
 BuildRequires:  ghc-fft-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-storable-complex-devel
 BuildRequires:  ghc-storable-complex-prof
+%endif
 
 %description
 An interface to the Fastest Fourier Transform in the West (FFTW) for the
@@ -62,26 +64,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/accelerate.spec.golden b/test/golden-test-cases/accelerate.spec.golden
--- a/test/golden-test-cases/accelerate.spec.golden
+++ b/test/golden-test-cases/accelerate.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package accelerate
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,54 +17,56 @@
 
 
 %global pkg_name accelerate
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        An embedded language for accelerated array processing
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-ansi-wl-pprint-devel
-BuildRequires:  ghc-ansi-wl-pprint-prof
 BuildRequires:  ghc-base-devel
 BuildRequires:  ghc-base-orphans-devel
+BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-exceptions-devel
+BuildRequires:  ghc-fclabels-devel
+BuildRequires:  ghc-filepath-devel
+BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-hashtables-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-template-haskell-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unique-devel
+BuildRequires:  ghc-unix-devel
+BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-ansi-wl-pprint-prof
 BuildRequires:  ghc-base-orphans-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-directory-prof
-BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-exceptions-prof
-BuildRequires:  ghc-fclabels-devel
 BuildRequires:  ghc-fclabels-prof
-BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-filepath-prof
-BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-hashtables-devel
 BuildRequires:  ghc-hashtables-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-template-haskell-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unique-devel
 BuildRequires:  ghc-unique-prof
-BuildRequires:  ghc-unix-devel
 BuildRequires:  ghc-unix-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 
 %description
 'Data.Array.Accelerate' defines an embedded array language for computations for
@@ -183,26 +185,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -226,9 +229,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/active.spec.golden b/test/golden-test-cases/active.spec.golden
--- a/test/golden-test-cases/active.spec.golden
+++ b/test/golden-test-cases/active.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package active
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name active
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.13
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Abstractions for animation
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-linear-devel
-BuildRequires:  ghc-linear-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroupoids-devel
-BuildRequires:  ghc-semigroupoids-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-linear-prof
+BuildRequires:  ghc-semigroupoids-prof
+BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-QuickCheck-prof
 %endif
+%endif
 
 %description
 "Active" abstraction for animated things with finite start and end times.
@@ -66,26 +70,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/adjunctions.spec.golden b/test/golden-test-cases/adjunctions.spec.golden
--- a/test/golden-test-cases/adjunctions.spec.golden
+++ b/test/golden-test-cases/adjunctions.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package adjunctions
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,48 +17,50 @@
 
 
 %global pkg_name adjunctions
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        4.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Adjunctions and representable functors
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-comonad-devel
-BuildRequires:  ghc-comonad-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-contravariant-devel
-BuildRequires:  ghc-contravariant-prof
 BuildRequires:  ghc-distributive-devel
-BuildRequires:  ghc-distributive-prof
 BuildRequires:  ghc-free-devel
-BuildRequires:  ghc-free-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroupoids-devel
-BuildRequires:  ghc-semigroupoids-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-comonad-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-contravariant-prof
+BuildRequires:  ghc-distributive-prof
+BuildRequires:  ghc-free-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-profunctors-prof
+BuildRequires:  ghc-semigroupoids-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-tagged-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-void-prof
+%endif
 
 %description
 Adjunctions and representable functors.
@@ -79,26 +81,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -122,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/aeson-diff.spec.golden b/test/golden-test-cases/aeson-diff.spec.golden
--- a/test/golden-test-cases/aeson-diff.spec.golden
+++ b/test/golden-test-cases/aeson-diff.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package aeson-diff
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,58 +17,62 @@
 
 
 %global pkg_name aeson-diff
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.1.0.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Extract and apply patches to JSON documents
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-edit-distance-vector-devel
-BuildRequires:  ghc-edit-distance-vector-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-edit-distance-vector-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Glob-devel
-BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-hlint-devel
-BuildRequires:  ghc-hlint-prof
 BuildRequires:  ghc-quickcheck-instances-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Glob-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-hlint-prof
 BuildRequires:  ghc-quickcheck-instances-prof
 %endif
+%endif
 
 %description
 This is a small library for working with changes to JSON documents. It includes
@@ -91,33 +95,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -140,9 +145,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/aeson-pretty.spec.golden b/test/golden-test-cases/aeson-pretty.spec.golden
--- a/test/golden-test-cases/aeson-pretty.spec.golden
+++ b/test/golden-test-cases/aeson-pretty.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package aeson-pretty
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,41 @@
 
 
 %global pkg_name aeson-pretty
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.8.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        JSON pretty-printing library and command-line tool
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-compat-devel
-BuildRequires:  ghc-base-compat-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cmdargs-devel
-BuildRequires:  ghc-cmdargs-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-compat-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cmdargs-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 A JSON pretty-printing library compatible with aeson as well as a command-line
@@ -82,33 +84,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -127,9 +130,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/algebraic-graphs.spec.golden b/test/golden-test-cases/algebraic-graphs.spec.golden
--- a/test/golden-test-cases/algebraic-graphs.spec.golden
+++ b/test/golden-test-cases/algebraic-graphs.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package algebraic-graphs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name algebraic-graphs
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A library for algebraic graph construction and transformation
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-extra-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-extra-prof
 %endif
+%endif
 
 %description
 <https://github.com/snowleopard/alga Alga> is a library for algebraic
@@ -91,26 +95,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -137,9 +142,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-cloudtrail.spec.golden b/test/golden-test-cases/amazonka-cloudtrail.spec.golden
--- a/test/golden-test-cases/amazonka-cloudtrail.spec.golden
+++ b/test/golden-test-cases/amazonka-cloudtrail.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-cloudtrail
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-cloudtrail
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon CloudTrail SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -83,26 +87,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +134,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-cloudwatch-logs.spec.golden b/test/golden-test-cases/amazonka-cloudwatch-logs.spec.golden
--- a/test/golden-test-cases/amazonka-cloudwatch-logs.spec.golden
+++ b/test/golden-test-cases/amazonka-cloudwatch-logs.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-cloudwatch-logs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-cloudwatch-logs
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon CloudWatch Logs SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -83,26 +87,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +134,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-codedeploy.spec.golden b/test/golden-test-cases/amazonka-codedeploy.spec.golden
--- a/test/golden-test-cases/amazonka-codedeploy.spec.golden
+++ b/test/golden-test-cases/amazonka-codedeploy.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-codedeploy
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-codedeploy
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon CodeDeploy SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -83,26 +87,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +134,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-cognito-idp.spec.golden b/test/golden-test-cases/amazonka-cognito-idp.spec.golden
--- a/test/golden-test-cases/amazonka-cognito-idp.spec.golden
+++ b/test/golden-test-cases/amazonka-cognito-idp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-cognito-idp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-cognito-idp
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon Cognito Identity Provider SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -83,26 +87,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +134,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-ecs.spec.golden b/test/golden-test-cases/amazonka-ecs.spec.golden
--- a/test/golden-test-cases/amazonka-ecs.spec.golden
+++ b/test/golden-test-cases/amazonka-ecs.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-ecs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-ecs
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon EC2 Container Service SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -82,26 +86,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -128,9 +133,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-kms.spec.golden b/test/golden-test-cases/amazonka-kms.spec.golden
--- a/test/golden-test-cases/amazonka-kms.spec.golden
+++ b/test/golden-test-cases/amazonka-kms.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-kms
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-kms
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon Key Management Service SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -82,26 +86,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -128,9 +133,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-lightsail.spec.golden b/test/golden-test-cases/amazonka-lightsail.spec.golden
--- a/test/golden-test-cases/amazonka-lightsail.spec.golden
+++ b/test/golden-test-cases/amazonka-lightsail.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-lightsail
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-lightsail
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon Lightsail SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -82,26 +86,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -128,9 +133,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-route53-domains.spec.golden b/test/golden-test-cases/amazonka-route53-domains.spec.golden
--- a/test/golden-test-cases/amazonka-route53-domains.spec.golden
+++ b/test/golden-test-cases/amazonka-route53-domains.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-route53-domains
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-route53-domains
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon Route 53 Domains SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -83,26 +87,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +134,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/amazonka-waf.spec.golden b/test/golden-test-cases/amazonka-waf.spec.golden
--- a/test/golden-test-cases/amazonka-waf.spec.golden
+++ b/test/golden-test-cases/amazonka-waf.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package amazonka-waf
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name amazonka-waf
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon WAF SDK
 License:        MPL-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
-BuildRequires:  ghc-amazonka-test-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-test-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 The types from this library are intended to be used with
@@ -82,26 +86,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -128,9 +133,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/api-field-json-th.spec.golden b/test/golden-test-cases/api-field-json-th.spec.golden
--- a/test/golden-test-cases/api-field-json-th.spec.golden
+++ b/test/golden-test-cases/api-field-json-th.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package api-field-json-th
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name api-field-json-th
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Option of aeson's deriveJSON
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-HUnit-prof
 %endif
+%endif
 
 %description
 Utils for using aeson's deriveJSON with lens's makeFields.
@@ -66,26 +70,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,9 +115,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/app-settings.spec.golden b/test/golden-test-cases/app-settings.spec.golden
--- a/test/golden-test-cases/app-settings.spec.golden
+++ b/test/golden-test-cases/app-settings.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package app-settings
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name app-settings
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.11
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A library to manage application settings (INI file-like)
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 A library to deal with application settings.
@@ -68,14 +72,14 @@
 You can then declare settings:
 
 > fontSize :: Setting Double > fontSize = Setting "fontSize" 14 > > dateFormat
-:: Setting String > dateFormat = Setting "dateFormat" "%x" > > backgroundColor
+:: Setting String > dateFormat = Setting "dateFormat" "%%x" > > backgroundColor
 :: Setting (Int, Int, Int) > backgroundColor = Setting "backcolor" (255, 0, 0)
 
 Optionally you can declare the list of all your settings, in that case the
 application will also save the default values in the configuration file, but
 commented out:
 
-> fontSize=16 > # dateFormat="%x" > # backcolor=(255,0,0)
+> fontSize=16 > # dateFormat="%%x" > # backcolor=(255,0,0)
 
 If you do not specify the list of settings, only the first line would be
 present in the configuration file.
@@ -142,26 +146,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -186,9 +191,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/apply-refact.spec.golden b/test/golden-test-cases/apply-refact.spec.golden
--- a/test/golden-test-cases/apply-refact.spec.golden
+++ b/test/golden-test-cases/apply-refact.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package apply-refact
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,59 +17,63 @@
 
 
 %global pkg_name apply-refact
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Perform refactorings specified by the refact library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filemanip-devel
-BuildRequires:  ghc-filemanip-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-devel
 BuildRequires:  ghc-ghc-exactprint-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-optparse-applicative-devel
+BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-refact-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-syb-devel
+BuildRequires:  ghc-temporary-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unix-compat-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filemanip-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-exactprint-prof
 BuildRequires:  ghc-ghc-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-optparse-applicative-prof
-BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-refact-devel
 BuildRequires:  ghc-refact-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-syb-prof
-BuildRequires:  ghc-temporary-devel
 BuildRequires:  ghc-temporary-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unix-compat-devel
 BuildRequires:  ghc-unix-compat-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-silently-devel
-BuildRequires:  ghc-silently-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-expected-failure-devel
-BuildRequires:  ghc-tasty-expected-failure-prof
 BuildRequires:  ghc-tasty-golden-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-silently-prof
+BuildRequires:  ghc-tasty-expected-failure-prof
 BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 Perform refactorings specified by the refact library. It is primarily used with
@@ -91,26 +95,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -138,9 +143,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/async.spec.golden b/test/golden-test-cases/async.spec.golden
--- a/test/golden-test-cases/async.spec.golden
+++ b/test/golden-test-cases/async.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package async
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name async
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        2.1.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Run IO operations asynchronously and wait for their results
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-stm-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-stm-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
 %endif
+%endif
 
 %description
 This package provides a higher-level interface over threads, in which an 'Async
@@ -74,26 +78,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/attoparsec-expr.spec.golden b/test/golden-test-cases/attoparsec-expr.spec.golden
--- a/test/golden-test-cases/attoparsec-expr.spec.golden
+++ b/test/golden-test-cases/attoparsec-expr.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package attoparsec-expr
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name attoparsec-expr
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Port of parsec's expression parser to attoparsec
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Port of parsec's expression parser to attoparsec.
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/attoparsec-time.spec.golden b/test/golden-test-cases/attoparsec-time.spec.golden
--- a/test/golden-test-cases/attoparsec-time.spec.golden
+++ b/test/golden-test-cases/attoparsec-time.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package attoparsec-time
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,44 +17,48 @@
 
 
 %global pkg_name attoparsec-time
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Attoparsec parsers of time
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
 BuildRequires:  ghc-base-prelude-devel
+BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-cabal-doctest-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-scientific-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-prelude-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-cabal-doctest-devel
 BuildRequires:  ghc-cabal-doctest-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-scientific-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-filepath-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-filepath-prof
 %endif
+%endif
 
 %description
 A collection of Attoparsec parsers for the "time" library.
@@ -75,26 +79,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -119,9 +124,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/avers-server.spec.golden b/test/golden-test-cases/avers-server.spec.golden
--- a/test/golden-test-cases/avers-server.spec.golden
+++ b/test/golden-test-cases/avers-server.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package avers-server
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,66 +17,68 @@
 
 
 %global pkg_name avers-server
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Server implementation of the Avers API
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-avers-api-devel
-BuildRequires:  ghc-avers-api-prof
 BuildRequires:  ghc-avers-devel
-BuildRequires:  ghc-avers-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bytestring-conversion-devel
-BuildRequires:  ghc-bytestring-conversion-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cookie-devel
-BuildRequires:  ghc-cookie-prof
 BuildRequires:  ghc-cryptonite-devel
-BuildRequires:  ghc-cryptonite-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-memory-devel
-BuildRequires:  ghc-memory-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-resource-pool-devel
-BuildRequires:  ghc-resource-pool-prof
 BuildRequires:  ghc-rethinkdb-client-driver-devel
-BuildRequires:  ghc-rethinkdb-client-driver-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-servant-devel
-BuildRequires:  ghc-servant-prof
 BuildRequires:  ghc-servant-server-devel
-BuildRequires:  ghc-servant-server-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-wai-devel
-BuildRequires:  ghc-wai-prof
 BuildRequires:  ghc-wai-websockets-devel
-BuildRequires:  ghc-wai-websockets-prof
 BuildRequires:  ghc-websockets-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-avers-api-prof
+BuildRequires:  ghc-avers-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bytestring-conversion-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cookie-prof
+BuildRequires:  ghc-cryptonite-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-memory-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-resource-pool-prof
+BuildRequires:  ghc-rethinkdb-client-driver-prof
+BuildRequires:  ghc-servant-prof
+BuildRequires:  ghc-servant-server-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-wai-prof
+BuildRequires:  ghc-wai-websockets-prof
 BuildRequires:  ghc-websockets-prof
+%endif
 
 %description
 Server implementation of the Avers API.
@@ -97,26 +99,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -138,9 +141,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/aws.spec.golden b/test/golden-test-cases/aws.spec.golden
--- a/test/golden-test-cases/aws.spec.golden
+++ b/test/golden-test-cases/aws.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package aws
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,113 +17,117 @@
 
 
 %global pkg_name aws
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.18
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Amazon Web Services (AWS) for Haskell
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base16-bytestring-devel
-BuildRequires:  ghc-base16-bytestring-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-byteable-devel
-BuildRequires:  ghc-byteable-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-cereal-devel
-BuildRequires:  ghc-cereal-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
+BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-cryptonite-devel
+BuildRequires:  ghc-data-default-devel
+BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-filepath-devel
+BuildRequires:  ghc-http-conduit-devel
+BuildRequires:  ghc-http-types-devel
+BuildRequires:  ghc-lifted-base-devel
+BuildRequires:  ghc-memory-devel
+BuildRequires:  ghc-monad-control-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-old-locale-devel
+BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-safe-devel
+BuildRequires:  ghc-scientific-devel
+BuildRequires:  ghc-tagged-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unordered-containers-devel
+BuildRequires:  ghc-utf8-string-devel
+BuildRequires:  ghc-vector-devel
+BuildRequires:  ghc-xml-conduit-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base16-bytestring-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-byteable-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-cereal-prof
 BuildRequires:  ghc-conduit-extra-prof
 BuildRequires:  ghc-conduit-prof
-BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-cryptonite-devel
 BuildRequires:  ghc-cryptonite-prof
-BuildRequires:  ghc-data-default-devel
 BuildRequires:  ghc-data-default-prof
-BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-directory-prof
-BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-filepath-prof
-BuildRequires:  ghc-http-conduit-devel
 BuildRequires:  ghc-http-conduit-prof
-BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-http-types-prof
-BuildRequires:  ghc-lifted-base-devel
 BuildRequires:  ghc-lifted-base-prof
-BuildRequires:  ghc-memory-devel
 BuildRequires:  ghc-memory-prof
-BuildRequires:  ghc-monad-control-devel
 BuildRequires:  ghc-monad-control-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-old-locale-devel
 BuildRequires:  ghc-old-locale-prof
-BuildRequires:  ghc-resourcet-devel
 BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-safe-prof
-BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-scientific-prof
-BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-tagged-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
-BuildRequires:  ghc-utf8-string-devel
 BuildRequires:  ghc-utf8-string-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
-BuildRequires:  ghc-xml-conduit-devel
 BuildRequires:  ghc-xml-conduit-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-conduit-combinators-devel
-BuildRequires:  ghc-conduit-combinators-prof
 BuildRequires:  ghc-errors-devel
-BuildRequires:  ghc-errors-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-client-tls-devel
-BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+BuildRequires:  ghc-transformers-base-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-conduit-combinators-prof
+BuildRequires:  ghc-errors-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-client-tls-prof
+BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
-BuildRequires:  ghc-transformers-base-devel
 BuildRequires:  ghc-transformers-base-prof
 %endif
+%endif
 
 %description
 Bindings for Amazon Web Services (AWS), with the aim of supporting all AWS
@@ -146,26 +150,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -192,9 +197,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/bbdb.spec.golden b/test/golden-test-cases/bbdb.spec.golden
--- a/test/golden-test-cases/bbdb.spec.golden
+++ b/test/golden-test-cases/bbdb.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package bbdb
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,31 @@
 
 
 %global pkg_name bbdb
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Ability to read, write, and modify BBDB files
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 BBDB (http://savannah.nongnu.org/projects/bbdb/) is a contact management
@@ -62,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -108,9 +113,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/benchpress.spec.golden b/test/golden-test-cases/benchpress.spec.golden
--- a/test/golden-test-cases/benchpress.spec.golden
+++ b/test/golden-test-cases/benchpress.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package benchpress
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name benchpress
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.2.10
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Micro-benchmarking with detailed statistics
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 Benchmarks actions and produces statistics such as min, mean, median, standard
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/binary-bits.spec.golden b/test/golden-test-cases/binary-bits.spec.golden
--- a/test/golden-test-cases/binary-bits.spec.golden
+++ b/test/golden-test-cases/binary-bits.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package binary-bits
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name binary-bits
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Bit parsing/writing on top of binary
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-test-framework-devel
-BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 Bit parsing/writing on top of binary. Provides functions to read and write bits
@@ -67,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -111,9 +116,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/binary-tagged.spec.golden b/test/golden-test-cases/binary-tagged.spec.golden
--- a/test/golden-test-cases/binary-tagged.spec.golden
+++ b/test/golden-test-cases/binary-tagged.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package binary-tagged
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,67 +17,71 @@
 
 
 %global pkg_name binary-tagged
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.4.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Tagged binary serialisation
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-SHA-devel
-BuildRequires:  ghc-SHA-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base16-bytestring-devel
-BuildRequires:  ghc-base16-bytestring-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-generics-sop-devel
-BuildRequires:  ghc-generics-sop-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-nats-devel
-BuildRequires:  ghc-nats-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-SHA-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base16-bytestring-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-generics-sop-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-nats-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-tagged-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-binary-orphans-devel
-BuildRequires:  ghc-binary-orphans-prof
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-devel
-BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-binary-orphans-prof
+BuildRequires:  ghc-quickcheck-instances-prof
+BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Check <https://github.com/phadej/binary-tagged#readme README on Github>.
@@ -98,26 +102,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -144,9 +149,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/bindings-uname.spec.golden b/test/golden-test-cases/bindings-uname.spec.golden
--- a/test/golden-test-cases/bindings-uname.spec.golden
+++ b/test/golden-test-cases/bindings-uname.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package bindings-uname
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name bindings-uname
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Low-level binding to POSIX uname(3)
-License:        SUSE-Public-Domain
+License:        LicenseRef-SUSE-Public-Domain
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 This is a low-level binding to POSIX uname(3) function. Perhaps it shoule be
@@ -52,26 +54,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -91,8 +94,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/bioalign.spec.golden b/test/golden-test-cases/bioalign.spec.golden
--- a/test/golden-test-cases/bioalign.spec.golden
+++ b/test/golden-test-cases/bioalign.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package bioalign
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name bioalign
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Data structures and helper functions for calculating alignments
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-biocore-devel
-BuildRequires:  ghc-biocore-prof
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-biocore-prof
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Data structures and helper functions for calculating alignments.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/bits.spec.golden b/test/golden-test-cases/bits.spec.golden
--- a/test/golden-test-cases/bits.spec.golden
+++ b/test/golden-test-cases/bits.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package bits
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,34 +17,38 @@
 
 
 %global pkg_name bits
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Various bit twiddling and bitwise serialization primitives
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytes-devel
-BuildRequires:  ghc-bytes-prof
 BuildRequires:  ghc-cabal-doctest-devel
-BuildRequires:  ghc-cabal-doctest-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytes-prof
+BuildRequires:  ghc-cabal-doctest-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-doctest-prof
 %endif
+%endif
 
 %description
 Various bit twiddling and bitwise serialization primitives.
@@ -65,26 +69,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -111,9 +116,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/blank-canvas.spec.golden b/test/golden-test-cases/blank-canvas.spec.golden
--- a/test/golden-test-cases/blank-canvas.spec.golden
+++ b/test/golden-test-cases/blank-canvas.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package blank-canvas
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,71 +17,75 @@
 
 
 %global pkg_name blank-canvas
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        HTML5 Canvas Graphics Library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-compat-devel
-BuildRequires:  ghc-base-compat-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-colour-devel
-BuildRequires:  ghc-colour-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-class-devel
-BuildRequires:  ghc-data-default-class-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-kansas-comet-devel
-BuildRequires:  ghc-kansas-comet-prof
 BuildRequires:  ghc-mime-types-devel
-BuildRequires:  ghc-mime-types-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scotty-devel
-BuildRequires:  ghc-scotty-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-text-show-devel
-BuildRequires:  ghc-text-show-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-extra-devel
+BuildRequires:  ghc-warp-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-compat-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-colour-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-class-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-kansas-comet-prof
+BuildRequires:  ghc-mime-types-prof
+BuildRequires:  ghc-scotty-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-text-show-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-wai-extra-prof
 BuildRequires:  ghc-wai-prof
-BuildRequires:  ghc-warp-devel
 BuildRequires:  ghc-warp-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-shake-devel
-BuildRequires:  ghc-shake-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-shake-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-prof
 %endif
+%endif
 
 %description
 'blank-canvas' is a Haskell binding to the complete
@@ -120,26 +124,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -171,9 +176,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc Changelog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/blaze-html.spec.golden b/test/golden-test-cases/blaze-html.spec.golden
--- a/test/golden-test-cases/blaze-html.spec.golden
+++ b/test/golden-test-cases/blaze-html.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package blaze-html
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name blaze-html
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.9.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A blazingly fast HTML combinator library for Haskell
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-blaze-markup-devel
-BuildRequires:  ghc-blaze-markup-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-blaze-markup-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 A blazingly fast HTML combinator library for the Haskell programming language.
@@ -76,26 +80,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -122,9 +127,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/blaze-markup.spec.golden b/test/golden-test-cases/blaze-markup.spec.golden
--- a/test/golden-test-cases/blaze-markup.spec.golden
+++ b/test/golden-test-cases/blaze-markup.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package blaze-markup
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,45 @@
 
 
 %global pkg_name blaze-markup
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.8.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A blazingly fast markup combinator library for Haskell
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 Core modules of a blazingly fast markup combinator library for the Haskell
@@ -74,26 +78,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/blaze-svg.spec.golden b/test/golden-test-cases/blaze-svg.spec.golden
--- a/test/golden-test-cases/blaze-svg.spec.golden
+++ b/test/golden-test-cases/blaze-svg.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package blaze-svg
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name blaze-svg
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.6.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        SVG combinator library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-markup-devel
-BuildRequires:  ghc-blaze-markup-prof
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-markup-prof
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A blazingly fast SVG combinator library for the Haskell programming language.
@@ -66,26 +68,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -109,9 +112,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/blosum.spec.golden b/test/golden-test-cases/blosum.spec.golden
--- a/test/golden-test-cases/blosum.spec.golden
+++ b/test/golden-test-cases/blosum.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package blosum
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,41 @@
 
 
 %global pkg_name blosum
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        BLOSUM generator
 License:        GPL-2.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-fasta-devel
-BuildRequires:  ghc-fasta-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-pipes-devel
-BuildRequires:  ghc-pipes-prof
 BuildRequires:  ghc-pipes-text-devel
-BuildRequires:  ghc-pipes-text-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-text-show-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-fasta-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-pipes-prof
+BuildRequires:  ghc-pipes-text-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-text-show-prof
+%endif
 
 %description
 Generates BLOSUMs for use with finding the degree of amino acid conservation.
@@ -70,33 +72,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -113,9 +116,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/boomerang.spec.golden b/test/golden-test-cases/boomerang.spec.golden
--- a/test/golden-test-cases/boomerang.spec.golden
+++ b/test/golden-test-cases/boomerang.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package boomerang
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name boomerang
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.4.5.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library for invertible parsing and printing
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Specify a single unified grammar which can be used for parsing and
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -99,9 +102,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/boxes.spec.golden b/test/golden-test-cases/boxes.spec.golden
--- a/test/golden-test-cases/boxes.spec.golden
+++ b/test/golden-test-cases/boxes.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package boxes
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,31 @@
 
 
 %global pkg_name boxes
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        2D text pretty-printing library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-split-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-QuickCheck-prof
 %endif
+%endif
 
 %description
 A pretty-printing library for laying out text in two dimensions, using a simple
@@ -59,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -105,9 +110,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/brittany.spec.golden b/test/golden-test-cases/brittany.spec.golden
--- a/test/golden-test-cases/brittany.spec.golden
+++ b/test/golden-test-cases/brittany.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package brittany
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,86 +17,90 @@
 
 
 %global pkg_name brittany
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.9.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Haskell source code formatter
 License:        AGPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-butcher-devel
-BuildRequires:  ghc-butcher-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cmdargs-devel
-BuildRequires:  ghc-cmdargs-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-czipwith-devel
-BuildRequires:  ghc-czipwith-prof
 BuildRequires:  ghc-data-tree-print-devel
-BuildRequires:  ghc-data-tree-print-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-extra-devel
-BuildRequires:  ghc-extra-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-boot-th-devel
-BuildRequires:  ghc-ghc-boot-th-prof
 BuildRequires:  ghc-ghc-devel
 BuildRequires:  ghc-ghc-exactprint-devel
-BuildRequires:  ghc-ghc-exactprint-prof
 BuildRequires:  ghc-ghc-paths-devel
+BuildRequires:  ghc-hspec-devel
+BuildRequires:  ghc-monad-memo-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-multistate-devel
+BuildRequires:  ghc-neat-interpolation-devel
+BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-safe-devel
+BuildRequires:  ghc-semigroups-devel
+BuildRequires:  ghc-strict-devel
+BuildRequires:  ghc-syb-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-uniplate-devel
+BuildRequires:  ghc-unsafe-devel
+BuildRequires:  ghc-yaml-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-butcher-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cmdargs-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-czipwith-prof
+BuildRequires:  ghc-data-tree-print-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-extra-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-ghc-boot-th-prof
+BuildRequires:  ghc-ghc-exactprint-prof
 BuildRequires:  ghc-ghc-paths-prof
 BuildRequires:  ghc-ghc-prof
-BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-prof
-BuildRequires:  ghc-monad-memo-devel
 BuildRequires:  ghc-monad-memo-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-multistate-devel
 BuildRequires:  ghc-multistate-prof
-BuildRequires:  ghc-neat-interpolation-devel
 BuildRequires:  ghc-neat-interpolation-prof
-BuildRequires:  ghc-pretty-devel
 BuildRequires:  ghc-pretty-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-safe-prof
-BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-semigroups-prof
-BuildRequires:  ghc-strict-devel
 BuildRequires:  ghc-strict-prof
-BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-syb-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-uniplate-devel
 BuildRequires:  ghc-uniplate-prof
-BuildRequires:  ghc-unsafe-devel
 BuildRequires:  ghc-unsafe-prof
-BuildRequires:  ghc-yaml-devel
 BuildRequires:  ghc-yaml-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-parsec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-parsec-prof
 %endif
+%endif
 
 %description
 See <https://github.com/lspitzner/brittany/blob/master/README.md the README>.
@@ -125,33 +129,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -173,9 +178,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md doc
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/broadcast-chan.spec.golden b/test/golden-test-cases/broadcast-chan.spec.golden
--- a/test/golden-test-cases/broadcast-chan.spec.golden
+++ b/test/golden-test-cases/broadcast-chan.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package broadcast-chan
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name broadcast-chan
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Broadcast channel type that avoids 0 reader space leaks
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A variation of "Control.Concurrent.Chan" from base, which allows to the easy
@@ -60,26 +62,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/butcher.spec.golden b/test/golden-test-cases/butcher.spec.golden
--- a/test/golden-test-cases/butcher.spec.golden
+++ b/test/golden-test-cases/butcher.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package butcher
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,48 +17,50 @@
 
 
 %global pkg_name butcher
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.2.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Chops a command or program invocation into digestable pieces
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deque-devel
-BuildRequires:  ghc-deque-prof
 BuildRequires:  ghc-either-devel
-BuildRequires:  ghc-either-prof
 BuildRequires:  ghc-extra-devel
-BuildRequires:  ghc-extra-prof
 BuildRequires:  ghc-free-devel
-BuildRequires:  ghc-free-prof
 BuildRequires:  ghc-microlens-devel
-BuildRequires:  ghc-microlens-prof
 BuildRequires:  ghc-microlens-th-devel
-BuildRequires:  ghc-microlens-th-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-multistate-devel
-BuildRequires:  ghc-multistate-prof
 BuildRequires:  ghc-pretty-devel
-BuildRequires:  ghc-pretty-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unsafe-devel
-BuildRequires:  ghc-unsafe-prof
 BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deque-prof
+BuildRequires:  ghc-either-prof
+BuildRequires:  ghc-extra-prof
+BuildRequires:  ghc-free-prof
+BuildRequires:  ghc-microlens-prof
+BuildRequires:  ghc-microlens-th-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-multistate-prof
+BuildRequires:  ghc-pretty-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unsafe-prof
 BuildRequires:  ghc-void-prof
+%endif
 
 %description
 See the <https://github.com/lspitzner/butcher/blob/master/README.md README> (it
@@ -80,26 +82,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -123,9 +126,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/bzlib.spec.golden b/test/golden-test-cases/bzlib.spec.golden
--- a/test/golden-test-cases/bzlib.spec.golden
+++ b/test/golden-test-cases/bzlib.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package bzlib
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,25 @@
 
 
 %global pkg_name bzlib
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.5.0.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Compression and decompression in the bzip2 format
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  libbz2-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+%endif
 
 %description
 This package provides a pure interface for compressing and decompressing
@@ -61,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +107,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/case-insensitive.spec.golden b/test/golden-test-cases/case-insensitive.spec.golden
--- a/test/golden-test-cases/case-insensitive.spec.golden
+++ b/test/golden-test-cases/case-insensitive.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package case-insensitive
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name case-insensitive
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.2.0.10
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Case insensitive string comparison
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
 %endif
+%endif
 
 %description
 The module 'Data.CaseInsensitive' provides the 'CI' type constructor which can
@@ -70,26 +74,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/cassava-conduit.spec.golden b/test/golden-test-cases/cassava-conduit.spec.golden
--- a/test/golden-test-cases/cassava-conduit.spec.golden
+++ b/test/golden-test-cases/cassava-conduit.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package cassava-conduit
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name cassava-conduit
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Conduit interface for cassava package
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cassava-devel
-BuildRequires:  ghc-cassava-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
+BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cassava-prof
 BuildRequires:  ghc-conduit-extra-prof
 BuildRequires:  ghc-conduit-prof
-BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-QuickCheck-prof
 %endif
+%endif
 
 %description
 Conduit interface for cassava package
@@ -76,26 +80,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -122,9 +127,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license etc/LICENCE.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/cassette.spec.golden b/test/golden-test-cases/cassette.spec.golden
--- a/test/golden-test-cases/cassette.spec.golden
+++ b/test/golden-test-cases/cassette.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package cassette
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name cassette
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A combinator library for simultaneously defining parsers and pretty printers
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Combinator library for defining both type safe parsers and pretty printers
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -95,9 +98,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/cereal-text.spec.golden b/test/golden-test-cases/cereal-text.spec.golden
--- a/test/golden-test-cases/cereal-text.spec.golden
+++ b/test/golden-test-cases/cereal-text.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package cereal-text
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name cereal-text
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Data.Text instances for the cereal serialization library
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-cereal-devel
-BuildRequires:  ghc-cereal-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-cereal-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Data.Text instances for the cereal serialization library.
@@ -60,26 +62,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/cheapskate.spec.golden b/test/golden-test-cases/cheapskate.spec.golden
--- a/test/golden-test-cases/cheapskate.spec.golden
+++ b/test/golden-test-cases/cheapskate.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package cheapskate
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,43 @@
 
 
 %global pkg_name cheapskate
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Experimental markdown processor
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-devel
-BuildRequires:  ghc-data-default-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-syb-devel
-BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-uniplate-devel
-BuildRequires:  ghc-uniplate-prof
 BuildRequires:  ghc-xss-sanitize-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-syb-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-uniplate-prof
 BuildRequires:  ghc-xss-sanitize-prof
+%endif
 
 %description
 This is an experimental Markdown processor in pure Haskell. It aims to process
@@ -79,33 +81,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -124,9 +127,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown changelog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/chell.spec.golden b/test/golden-test-cases/chell.spec.golden
--- a/test/golden-test-cases/chell.spec.golden
+++ b/test/golden-test-cases/chell.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package chell
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,36 +17,38 @@
 
 
 %global pkg_name chell
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A simple and intuitive library for automated testing
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-ansi-terminal-devel
-BuildRequires:  ghc-ansi-terminal-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-options-devel
-BuildRequires:  ghc-options-prof
 BuildRequires:  ghc-patience-devel
-BuildRequires:  ghc-patience-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-ansi-terminal-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-options-prof
+BuildRequires:  ghc-patience-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Chell is a simple and intuitive library for automated testing. It natively
@@ -89,26 +91,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -130,9 +133,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/clumpiness.spec.golden b/test/golden-test-cases/clumpiness.spec.golden
--- a/test/golden-test-cases/clumpiness.spec.golden
+++ b/test/golden-test-cases/clumpiness.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package clumpiness
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name clumpiness
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.17.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Calculate the clumpiness of leaf properties in a tree
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tree-fun-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-tree-fun-prof
+%endif
 
 %description
 Calculate the clumpiness of leaf properties in a tree.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/code-page.spec.golden b/test/golden-test-cases/code-page.spec.golden
--- a/test/golden-test-cases/code-page.spec.golden
+++ b/test/golden-test-cases/code-page.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package code-page
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,21 +17,23 @@
 
 
 %global pkg_name code-page
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Windows code page library for Haskell
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 This library provides two modules:
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -105,9 +108,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/colorize-haskell.spec.golden b/test/golden-test-cases/colorize-haskell.spec.golden
--- a/test/golden-test-cases/colorize-haskell.spec.golden
+++ b/test/golden-test-cases/colorize-haskell.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package colorize-haskell
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name colorize-haskell
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Highligt Haskell source
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-ansi-terminal-devel
-BuildRequires:  ghc-ansi-terminal-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-haskell-lexer-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-ansi-terminal-prof
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-haskell-lexer-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Highligt Haskell source.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -97,9 +100,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/countable.spec.golden b/test/golden-test-cases/countable.spec.golden
--- a/test/golden-test-cases/countable.spec.golden
+++ b/test/golden-test-cases/countable.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package countable
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name countable
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Countable, Searchable, Finite, Empty classes
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-silently-devel
-BuildRequires:  ghc-silently-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-golden-devel
-BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-silently-prof
+BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 * 'class Countable', for countable types
@@ -88,26 +92,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -132,9 +137,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/cpu.spec.golden b/test/golden-test-cases/cpu.spec.golden
--- a/test/golden-test-cases/cpu.spec.golden
+++ b/test/golden-test-cases/cpu.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package cpu
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name cpu
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Cpu information and properties helpers
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Lowlevel cpu routines to get basic properties of the cpu platform, like
@@ -52,26 +54,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -95,9 +98,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/criterion.spec.golden b/test/golden-test-cases/criterion.spec.golden
--- a/test/golden-test-cases/criterion.spec.golden
+++ b/test/golden-test-cases/criterion.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package criterion
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,90 +17,94 @@
 
 
 %global pkg_name criterion
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.2.6.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Robust, reliable performance measurement and analysis
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-Glob-devel
-BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-ansi-wl-pprint-devel
-BuildRequires:  ghc-ansi-wl-pprint-prof
 BuildRequires:  ghc-base-compat-devel
-BuildRequires:  ghc-base-compat-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cassava-devel
-BuildRequires:  ghc-cassava-prof
 BuildRequires:  ghc-code-page-devel
-BuildRequires:  ghc-code-page-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-js-flot-devel
-BuildRequires:  ghc-js-flot-prof
 BuildRequires:  ghc-js-jquery-devel
-BuildRequires:  ghc-js-jquery-prof
 BuildRequires:  ghc-microstache-devel
-BuildRequires:  ghc-microstache-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-mwc-random-devel
-BuildRequires:  ghc-mwc-random-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-statistics-devel
-BuildRequires:  ghc-statistics-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-algorithms-devel
-BuildRequires:  ghc-vector-algorithms-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Glob-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-ansi-wl-pprint-prof
+BuildRequires:  ghc-base-compat-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cassava-prof
+BuildRequires:  ghc-code-page-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-js-flot-prof
+BuildRequires:  ghc-js-jquery-prof
+BuildRequires:  ghc-microstache-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-mwc-random-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-statistics-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-vector-algorithms-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 This library provides a powerful but simple way to measure software
@@ -131,33 +135,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -185,9 +190,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown changelog.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/crypt-sha512.spec.golden b/test/golden-test-cases/crypt-sha512.spec.golden
--- a/test/golden-test-cases/crypt-sha512.spec.golden
+++ b/test/golden-test-cases/crypt-sha512.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package crypt-sha512
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name crypt-sha512
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Pure Haskell implelementation for GNU SHA512 crypt algorithm
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cryptohash-sha512-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cryptohash-sha512-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Crypt() is the password encryption function. It is based on the Data Encryption
@@ -72,26 +76,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -118,9 +123,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/crypto-random-api.spec.golden b/test/golden-test-cases/crypto-random-api.spec.golden
--- a/test/golden-test-cases/crypto-random-api.spec.golden
+++ b/test/golden-test-cases/crypto-random-api.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package crypto-random-api
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name crypto-random-api
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Simple random generators API for cryptography related code
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-entropy-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-entropy-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Simple random generators API for cryptography related code.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/csv.spec.golden b/test/golden-test-cases/csv.spec.golden
--- a/test/golden-test-cases/csv.spec.golden
+++ b/test/golden-test-cases/csv.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package csv
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name csv
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        CSV loader and dumper
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 CSV loader and dumper
@@ -60,26 +62,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license COPYING
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/data-accessor.spec.golden b/test/golden-test-cases/data-accessor.spec.golden
--- a/test/golden-test-cases/data-accessor.spec.golden
+++ b/test/golden-test-cases/data-accessor.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package data-accessor
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name data-accessor
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.2.7
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Utilities for accessing and manipulating fields of records
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 In Haskell 98 the name of a record field is automatically also the name of a
@@ -104,26 +106,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -145,9 +148,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/data-default-instances-containers.spec.golden b/test/golden-test-cases/data-default-instances-containers.spec.golden
--- a/test/golden-test-cases/data-default-instances-containers.spec.golden
+++ b/test/golden-test-cases/data-default-instances-containers.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package data-default-instances-containers
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name data-default-instances-containers
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Default instances for types in containers
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-class-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-class-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Default instances for types in containers.
@@ -57,26 +59,27 @@
 This package provides the Haskell %{name} library
 development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/data-endian.spec.golden b/test/golden-test-cases/data-endian.spec.golden
--- a/test/golden-test-cases/data-endian.spec.golden
+++ b/test/golden-test-cases/data-endian.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package data-endian
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name data-endian
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Endian-sensitive data
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 This package provides helpers for converting endian-sensitive data.
@@ -51,26 +53,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -92,9 +95,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/data-msgpack.spec.golden b/test/golden-test-cases/data-msgpack.spec.golden
--- a/test/golden-test-cases/data-msgpack.spec.golden
+++ b/test/golden-test-cases/data-msgpack.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package data-msgpack
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,50 +17,54 @@
 
 
 %global pkg_name data-msgpack
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.10
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A Haskell implementation of MessagePack
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-binary-ieee754-devel
-BuildRequires:  ghc-data-binary-ieee754-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-groom-devel
-BuildRequires:  ghc-groom-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-binary-ieee754-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-groom-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-void-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 A Haskell implementation of MessagePack <http://msgpack.org/>
@@ -85,33 +89,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -131,9 +136,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/data-serializer.spec.golden b/test/golden-test-cases/data-serializer.spec.golden
--- a/test/golden-test-cases/data-serializer.spec.golden
+++ b/test/golden-test-cases/data-serializer.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package data-serializer
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,45 @@
 
 
 %global pkg_name data-serializer
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Common API for serialization libraries
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cereal-devel
-BuildRequires:  ghc-cereal-prof
 BuildRequires:  ghc-data-endian-devel
-BuildRequires:  ghc-data-endian-prof
 BuildRequires:  ghc-parsers-devel
-BuildRequires:  ghc-parsers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-split-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cereal-prof
+BuildRequires:  ghc-data-endian-prof
+BuildRequires:  ghc-parsers-prof
+BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-split-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
-BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 This package provides a common API for serialization libraries like
@@ -74,26 +78,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/deque.spec.golden b/test/golden-test-cases/deque.spec.golden
--- a/test/golden-test-cases/deque.spec.golden
+++ b/test/golden-test-cases/deque.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package deque
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name deque
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Double-ended queue
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 An implementation of Double-Ended Queue (aka Dequeue or Deque) based on the
@@ -52,26 +54,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -93,9 +96,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/dhall-bash.spec.golden b/test/golden-test-cases/dhall-bash.spec.golden
--- a/test/golden-test-cases/dhall-bash.spec.golden
+++ b/test/golden-test-cases/dhall-bash.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package dhall-bash
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,43 @@
 
 
 %global pkg_name dhall-bash
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Compile Dhall to Bash
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-dhall-devel
-BuildRequires:  ghc-dhall-prof
 BuildRequires:  ghc-neat-interpolation-devel
-BuildRequires:  ghc-neat-interpolation-prof
 BuildRequires:  ghc-optparse-generic-devel
-BuildRequires:  ghc-optparse-generic-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-shell-escape-devel
-BuildRequires:  ghc-shell-escape-prof
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-format-devel
+BuildRequires:  ghc-trifecta-devel
+BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-dhall-prof
+BuildRequires:  ghc-neat-interpolation-prof
+BuildRequires:  ghc-optparse-generic-prof
+BuildRequires:  ghc-shell-escape-prof
 BuildRequires:  ghc-text-format-prof
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-trifecta-devel
 BuildRequires:  ghc-trifecta-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 Use this package if you want to compile Dhall expressions to Bash. You can use
@@ -79,33 +81,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -122,9 +125,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/diagrams-solve.spec.golden b/test/golden-test-cases/diagrams-solve.spec.golden
--- a/test/golden-test-cases/diagrams-solve.spec.golden
+++ b/test/golden-test-cases/diagrams-solve.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package diagrams-solve
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name diagrams-solve
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Pure Haskell solver routines used by diagrams
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Pure Haskell solver routines used by the diagrams project. Currently includes
@@ -64,26 +68,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,9 +115,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/discrimination.spec.golden b/test/golden-test-cases/discrimination.spec.golden
--- a/test/golden-test-cases/discrimination.spec.golden
+++ b/test/golden-test-cases/discrimination.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package discrimination
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,46 +17,48 @@
 
 
 %global pkg_name discrimination
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Fast generic linear-time sorting, joins and container construction
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-contravariant-devel
-BuildRequires:  ghc-contravariant-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
 BuildRequires:  ghc-promises-devel
-BuildRequires:  ghc-promises-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-contravariant-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-primitive-prof
+BuildRequires:  ghc-profunctors-prof
+BuildRequires:  ghc-promises-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-void-prof
+%endif
 
 %description
 This package provides fast, generic, linear-time discrimination and sorting.
@@ -84,26 +86,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -127,9 +130,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/dotenv.spec.golden b/test/golden-test-cases/dotenv.spec.golden
--- a/test/golden-test-cases/dotenv.spec.golden
+++ b/test/golden-test-cases/dotenv.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package dotenv
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,46 +17,50 @@
 
 
 %global pkg_name dotenv
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Loads environment variables from dotenv files
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-compat-devel
-BuildRequires:  ghc-base-compat-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-megaparsec-devel
-BuildRequires:  ghc-megaparsec-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-yaml-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-compat-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-megaparsec-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-yaml-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-megaparsec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-megaparsec-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 In most applications, <http://12factor.net/config configuration should be
@@ -100,33 +104,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -152,9 +157,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/dotnet-timespan.spec.golden b/test/golden-test-cases/dotnet-timespan.spec.golden
--- a/test/golden-test-cases/dotnet-timespan.spec.golden
+++ b/test/golden-test-cases/dotnet-timespan.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package dotnet-timespan
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name dotnet-timespan
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        .NET TimeSpan
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 .NET TimeSpan.
@@ -51,26 +53,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -94,9 +97,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/dpor.spec.golden b/test/golden-test-cases/dpor.spec.golden
--- a/test/golden-test-cases/dpor.spec.golden
+++ b/test/golden-test-cases/dpor.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package dpor
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name dpor
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A generic implementation of dynamic partial-order reduction (DPOR) for testing arbitrary models of concurrency
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-semigroups-prof
+%endif
 
 %description
 We can characterise the state of a concurrent computation by considering the
@@ -85,26 +87,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -126,9 +129,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/drawille.spec.golden b/test/golden-test-cases/drawille.spec.golden
--- a/test/golden-test-cases/drawille.spec.golden
+++ b/test/golden-test-cases/drawille.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package drawille
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,33 @@
 
 
 %global pkg_name drawille
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A port of asciimoo's drawille to haskell
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 A tiny library for drawing with braille.
@@ -60,26 +64,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +109,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/drifter-postgresql.spec.golden b/test/golden-test-cases/drifter-postgresql.spec.golden
--- a/test/golden-test-cases/drifter-postgresql.spec.golden
+++ b/test/golden-test-cases/drifter-postgresql.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package drifter-postgresql
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,45 +17,49 @@
 
 
 %global pkg_name drifter-postgresql
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        PostgreSQL support for the drifter schema migration tool
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-drifter-devel
-BuildRequires:  ghc-drifter-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-postgresql-simple-devel
-BuildRequires:  ghc-postgresql-simple-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-drifter-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-postgresql-simple-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-either-devel
-BuildRequires:  ghc-either-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-either-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
 %endif
+%endif
 
 %description
 Support for postgresql-simple Query migrations as well as arbitrary Haskell IO
@@ -77,26 +81,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -123,9 +128,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ede.spec.golden b/test/golden-test-cases/ede.spec.golden
--- a/test/golden-test-cases/ede.spec.golden
+++ b/test/golden-test-cases/ede.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ede
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,67 +17,71 @@
 
 
 %global pkg_name ede
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.8.7
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Templating language with similar syntax and features to Liquid or Jinja2
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-ansi-wl-pprint-devel
-BuildRequires:  ghc-ansi-wl-pprint-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-comonad-devel
-BuildRequires:  ghc-comonad-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-double-conversion-devel
-BuildRequires:  ghc-double-conversion-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-free-devel
-BuildRequires:  ghc-free-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parsers-devel
-BuildRequires:  ghc-parsers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-format-devel
-BuildRequires:  ghc-text-format-prof
 BuildRequires:  ghc-text-manipulate-devel
+BuildRequires:  ghc-trifecta-devel
+BuildRequires:  ghc-unordered-containers-devel
+BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-ansi-wl-pprint-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-comonad-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-double-conversion-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-free-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-parsers-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-text-format-prof
 BuildRequires:  ghc-text-manipulate-prof
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-trifecta-devel
 BuildRequires:  ghc-trifecta-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-golden-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 ED-E is a templating language written in Haskell with a specific set of
@@ -120,26 +124,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -171,9 +176,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ekg-cloudwatch.spec.golden b/test/golden-test-cases/ekg-cloudwatch.spec.golden
--- a/test/golden-test-cases/ekg-cloudwatch.spec.golden
+++ b/test/golden-test-cases/ekg-cloudwatch.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ekg-cloudwatch
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,42 +17,44 @@
 
 
 %global pkg_name ekg-cloudwatch
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.1.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        An ekg backend for Amazon Cloudwatch
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-amazonka-cloudwatch-devel
-BuildRequires:  ghc-amazonka-cloudwatch-prof
 BuildRequires:  ghc-amazonka-core-devel
-BuildRequires:  ghc-amazonka-core-prof
 BuildRequires:  ghc-amazonka-devel
-BuildRequires:  ghc-amazonka-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-ekg-core-devel
-BuildRequires:  ghc-ekg-core-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-amazonka-cloudwatch-prof
+BuildRequires:  ghc-amazonka-core-prof
+BuildRequires:  ghc-amazonka-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-ekg-core-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 
 %description
 Push ekg metrics to Amazon Cloudwatch.
@@ -73,26 +75,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +119,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/emailaddress.spec.golden b/test/golden-test-cases/emailaddress.spec.golden
--- a/test/golden-test-cases/emailaddress.spec.golden
+++ b/test/golden-test-cases/emailaddress.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package emailaddress
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,51 +17,55 @@
 
 
 %global pkg_name emailaddress
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Wrapper around email-validate library adding instances for common type classes
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-email-validate-devel
-BuildRequires:  ghc-email-validate-prof
 BuildRequires:  ghc-http-api-data-devel
-BuildRequires:  ghc-http-api-data-prof
 BuildRequires:  ghc-opaleye-devel
-BuildRequires:  ghc-opaleye-prof
 BuildRequires:  ghc-path-pieces-devel
-BuildRequires:  ghc-path-pieces-prof
 BuildRequires:  ghc-persistent-devel
-BuildRequires:  ghc-persistent-prof
 BuildRequires:  ghc-postgresql-simple-devel
-BuildRequires:  ghc-postgresql-simple-prof
 BuildRequires:  ghc-product-profunctors-devel
-BuildRequires:  ghc-product-profunctors-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-email-validate-prof
+BuildRequires:  ghc-http-api-data-prof
+BuildRequires:  ghc-opaleye-prof
+BuildRequires:  ghc-path-pieces-prof
+BuildRequires:  ghc-persistent-prof
+BuildRequires:  ghc-postgresql-simple-prof
+BuildRequires:  ghc-product-profunctors-prof
+BuildRequires:  ghc-profunctors-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Glob-devel
-BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-doctest-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-doctest-prof
 %endif
+%endif
 
 %description
 Wrapper around email-validate library adding instances for common type classes.
@@ -82,26 +86,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -128,9 +133,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/envelope.spec.golden b/test/golden-test-cases/envelope.spec.golden
--- a/test/golden-test-cases/envelope.spec.golden
+++ b/test/golden-test-cases/envelope.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package envelope
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name envelope
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Defines generic 'Envelope' type to wrap reponses from a JSON API
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-http-api-data-devel
-BuildRequires:  ghc-http-api-data-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-http-api-data-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Glob-devel
-BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-doctest-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-doctest-prof
 %endif
+%endif
 
 %description
 Defines generic 'Envelope' type to wrap reponses from a JSON API.
@@ -66,26 +70,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/eventful-sqlite.spec.golden b/test/golden-test-cases/eventful-sqlite.spec.golden
--- a/test/golden-test-cases/eventful-sqlite.spec.golden
+++ b/test/golden-test-cases/eventful-sqlite.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package eventful-sqlite
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,47 +17,51 @@
 
 
 %global pkg_name eventful-sqlite
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        SQLite implementations for eventful
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-eventful-core-devel
-BuildRequires:  ghc-eventful-core-prof
 BuildRequires:  ghc-eventful-sql-common-devel
-BuildRequires:  ghc-eventful-sql-common-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-persistent-devel
-BuildRequires:  ghc-persistent-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-uuid-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-eventful-core-prof
+BuildRequires:  ghc-eventful-sql-common-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-persistent-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-uuid-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-eventful-test-helpers-devel
-BuildRequires:  ghc-eventful-test-helpers-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-persistent-sqlite-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-eventful-test-helpers-prof
+BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-persistent-sqlite-prof
 %endif
+%endif
 
 %description
 SQLite implementations for eventful.
@@ -78,26 +82,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -124,9 +129,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/exact-pi.spec.golden b/test/golden-test-cases/exact-pi.spec.golden
--- a/test/golden-test-cases/exact-pi.spec.golden
+++ b/test/golden-test-cases/exact-pi.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package exact-pi
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name exact-pi
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Exact rational multiples of pi (and integer powers of pi)
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-numtype-dk-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-numtype-dk-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Provides an exact representation for rational multiples of pi alongside an
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/expiring-cache-map.spec.golden b/test/golden-test-cases/expiring-cache-map.spec.golden
--- a/test/golden-test-cases/expiring-cache-map.spec.golden
+++ b/test/golden-test-cases/expiring-cache-map.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package expiring-cache-map
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name expiring-cache-map
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.6.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        General purpose simple caching
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-time-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-time-prof
 %endif
+%endif
 
 %description
 A simple general purpose shared state cache map with automatic expiration of
@@ -67,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/explicit-exception.spec.golden b/test/golden-test-cases/explicit-exception.spec.golden
--- a/test/golden-test-cases/explicit-exception.spec.golden
+++ b/test/golden-test-cases/explicit-exception.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package explicit-exception
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name explicit-exception
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.9
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Exceptions which are explicit in the type signature
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Synchronous and Asynchronous exceptions which are explicit in the type
@@ -73,26 +75,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -114,9 +117,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/fdo-notify.spec.golden b/test/golden-test-cases/fdo-notify.spec.golden
--- a/test/golden-test-cases/fdo-notify.spec.golden
+++ b/test/golden-test-cases/fdo-notify.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package fdo-notify
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name fdo-notify
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Desktop Notifications client
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-dbus-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-dbus-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A library for issuing notifications using FreeDesktop.org's Desktop
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/fgl.spec.golden b/test/golden-test-cases/fgl.spec.golden
--- a/test/golden-test-cases/fgl.spec.golden
+++ b/test/golden-test-cases/fgl.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package fgl
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name fgl
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        5.5.4.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Martin Erwig's Functional Graph Library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 An inductive representation of manipulating graph data structures.
@@ -69,26 +73,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -115,9 +120,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/file-modules.spec.golden b/test/golden-test-cases/file-modules.spec.golden
--- a/test/golden-test-cases/file-modules.spec.golden
+++ b/test/golden-test-cases/file-modules.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package file-modules
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,34 +17,36 @@
 
 
 %global pkg_name file-modules
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.2.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Takes a Haskell source-code file and outputs its modules
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-MissingH-devel
-BuildRequires:  ghc-MissingH-prof
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-haskell-src-exts-devel
-BuildRequires:  ghc-haskell-src-exts-prof
 BuildRequires:  ghc-regex-compat-devel
-BuildRequires:  ghc-regex-compat-prof
 BuildRequires:  ghc-regex-pcre-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-MissingH-prof
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-haskell-src-exts-prof
+BuildRequires:  ghc-regex-compat-prof
 BuildRequires:  ghc-regex-pcre-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Uses 'haskell-src-exts' to parse module imports and follows links . to local
@@ -66,26 +68,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -108,9 +111,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/fingertree.spec.golden b/test/golden-test-cases/fingertree.spec.golden
--- a/test/golden-test-cases/fingertree.spec.golden
+++ b/test/golden-test-cases/fingertree.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package fingertree
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name fingertree
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.3.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generic finger-tree structure, with example instances
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 A general sequence representation with arbitrary annotations, for use as a base
@@ -73,26 +77,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -119,9 +124,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/fixed-vector.spec.golden b/test/golden-test-cases/fixed-vector.spec.golden
--- a/test/golden-test-cases/fixed-vector.spec.golden
+++ b/test/golden-test-cases/fixed-vector.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package fixed-vector
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name fixed-vector
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generic vectors with statically known size
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-filemanip-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-filemanip-prof
 %endif
+%endif
 
 %description
 Generic library for vectors with statically known size. Implementation is based
@@ -93,26 +97,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -139,9 +144,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/fixed.spec.golden b/test/golden-test-cases/fixed.spec.golden
--- a/test/golden-test-cases/fixed.spec.golden
+++ b/test/golden-test-cases/fixed.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package fixed
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name fixed
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Signed 15.16 precision fixed point arithmetic
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Signed 15.16 precision fixed point arithmetic.
@@ -51,26 +53,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -94,9 +97,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/foundation.spec.golden b/test/golden-test-cases/foundation.spec.golden
--- a/test/golden-test-cases/foundation.spec.golden
+++ b/test/golden-test-cases/foundation.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package foundation
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,25 @@
 
 
 %global pkg_name foundation
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.17
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Alternative prelude with batteries and no dependencies
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-basement-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-basement-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A custom prelude with no dependencies apart from base.
@@ -72,26 +74,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -118,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/frisby.spec.golden b/test/golden-test-cases/frisby.spec.golden
--- a/test/golden-test-cases/frisby.spec.golden
+++ b/test/golden-test-cases/frisby.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package frisby
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name frisby
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Linear time composable parser for PEG grammars
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-semigroups-prof
+%endif
 
 %description
 Frisby is a parser library that can parse arbitrary PEG grammars in linear
@@ -69,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +115,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc Changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/funcmp.spec.golden b/test/golden-test-cases/funcmp.spec.golden
--- a/test/golden-test-cases/funcmp.spec.golden
+++ b/test/golden-test-cases/funcmp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package funcmp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name funcmp
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Functional MetaPost
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Functional MetaPost is a Haskell frontend to the MetaPost language by John
@@ -75,26 +77,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -131,9 +134,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license COPYING
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/functor-classes-compat.spec.golden b/test/golden-test-cases/functor-classes-compat.spec.golden
--- a/test/golden-test-cases/functor-classes-compat.spec.golden
+++ b/test/golden-test-cases/functor-classes-compat.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package functor-classes-compat
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name functor-classes-compat
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Data.Functor.Classes instances for core packages
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 "Data.Functor.Classes" instances for core packages:
@@ -66,26 +68,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -109,9 +112,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/general-games.spec.golden b/test/golden-test-cases/general-games.spec.golden
--- a/test/golden-test-cases/general-games.spec.golden
+++ b/test/golden-test-cases/general-games.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package general-games
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name general-games
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library supporting simulation of a number of games
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-MonadRandom-devel
-BuildRequires:  ghc-MonadRandom-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-monad-loops-devel
-BuildRequires:  ghc-monad-loops-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-random-shuffle-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-MonadRandom-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-monad-loops-prof
+BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-random-shuffle-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Library providing framework for simulating outcomes of a variety of games,
@@ -67,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/generic-lens.spec.golden b/test/golden-test-cases/generic-lens.spec.golden
--- a/test/golden-test-cases/generic-lens.spec.golden
+++ b/test/golden-test-cases/generic-lens.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package generic-lens
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name generic-lens
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generic data-structure operations exposed as lenses
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagged-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-profunctors-prof
 BuildRequires:  ghc-tagged-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-inspection-testing-devel
-BuildRequires:  ghc-inspection-testing-prof
 BuildRequires:  ghc-lens-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-inspection-testing-prof
 BuildRequires:  ghc-lens-prof
 %endif
+%endif
 
 %description
 This package uses the GHC 8 Generic representation to derive various operations
@@ -67,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/genvalidity-aeson.spec.golden b/test/golden-test-cases/genvalidity-aeson.spec.golden
--- a/test/golden-test-cases/genvalidity-aeson.spec.golden
+++ b/test/golden-test-cases/genvalidity-aeson.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package genvalidity-aeson
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,45 +17,49 @@
 
 
 %global pkg_name genvalidity-aeson
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        GenValidity support for aeson
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-genvalidity-devel
-BuildRequires:  ghc-genvalidity-prof
 BuildRequires:  ghc-genvalidity-scientific-devel
-BuildRequires:  ghc-genvalidity-scientific-prof
 BuildRequires:  ghc-genvalidity-text-devel
-BuildRequires:  ghc-genvalidity-text-prof
 BuildRequires:  ghc-genvalidity-unordered-containers-devel
-BuildRequires:  ghc-genvalidity-unordered-containers-prof
 BuildRequires:  ghc-genvalidity-vector-devel
-BuildRequires:  ghc-genvalidity-vector-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-validity-aeson-devel
-BuildRequires:  ghc-validity-aeson-prof
 BuildRequires:  ghc-validity-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-genvalidity-prof
+BuildRequires:  ghc-genvalidity-scientific-prof
+BuildRequires:  ghc-genvalidity-text-prof
+BuildRequires:  ghc-genvalidity-unordered-containers-prof
+BuildRequires:  ghc-genvalidity-vector-prof
+BuildRequires:  ghc-validity-aeson-prof
 BuildRequires:  ghc-validity-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-genvalidity-hspec-devel
-BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 GenValidity support for aeson.
@@ -76,26 +80,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +125,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/genvalidity-hspec-aeson.spec.golden b/test/golden-test-cases/genvalidity-hspec-aeson.spec.golden
--- a/test/golden-test-cases/genvalidity-hspec-aeson.spec.golden
+++ b/test/golden-test-cases/genvalidity-hspec-aeson.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package genvalidity-hspec-aeson
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,45 +17,49 @@
 
 
 %global pkg_name genvalidity-hspec-aeson
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Standard spec's for aeson-related instances
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-genvalidity-devel
 BuildRequires:  ghc-genvalidity-hspec-devel
+BuildRequires:  ghc-hspec-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-genvalidity-prof
-BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-genvalidity-aeson-devel
-BuildRequires:  ghc-genvalidity-aeson-prof
 BuildRequires:  ghc-genvalidity-text-devel
-BuildRequires:  ghc-genvalidity-text-prof
 BuildRequires:  ghc-text-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-genvalidity-aeson-prof
+BuildRequires:  ghc-genvalidity-text-prof
 BuildRequires:  ghc-text-prof
 %endif
+%endif
 
 %description
 Standard spec's for aeson-related Instances.
@@ -77,26 +81,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -121,9 +126,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/genvalidity-hspec-binary.spec.golden b/test/golden-test-cases/genvalidity-hspec-binary.spec.golden
--- a/test/golden-test-cases/genvalidity-hspec-binary.spec.golden
+++ b/test/golden-test-cases/genvalidity-hspec-binary.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package genvalidity-hspec-binary
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name genvalidity-hspec-binary
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Standard spec's for binary-related Instances
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-genvalidity-devel
 BuildRequires:  ghc-genvalidity-hspec-devel
+BuildRequires:  ghc-hspec-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-genvalidity-prof
-BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-doctest-prof
 %endif
+%endif
 
 %description
 Standard spec's for cereal-related Instances, see
@@ -70,26 +74,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/genvalidity-scientific.spec.golden b/test/golden-test-cases/genvalidity-scientific.spec.golden
--- a/test/golden-test-cases/genvalidity-scientific.spec.golden
+++ b/test/golden-test-cases/genvalidity-scientific.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package genvalidity-scientific
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name genvalidity-scientific
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        GenValidity support for Scientific
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-genvalidity-devel
-BuildRequires:  ghc-genvalidity-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-validity-devel
-BuildRequires:  ghc-validity-prof
 BuildRequires:  ghc-validity-scientific-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-genvalidity-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-validity-prof
 BuildRequires:  ghc-validity-scientific-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-genvalidity-hspec-devel
-BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 GenValidity support for Scientific.
@@ -69,26 +73,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/genvalidity-uuid.spec.golden b/test/golden-test-cases/genvalidity-uuid.spec.golden
--- a/test/golden-test-cases/genvalidity-uuid.spec.golden
+++ b/test/golden-test-cases/genvalidity-uuid.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package genvalidity-uuid
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name genvalidity-uuid
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        GenValidity support for UUID
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-genvalidity-devel
-BuildRequires:  ghc-genvalidity-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-uuid-devel
-BuildRequires:  ghc-uuid-prof
 BuildRequires:  ghc-validity-devel
-BuildRequires:  ghc-validity-prof
 BuildRequires:  ghc-validity-uuid-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-genvalidity-prof
+BuildRequires:  ghc-uuid-prof
+BuildRequires:  ghc-validity-prof
 BuildRequires:  ghc-validity-uuid-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-genvalidity-hspec-devel
-BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-genvalidity-hspec-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 GenValidity support for UUID.
@@ -68,26 +72,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ghc-syb-utils.spec.golden b/test/golden-test-cases/ghc-syb-utils.spec.golden
--- a/test/golden-test-cases/ghc-syb-utils.spec.golden
+++ b/test/golden-test-cases/ghc-syb-utils.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-syb-utils
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name ghc-syb-utils
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.3.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Scrap Your Boilerplate utilities for the GHC API
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-ghc-devel
-BuildRequires:  ghc-ghc-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-syb-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-ghc-prof
 BuildRequires:  ghc-syb-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-paths-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-paths-prof
 %endif
+%endif
 
 %description
 Scrap Your Boilerplate utilities for the GHC API.
@@ -64,26 +68,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -108,9 +113,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ghcid.spec.golden b/test/golden-test-cases/ghcid.spec.golden
--- a/test/golden-test-cases/ghcid.spec.golden
+++ b/test/golden-test-cases/ghcid.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ghcid
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,49 +17,53 @@
 
 
 %global pkg_name ghcid
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        GHCi based bare bones IDE
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-ansi-terminal-devel
-BuildRequires:  ghc-ansi-terminal-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-cmdargs-devel
-BuildRequires:  ghc-cmdargs-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-extra-devel
-BuildRequires:  ghc-extra-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-fsnotify-devel
-BuildRequires:  ghc-fsnotify-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-terminal-size-devel
-BuildRequires:  ghc-terminal-size-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-ansi-terminal-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-cmdargs-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-extra-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-fsnotify-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-terminal-size-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 Either "GHCi as a daemon" or "GHC + a bit of an IDE". A very simple Haskell
@@ -85,26 +89,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -132,9 +137,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.txt README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/giphy-api.spec.golden b/test/golden-test-cases/giphy-api.spec.golden
--- a/test/golden-test-cases/giphy-api.spec.golden
+++ b/test/golden-test-cases/giphy-api.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package giphy-api
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,59 +17,63 @@
 
 
 %global pkg_name giphy-api
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Giphy HTTP API wrapper and CLI search tool
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-http-api-data-devel
-BuildRequires:  ghc-http-api-data-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-client-tls-devel
-BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-microlens-devel
-BuildRequires:  ghc-microlens-prof
 BuildRequires:  ghc-microlens-th-devel
-BuildRequires:  ghc-microlens-th-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-servant-client-devel
-BuildRequires:  ghc-servant-client-prof
 BuildRequires:  ghc-servant-devel
-BuildRequires:  ghc-servant-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-http-api-data-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-client-tls-prof
+BuildRequires:  ghc-microlens-prof
+BuildRequires:  ghc-microlens-th-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-servant-client-prof
+BuildRequires:  ghc-servant-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-basic-prelude-devel
-BuildRequires:  ghc-basic-prelude-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-lens-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-basic-prelude-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-lens-prof
 %endif
+%endif
 
 %description
 Giphy HTTP API wrapper and CLI search tool.
@@ -90,26 +94,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -136,9 +141,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/github.spec.golden b/test/golden-test-cases/github.spec.golden
--- a/test/golden-test-cases/github.spec.golden
+++ b/test/golden-test-cases/github.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package github
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,87 +17,91 @@
 
 
 %global pkg_name github
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.18
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Access to the GitHub API, v3
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-compat-devel
-BuildRequires:  ghc-aeson-compat-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-compat-devel
-BuildRequires:  ghc-base-compat-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base16-bytestring-devel
-BuildRequires:  ghc-base16-bytestring-prof
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-binary-orphans-devel
-BuildRequires:  ghc-binary-orphans-prof
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-byteable-devel
-BuildRequires:  ghc-byteable-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cryptohash-devel
-BuildRequires:  ghc-cryptohash-prof
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-deepseq-generics-devel
-BuildRequires:  ghc-deepseq-generics-prof
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-client-tls-devel
-BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-http-link-header-devel
-BuildRequires:  ghc-http-link-header-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-iso8601-time-devel
-BuildRequires:  ghc-iso8601-time-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-tls-devel
-BuildRequires:  ghc-tls-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-instances-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-compat-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-compat-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base16-bytestring-prof
+BuildRequires:  ghc-binary-orphans-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-byteable-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cryptohash-prof
+BuildRequires:  ghc-deepseq-generics-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-client-tls-prof
+BuildRequires:  ghc-http-link-header-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-iso8601-time-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-tls-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-instances-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-file-embed-devel
-BuildRequires:  ghc-file-embed-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-file-embed-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 The GitHub API provides programmatic access to the full GitHub Web site, from
@@ -129,26 +133,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -175,9 +180,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gl.spec.golden b/test/golden-test-cases/gl.spec.golden
--- a/test/golden-test-cases/gl.spec.golden
+++ b/test/golden-test-cases/gl.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gl
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,36 +17,38 @@
 
 
 %global pkg_name gl
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.8.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Complete OpenGL raw bindings
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  Mesa-libGL-devel
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-fixed-devel
-BuildRequires:  ghc-fixed-prof
 BuildRequires:  ghc-half-devel
-BuildRequires:  ghc-half-prof
 BuildRequires:  ghc-hxt-devel
-BuildRequires:  ghc-hxt-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-fixed-prof
+BuildRequires:  ghc-half-prof
+BuildRequires:  ghc-hxt-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Complete OpenGL raw bindings.
@@ -59,35 +61,36 @@
 
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
+Requires:       Mesa-libGL-devel
 Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
-Requires:       Mesa-libGL-devel
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -111,9 +114,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown TODO.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-adexchange-buyer.spec.golden b/test/golden-test-cases/gogol-adexchange-buyer.spec.golden
--- a/test/golden-test-cases/gogol-adexchange-buyer.spec.golden
+++ b/test/golden-test-cases/gogol-adexchange-buyer.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-adexchange-buyer
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-adexchange-buyer
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Ad Exchange Buyer SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Accesses your bidding-account information, submits creatives for validation,
@@ -60,26 +62,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-admin-emailmigration.spec.golden b/test/golden-test-cases/gogol-admin-emailmigration.spec.golden
--- a/test/golden-test-cases/gogol-admin-emailmigration.spec.golden
+++ b/test/golden-test-cases/gogol-admin-emailmigration.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-admin-emailmigration
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-admin-emailmigration
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Email Migration API v2 SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Email Migration API lets you migrate emails of users to Google backends.
@@ -59,26 +61,27 @@
 This package provides the Haskell %{name} library
 development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-affiliates.spec.golden b/test/golden-test-cases/gogol-affiliates.spec.golden
--- a/test/golden-test-cases/gogol-affiliates.spec.golden
+++ b/test/golden-test-cases/gogol-affiliates.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-affiliates
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-affiliates
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Affiliate Network SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Lets you have programmatic access to your Google Affiliate Network data.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-apps-tasks.spec.golden b/test/golden-test-cases/gogol-apps-tasks.spec.golden
--- a/test/golden-test-cases/gogol-apps-tasks.spec.golden
+++ b/test/golden-test-cases/gogol-apps-tasks.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-apps-tasks
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-apps-tasks
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Tasks SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Lets you manage your tasks and task lists.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-appstate.spec.golden b/test/golden-test-cases/gogol-appstate.spec.golden
--- a/test/golden-test-cases/gogol-appstate.spec.golden
+++ b/test/golden-test-cases/gogol-appstate.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-appstate
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-appstate
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google App State SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 The Google App State API.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-blogger.spec.golden b/test/golden-test-cases/gogol-blogger.spec.golden
--- a/test/golden-test-cases/gogol-blogger.spec.golden
+++ b/test/golden-test-cases/gogol-blogger.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-blogger
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-blogger
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Blogger SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 API for access to the data within Blogger.
@@ -62,26 +64,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -105,9 +108,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-datastore.spec.golden b/test/golden-test-cases/gogol-datastore.spec.golden
--- a/test/golden-test-cases/gogol-datastore.spec.golden
+++ b/test/golden-test-cases/gogol-datastore.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-datastore
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-datastore
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Cloud Datastore SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Accesses the schemaless NoSQL database to provide fully managed, robust,
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-dfareporting.spec.golden b/test/golden-test-cases/gogol-dfareporting.spec.golden
--- a/test/golden-test-cases/gogol-dfareporting.spec.golden
+++ b/test/golden-test-cases/gogol-dfareporting.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-dfareporting
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-dfareporting
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google DCM/DFA Reporting And Trafficking SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Manages your DoubleClick Campaign Manager ad campaigns and reports.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-firebase-rules.spec.golden b/test/golden-test-cases/gogol-firebase-rules.spec.golden
--- a/test/golden-test-cases/gogol-firebase-rules.spec.golden
+++ b/test/golden-test-cases/gogol-firebase-rules.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-firebase-rules
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-firebase-rules
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Firebase Rules SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Creates and manages rules that determine when a Firebase Rules-enabled service
@@ -60,26 +62,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-gmail.spec.golden b/test/golden-test-cases/gogol-gmail.spec.golden
--- a/test/golden-test-cases/gogol-gmail.spec.golden
+++ b/test/golden-test-cases/gogol-gmail.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-gmail
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-gmail
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Gmail SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Access Gmail mailboxes including sending user email.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-kgsearch.spec.golden b/test/golden-test-cases/gogol-kgsearch.spec.golden
--- a/test/golden-test-cases/gogol-kgsearch.spec.golden
+++ b/test/golden-test-cases/gogol-kgsearch.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-kgsearch
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-kgsearch
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Knowledge Graph Search SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Searches the Google Knowledge Graph for entities.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-maps-engine.spec.golden b/test/golden-test-cases/gogol-maps-engine.spec.golden
--- a/test/golden-test-cases/gogol-maps-engine.spec.golden
+++ b/test/golden-test-cases/gogol-maps-engine.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-maps-engine
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-maps-engine
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Maps Engine SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 The Google Maps Engine API allows developers to store and query geospatial
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-plus.spec.golden b/test/golden-test-cases/gogol-plus.spec.golden
--- a/test/golden-test-cases/gogol-plus.spec.golden
+++ b/test/golden-test-cases/gogol-plus.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-plus
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-plus
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google + SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Builds on top of the Google+ platform.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-resourceviews.spec.golden b/test/golden-test-cases/gogol-resourceviews.spec.golden
--- a/test/golden-test-cases/gogol-resourceviews.spec.golden
+++ b/test/golden-test-cases/gogol-resourceviews.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-resourceviews
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-resourceviews
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Compute Engine Instance Groups SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 The Resource View API allows users to create and manage logical sets of Google
@@ -64,26 +66,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -107,9 +110,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-translate.spec.golden b/test/golden-test-cases/gogol-translate.spec.golden
--- a/test/golden-test-cases/gogol-translate.spec.golden
+++ b/test/golden-test-cases/gogol-translate.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-translate
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-translate
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Translate SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Translates text from one language to another.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-webmaster-tools.spec.golden b/test/golden-test-cases/gogol-webmaster-tools.spec.golden
--- a/test/golden-test-cases/gogol-webmaster-tools.spec.golden
+++ b/test/golden-test-cases/gogol-webmaster-tools.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-webmaster-tools
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-webmaster-tools
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google Search Console SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 View Google Search Console data for your verified sites.
@@ -59,26 +61,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gogol-youtube.spec.golden b/test/golden-test-cases/gogol-youtube.spec.golden
--- a/test/golden-test-cases/gogol-youtube.spec.golden
+++ b/test/golden-test-cases/gogol-youtube.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gogol-youtube
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name gogol-youtube
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Google YouTube Data SDK
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-gogol-core-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Supports core YouTube features, such as uploading videos, creating and managing
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/groundhog-mysql.spec.golden b/test/golden-test-cases/groundhog-mysql.spec.golden
--- a/test/golden-test-cases/groundhog-mysql.spec.golden
+++ b/test/golden-test-cases/groundhog-mysql.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package groundhog-mysql
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,44 +17,46 @@
 
 
 %global pkg_name groundhog-mysql
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        MySQL backend for the groundhog library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-groundhog-devel
-BuildRequires:  ghc-groundhog-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-monad-logger-devel
-BuildRequires:  ghc-monad-logger-prof
 BuildRequires:  ghc-mysql-devel
-BuildRequires:  ghc-mysql-prof
 BuildRequires:  ghc-mysql-simple-devel
-BuildRequires:  ghc-mysql-simple-prof
 BuildRequires:  ghc-resource-pool-devel
-BuildRequires:  ghc-resource-pool-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-groundhog-prof
+BuildRequires:  ghc-monad-control-prof
+BuildRequires:  ghc-monad-logger-prof
+BuildRequires:  ghc-mysql-prof
+BuildRequires:  ghc-mysql-simple-prof
+BuildRequires:  ghc-resource-pool-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This package uses mysql-simple and mysql.
@@ -75,26 +77,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -118,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/gsasl.spec.golden b/test/golden-test-cases/gsasl.spec.golden
--- a/test/golden-test-cases/gsasl.spec.golden
+++ b/test/golden-test-cases/gsasl.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package gsasl
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name gsasl
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Bindings for GNU libgsasl
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(libgsasl)
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Bindings for GNU libgsasl.
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hOpenPGP.spec.golden b/test/golden-test-cases/hOpenPGP.spec.golden
--- a/test/golden-test-cases/hOpenPGP.spec.golden
+++ b/test/golden-test-cases/hOpenPGP.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hOpenPGP
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,111 +17,115 @@
 
 
 %global pkg_name hOpenPGP
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        2.5.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Native Haskell implementation of OpenPGP (RFC4880)
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base16-bytestring-devel
-BuildRequires:  ghc-base16-bytestring-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-binary-conduit-devel
-BuildRequires:  ghc-binary-conduit-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-byteable-devel
-BuildRequires:  ghc-byteable-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-bzlib-devel
-BuildRequires:  ghc-bzlib-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
-BuildRequires:  ghc-conduit-extra-prof
-BuildRequires:  ghc-conduit-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-crypto-cipher-types-devel
-BuildRequires:  ghc-crypto-cipher-types-prof
 BuildRequires:  ghc-cryptonite-devel
-BuildRequires:  ghc-cryptonite-prof
 BuildRequires:  ghc-data-default-class-devel
-BuildRequires:  ghc-data-default-class-prof
 BuildRequires:  ghc-errors-devel
-BuildRequires:  ghc-errors-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-incremental-parser-devel
-BuildRequires:  ghc-incremental-parser-prof
 BuildRequires:  ghc-ixset-typed-devel
-BuildRequires:  ghc-ixset-typed-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-memory-devel
-BuildRequires:  ghc-memory-prof
 BuildRequires:  ghc-monad-loops-devel
-BuildRequires:  ghc-monad-loops-prof
 BuildRequires:  ghc-nettle-devel
-BuildRequires:  ghc-nettle-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-newtype-devel
-BuildRequires:  ghc-newtype-prof
 BuildRequires:  ghc-openpgp-asciiarmor-devel
-BuildRequires:  ghc-openpgp-asciiarmor-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-securemem-devel
-BuildRequires:  ghc-securemem-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-locale-compat-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unordered-containers-devel
+BuildRequires:  ghc-wl-pprint-extras-devel
+BuildRequires:  ghc-zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base16-bytestring-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-binary-conduit-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-byteable-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-bzlib-prof
+BuildRequires:  ghc-conduit-extra-prof
+BuildRequires:  ghc-conduit-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-crypto-cipher-types-prof
+BuildRequires:  ghc-cryptonite-prof
+BuildRequires:  ghc-data-default-class-prof
+BuildRequires:  ghc-errors-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-incremental-parser-prof
+BuildRequires:  ghc-ixset-typed-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-memory-prof
+BuildRequires:  ghc-monad-loops-prof
+BuildRequires:  ghc-nettle-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-newtype-prof
+BuildRequires:  ghc-openpgp-asciiarmor-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-securemem-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-locale-compat-prof
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
-BuildRequires:  ghc-wl-pprint-extras-devel
 BuildRequires:  ghc-wl-pprint-extras-prof
-BuildRequires:  ghc-zlib-devel
 BuildRequires:  ghc-zlib-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Native Haskell implementation of OpenPGP (RFC4880), plus Camellia (RFC5581).
@@ -142,26 +146,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -186,9 +191,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hPDB-examples.spec.golden b/test/golden-test-cases/hPDB-examples.spec.golden
--- a/test/golden-test-cases/hPDB-examples.spec.golden
+++ b/test/golden-test-cases/hPDB-examples.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hPDB-examples
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
 #
 
 
+%bcond_with ghc_prof
 %bcond_with tests
 Name:           hPDB-examples
 Version:        1.2.0.8
@@ -24,57 +25,61 @@
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-AC-Vector-devel
-BuildRequires:  ghc-AC-Vector-prof
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-GLUT-devel
-BuildRequires:  ghc-GLUT-prof
 BuildRequires:  ghc-Octree-devel
-BuildRequires:  ghc-Octree-prof
 BuildRequires:  ghc-OpenGL-devel
-BuildRequires:  ghc-OpenGL-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-hPDB-devel
-BuildRequires:  ghc-hPDB-prof
 BuildRequires:  ghc-iterable-devel
-BuildRequires:  ghc-iterable-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-format-devel
+BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-AC-Vector-prof
+BuildRequires:  ghc-GLUT-prof
+BuildRequires:  ghc-Octree-prof
+BuildRequires:  ghc-OpenGL-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-hPDB-prof
+BuildRequires:  ghc-iterable-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-format-prof
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-IfElse-devel
-BuildRequires:  ghc-IfElse-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-time-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-IfElse-prof
+BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-time-prof
 %endif
+%endif
 
 %description
 Examples for handling Protein Data Bank file format.
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_bin_build
diff --git a/test/golden-test-cases/haddock-library.spec.golden b/test/golden-test-cases/haddock-library.spec.golden
--- a/test/golden-test-cases/haddock-library.spec.golden
+++ b/test/golden-test-cases/haddock-library.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package haddock-library
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,45 +17,49 @@
 
 
 %global pkg_name haddock-library
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library exposing some functionality of Haddock
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-compat-devel
-BuildRequires:  ghc-base-compat-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-tree-diff-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-compat-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-hspec-prof
+BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-tree-diff-prof
 %endif
+%endif
 
 %description
 Haddock is a documentation-generation tool for Haskell libraries.
@@ -80,26 +84,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -128,10 +133,12 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 %license vendor/attoparsec-0.13.1.0/LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hakyll.spec.golden b/test/golden-test-cases/hakyll.spec.golden
--- a/test/golden-test-cases/hakyll.spec.golden
+++ b/test/golden-test-cases/hakyll.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hakyll
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,108 +17,112 @@
 
 
 %global pkg_name hakyll
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        4.10.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A static website compiler library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-blaze-markup-devel
-BuildRequires:  ghc-blaze-markup-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cryptohash-devel
-BuildRequires:  ghc-cryptohash-prof
 BuildRequires:  ghc-data-default-devel
-BuildRequires:  ghc-data-default-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-fsnotify-devel
-BuildRequires:  ghc-fsnotify-prof
 BuildRequires:  ghc-http-conduit-devel
-BuildRequires:  ghc-http-conduit-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-lrucache-devel
-BuildRequires:  ghc-lrucache-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-pandoc-citeproc-devel
-BuildRequires:  ghc-pandoc-citeproc-prof
 BuildRequires:  ghc-pandoc-devel
-BuildRequires:  ghc-pandoc-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-regex-base-devel
-BuildRequires:  ghc-regex-base-prof
 BuildRequires:  ghc-regex-tdfa-devel
-BuildRequires:  ghc-regex-tdfa-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-system-filepath-devel
-BuildRequires:  ghc-system-filepath-prof
 BuildRequires:  ghc-tagsoup-devel
-BuildRequires:  ghc-tagsoup-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-locale-compat-devel
+BuildRequires:  ghc-unordered-containers-devel
+BuildRequires:  ghc-vector-devel
+BuildRequires:  ghc-wai-app-static-devel
+BuildRequires:  ghc-wai-devel
+BuildRequires:  ghc-warp-devel
+BuildRequires:  ghc-yaml-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-blaze-markup-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cryptohash-prof
+BuildRequires:  ghc-data-default-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-fsnotify-prof
+BuildRequires:  ghc-http-conduit-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-lrucache-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-pandoc-citeproc-prof
+BuildRequires:  ghc-pandoc-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-regex-base-prof
+BuildRequires:  ghc-regex-tdfa-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-system-filepath-prof
+BuildRequires:  ghc-tagsoup-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-locale-compat-prof
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
-BuildRequires:  ghc-wai-app-static-devel
 BuildRequires:  ghc-wai-app-static-prof
-BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-prof
-BuildRequires:  ghc-warp-devel
 BuildRequires:  ghc-warp-prof
-BuildRequires:  ghc-yaml-devel
 BuildRequires:  ghc-yaml-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Hakyll is a static website compiler library. It provides you with the tools to
@@ -153,33 +157,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -226,9 +231,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/happstack-hsp.spec.golden b/test/golden-test-cases/happstack-hsp.spec.golden
--- a/test/golden-test-cases/happstack-hsp.spec.golden
+++ b/test/golden-test-cases/happstack-hsp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package happstack-hsp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,38 +17,40 @@
 
 
 %global pkg_name happstack-hsp
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        7.3.7.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Support for using HSP templates in Happstack
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-happstack-server-devel
-BuildRequires:  ghc-happstack-server-prof
 BuildRequires:  ghc-harp-devel
-BuildRequires:  ghc-harp-prof
 BuildRequires:  ghc-hsp-devel
-BuildRequires:  ghc-hsp-prof
 BuildRequires:  ghc-hsx2hs-devel
-BuildRequires:  ghc-hsx2hs-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-syb-devel
-BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-utf8-string-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-happstack-server-prof
+BuildRequires:  ghc-harp-prof
+BuildRequires:  ghc-hsp-prof
+BuildRequires:  ghc-hsx2hs-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-syb-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-utf8-string-prof
+%endif
 
 %description
 Happstack is a web application framework. HSP is an XML templating solution.
@@ -70,26 +72,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -111,9 +114,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/happy.spec.golden b/test/golden-test-cases/happy.spec.golden
--- a/test/golden-test-cases/happy.spec.golden
+++ b/test/golden-test-cases/happy.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package happy
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
 #
 
 
+%bcond_with ghc_prof
 %bcond_with tests
 Name:           happy
 Version:        1.19.8
@@ -24,26 +25,30 @@
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-process-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-process-prof
 %endif
+%endif
 
 %description
 Happy is a parser generator for Haskell. Given a grammar specification in BNF,
@@ -51,7 +56,7 @@
 to the 'yacc' tool for C.
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_bin_build
diff --git a/test/golden-test-cases/harp.spec.golden b/test/golden-test-cases/harp.spec.golden
--- a/test/golden-test-cases/harp.spec.golden
+++ b/test/golden-test-cases/harp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package harp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name harp
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        HaRP allows pattern-matching with regular expressions
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 HaRP, or Haskell Regular Patterns, is a Haskell extension that extends the
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -99,9 +102,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hashtables.spec.golden b/test/golden-test-cases/hashtables.spec.golden
--- a/test/golden-test-cases/hashtables.spec.golden
+++ b/test/golden-test-cases/hashtables.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hashtables
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name hashtables
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.2.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Mutable hash tables in the ST monad
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-primitive-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 This package provides a couple of different implementations of mutable hash
@@ -53,7 +55,7 @@
 introduced by Pagh and Rodler in 2001 (see
 <http://en.wikipedia.org/wiki/Cuckoo_hashing>). Cuckoo hashing has worst-case
 /O(1)/ lookups and can reach a high "load factor", in which the table can
-perform acceptably well even when approaching 90% full. Randomized testing
+perform acceptably well even when approaching 90%% full. Randomized testing
 shows this implementation of cuckoo hashing to be slightly faster on insert and
 slightly slower on lookup than "Data.Hashtable.ST.Basic", while being more
 space efficient by about a half-word per key-value mapping. Cuckoo hashing,
@@ -128,26 +130,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -171,9 +174,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/haskell-tools-debug.spec.golden b/test/golden-test-cases/haskell-tools-debug.spec.golden
--- a/test/golden-test-cases/haskell-tools-debug.spec.golden
+++ b/test/golden-test-cases/haskell-tools-debug.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package haskell-tools-debug
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,45 @@
 
 
 %global pkg_name haskell-tools-debug
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Debugging Tools for Haskell-tools
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-devel
 BuildRequires:  ghc-ghc-paths-devel
+BuildRequires:  ghc-haskell-tools-ast-devel
+BuildRequires:  ghc-haskell-tools-backend-ghc-devel
+BuildRequires:  ghc-haskell-tools-builtin-refactorings-devel
+BuildRequires:  ghc-haskell-tools-prettyprint-devel
+BuildRequires:  ghc-haskell-tools-refactor-devel
+BuildRequires:  ghc-references-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-split-devel
+BuildRequires:  ghc-template-haskell-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-paths-prof
 BuildRequires:  ghc-ghc-prof
-BuildRequires:  ghc-haskell-tools-ast-devel
 BuildRequires:  ghc-haskell-tools-ast-prof
-BuildRequires:  ghc-haskell-tools-backend-ghc-devel
 BuildRequires:  ghc-haskell-tools-backend-ghc-prof
-BuildRequires:  ghc-haskell-tools-builtin-refactorings-devel
 BuildRequires:  ghc-haskell-tools-builtin-refactorings-prof
-BuildRequires:  ghc-haskell-tools-prettyprint-devel
 BuildRequires:  ghc-haskell-tools-prettyprint-prof
-BuildRequires:  ghc-haskell-tools-refactor-devel
 BuildRequires:  ghc-haskell-tools-refactor-prof
-BuildRequires:  ghc-references-devel
 BuildRequires:  ghc-references-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-split-prof
-BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-template-haskell-prof
+%endif
 
 %description
 Debugging Tools for Haskell-tools.
@@ -75,33 +77,34 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -118,9 +121,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/haskell-tools-rewrite.spec.golden b/test/golden-test-cases/haskell-tools-rewrite.spec.golden
--- a/test/golden-test-cases/haskell-tools-rewrite.spec.golden
+++ b/test/golden-test-cases/haskell-tools-rewrite.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package haskell-tools-rewrite
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name haskell-tools-rewrite
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Facilities for generating new parts of the Haskell-Tools AST
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-ghc-devel
-BuildRequires:  ghc-ghc-prof
 BuildRequires:  ghc-haskell-tools-ast-devel
-BuildRequires:  ghc-haskell-tools-ast-prof
 BuildRequires:  ghc-haskell-tools-prettyprint-devel
-BuildRequires:  ghc-haskell-tools-prettyprint-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-references-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-ghc-prof
+BuildRequires:  ghc-haskell-tools-ast-prof
+BuildRequires:  ghc-haskell-tools-prettyprint-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-references-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 Contains utility functions to generate parts of the Haskell-Tools AST.
@@ -79,26 +83,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -123,9 +128,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hasql.spec.golden b/test/golden-test-cases/hasql.spec.golden
--- a/test/golden-test-cases/hasql.spec.golden
+++ b/test/golden-test-cases/hasql.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hasql
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,79 +17,83 @@
 
 
 %global pkg_name hasql
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        An efficient PostgreSQL driver and a flexible mapping API
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
 BuildRequires:  ghc-base-prelude-devel
-BuildRequires:  ghc-base-prelude-prof
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-bytestring-strict-builder-devel
-BuildRequires:  ghc-bytestring-strict-builder-prof
 BuildRequires:  ghc-contravariant-devel
 BuildRequires:  ghc-contravariant-extras-devel
+BuildRequires:  ghc-data-default-class-devel
+BuildRequires:  ghc-dlist-devel
+BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-hashtables-devel
+BuildRequires:  ghc-loch-th-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-placeholders-devel
+BuildRequires:  ghc-postgresql-binary-devel
+BuildRequires:  ghc-postgresql-libpq-devel
+BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-semigroups-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prelude-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-bytestring-strict-builder-prof
 BuildRequires:  ghc-contravariant-extras-prof
 BuildRequires:  ghc-contravariant-prof
-BuildRequires:  ghc-data-default-class-devel
 BuildRequires:  ghc-data-default-class-prof
-BuildRequires:  ghc-dlist-devel
 BuildRequires:  ghc-dlist-prof
-BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-hashtables-devel
 BuildRequires:  ghc-hashtables-prof
-BuildRequires:  ghc-loch-th-devel
 BuildRequires:  ghc-loch-th-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-placeholders-devel
 BuildRequires:  ghc-placeholders-prof
-BuildRequires:  ghc-postgresql-binary-devel
 BuildRequires:  ghc-postgresql-binary-prof
-BuildRequires:  ghc-postgresql-libpq-devel
 BuildRequires:  ghc-postgresql-libpq-prof
-BuildRequires:  ghc-profunctors-devel
 BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-semigroups-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-bug-devel
-BuildRequires:  ghc-bug-prof
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-rebase-devel
-BuildRequires:  ghc-rebase-prof
 BuildRequires:  ghc-rerebase-devel
-BuildRequires:  ghc-rerebase-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-bug-prof
+BuildRequires:  ghc-quickcheck-instances-prof
+BuildRequires:  ghc-rebase-prof
+BuildRequires:  ghc-rerebase-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 This package is the root of the "hasql" ecosystem.
@@ -115,26 +119,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -159,9 +164,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hformat.spec.golden b/test/golden-test-cases/hformat.spec.golden
--- a/test/golden-test-cases/hformat.spec.golden
+++ b/test/golden-test-cases/hformat.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hformat
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name hformat
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Simple Haskell formatting
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-ansi-terminal-devel
-BuildRequires:  ghc-ansi-terminal-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base-unicode-symbols-devel
-BuildRequires:  ghc-base-unicode-symbols-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-ansi-terminal-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base-unicode-symbols-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 String formatting.
@@ -62,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +111,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/highlighting-kate.spec.golden b/test/golden-test-cases/highlighting-kate.spec.golden
--- a/test/golden-test-cases/highlighting-kate.spec.golden
+++ b/test/golden-test-cases/highlighting-kate.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package highlighting-kate
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name highlighting-kate
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Syntax highlighting
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-regex-pcre-builtin-devel
-BuildRequires:  ghc-regex-pcre-builtin-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-utf8-string-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-regex-pcre-builtin-prof
 BuildRequires:  ghc-utf8-string-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Diff-devel
-BuildRequires:  ghc-Diff-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-process-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Diff-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-process-prof
 %endif
+%endif
 
 %description
 Highlighting-kate is a syntax highlighting library with support for nearly one
@@ -79,26 +83,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -125,9 +130,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hit.spec.golden b/test/golden-test-cases/hit.spec.golden
--- a/test/golden-test-cases/hit.spec.golden
+++ b/test/golden-test-cases/hit.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hit
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,63 +17,67 @@
 
 
 %global pkg_name hit
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Git operations in haskell
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-byteable-devel
-BuildRequires:  ghc-byteable-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cryptohash-devel
-BuildRequires:  ghc-cryptohash-prof
 BuildRequires:  ghc-hourglass-devel
-BuildRequires:  ghc-hourglass-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-patience-devel
-BuildRequires:  ghc-patience-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-system-fileio-devel
-BuildRequires:  ghc-system-fileio-prof
 BuildRequires:  ghc-system-filepath-devel
-BuildRequires:  ghc-system-filepath-prof
 BuildRequires:  ghc-unix-compat-devel
-BuildRequires:  ghc-unix-compat-prof
 BuildRequires:  ghc-utf8-string-devel
-BuildRequires:  ghc-utf8-string-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-zlib-bindings-devel
-BuildRequires:  ghc-zlib-bindings-prof
 BuildRequires:  ghc-zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-byteable-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cryptohash-prof
+BuildRequires:  ghc-hourglass-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-patience-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-system-fileio-prof
+BuildRequires:  ghc-system-filepath-prof
+BuildRequires:  ghc-unix-compat-prof
+BuildRequires:  ghc-utf8-string-prof
+BuildRequires:  ghc-vector-prof
+BuildRequires:  ghc-zlib-bindings-prof
 BuildRequires:  ghc-zlib-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-bytedump-devel
-BuildRequires:  ghc-bytedump-prof
 BuildRequires:  ghc-tasty-devel
-BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-bytedump-prof
+BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 An haskell implementation of git storage operations, allowing users to
@@ -101,26 +105,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -147,9 +152,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hjson.spec.golden b/test/golden-test-cases/hjson.spec.golden
--- a/test/golden-test-cases/hjson.spec.golden
+++ b/test/golden-test-cases/hjson.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hjson
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name hjson
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.3.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        JSON parsing library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 JSON parsing library with simple and sane API.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license COPYING
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hmpfr.spec.golden b/test/golden-test-cases/hmpfr.spec.golden
--- a/test/golden-test-cases/hmpfr.spec.golden
+++ b/test/golden-test-cases/hmpfr.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hmpfr
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,21 +17,23 @@
 
 
 %global pkg_name hmpfr
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Haskell binding to the MPFR library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  mpfr-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+%endif
 
 %description
 Haskell binding to the MPFR library.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hoogle.spec.golden b/test/golden-test-cases/hoogle.spec.golden
--- a/test/golden-test-cases/hoogle.spec.golden
+++ b/test/golden-test-cases/hoogle.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hoogle
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,99 +17,101 @@
 
 
 %global pkg_name hoogle
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        5.0.14
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Haskell API Search
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cmdargs-devel
-BuildRequires:  ghc-cmdargs-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
-BuildRequires:  ghc-conduit-extra-prof
-BuildRequires:  ghc-conduit-prof
 BuildRequires:  ghc-connection-devel
-BuildRequires:  ghc-connection-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-extra-devel
-BuildRequires:  ghc-extra-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-haskell-src-exts-devel
-BuildRequires:  ghc-haskell-src-exts-prof
 BuildRequires:  ghc-http-conduit-devel
-BuildRequires:  ghc-http-conduit-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-js-flot-devel
-BuildRequires:  ghc-js-flot-prof
 BuildRequires:  ghc-js-jquery-devel
-BuildRequires:  ghc-js-jquery-prof
 BuildRequires:  ghc-mmap-devel
-BuildRequires:  ghc-mmap-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-old-locale-devel
-BuildRequires:  ghc-old-locale-prof
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-process-extras-devel
-BuildRequires:  ghc-process-extras-prof
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-storable-tuple-devel
-BuildRequires:  ghc-storable-tuple-prof
 BuildRequires:  ghc-tar-devel
-BuildRequires:  ghc-tar-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-uniplate-devel
-BuildRequires:  ghc-uniplate-prof
 BuildRequires:  ghc-utf8-string-devel
-BuildRequires:  ghc-utf8-string-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-logger-devel
+BuildRequires:  ghc-warp-devel
+BuildRequires:  ghc-warp-tls-devel
+BuildRequires:  ghc-zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cmdargs-prof
+BuildRequires:  ghc-conduit-extra-prof
+BuildRequires:  ghc-conduit-prof
+BuildRequires:  ghc-connection-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-extra-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-haskell-src-exts-prof
+BuildRequires:  ghc-http-conduit-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-js-flot-prof
+BuildRequires:  ghc-js-jquery-prof
+BuildRequires:  ghc-mmap-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-old-locale-prof
+BuildRequires:  ghc-process-extras-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-storable-tuple-prof
+BuildRequires:  ghc-tar-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-uniplate-prof
+BuildRequires:  ghc-utf8-string-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-wai-logger-prof
 BuildRequires:  ghc-wai-prof
-BuildRequires:  ghc-warp-devel
 BuildRequires:  ghc-warp-prof
-BuildRequires:  ghc-warp-tls-devel
 BuildRequires:  ghc-warp-tls-prof
-BuildRequires:  ghc-zlib-devel
 BuildRequires:  ghc-zlib-prof
+%endif
 
 %description
 Hoogle is a Haskell API search engine, which allows you to search many standard
@@ -131,33 +133,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -189,9 +192,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.txt README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hostname-validate.spec.golden b/test/golden-test-cases/hostname-validate.spec.golden
--- a/test/golden-test-cases/hostname-validate.spec.golden
+++ b/test/golden-test-cases/hostname-validate.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hostname-validate
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name hostname-validate
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Validate hostnames e.g. localhost or foo.co.uk
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Validate hostnames e.g. localhost or foo.co.uk. See also RFC 1123, RFC 952, and
@@ -56,26 +58,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -97,9 +100,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hsinstall.spec.golden b/test/golden-test-cases/hsinstall.spec.golden
--- a/test/golden-test-cases/hsinstall.spec.golden
+++ b/test/golden-test-cases/hsinstall.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hsinstall
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,25 +17,27 @@
 
 
 %global pkg_name hsinstall
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Install Haskell software
 License:        ISC
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 This is a utility to install Haskell programs on a system using stack.
@@ -60,33 +62,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -108,9 +111,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md doc
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hstatsd.spec.golden b/test/golden-test-cases/hstatsd.spec.golden
--- a/test/golden-test-cases/hstatsd.spec.golden
+++ b/test/golden-test-cases/hstatsd.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hstatsd
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name hstatsd
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Quick and dirty statsd interface
-License:        SUSE-Public-Domain
+License:        LicenseRef-SUSE-Public-Domain
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Quick and dirty statsd interface.
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,8 +101,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hsx-jmacro.spec.golden b/test/golden-test-cases/hsx-jmacro.spec.golden
--- a/test/golden-test-cases/hsx-jmacro.spec.golden
+++ b/test/golden-test-cases/hsx-jmacro.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hsx-jmacro
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name hsx-jmacro
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        7.3.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Hsp+jmacro support
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hsp-devel
-BuildRequires:  ghc-hsp-prof
 BuildRequires:  ghc-jmacro-devel
-BuildRequires:  ghc-jmacro-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-wl-pprint-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-hsp-prof
+BuildRequires:  ghc-jmacro-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-wl-pprint-text-prof
+%endif
 
 %description
 HSP allows for the use of literal XML in Haskell program text. JMacro allows
@@ -64,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -107,9 +110,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md example.hs example2.hs
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hsyslog.spec.golden b/test/golden-test-cases/hsyslog.spec.golden
--- a/test/golden-test-cases/hsyslog.spec.golden
+++ b/test/golden-test-cases/hsyslog.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hsyslog
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,32 @@
 
 
 %global pkg_name hsyslog
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        5.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        FFI interface to syslog(3) from POSIX.1-2001
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-cabal-doctest-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-cabal-doctest-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-doctest-prof
 %endif
+%endif
 
 %description
 A Haskell interface to 'syslog(3)' as specified in
@@ -69,26 +73,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/htoml.spec.golden b/test/golden-test-cases/htoml.spec.golden
--- a/test/golden-test-cases/htoml.spec.golden
+++ b/test/golden-test-cases/htoml.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package htoml
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,49 +17,53 @@
 
 
 %global pkg_name htoml
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Parser for TOML files
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-old-locale-devel
-BuildRequires:  ghc-old-locale-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-old-locale-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-file-embed-devel
-BuildRequires:  ghc-file-embed-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hspec-devel
-BuildRequires:  ghc-tasty-hspec-prof
 BuildRequires:  ghc-tasty-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-file-embed-prof
+BuildRequires:  ghc-tasty-hspec-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 TOML is an obvious and minimal format for config files.
@@ -83,26 +87,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +134,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/http-conduit.spec.golden b/test/golden-test-cases/http-conduit.spec.golden
--- a/test/golden-test-cases/http-conduit.spec.golden
+++ b/test/golden-test-cases/http-conduit.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package http-conduit
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,83 +17,87 @@
 
 
 %global pkg_name http-conduit
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        2.2.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        HTTP client package with conduit interface and HTTPS support
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
+BuildRequires:  ghc-exceptions-devel
+BuildRequires:  ghc-http-client-devel
+BuildRequires:  ghc-http-client-tls-devel
+BuildRequires:  ghc-http-types-devel
+BuildRequires:  ghc-lifted-base-devel
+BuildRequires:  ghc-monad-control-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-conduit-extra-prof
 BuildRequires:  ghc-conduit-prof
-BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-exceptions-prof
-BuildRequires:  ghc-http-client-devel
 BuildRequires:  ghc-http-client-prof
-BuildRequires:  ghc-http-client-tls-devel
 BuildRequires:  ghc-http-client-tls-prof
-BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-http-types-prof
-BuildRequires:  ghc-lifted-base-devel
 BuildRequires:  ghc-lifted-base-prof
-BuildRequires:  ghc-monad-control-devel
 BuildRequires:  ghc-monad-control-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-resourcet-devel
 BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-connection-devel
-BuildRequires:  ghc-connection-prof
 BuildRequires:  ghc-cookie-devel
-BuildRequires:  ghc-cookie-prof
 BuildRequires:  ghc-data-default-class-devel
-BuildRequires:  ghc-data-default-class-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-streaming-commons-devel
-BuildRequires:  ghc-streaming-commons-prof
 BuildRequires:  ghc-temporary-devel
-BuildRequires:  ghc-temporary-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-utf8-string-devel
-BuildRequires:  ghc-utf8-string-prof
 BuildRequires:  ghc-wai-conduit-devel
-BuildRequires:  ghc-wai-conduit-prof
 BuildRequires:  ghc-wai-devel
-BuildRequires:  ghc-wai-prof
 BuildRequires:  ghc-warp-devel
-BuildRequires:  ghc-warp-prof
 BuildRequires:  ghc-warp-tls-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-connection-prof
+BuildRequires:  ghc-cookie-prof
+BuildRequires:  ghc-data-default-class-prof
+BuildRequires:  ghc-hspec-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-streaming-commons-prof
+BuildRequires:  ghc-temporary-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-utf8-string-prof
+BuildRequires:  ghc-wai-conduit-prof
+BuildRequires:  ghc-wai-prof
+BuildRequires:  ghc-warp-prof
 BuildRequires:  ghc-warp-tls-prof
 %endif
+%endif
 
 %description
 Hackage documentation generation is not reliable. For up to date documentation,
@@ -115,26 +119,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -161,9 +166,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/http-link-header.spec.golden b/test/golden-test-cases/http-link-header.spec.golden
--- a/test/golden-test-cases/http-link-header.spec.golden
+++ b/test/golden-test-cases/http-link-header.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package http-link-header
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name http-link-header
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A parser and writer for the HTTP Link header as specified in RFC 5988 "Web Linking"
-License:        SUSE-Public-Domain
+License:        LicenseRef-SUSE-Public-Domain
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-conversion-devel
-BuildRequires:  ghc-bytestring-conversion-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-errors-devel
-BuildRequires:  ghc-errors-prof
 BuildRequires:  ghc-http-api-data-devel
-BuildRequires:  ghc-http-api-data-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-conversion-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-errors-prof
+BuildRequires:  ghc-http-api-data-prof
+BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-attoparsec-devel
-BuildRequires:  ghc-hspec-attoparsec-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-hspec-attoparsec-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Https://github.com/myfreeweb/http-link-header.
@@ -74,26 +78,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license UNLICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/http-media.spec.golden b/test/golden-test-cases/http-media.spec.golden
--- a/test/golden-test-cases/http-media.spec.golden
+++ b/test/golden-test-cases/http-media.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package http-media
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name http-media
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.7.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Processing HTTP Content-Type and Accept headers
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-utf8-string-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-utf8-string-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-test-framework-devel
-BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 This library is intended to be a comprehensive solution to parsing and
@@ -88,26 +92,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -134,9 +139,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hxt-charproperties.spec.golden b/test/golden-test-cases/hxt-charproperties.spec.golden
--- a/test/golden-test-cases/hxt-charproperties.spec.golden
+++ b/test/golden-test-cases/hxt-charproperties.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hxt-charproperties
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name hxt-charproperties
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        9.2.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Character properties and classes for XML and Unicode
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Character proprties defined by XML and Unicode standards. These modules contain
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -94,9 +97,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hxt-expat.spec.golden b/test/golden-test-cases/hxt-expat.spec.golden
--- a/test/golden-test-cases/hxt-expat.spec.golden
+++ b/test/golden-test-cases/hxt-expat.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hxt-expat
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name hxt-expat
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        9.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Expat parser for HXT
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-hexpat-devel
-BuildRequires:  ghc-hexpat-prof
 BuildRequires:  ghc-hxt-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-hexpat-prof
 BuildRequires:  ghc-hxt-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 The Expat interface for the HXT.
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/hxt-tagsoup.spec.golden b/test/golden-test-cases/hxt-tagsoup.spec.golden
--- a/test/golden-test-cases/hxt-tagsoup.spec.golden
+++ b/test/golden-test-cases/hxt-tagsoup.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package hxt-tagsoup
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name hxt-tagsoup
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        9.1.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        TagSoup parser for HXT
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hxt-charproperties-devel
-BuildRequires:  ghc-hxt-charproperties-prof
 BuildRequires:  ghc-hxt-devel
-BuildRequires:  ghc-hxt-prof
 BuildRequires:  ghc-hxt-unicode-devel
-BuildRequires:  ghc-hxt-unicode-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagsoup-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-hxt-charproperties-prof
+BuildRequires:  ghc-hxt-prof
+BuildRequires:  ghc-hxt-unicode-prof
 BuildRequires:  ghc-tagsoup-prof
+%endif
 
 %description
 The Tagsoup interface for the HXT lazy HTML parser.
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/iconv.spec.golden b/test/golden-test-cases/iconv.spec.golden
--- a/test/golden-test-cases/iconv.spec.golden
+++ b/test/golden-test-cases/iconv.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package iconv
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name iconv
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.1.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        String encoding conversion
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Provides an interface to the POSIX iconv library functions for string encoding
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -97,9 +100,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/incremental-parser.spec.golden b/test/golden-test-cases/incremental-parser.spec.golden
--- a/test/golden-test-cases/incremental-parser.spec.golden
+++ b/test/golden-test-cases/incremental-parser.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package incremental-parser
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name incremental-parser
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.5.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generic parser library capable of providing partial results from partial input
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-monoid-subclasses-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-monoid-subclasses-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-checkers-devel
-BuildRequires:  ghc-checkers-prof
 BuildRequires:  ghc-tasty-devel
-BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-checkers-prof
+BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 This package defines yet another parser combinator library. This one is
@@ -69,26 +73,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -115,9 +120,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/indentation-core.spec.golden b/test/golden-test-cases/indentation-core.spec.golden
--- a/test/golden-test-cases/indentation-core.spec.golden
+++ b/test/golden-test-cases/indentation-core.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package indentation-core
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name indentation-core
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Indentation sensitive parsing combinators core library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Indentation sensitive parsing combinators core library
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/indentation-parsec.spec.golden b/test/golden-test-cases/indentation-parsec.spec.golden
--- a/test/golden-test-cases/indentation-parsec.spec.golden
+++ b/test/golden-test-cases/indentation-parsec.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package indentation-parsec
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name indentation-parsec
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Indentation sensitive parsing combinators for Parsec
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-indentation-core-devel
-BuildRequires:  ghc-indentation-core-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-indentation-core-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 Indentation sensitive parsing combinators for Parsec
@@ -76,26 +80,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -122,9 +127,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/inline-c-cpp.spec.golden b/test/golden-test-cases/inline-c-cpp.spec.golden
--- a/test/golden-test-cases/inline-c-cpp.spec.golden
+++ b/test/golden-test-cases/inline-c-cpp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package inline-c-cpp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name inline-c-cpp
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Lets you embed C++ code into Haskell
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-inline-c-devel
-BuildRequires:  ghc-inline-c-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-safe-exceptions-devel
-BuildRequires:  ghc-safe-exceptions-prof
 BuildRequires:  ghc-template-haskell-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-inline-c-prof
+BuildRequires:  ghc-safe-exceptions-prof
 BuildRequires:  ghc-template-haskell-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Utilities to inline C++ code into Haskell using inline-c. See tests for example
@@ -63,26 +67,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -107,9 +112,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/integer-logarithms.spec.golden b/test/golden-test-cases/integer-logarithms.spec.golden
--- a/test/golden-test-cases/integer-logarithms.spec.golden
+++ b/test/golden-test-cases/integer-logarithms.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package integer-logarithms
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name integer-logarithms
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Integer logarithms
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-smallcheck-devel
-BuildRequires:  ghc-smallcheck-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+BuildRequires:  ghc-tasty-smallcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-smallcheck-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
-BuildRequires:  ghc-tasty-smallcheck-devel
 BuildRequires:  ghc-tasty-smallcheck-prof
 %endif
+%endif
 
 %description
 "Math.NumberTheory.Logarithms" and "Math.NumberTheory.Powers.Integer" from the
@@ -73,26 +77,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -119,9 +124,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog.md readme.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/intero.spec.golden b/test/golden-test-cases/intero.spec.golden
--- a/test/golden-test-cases/intero.spec.golden
+++ b/test/golden-test-cases/intero.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package intero
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
 #
 
 
+%bcond_with ghc_prof
 %bcond_with tests
 Name:           intero
 Version:        0.1.24
@@ -24,55 +25,59 @@
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-boot-th-devel
-BuildRequires:  ghc-ghc-boot-th-prof
 BuildRequires:  ghc-ghc-devel
 BuildRequires:  ghc-ghc-paths-devel
+BuildRequires:  ghc-ghci-devel
+BuildRequires:  ghc-haskeline-devel
+BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-syb-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unix-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-ghc-boot-th-prof
 BuildRequires:  ghc-ghc-paths-prof
 BuildRequires:  ghc-ghc-prof
-BuildRequires:  ghc-ghci-devel
 BuildRequires:  ghc-ghci-prof
-BuildRequires:  ghc-haskeline-devel
 BuildRequires:  ghc-haskeline-prof
-BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-syb-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unix-devel
 BuildRequires:  ghc-unix-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-regex-compat-devel
-BuildRequires:  ghc-regex-compat-prof
 BuildRequires:  ghc-temporary-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-hspec-prof
+BuildRequires:  ghc-regex-compat-prof
 BuildRequires:  ghc-temporary-prof
 %endif
+%endif
 
 %description
 Complete interactive development program for Haskell.
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_bin_build
diff --git a/test/golden-test-cases/invariant.spec.golden b/test/golden-test-cases/invariant.spec.golden
--- a/test/golden-test-cases/invariant.spec.golden
+++ b/test/golden-test-cases/invariant.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package invariant
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,57 +17,61 @@
 
 
 %global pkg_name invariant
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Haskell98 invariant functors
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-StateVar-devel
-BuildRequires:  ghc-StateVar-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-comonad-devel
-BuildRequires:  ghc-comonad-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-contravariant-devel
-BuildRequires:  ghc-contravariant-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-th-abstraction-devel
-BuildRequires:  ghc-th-abstraction-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-StateVar-prof
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-comonad-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-contravariant-prof
+BuildRequires:  ghc-profunctors-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-tagged-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-th-abstraction-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Haskell98 invariant functors (also known as exponential functors).
@@ -92,26 +96,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -138,9 +143,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/io-machine.spec.golden b/test/golden-test-cases/io-machine.spec.golden
--- a/test/golden-test-cases/io-machine.spec.golden
+++ b/test/golden-test-cases/io-machine.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package io-machine
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,25 @@
 
 
 %global pkg_name io-machine
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Easy I/O model to learn IO monad
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 Easy I/O model to learn IO monad.
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/io-streams-haproxy.spec.golden b/test/golden-test-cases/io-streams-haproxy.spec.golden
--- a/test/golden-test-cases/io-streams-haproxy.spec.golden
+++ b/test/golden-test-cases/io-streams-haproxy.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package io-streams-haproxy
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name io-streams-haproxy
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        HAProxy protocol 1.5 support for io-streams
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-io-streams-devel
-BuildRequires:  ghc-io-streams-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-io-streams-prof
+BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
 %endif
+%endif
 
 %description
 HAProxy protocol version 1.5 support (see
@@ -74,26 +78,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CONTRIBUTORS
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ip.spec.golden b/test/golden-test-cases/ip.spec.golden
--- a/test/golden-test-cases/ip.spec.golden
+++ b/test/golden-test-cases/ip.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ip
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,51 +17,55 @@
 
 
 %global pkg_name ip
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library for IP and MAC addresses
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-primitive-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-quickcheck-classes-devel
-BuildRequires:  ghc-quickcheck-classes-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-quickcheck-classes-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 The `ip` package provides types and functions for dealing with IPv4 addresses,
@@ -100,26 +104,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -144,9 +149,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/iso639.spec.golden b/test/golden-test-cases/iso639.spec.golden
--- a/test/golden-test-cases/iso639.spec.golden
+++ b/test/golden-test-cases/iso639.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package iso639
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name iso639
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        ISO-639-1 language codes
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 ISO-639-1 language codes mapping to Haskell datatypes
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/iso8601-time.spec.golden b/test/golden-test-cases/iso8601-time.spec.golden
--- a/test/golden-test-cases/iso8601-time.spec.golden
+++ b/test/golden-test-cases/iso8601-time.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package iso8601-time
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,33 @@
 
 
 %global pkg_name iso8601-time
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Convert to/from the ISO 8601 time format
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-time-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Conversion functions between Haskell time types and the ISO 8601 format, which
@@ -61,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,8 +108,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/jmacro-rpc-happstack.spec.golden b/test/golden-test-cases/jmacro-rpc-happstack.spec.golden
--- a/test/golden-test-cases/jmacro-rpc-happstack.spec.golden
+++ b/test/golden-test-cases/jmacro-rpc-happstack.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package jmacro-rpc-happstack
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,36 +17,38 @@
 
 
 %global pkg_name jmacro-rpc-happstack
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Happstack backend for jmacro-rpc
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-happstack-server-devel
-BuildRequires:  ghc-happstack-server-prof
 BuildRequires:  ghc-jmacro-devel
-BuildRequires:  ghc-jmacro-prof
 BuildRequires:  ghc-jmacro-rpc-devel
-BuildRequires:  ghc-jmacro-rpc-prof
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-happstack-server-prof
+BuildRequires:  ghc-jmacro-prof
+BuildRequires:  ghc-jmacro-rpc-prof
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Provides functions for serving jmacro-rpc json rpcs and panels from Happstack.
@@ -68,26 +70,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -109,9 +112,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/jmacro-rpc.spec.golden b/test/golden-test-cases/jmacro-rpc.spec.golden
--- a/test/golden-test-cases/jmacro-rpc.spec.golden
+++ b/test/golden-test-cases/jmacro-rpc.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package jmacro-rpc
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,46 +17,48 @@
 
 
 %global pkg_name jmacro-rpc
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        JSON-RPC clients and servers using JMacro, and evented client-server Reactive Programming
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-contravariant-devel
-BuildRequires:  ghc-contravariant-prof
 BuildRequires:  ghc-jmacro-devel
-BuildRequires:  ghc-jmacro-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-contravariant-prof
+BuildRequires:  ghc-jmacro-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 Base jmacro-rpc package. Provides server-independent functions.
@@ -77,26 +79,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -118,9 +121,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/jose.spec.golden b/test/golden-test-cases/jose.spec.golden
--- a/test/golden-test-cases/jose.spec.golden
+++ b/test/golden-test-cases/jose.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package jose
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,76 +17,80 @@
 
 
 %global pkg_name jose
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Javascript Object Signing and Encryption and JSON Web Token library
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-concise-devel
-BuildRequires:  ghc-concise-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cryptonite-devel
-BuildRequires:  ghc-cryptonite-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-memory-devel
-BuildRequires:  ghc-memory-prof
 BuildRequires:  ghc-monad-time-devel
-BuildRequires:  ghc-monad-time-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-safe-devel
-BuildRequires:  ghc-safe-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-x509-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-concise-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cryptonite-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-memory-prof
+BuildRequires:  ghc-monad-time-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-quickcheck-instances-prof
+BuildRequires:  ghc-safe-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-unordered-containers-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-x509-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hspec-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-tasty-hspec-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 An implementation of the Javascript Object Signing and Encryption (JOSE) and
@@ -119,33 +123,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -167,9 +172,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/katip-elasticsearch.spec.golden b/test/golden-test-cases/katip-elasticsearch.spec.golden
--- a/test/golden-test-cases/katip-elasticsearch.spec.golden
+++ b/test/golden-test-cases/katip-elasticsearch.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package katip-elasticsearch
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,77 +17,81 @@
 
 
 %global pkg_name katip-elasticsearch
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        ElasticSearch scribe for the Katip logging framework
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bloodhound-devel
-BuildRequires:  ghc-bloodhound-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-enclosed-exceptions-devel
-BuildRequires:  ghc-enclosed-exceptions-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-katip-devel
-BuildRequires:  ghc-katip-prof
 BuildRequires:  ghc-retry-devel
-BuildRequires:  ghc-retry-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-stm-chans-devel
-BuildRequires:  ghc-stm-chans-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-uuid-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bloodhound-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-enclosed-exceptions-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-katip-prof
+BuildRequires:  ghc-retry-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-stm-chans-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-uuid-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-lens-aeson-devel
-BuildRequires:  ghc-lens-aeson-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+BuildRequires:  ghc-vector-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-lens-aeson-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-quickcheck-instances-prof
+BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
 %endif
+%endif
 
 %description
 ElasticSearch scribe for the Katip logging framework.
@@ -109,26 +113,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -155,9 +160,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/katip.spec.golden b/test/golden-test-cases/katip.spec.golden
--- a/test/golden-test-cases/katip.spec.golden
+++ b/test/golden-test-cases/katip.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package katip
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,91 +17,95 @@
 
 
 %global pkg_name katip
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A structured logging framework
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-auto-update-devel
-BuildRequires:  ghc-auto-update-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-either-devel
-BuildRequires:  ghc-either-prof
 BuildRequires:  ghc-hostname-devel
-BuildRequires:  ghc-hostname-prof
 BuildRequires:  ghc-microlens-devel
-BuildRequires:  ghc-microlens-prof
 BuildRequires:  ghc-microlens-th-devel
-BuildRequires:  ghc-microlens-th-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-old-locale-devel
-BuildRequires:  ghc-old-locale-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-safe-exceptions-devel
-BuildRequires:  ghc-safe-exceptions-prof
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-string-conv-devel
-BuildRequires:  ghc-string-conv-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-base-devel
-BuildRequires:  ghc-transformers-base-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unix-devel
-BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-auto-update-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-either-prof
+BuildRequires:  ghc-hostname-prof
+BuildRequires:  ghc-microlens-prof
+BuildRequires:  ghc-microlens-th-prof
+BuildRequires:  ghc-monad-control-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-old-locale-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-safe-exceptions-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-string-conv-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-base-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-regex-tdfa-devel
-BuildRequires:  ghc-regex-tdfa-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-golden-devel
-BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+BuildRequires:  ghc-time-locale-compat-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-quickcheck-instances-prof
+BuildRequires:  ghc-regex-tdfa-prof
+BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
-BuildRequires:  ghc-time-locale-compat-devel
 BuildRequires:  ghc-time-locale-compat-prof
 %endif
+%endif
 
 %description
 Katip is a structured logging framework. See README.md for more details.
@@ -122,26 +126,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -168,9 +173,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/katydid.spec.golden b/test/golden-test-cases/katydid.spec.golden
--- a/test/golden-test-cases/katydid.spec.golden
+++ b/test/golden-test-cases/katydid.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package katydid
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,46 +17,50 @@
 
 
 %global pkg_name katydid
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A haskell implementation of Katydid
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hxt-devel
-BuildRequires:  ghc-hxt-prof
 BuildRequires:  ghc-json-devel
-BuildRequires:  ghc-json-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-regex-tdfa-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-hxt-prof
+BuildRequires:  ghc-json-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-regex-tdfa-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 A haskell implementation of Katydid
@@ -90,33 +94,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -138,9 +143,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/kawhi.spec.golden b/test/golden-test-cases/kawhi.spec.golden
--- a/test/golden-test-cases/kawhi.spec.golden
+++ b/test/golden-test-cases/kawhi.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package kawhi
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,53 +17,57 @@
 
 
 %global pkg_name kawhi
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Stats.NBA.com library
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-conduit-devel
-BuildRequires:  ghc-http-conduit-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-safe-devel
-BuildRequires:  ghc-safe-prof
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-conduit-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-safe-prof
+BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-smallcheck-devel
-BuildRequires:  ghc-smallcheck-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+BuildRequires:  ghc-tasty-smallcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-smallcheck-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
-BuildRequires:  ghc-tasty-smallcheck-devel
 BuildRequires:  ghc-tasty-smallcheck-prof
 %endif
+%endif
 
 %description
 Functions and types for interacting with stats.NBA.com.
@@ -84,26 +88,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -130,9 +135,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/kraken.spec.golden b/test/golden-test-cases/kraken.spec.golden
--- a/test/golden-test-cases/kraken.spec.golden
+++ b/test/golden-test-cases/kraken.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package kraken
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name kraken
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Kraken.io API client
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-client-tls-devel
-BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Kraken is a robust, ultra-fast image optimizer and compressor with
@@ -62,26 +64,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/l10n.spec.golden b/test/golden-test-cases/l10n.spec.golden
--- a/test/golden-test-cases/l10n.spec.golden
+++ b/test/golden-test-cases/l10n.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package l10n
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name l10n
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Enables providing localization as typeclass instances in separate files
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 Enables providing localization as typeclass instances in separate files.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/lambdabot-social-plugins.spec.golden b/test/golden-test-cases/lambdabot-social-plugins.spec.golden
--- a/test/golden-test-cases/lambdabot-social-plugins.spec.golden
+++ b/test/golden-test-cases/lambdabot-social-plugins.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package lambdabot-social-plugins
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,34 +17,36 @@
 
 
 %global pkg_name lambdabot-social-plugins
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        5.1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Social plugins for Lambdabot
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-lambdabot-core-devel
-BuildRequires:  ghc-lambdabot-core-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-lambdabot-core-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 Lambdabot is an IRC bot written over several years by those on the #haskell IRC
@@ -79,26 +81,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +123,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/lazy-csv.spec.golden b/test/golden-test-cases/lazy-csv.spec.golden
--- a/test/golden-test-cases/lazy-csv.spec.golden
+++ b/test/golden-test-cases/lazy-csv.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package lazy-csv
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name lazy-csv
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.5.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Efficient lazy parsers for CSV (comma-separated values)
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 The CSV format is defined by RFC 4180. These efficient lazy parsers (String and
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog.html
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENCE-BSD3
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/lens-aeson.spec.golden b/test/golden-test-cases/lens-aeson.spec.golden
--- a/test/golden-test-cases/lens-aeson.spec.golden
+++ b/test/golden-test-cases/lens-aeson.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package lens-aeson
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,50 +17,54 @@
 
 
 %global pkg_name lens-aeson
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Law-abiding lenses for aeson
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cabal-doctest-devel
-BuildRequires:  ghc-cabal-doctest-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cabal-doctest-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-generic-deriving-devel
-BuildRequires:  ghc-generic-deriving-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-simple-reflect-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-generic-deriving-prof
+BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-simple-reflect-prof
 %endif
+%endif
 
 %description
 Law-abiding lenses for aeson.
@@ -81,26 +85,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -127,9 +132,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/lens.spec.golden b/test/golden-test-cases/lens.spec.golden
--- a/test/golden-test-cases/lens.spec.golden
+++ b/test/golden-test-cases/lens.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package lens
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,108 +17,112 @@
 
 
 %global pkg_name lens
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        4.15.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Lenses, Folds and Traversals
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
 BuildRequires:  ghc-base-orphans-devel
+BuildRequires:  ghc-bifunctors-devel
+BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-cabal-doctest-devel
+BuildRequires:  ghc-call-stack-devel
+BuildRequires:  ghc-comonad-devel
+BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-contravariant-devel
+BuildRequires:  ghc-distributive-devel
+BuildRequires:  ghc-exceptions-devel
+BuildRequires:  ghc-filepath-devel
+BuildRequires:  ghc-free-devel
+BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-kan-extensions-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-parallel-devel
+BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-reflection-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-semigroupoids-devel
+BuildRequires:  ghc-semigroups-devel
+BuildRequires:  ghc-tagged-devel
+BuildRequires:  ghc-template-haskell-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-th-abstraction-devel
+BuildRequires:  ghc-transformers-compat-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unordered-containers-devel
+BuildRequires:  ghc-vector-devel
+BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-orphans-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-bifunctors-devel
 BuildRequires:  ghc-bifunctors-prof
-BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-cabal-doctest-devel
 BuildRequires:  ghc-cabal-doctest-prof
-BuildRequires:  ghc-call-stack-devel
 BuildRequires:  ghc-call-stack-prof
-BuildRequires:  ghc-comonad-devel
 BuildRequires:  ghc-comonad-prof
-BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-contravariant-devel
 BuildRequires:  ghc-contravariant-prof
-BuildRequires:  ghc-distributive-devel
 BuildRequires:  ghc-distributive-prof
-BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-exceptions-prof
-BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-filepath-prof
-BuildRequires:  ghc-free-devel
 BuildRequires:  ghc-free-prof
-BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-kan-extensions-devel
 BuildRequires:  ghc-kan-extensions-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-parallel-devel
 BuildRequires:  ghc-parallel-prof
-BuildRequires:  ghc-profunctors-devel
 BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-reflection-devel
 BuildRequires:  ghc-reflection-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroupoids-prof
-BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-semigroups-prof
-BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-tagged-prof
-BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-template-haskell-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-th-abstraction-devel
 BuildRequires:  ghc-th-abstraction-prof
-BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-compat-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
-BuildRequires:  ghc-void-devel
 BuildRequires:  ghc-void-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-generic-deriving-devel
-BuildRequires:  ghc-generic-deriving-prof
 BuildRequires:  ghc-nats-devel
-BuildRequires:  ghc-nats-prof
 BuildRequires:  ghc-simple-reflect-devel
-BuildRequires:  ghc-simple-reflect-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+BuildRequires:  ghc-test-framework-th-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-generic-deriving-prof
+BuildRequires:  ghc-nats-prof
+BuildRequires:  ghc-simple-reflect-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
-BuildRequires:  ghc-test-framework-th-devel
 BuildRequires:  ghc-test-framework-th-prof
 %endif
+%endif
 
 %description
 This package comes "Batteries Included" with many useful lenses for the types
@@ -156,8 +160,6 @@
 With some signatures simplified, the core of the hierarchy of lens-like
 constructions looks like:
 
-
-
 <<http://i.imgur.com/ALlbPRa.png>>
 
 <Hierarchy.png (Local Copy)>
@@ -222,26 +224,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -268,9 +271,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/libgit.spec.golden b/test/golden-test-cases/libgit.spec.golden
--- a/test/golden-test-cases/libgit.spec.golden
+++ b/test/golden-test-cases/libgit.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package libgit
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name libgit
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Simple Git Wrapper
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Simple git wrapper to access common git functions in a simple haskell way.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/librato.spec.golden b/test/golden-test-cases/librato.spec.golden
--- a/test/golden-test-cases/librato.spec.golden
+++ b/test/golden-test-cases/librato.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package librato
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,46 +17,48 @@
 
 
 %global pkg_name librato
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Bindings to the Librato API
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-either-devel
-BuildRequires:  ghc-either-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-conduit-devel
-BuildRequires:  ghc-http-conduit-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-uri-templater-devel
-BuildRequires:  ghc-uri-templater-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-either-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-conduit-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
+BuildRequires:  ghc-uri-templater-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 Bindings to the Librato API.
@@ -77,26 +79,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +123,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/lifted-async.spec.golden b/test/golden-test-cases/lifted-async.spec.golden
--- a/test/golden-test-cases/lifted-async.spec.golden
+++ b/test/golden-test-cases/lifted-async.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package lifted-async
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name lifted-async
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.9.3.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Run lifted IO operations asynchronously and wait for their results
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-constraints-devel
-BuildRequires:  ghc-constraints-prof
 BuildRequires:  ghc-lifted-base-devel
-BuildRequires:  ghc-lifted-base-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-base-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-constraints-prof
+BuildRequires:  ghc-lifted-base-prof
+BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-transformers-base-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-th-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-th-devel
 BuildRequires:  ghc-tasty-th-prof
 %endif
+%endif
 
 %description
 This package provides IO operations from 'async' package lifted to any instance
@@ -75,26 +79,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -121,9 +126,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/lmdb.spec.golden b/test/golden-test-cases/lmdb.spec.golden
--- a/test/golden-test-cases/lmdb.spec.golden
+++ b/test/golden-test-cases/lmdb.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package lmdb
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,25 @@
 
 
 %global pkg_name lmdb
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Lightning MDB bindings
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  lmdb-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+%endif
 
 %description
 LMDB is a read-optimized Berkeley DB replacement developed by Symas for the
@@ -65,26 +67,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/logging-effect-extra-file.spec.golden b/test/golden-test-cases/logging-effect-extra-file.spec.golden
--- a/test/golden-test-cases/logging-effect-extra-file.spec.golden
+++ b/test/golden-test-cases/logging-effect-extra-file.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package logging-effect-extra-file
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,29 @@
 
 
 %global pkg_name logging-effect-extra-file
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        TH splices to augment log messages with file info
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-logging-effect-devel
-BuildRequires:  ghc-logging-effect-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-wl-pprint-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-logging-effect-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-wl-pprint-text-prof
+%endif
 
 %description
 TH splices to augment log messages with file info.
@@ -59,33 +61,34 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -94,17 +97,21 @@
 %ghc_pkg_recache
 
 %files
-%doc CHANGELOG.md LICENSE.md README.md
+%license LICENSE.md
+%doc CHANGELOG.md README.md
 %{_bindir}/log-file
 %{_bindir}/log-file-and-severity
 
 %files -n ghc-%{name} -f ghc-%{name}.files
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%doc CHANGELOG.md LICENSE.md README.md
+%license LICENSE.md
+%doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/lucid.spec.golden b/test/golden-test-cases/lucid.spec.golden
--- a/test/golden-test-cases/lucid.spec.golden
+++ b/test/golden-test-cases/lucid.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package lucid
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,49 +17,53 @@
 
 
 %global pkg_name lucid
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        2.9.9
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Clear to write, read and edit DSL for HTML
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-mmorph-devel
-BuildRequires:  ghc-mmorph-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-mmorph-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-parsec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-parsec-prof
 %endif
+%endif
 
 %description
 Clear to write, read and edit DSL for HTML. See the 'Lucid' module for
@@ -81,26 +85,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -127,9 +132,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mainland-pretty.spec.golden b/test/golden-test-cases/mainland-pretty.spec.golden
--- a/test/golden-test-cases/mainland-pretty.spec.golden
+++ b/test/golden-test-cases/mainland-pretty.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mainland-pretty
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name mainland-pretty
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.6.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Pretty printing designed for printing source code
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-srcloc-devel
-BuildRequires:  ghc-srcloc-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-srcloc-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Pretty printing designed for printing source code based on Wadler's paper /A
@@ -63,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +107,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/matrices.spec.golden b/test/golden-test-cases/matrices.spec.golden
--- a/test/golden-test-cases/matrices.spec.golden
+++ b/test/golden-test-cases/matrices.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package matrices
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name matrices
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Native matrix based on vector
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-primitive-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Pure Haskell matrix library, supporting creating, indexing, and modifying
@@ -67,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -111,9 +116,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/median-stream.spec.golden b/test/golden-test-cases/median-stream.spec.golden
--- a/test/golden-test-cases/median-stream.spec.golden
+++ b/test/golden-test-cases/median-stream.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package median-stream
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,31 @@
 
 
 %global pkg_name median-stream
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.7.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Constant-time queries for the median of a stream of numeric data
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-heap-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-heap-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-QuickCheck-prof
 %endif
+%endif
 
 %description
 Uses the two-heap approach to support O(lg n) insertions and O(1) queries for
@@ -59,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +108,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/megaparsec.spec.golden b/test/golden-test-cases/megaparsec.spec.golden
--- a/test/golden-test-cases/megaparsec.spec.golden
+++ b/test/golden-test-cases/megaparsec.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package megaparsec
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,47 +17,51 @@
 
 
 %global pkg_name megaparsec
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        6.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Monadic parser combinators
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-parser-combinators-devel
-BuildRequires:  ghc-parser-combinators-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-parser-combinators-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-expectations-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-expectations-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 This is industrial-strength monadic parser combinator library.
@@ -79,26 +83,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -125,9 +130,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc AUTHORS.md CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mersenne-random.spec.golden b/test/golden-test-cases/mersenne-random.spec.golden
--- a/test/golden-test-cases/mersenne-random.spec.golden
+++ b/test/golden-test-cases/mersenne-random.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mersenne-random
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name mersenne-random
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generate high quality pseudorandom numbers using a SIMD Fast Mersenne Twister
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-old-time-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-old-time-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 The Mersenne twister is a pseudorandom number generator developed by Makoto
@@ -79,26 +81,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +123,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/messagepack.spec.golden b/test/golden-test-cases/messagepack.spec.golden
--- a/test/golden-test-cases/messagepack.spec.golden
+++ b/test/golden-test-cases/messagepack.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package messagepack
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name messagepack
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Serialize instance for Message Pack Object
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cereal-devel
-BuildRequires:  ghc-cereal-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cereal-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-test-framework-devel
-BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-devel
-BuildRequires:  ghc-test-framework-quickcheck2-prof
 BuildRequires:  ghc-test-framework-th-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-test-framework-prof
+BuildRequires:  ghc-test-framework-quickcheck2-prof
 BuildRequires:  ghc-test-framework-th-prof
 %endif
+%endif
 
 %description
 Serialize instance for Message Pack Object.
@@ -70,26 +74,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/microlens-ghc.spec.golden b/test/golden-test-cases/microlens-ghc.spec.golden
--- a/test/golden-test-cases/microlens-ghc.spec.golden
+++ b/test/golden-test-cases/microlens-ghc.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package microlens-ghc
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name microlens-ghc
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.8.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Microlens + array, bytestring, containers, transformers
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-microlens-devel
-BuildRequires:  ghc-microlens-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-microlens-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Use this package instead of <http://hackage.haskell.org/package/microlens
@@ -77,26 +79,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +123,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/microlens.spec.golden b/test/golden-test-cases/microlens.spec.golden
--- a/test/golden-test-cases/microlens.spec.golden
+++ b/test/golden-test-cases/microlens.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package microlens
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name microlens
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.8.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A tiny lens library with no dependencies. If you're writing an app, you probably want microlens-platform, not this
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 NOTE: If you're writing an app, you probably want
@@ -106,26 +108,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -149,9 +152,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/minio-hs.spec.golden b/test/golden-test-cases/minio-hs.spec.golden
--- a/test/golden-test-cases/minio-hs.spec.golden
+++ b/test/golden-test-cases/minio-hs.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package minio-hs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,97 +17,101 @@
 
 
 %global pkg_name minio-hs
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A Minio Haskell Library for Amazon S3 compatible cloud storage
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-conduit-combinators-devel
-BuildRequires:  ghc-conduit-combinators-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
-BuildRequires:  ghc-conduit-extra-prof
-BuildRequires:  ghc-conduit-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cryptonite-conduit-devel
-BuildRequires:  ghc-cryptonite-conduit-prof
 BuildRequires:  ghc-cryptonite-devel
-BuildRequires:  ghc-cryptonite-prof
 BuildRequires:  ghc-data-default-devel
-BuildRequires:  ghc-data-default-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-conduit-devel
-BuildRequires:  ghc-http-conduit-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-lifted-async-devel
-BuildRequires:  ghc-lifted-async-prof
 BuildRequires:  ghc-lifted-base-devel
-BuildRequires:  ghc-lifted-base-prof
 BuildRequires:  ghc-memory-devel
-BuildRequires:  ghc-memory-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-protolude-devel
-BuildRequires:  ghc-protolude-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-format-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-transformers-base-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-vector-devel
+BuildRequires:  ghc-xml-conduit-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-conduit-combinators-prof
+BuildRequires:  ghc-conduit-extra-prof
+BuildRequires:  ghc-conduit-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cryptonite-conduit-prof
+BuildRequires:  ghc-cryptonite-prof
+BuildRequires:  ghc-data-default-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-conduit-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-lifted-async-prof
+BuildRequires:  ghc-lifted-base-prof
+BuildRequires:  ghc-memory-prof
+BuildRequires:  ghc-monad-control-prof
+BuildRequires:  ghc-protolude-prof
+BuildRequires:  ghc-resourcet-prof
 BuildRequires:  ghc-text-format-prof
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-base-devel
 BuildRequires:  ghc-transformers-base-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
-BuildRequires:  ghc-xml-conduit-devel
 BuildRequires:  ghc-xml-conduit-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+BuildRequires:  ghc-tasty-smallcheck-devel
+BuildRequires:  ghc-temporary-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
-BuildRequires:  ghc-tasty-smallcheck-devel
 BuildRequires:  ghc-tasty-smallcheck-prof
-BuildRequires:  ghc-temporary-devel
 BuildRequires:  ghc-temporary-prof
 %endif
+%endif
 
 %description
 The Minio Haskell client library provides simple APIs to access Minio, Amazon
@@ -129,26 +133,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -173,9 +178,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mmorph.spec.golden b/test/golden-test-cases/mmorph.spec.golden
--- a/test/golden-test-cases/mmorph.spec.golden
+++ b/test/golden-test-cases/mmorph.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mmorph
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name mmorph
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Monad morphisms
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This library provides monad morphism utilities, most commonly used for
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mnist-idx.spec.golden b/test/golden-test-cases/mnist-idx.spec.golden
--- a/test/golden-test-cases/mnist-idx.spec.golden
+++ b/test/golden-test-cases/mnist-idx.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mnist-idx
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name mnist-idx
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.2.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Read and write IDX data that is used in e.g. the MNIST database
 License:        LGPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 This package provides functionality to read and write data in the IDX binary
@@ -66,26 +70,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,9 +115,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mole.spec.golden b/test/golden-test-cases/mole.spec.golden
--- a/test/golden-test-cases/mole.spec.golden
+++ b/test/golden-test-cases/mole.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mole
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
 #
 
 
+%bcond_with ghc_prof
 %bcond_with tests
 Name:           mole
 Version:        0.0.6
@@ -24,69 +25,73 @@
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-cryptohash-devel
-BuildRequires:  ghc-cryptohash-prof
 BuildRequires:  ghc-css-syntax-devel
-BuildRequires:  ghc-css-syntax-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filemanip-devel
-BuildRequires:  ghc-filemanip-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-fsnotify-devel
-BuildRequires:  ghc-fsnotify-prof
 BuildRequires:  ghc-kraken-devel
-BuildRequires:  ghc-kraken-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-snap-core-devel
-BuildRequires:  ghc-snap-core-prof
 BuildRequires:  ghc-snap-server-devel
-BuildRequires:  ghc-snap-server-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-tagsoup-devel
-BuildRequires:  ghc-tagsoup-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unix-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-cryptohash-prof
+BuildRequires:  ghc-css-syntax-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filemanip-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-fsnotify-prof
+BuildRequires:  ghc-kraken-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-snap-core-prof
+BuildRequires:  ghc-snap-server-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-tagsoup-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unix-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-hspec-smallcheck-devel
-BuildRequires:  ghc-hspec-smallcheck-prof
 BuildRequires:  ghc-smallcheck-devel
-BuildRequires:  ghc-smallcheck-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-hspec-prof
+BuildRequires:  ghc-hspec-smallcheck-prof
+BuildRequires:  ghc-smallcheck-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
 %endif
+%endif
 
 %description
 A glorified string replacement tool. For a very specific purpose. That purpose
@@ -95,7 +100,7 @@
 compresses the files, adds fingerprints and writes the result to a directory.
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_bin_build
diff --git a/test/golden-test-cases/monad-products.spec.golden b/test/golden-test-cases/monad-products.spec.golden
--- a/test/golden-test-cases/monad-products.spec.golden
+++ b/test/golden-test-cases/monad-products.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package monad-products
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name monad-products
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        4.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Monad products
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroupoids-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-semigroupoids-prof
+%endif
 
 %description
 Monad products.
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/monadcryptorandom.spec.golden b/test/golden-test-cases/monadcryptorandom.spec.golden
--- a/test/golden-test-cases/monadcryptorandom.spec.golden
+++ b/test/golden-test-cases/monadcryptorandom.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package monadcryptorandom
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,34 +17,36 @@
 
 
 %global pkg_name monadcryptorandom
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.7.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A monad for using CryptoRandomGen
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-crypto-api-devel
-BuildRequires:  ghc-crypto-api-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-crypto-api-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-tagged-prof
+BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 A monad for using CryptoRandomGen.
@@ -65,26 +67,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/monadloc.spec.golden b/test/golden-test-cases/monadloc.spec.golden
--- a/test/golden-test-cases/monadloc.spec.golden
+++ b/test/golden-test-cases/monadloc.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package monadloc
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name monadloc
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.7.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A class for monads which can keep a monadic call trace
-License:        SUSE-Public-Domain
+License:        LicenseRef-SUSE-Public-Domain
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This package defines a class for monads which can keep a monadic call trace.
@@ -76,26 +78,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -115,8 +118,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mongoDB.spec.golden b/test/golden-test-cases/mongoDB.spec.golden
--- a/test/golden-test-cases/mongoDB.spec.golden
+++ b/test/golden-test-cases/mongoDB.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mongoDB
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,83 +17,87 @@
 
 
 %global pkg_name mongoDB
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        2.3.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Driver (client) for MongoDB, a free, scalable, fast, document DBMS
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base16-bytestring-devel
-BuildRequires:  ghc-base16-bytestring-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bson-devel
-BuildRequires:  ghc-bson-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
+BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-cryptohash-devel
+BuildRequires:  ghc-data-default-class-devel
+BuildRequires:  ghc-hashtables-devel
+BuildRequires:  ghc-lifted-base-devel
+BuildRequires:  ghc-monad-control-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-nonce-devel
+BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-pureMD5-devel
+BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-random-shuffle-devel
+BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-tagged-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-tls-devel
+BuildRequires:  ghc-transformers-base-devel
+BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base16-bytestring-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bson-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-conduit-extra-prof
 BuildRequires:  ghc-conduit-prof
-BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-cryptohash-devel
 BuildRequires:  ghc-cryptohash-prof
-BuildRequires:  ghc-data-default-class-devel
 BuildRequires:  ghc-data-default-class-prof
-BuildRequires:  ghc-hashtables-devel
 BuildRequires:  ghc-hashtables-prof
-BuildRequires:  ghc-lifted-base-devel
 BuildRequires:  ghc-lifted-base-prof
-BuildRequires:  ghc-monad-control-devel
 BuildRequires:  ghc-monad-control-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-nonce-devel
 BuildRequires:  ghc-nonce-prof
-BuildRequires:  ghc-parsec-devel
 BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-pureMD5-devel
 BuildRequires:  ghc-pureMD5-prof
-BuildRequires:  ghc-random-devel
 BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-random-shuffle-devel
 BuildRequires:  ghc-random-shuffle-prof
-BuildRequires:  ghc-resourcet-devel
 BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-tagged-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-tls-devel
 BuildRequires:  ghc-tls-prof
-BuildRequires:  ghc-transformers-base-devel
 BuildRequires:  ghc-transformers-base-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-old-locale-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-old-locale-prof
 %endif
+%endif
 
 %description
 This package lets you connect to MongoDB servers and update/query their data.
@@ -116,26 +120,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -162,9 +167,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/monoid-extras.spec.golden b/test/golden-test-cases/monoid-extras.spec.golden
--- a/test/golden-test-cases/monoid-extras.spec.golden
+++ b/test/golden-test-cases/monoid-extras.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package monoid-extras
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name monoid-extras
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Various extra monoid-related definitions and utilities
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-groups-devel
-BuildRequires:  ghc-groups-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroupoids-devel
-BuildRequires:  ghc-semigroupoids-prof
 BuildRequires:  ghc-semigroups-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-groups-prof
+BuildRequires:  ghc-semigroupoids-prof
 BuildRequires:  ghc-semigroups-prof
+%endif
 
 %description
 Various extra monoid-related definitions and utilities, such as monoid actions,
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mwc-random-monad.spec.golden b/test/golden-test-cases/mwc-random-monad.spec.golden
--- a/test/golden-test-cases/mwc-random-monad.spec.golden
+++ b/test/golden-test-cases/mwc-random-monad.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mwc-random-monad
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name mwc-random-monad
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.7.3.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Monadic interface for mwc-random
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-monad-primitive-devel
-BuildRequires:  ghc-monad-primitive-prof
 BuildRequires:  ghc-mwc-random-devel
-BuildRequires:  ghc-mwc-random-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-monad-primitive-prof
+BuildRequires:  ghc-mwc-random-prof
+BuildRequires:  ghc-primitive-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 Simple monadic interface for mwc-random.
@@ -61,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +107,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/mwc-random.spec.golden b/test/golden-test-cases/mwc-random.spec.golden
--- a/test/golden-test-cases/mwc-random.spec.golden
+++ b/test/golden-test-cases/mwc-random.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package mwc-random
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name mwc-random
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.13.6.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Fast, high quality pseudo random number generation
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-math-functions-devel
-BuildRequires:  ghc-math-functions-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-math-functions-prof
+BuildRequires:  ghc-primitive-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 This package contains code for generating high quality random numbers that
@@ -69,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +115,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/nanospec.spec.golden b/test/golden-test-cases/nanospec.spec.golden
--- a/test/golden-test-cases/nanospec.spec.golden
+++ b/test/golden-test-cases/nanospec.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package nanospec
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,31 @@
 
 
 %global pkg_name nanospec
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A lightweight implementation of a subset of Hspec's API
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-silently-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-silently-prof
 %endif
+%endif
 
 %description
 A lightweight implementation of a subset of Hspec's API with minimal
@@ -59,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +108,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/nats.spec.golden b/test/golden-test-cases/nats.spec.golden
--- a/test/golden-test-cases/nats.spec.golden
+++ b/test/golden-test-cases/nats.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package nats
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,18 +17,18 @@
 
 
 %global pkg_name nats
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Natural numbers
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
 
 %description
 Natural numbers.
@@ -49,26 +49,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -92,9 +93,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/netpbm.spec.golden b/test/golden-test-cases/netpbm.spec.golden
--- a/test/golden-test-cases/netpbm.spec.golden
+++ b/test/golden-test-cases/netpbm.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package netpbm
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,45 @@
 
 
 %global pkg_name netpbm
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Loading PBM, PGM, PPM image files
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-binary-devel
-BuildRequires:  ghc-attoparsec-binary-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-storable-record-devel
-BuildRequires:  ghc-storable-record-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-vector-th-unbox-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-binary-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-storable-record-prof
+BuildRequires:  ghc-unordered-containers-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-vector-th-unbox-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 This package contains pure Haskell parsers for the netpbm image formats: PBM,
@@ -89,26 +93,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -131,8 +136,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/network-protocol-xmpp.spec.golden b/test/golden-test-cases/network-protocol-xmpp.spec.golden
--- a/test/golden-test-cases/network-protocol-xmpp.spec.golden
+++ b/test/golden-test-cases/network-protocol-xmpp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package network-protocol-xmpp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,40 +17,42 @@
 
 
 %global pkg_name network-protocol-xmpp
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Client library for the XMPP protocol
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-gnuidn-devel
-BuildRequires:  ghc-gnuidn-prof
 BuildRequires:  ghc-gnutls-devel
-BuildRequires:  ghc-gnutls-prof
 BuildRequires:  ghc-gsasl-devel
-BuildRequires:  ghc-gsasl-prof
 BuildRequires:  ghc-libxml-sax-devel
-BuildRequires:  ghc-libxml-sax-prof
 BuildRequires:  ghc-monads-tf-devel
-BuildRequires:  ghc-monads-tf-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-xml-types-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-gnuidn-prof
+BuildRequires:  ghc-gnutls-prof
+BuildRequires:  ghc-gsasl-prof
+BuildRequires:  ghc-libxml-sax-prof
+BuildRequires:  ghc-monads-tf-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-xml-types-prof
+%endif
 
 %description
 Client library for the XMPP protocol.
@@ -72,26 +74,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +116,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/network-transport-tcp.spec.golden b/test/golden-test-cases/network-transport-tcp.spec.golden
--- a/test/golden-test-cases/network-transport-tcp.spec.golden
+++ b/test/golden-test-cases/network-transport-tcp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package network-transport-tcp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name network-transport-tcp
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        TCP instantiation of Network.Transport
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-accessor-devel
-BuildRequires:  ghc-data-accessor-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-network-transport-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-accessor-prof
+BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-network-transport-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-network-transport-tests-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-network-transport-tests-prof
 %endif
+%endif
 
 %description
 TCP instantiation of Network.Transport.
@@ -67,26 +71,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/nix-paths.spec.golden b/test/golden-test-cases/nix-paths.spec.golden
--- a/test/golden-test-cases/nix-paths.spec.golden
+++ b/test/golden-test-cases/nix-paths.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package nix-paths
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,29 @@
 
 
 %global pkg_name nix-paths
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Knowledge of Nix's installation directories
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  nix-build
 BuildRequires:  nix-env
 BuildRequires:  nix-hash
 BuildRequires:  nix-instantiate
 BuildRequires:  nix-store
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-process-prof
+%endif
 
 %description
 This module provides full paths to various Nix utilities, like 'nix-store',
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/nvim-hs.spec.golden b/test/golden-test-cases/nvim-hs.spec.golden
--- a/test/golden-test-cases/nvim-hs.spec.golden
+++ b/test/golden-test-cases/nvim-hs.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package nvim-hs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,102 +17,106 @@
 
 
 %global pkg_name nvim-hs
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Haskell plugin backend for neovim
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-ansi-wl-pprint-devel
-BuildRequires:  ghc-ansi-wl-pprint-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cereal-conduit-devel
-BuildRequires:  ghc-cereal-conduit-prof
 BuildRequires:  ghc-cereal-devel
-BuildRequires:  ghc-cereal-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
-BuildRequires:  ghc-conduit-extra-prof
-BuildRequires:  ghc-conduit-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-devel
-BuildRequires:  ghc-data-default-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-dyre-devel
-BuildRequires:  ghc-dyre-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-foreign-store-devel
-BuildRequires:  ghc-foreign-store-prof
 BuildRequires:  ghc-hslogger-devel
-BuildRequires:  ghc-hslogger-prof
 BuildRequires:  ghc-lifted-base-devel
-BuildRequires:  ghc-lifted-base-prof
 BuildRequires:  ghc-megaparsec-devel
-BuildRequires:  ghc-megaparsec-prof
 BuildRequires:  ghc-messagepack-devel
-BuildRequires:  ghc-messagepack-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-setenv-devel
-BuildRequires:  ghc-setenv-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-streaming-commons-devel
-BuildRequires:  ghc-streaming-commons-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-locale-compat-devel
+BuildRequires:  ghc-transformers-base-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-utf8-string-devel
+BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-ansi-wl-pprint-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cereal-conduit-prof
+BuildRequires:  ghc-cereal-prof
+BuildRequires:  ghc-conduit-extra-prof
+BuildRequires:  ghc-conduit-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-dyre-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-foreign-store-prof
+BuildRequires:  ghc-hslogger-prof
+BuildRequires:  ghc-lifted-base-prof
+BuildRequires:  ghc-megaparsec-prof
+BuildRequires:  ghc-messagepack-prof
+BuildRequires:  ghc-monad-control-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-setenv-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-streaming-commons-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-locale-compat-prof
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-base-devel
 BuildRequires:  ghc-transformers-base-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-utf8-string-devel
 BuildRequires:  ghc-utf8-string-prof
-BuildRequires:  ghc-void-devel
 BuildRequires:  ghc-void-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-discover-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-discover-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 This package provides a plugin provider for neovim. It allows you to write
@@ -151,33 +155,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -199,9 +204,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/once.spec.golden b/test/golden-test-cases/once.spec.golden
--- a/test/golden-test-cases/once.spec.golden
+++ b/test/golden-test-cases/once.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package once
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name once
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Memoization for IO actions and functions
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 
 %description
 Please see Control.Once for examples.
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/one-liner.spec.golden b/test/golden-test-cases/one-liner.spec.golden
--- a/test/golden-test-cases/one-liner.spec.golden
+++ b/test/golden-test-cases/one-liner.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package one-liner
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name one-liner
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.9.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Constraint-based generics
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-contravariant-devel
-BuildRequires:  ghc-contravariant-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-contravariant-prof
+BuildRequires:  ghc-profunctors-prof
+BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-HUnit-prof
 %endif
+%endif
 
 %description
 Write short and concise generic instances of type classes. one-liner is
@@ -67,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/online.spec.golden b/test/golden-test-cases/online.spec.golden
--- a/test/golden-test-cases/online.spec.golden
+++ b/test/golden-test-cases/online.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package online
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,32 +17,34 @@
 
 
 %global pkg_name online
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Online statistics
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-foldl-devel
-BuildRequires:  ghc-foldl-prof
 BuildRequires:  ghc-numhask-devel
-BuildRequires:  ghc-numhask-prof
 BuildRequires:  ghc-protolude-devel
-BuildRequires:  ghc-protolude-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tdigest-devel
-BuildRequires:  ghc-tdigest-prof
 BuildRequires:  ghc-vector-algorithms-devel
-BuildRequires:  ghc-vector-algorithms-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-foldl-prof
+BuildRequires:  ghc-numhask-prof
+BuildRequires:  ghc-protolude-prof
+BuildRequires:  ghc-tdigest-prof
+BuildRequires:  ghc-vector-algorithms-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 Transformation of statistics to online algorithms.
@@ -63,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc readme.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/openexr-write.spec.golden b/test/golden-test-cases/openexr-write.spec.golden
--- a/test/golden-test-cases/openexr-write.spec.golden
+++ b/test/golden-test-cases/openexr-write.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package openexr-write
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name openexr-write
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library for writing images in OpenEXR HDR file format
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-data-binary-ieee754-devel
-BuildRequires:  ghc-data-binary-ieee754-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-vector-split-devel
-BuildRequires:  ghc-vector-split-prof
 BuildRequires:  ghc-zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-data-binary-ieee754-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-vector-prof
+BuildRequires:  ghc-vector-split-prof
 BuildRequires:  ghc-zlib-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 OpenEXR allows to store pixels as floating point numbers and thus can capture
@@ -75,26 +79,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -121,9 +126,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/openpgp-asciiarmor.spec.golden b/test/golden-test-cases/openpgp-asciiarmor.spec.golden
--- a/test/golden-test-cases/openpgp-asciiarmor.spec.golden
+++ b/test/golden-test-cases/openpgp-asciiarmor.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package openpgp-asciiarmor
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name openpgp-asciiarmor
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        OpenPGP (RFC4880) ASCII Armor codec
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cereal-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cereal-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
 %endif
+%endif
 
 %description
 OpenPGP (RFC4880) ASCII Armor codec.
@@ -68,26 +72,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pager.spec.golden b/test/golden-test-cases/pager.spec.golden
--- a/test/golden-test-cases/pager.spec.golden
+++ b/test/golden-test-cases/pager.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pager
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,45 @@
 
 
 %global pkg_name pager
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Open up a pager, like 'less' or 'more'
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
+BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-safe-devel
+BuildRequires:  ghc-terminfo-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unix-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-conduit-extra-prof
 BuildRequires:  ghc-conduit-prof
-BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-directory-prof
-BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-resourcet-devel
 BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-safe-prof
-BuildRequires:  ghc-terminfo-devel
 BuildRequires:  ghc-terminfo-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unix-devel
 BuildRequires:  ghc-unix-prof
+%endif
 
 %description
 This opens up the user's $PAGER. On Linux, this is usually called 'less'.
@@ -79,33 +81,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -126,9 +129,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pandoc.spec.golden b/test/golden-test-cases/pandoc.spec.golden
--- a/test/golden-test-cases/pandoc.spec.golden
+++ b/test/golden-test-cases/pandoc.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pandoc
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,141 +17,145 @@
 
 
 %global pkg_name pandoc
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        2.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Conversion between markup formats
 License:        GPL-2.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-Glob-devel
-BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-HTTP-devel
-BuildRequires:  ghc-HTTP-prof
 BuildRequires:  ghc-JuicyPixels-devel
-BuildRequires:  ghc-JuicyPixels-prof
 BuildRequires:  ghc-SHA-devel
-BuildRequires:  ghc-SHA-prof
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-aeson-pretty-devel
-BuildRequires:  ghc-aeson-pretty-prof
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-compat-devel
-BuildRequires:  ghc-base-compat-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-blaze-markup-devel
-BuildRequires:  ghc-blaze-markup-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-cmark-gfm-devel
-BuildRequires:  ghc-cmark-gfm-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-devel
-BuildRequires:  ghc-data-default-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-doctemplates-devel
-BuildRequires:  ghc-doctemplates-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-haddock-library-devel
-BuildRequires:  ghc-haddock-library-prof
 BuildRequires:  ghc-hslua-devel
 BuildRequires:  ghc-hslua-module-text-devel
+BuildRequires:  ghc-http-client-devel
+BuildRequires:  ghc-http-client-tls-devel
+BuildRequires:  ghc-http-types-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-network-uri-devel
+BuildRequires:  ghc-pandoc-types-devel
+BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-safe-devel
+BuildRequires:  ghc-scientific-devel
+BuildRequires:  ghc-skylighting-devel
+BuildRequires:  ghc-split-devel
+BuildRequires:  ghc-syb-devel
+BuildRequires:  ghc-tagsoup-devel
+BuildRequires:  ghc-temporary-devel
+BuildRequires:  ghc-texmath-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-unix-devel
+BuildRequires:  ghc-unordered-containers-devel
+BuildRequires:  ghc-vector-devel
+BuildRequires:  ghc-xml-devel
+BuildRequires:  ghc-yaml-devel
+BuildRequires:  ghc-zip-archive-devel
+BuildRequires:  ghc-zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-Glob-prof
+BuildRequires:  ghc-HTTP-prof
+BuildRequires:  ghc-JuicyPixels-prof
+BuildRequires:  ghc-SHA-prof
+BuildRequires:  ghc-aeson-pretty-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-compat-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-blaze-markup-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-cmark-gfm-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-doctemplates-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-haddock-library-prof
 BuildRequires:  ghc-hslua-module-text-prof
 BuildRequires:  ghc-hslua-prof
-BuildRequires:  ghc-http-client-devel
 BuildRequires:  ghc-http-client-prof
-BuildRequires:  ghc-http-client-tls-devel
 BuildRequires:  ghc-http-client-tls-prof
-BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-http-types-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-network-uri-devel
 BuildRequires:  ghc-network-uri-prof
-BuildRequires:  ghc-pandoc-types-devel
 BuildRequires:  ghc-pandoc-types-prof
-BuildRequires:  ghc-parsec-devel
 BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-random-devel
 BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-safe-prof
-BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-scientific-prof
-BuildRequires:  ghc-skylighting-devel
 BuildRequires:  ghc-skylighting-prof
-BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-split-prof
-BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-syb-prof
-BuildRequires:  ghc-tagsoup-devel
 BuildRequires:  ghc-tagsoup-prof
-BuildRequires:  ghc-temporary-devel
 BuildRequires:  ghc-temporary-prof
-BuildRequires:  ghc-texmath-devel
 BuildRequires:  ghc-texmath-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-unix-devel
 BuildRequires:  ghc-unix-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
-BuildRequires:  ghc-xml-devel
 BuildRequires:  ghc-xml-prof
-BuildRequires:  ghc-yaml-devel
 BuildRequires:  ghc-yaml-prof
-BuildRequires:  ghc-zip-archive-devel
 BuildRequires:  ghc-zip-archive-prof
-BuildRequires:  ghc-zlib-devel
 BuildRequires:  ghc-zlib-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Diff-devel
-BuildRequires:  ghc-Diff-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-executable-path-devel
-BuildRequires:  ghc-executable-path-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-golden-devel
-BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Diff-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-executable-path-prof
+BuildRequires:  ghc-tasty-golden-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Pandoc is a Haskell library for converting from one markup format to another,
@@ -188,33 +192,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -383,9 +388,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc AUTHORS.md README.md changelog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license COPYING.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/partial-isomorphisms.spec.golden b/test/golden-test-cases/partial-isomorphisms.spec.golden
--- a/test/golden-test-cases/partial-isomorphisms.spec.golden
+++ b/test/golden-test-cases/partial-isomorphisms.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package partial-isomorphisms
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name partial-isomorphisms
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Partial isomorphisms
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-template-haskell-prof
+%endif
 
 %description
 Partial isomorphisms as described in the paper:
@@ -61,26 +63,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/partial-semigroup.spec.golden b/test/golden-test-cases/partial-semigroup.spec.golden
--- a/test/golden-test-cases/partial-semigroup.spec.golden
+++ b/test/golden-test-cases/partial-semigroup.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package partial-semigroup
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,31 @@
 
 
 %global pkg_name partial-semigroup
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A partial binary associative operator
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-hedgehog-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-hedgehog-prof
 %endif
+%endif
 
 %description
 A partial semigroup is like a semigroup, but the operator is partial.
@@ -59,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +108,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pathtype.spec.golden b/test/golden-test-cases/pathtype.spec.golden
--- a/test/golden-test-cases/pathtype.spec.golden
+++ b/test/golden-test-cases/pathtype.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pathtype
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,45 @@
 
 
 %global pkg_name pathtype
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Type-safe replacement for System.FilePath etc
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-old-time-devel
-BuildRequires:  ghc-old-time-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-utility-ht-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-old-time-prof
+BuildRequires:  ghc-tagged-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-utility-ht-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-random-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-random-prof
 %endif
+%endif
 
 %description
 This package provides type-safe access to filepath manipulations.
@@ -108,26 +112,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -154,9 +159,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pcap.spec.golden b/test/golden-test-cases/pcap.spec.golden
--- a/test/golden-test-cases/pcap.spec.golden
+++ b/test/golden-test-cases/pcap.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pcap
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name pcap
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.5.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A system-independent interface for user-level packet capture
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 A system-independent interface for user-level packet capture.
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pdfinfo.spec.golden b/test/golden-test-cases/pdfinfo.spec.golden
--- a/test/golden-test-cases/pdfinfo.spec.golden
+++ b/test/golden-test-cases/pdfinfo.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pdfinfo
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,32 +17,34 @@
 
 
 %global pkg_name pdfinfo
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.5.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Wrapper around the pdfinfo command
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-old-locale-devel
-BuildRequires:  ghc-old-locale-prof
 BuildRequires:  ghc-process-extras-devel
-BuildRequires:  ghc-process-extras-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-locale-compat-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-old-locale-prof
+BuildRequires:  ghc-process-extras-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-locale-compat-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 Just a wrapper around the pdfinfo command (for collecting PDF file info).
@@ -64,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -105,9 +108,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pell.spec.golden b/test/golden-test-cases/pell.spec.golden
--- a/test/golden-test-cases/pell.spec.golden
+++ b/test/golden-test-cases/pell.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pell
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name pell
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Package to solve the Generalized Pell Equation
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-arithmoi-devel
-BuildRequires:  ghc-arithmoi-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-arithmoi-prof
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-cabal-test-quickcheck-devel
-BuildRequires:  ghc-cabal-test-quickcheck-prof
 BuildRequires:  ghc-primes-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-cabal-test-quickcheck-prof
 BuildRequires:  ghc-primes-prof
 %endif
+%endif
 
 %description
 Finds all solutions of the generalized Pell Equation.
@@ -66,26 +70,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/persistable-types-HDBC-pg.spec.golden b/test/golden-test-cases/persistable-types-HDBC-pg.spec.golden
--- a/test/golden-test-cases/persistable-types-HDBC-pg.spec.golden
+++ b/test/golden-test-cases/persistable-types-HDBC-pg.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package persistable-types-HDBC-pg
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,32 +17,34 @@
 
 
 %global pkg_name persistable-types-HDBC-pg
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.1.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        HDBC and Relational-Record instances of PostgreSQL extended types
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-HDBC-devel
-BuildRequires:  ghc-HDBC-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-convertible-devel
-BuildRequires:  ghc-convertible-prof
 BuildRequires:  ghc-persistable-record-devel
-BuildRequires:  ghc-persistable-record-prof
 BuildRequires:  ghc-relational-query-HDBC-devel
-BuildRequires:  ghc-relational-query-HDBC-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-postgresql-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-HDBC-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-convertible-prof
+BuildRequires:  ghc-persistable-record-prof
+BuildRequires:  ghc-relational-query-HDBC-prof
 BuildRequires:  ghc-text-postgresql-prof
+%endif
 
 %description
 This package contains HDBC Convertible instances and Relational-Record
@@ -66,26 +68,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -109,9 +112,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc example
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/persistent-mysql-haskell.spec.golden b/test/golden-test-cases/persistent-mysql-haskell.spec.golden
--- a/test/golden-test-cases/persistent-mysql-haskell.spec.golden
+++ b/test/golden-test-cases/persistent-mysql-haskell.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package persistent-mysql-haskell
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,55 +17,57 @@
 
 
 %global pkg_name persistent-mysql-haskell
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A pure haskell backend for the persistent library using MySQL database server
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-conduit-devel
-BuildRequires:  ghc-conduit-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-io-streams-devel
-BuildRequires:  ghc-io-streams-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-monad-logger-devel
-BuildRequires:  ghc-monad-logger-prof
 BuildRequires:  ghc-mysql-haskell-devel
-BuildRequires:  ghc-mysql-haskell-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-persistent-devel
-BuildRequires:  ghc-persistent-prof
 BuildRequires:  ghc-persistent-template-devel
-BuildRequires:  ghc-persistent-template-prof
 BuildRequires:  ghc-resource-pool-devel
-BuildRequires:  ghc-resource-pool-prof
 BuildRequires:  ghc-resourcet-devel
-BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-tls-devel
-BuildRequires:  ghc-tls-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-conduit-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-io-streams-prof
+BuildRequires:  ghc-monad-control-prof
+BuildRequires:  ghc-monad-logger-prof
+BuildRequires:  ghc-mysql-haskell-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-persistent-prof
+BuildRequires:  ghc-persistent-template-prof
+BuildRequires:  ghc-resource-pool-prof
+BuildRequires:  ghc-resourcet-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-tls-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This package contains a backend for persistent using the MySQL database server.
@@ -96,33 +98,34 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -141,9 +144,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/picosat.spec.golden b/test/golden-test-cases/picosat.spec.golden
--- a/test/golden-test-cases/picosat.spec.golden
+++ b/test/golden-test-cases/picosat.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package picosat
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name picosat
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Bindings to the PicoSAT solver
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-rdtsc-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-rdtsc-prof
 %endif
+%endif
 
 %description
 `picosat` provides bindings for the fast PicoSAT solver library.
@@ -62,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +111,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pinch.spec.golden b/test/golden-test-cases/pinch.spec.golden
--- a/test/golden-test-cases/pinch.spec.golden
+++ b/test/golden-test-cases/pinch.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pinch
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,45 +17,49 @@
 
 
 %global pkg_name pinch
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        An alternative implementation of Thrift for Haskell
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-discover-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-discover-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 This library provides machinery for types to specify how they can be serialized
@@ -87,26 +91,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -133,9 +138,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.md README.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pipes-network.spec.golden b/test/golden-test-cases/pipes-network.spec.golden
--- a/test/golden-test-cases/pipes-network.spec.golden
+++ b/test/golden-test-cases/pipes-network.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pipes-network
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,32 +17,34 @@
 
 
 %global pkg_name pipes-network
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.6.4.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Use network sockets together with the pipes library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-network-simple-devel
-BuildRequires:  ghc-network-simple-prof
 BuildRequires:  ghc-pipes-devel
-BuildRequires:  ghc-pipes-prof
 BuildRequires:  ghc-pipes-safe-devel
-BuildRequires:  ghc-pipes-safe-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-network-simple-prof
+BuildRequires:  ghc-pipes-prof
+BuildRequires:  ghc-pipes-safe-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Use network sockets together with the 'pipes' library.
@@ -77,26 +79,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +123,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pipes-safe.spec.golden b/test/golden-test-cases/pipes-safe.spec.golden
--- a/test/golden-test-cases/pipes-safe.spec.golden
+++ b/test/golden-test-cases/pipes-safe.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pipes-safe
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,36 +17,38 @@
 
 
 %global pkg_name pipes-safe
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        2.2.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Safety for the pipes ecosystem
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-monad-control-devel
-BuildRequires:  ghc-monad-control-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-pipes-devel
-BuildRequires:  ghc-pipes-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-base-devel
-BuildRequires:  ghc-transformers-base-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-monad-control-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-pipes-prof
+BuildRequires:  ghc-primitive-prof
+BuildRequires:  ghc-transformers-base-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This package adds resource management and exception handling to the 'pipes'
@@ -82,26 +84,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -125,9 +128,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pointed.spec.golden b/test/golden-test-cases/pointed.spec.golden
--- a/test/golden-test-cases/pointed.spec.golden
+++ b/test/golden-test-cases/pointed.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pointed
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,44 +17,46 @@
 
 
 %global pkg_name pointed
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Pointed and copointed data
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-comonad-devel
-BuildRequires:  ghc-comonad-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-class-devel
-BuildRequires:  ghc-data-default-class-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-kan-extensions-devel
-BuildRequires:  ghc-kan-extensions-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroupoids-devel
-BuildRequires:  ghc-semigroupoids-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-comonad-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-class-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-kan-extensions-prof
+BuildRequires:  ghc-semigroupoids-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-tagged-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 
 %description
 Pointed and copointed data.
@@ -75,26 +77,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -118,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/poly-arity.spec.golden b/test/golden-test-cases/poly-arity.spec.golden
--- a/test/golden-test-cases/poly-arity.spec.golden
+++ b/test/golden-test-cases/poly-arity.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package poly-arity
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name poly-arity
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Tools for working with functions of undetermined arity
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-constraints-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-constraints-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Tools for working with functions of undetermined arity.
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -94,9 +97,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/polynomials-bernstein.spec.golden b/test/golden-test-cases/polynomials-bernstein.spec.golden
--- a/test/golden-test-cases/polynomials-bernstein.spec.golden
+++ b/test/golden-test-cases/polynomials-bernstein.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package polynomials-bernstein
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name polynomials-bernstein
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A solver for systems of polynomial equations in bernstein form
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 This library defines an optimized type for representing polynomials in
@@ -56,26 +58,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -97,9 +100,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/postgresql-simple-url.spec.golden b/test/golden-test-cases/postgresql-simple-url.spec.golden
--- a/test/golden-test-cases/postgresql-simple-url.spec.golden
+++ b/test/golden-test-cases/postgresql-simple-url.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package postgresql-simple-url
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name postgresql-simple-url
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Parse postgres:// url into ConnectInfo
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-network-uri-devel
-BuildRequires:  ghc-network-uri-prof
 BuildRequires:  ghc-postgresql-simple-devel
-BuildRequires:  ghc-postgresql-simple-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-network-uri-prof
+BuildRequires:  ghc-postgresql-simple-prof
 BuildRequires:  ghc-split-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
-BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 The 'Database.PostgreSQL.Simple.URL' module in this package exports two helper
@@ -66,26 +70,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/prelude-safeenum.spec.golden b/test/golden-test-cases/prelude-safeenum.spec.golden
--- a/test/golden-test-cases/prelude-safeenum.spec.golden
+++ b/test/golden-test-cases/prelude-safeenum.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package prelude-safeenum
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name prelude-safeenum
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A redefinition of the Prelude's Enum class in order to render it safe
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A redefinition of the Prelude's Enum class in order to render it safe.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc AUTHORS CHANGELOG README
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/presburger.spec.golden b/test/golden-test-cases/presburger.spec.golden
--- a/test/golden-test-cases/presburger.spec.golden
+++ b/test/golden-test-cases/presburger.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package presburger
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,33 @@
 
 
 %global pkg_name presburger
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.3.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A decision procedure for quantifier-free linear arithmetic
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-pretty-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-QuickCheck-prof
 %endif
+%endif
 
 %description
 The decision procedure is based on the algorithm used in CVC4, which is itself
@@ -61,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -105,9 +110,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/prettyclass.spec.golden b/test/golden-test-cases/prettyclass.spec.golden
--- a/test/golden-test-cases/prettyclass.spec.golden
+++ b/test/golden-test-cases/prettyclass.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package prettyclass
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name prettyclass
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Pretty printing class similar to Show
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-pretty-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Pretty printing class similar to Show, based on the HughesPJ pretty printing
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -94,8 +97,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.spec.golden b/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.spec.golden
--- a/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.spec.golden
+++ b/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package prettyprinter-compat-ansi-wl-pprint
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name prettyprinter-compat-ansi-wl-pprint
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Drop-in compatibility package to migrate from »ansi-wl-pprint« to »prettyprinter«
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-prettyprinter-ansi-terminal-devel
-BuildRequires:  ghc-prettyprinter-ansi-terminal-prof
 BuildRequires:  ghc-prettyprinter-devel
-BuildRequires:  ghc-prettyprinter-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-prettyprinter-ansi-terminal-prof
+BuildRequires:  ghc-prettyprinter-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Drop-in compatibility package to migrate from »ansi-wl-pprint« to
@@ -60,26 +62,27 @@
 This package provides the Haskell %{name} library
 development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CONTRIBUTORS.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/prettyprinter-compat-wl-pprint.spec.golden b/test/golden-test-cases/prettyprinter-compat-wl-pprint.spec.golden
--- a/test/golden-test-cases/prettyprinter-compat-wl-pprint.spec.golden
+++ b/test/golden-test-cases/prettyprinter-compat-wl-pprint.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package prettyprinter-compat-wl-pprint
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name prettyprinter-compat-wl-pprint
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Prettyprinter compatibility module for previous users of the wl-pprint package
 License:        BSD-2-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-prettyprinter-devel
-BuildRequires:  ghc-prettyprinter-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-prettyprinter-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Prettyprinter compatibility module for previous users of the wl-pprint package.
@@ -57,26 +59,27 @@
 This package provides the Haskell %{name} library
 development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CONTRIBUTORS.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/primitive.spec.golden b/test/golden-test-cases/primitive.spec.golden
--- a/test/golden-test-cases/primitive.spec.golden
+++ b/test/golden-test-cases/primitive.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package primitive
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,25 @@
 
 
 %global pkg_name primitive
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Primitive memory-related operations
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This package provides various primitive memory-related operations.
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/product-profunctors.spec.golden b/test/golden-test-cases/product-profunctors.spec.golden
--- a/test/golden-test-cases/product-profunctors.spec.golden
+++ b/test/golden-test-cases/product-profunctors.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package product-profunctors
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,31 @@
 
 
 %global pkg_name product-profunctors
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.8.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Product-profunctors
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-contravariant-devel
-BuildRequires:  ghc-contravariant-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-template-haskell-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-contravariant-prof
+BuildRequires:  ghc-profunctors-prof
+BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-template-haskell-prof
+%endif
 
 %description
 Product profunctors.
@@ -61,26 +63,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -105,9 +108,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/profiterole.spec.golden b/test/golden-test-cases/profiterole.spec.golden
--- a/test/golden-test-cases/profiterole.spec.golden
+++ b/test/golden-test-cases/profiterole.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package profiterole
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
 #
 
 
+%bcond_with ghc_prof
 Name:           profiterole
 Version:        0.1
 Release:        0
@@ -23,34 +24,36 @@
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-extra-devel
-BuildRequires:  ghc-extra-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-ghc-prof-devel
-BuildRequires:  ghc-ghc-prof-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-extra-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-ghc-prof-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Given a GHC profile output, this tool generates alternative views on the data,
 which are typically more concise and may reveal new insights.
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_bin_build
diff --git a/test/golden-test-cases/projectroot.spec.golden b/test/golden-test-cases/projectroot.spec.golden
--- a/test/golden-test-cases/projectroot.spec.golden
+++ b/test/golden-test-cases/projectroot.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package projectroot
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,33 @@
 
 
 %global pkg_name projectroot
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Bindings to the projectroot C logic
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Simple way of finding the root of a project given an entry-point. This module
@@ -62,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +111,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/proto-lens-optparse.spec.golden b/test/golden-test-cases/proto-lens-optparse.spec.golden
--- a/test/golden-test-cases/proto-lens-optparse.spec.golden
+++ b/test/golden-test-cases/proto-lens-optparse.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package proto-lens-optparse
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name proto-lens-optparse
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Adapting proto-lens to optparse-applicative ReadMs
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-proto-lens-devel
-BuildRequires:  ghc-proto-lens-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-proto-lens-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 A package adapting proto-lens to optparse-applicative ReadMs. This gives an
@@ -59,26 +61,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc Changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/proto-lens.spec.golden b/test/golden-test-cases/proto-lens.spec.golden
--- a/test/golden-test-cases/proto-lens.spec.golden
+++ b/test/golden-test-cases/proto-lens.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package proto-lens
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,40 +17,42 @@
 
 
 %global pkg_name proto-lens
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.2.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A lens-based implementation of protocol buffers in Haskell
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-class-devel
-BuildRequires:  ghc-data-default-class-prof
 BuildRequires:  ghc-lens-family-devel
-BuildRequires:  ghc-lens-family-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
 BuildRequires:  ghc-pretty-devel
-BuildRequires:  ghc-pretty-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-class-prof
+BuildRequires:  ghc-lens-family-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-pretty-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-void-prof
+%endif
 
 %description
 The proto-lens library provides to protocol buffers using modern Haskell
@@ -78,26 +80,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -121,9 +124,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc Changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/psqueues.spec.golden b/test/golden-test-cases/psqueues.spec.golden
--- a/test/golden-test-cases/psqueues.spec.golden
+++ b/test/golden-test-cases/psqueues.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package psqueues
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,45 @@
 
 
 %global pkg_name psqueues
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.4.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Pure priority search queues
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 The psqueues package provides <http://en.wikipedia.org/wiki/Priority_queue
@@ -109,26 +113,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -155,9 +160,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/pusher-http-haskell.spec.golden b/test/golden-test-cases/pusher-http-haskell.spec.golden
--- a/test/golden-test-cases/pusher-http-haskell.spec.golden
+++ b/test/golden-test-cases/pusher-http-haskell.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package pusher-http-haskell
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,55 +17,59 @@
 
 
 %global pkg_name pusher-http-haskell
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.5.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Haskell client library for the Pusher HTTP API
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base16-bytestring-devel
-BuildRequires:  ghc-base16-bytestring-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cryptonite-devel
-BuildRequires:  ghc-cryptonite-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-memory-devel
-BuildRequires:  ghc-memory-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base16-bytestring-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cryptonite-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-memory-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-scientific-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-scientific-prof
 %endif
+%endif
 
 %description
 Functions that correspond to endpoints of the Pusher HTTP API.
@@ -90,26 +94,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -134,9 +139,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/quickcheck-arbitrary-adt.spec.golden b/test/golden-test-cases/quickcheck-arbitrary-adt.spec.golden
--- a/test/golden-test-cases/quickcheck-arbitrary-adt.spec.golden
+++ b/test/golden-test-cases/quickcheck-arbitrary-adt.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package quickcheck-arbitrary-adt
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name quickcheck-arbitrary-adt
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generic typeclasses for generating arbitrary ADTs
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-transformers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-hspec-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-transformers-prof
 %endif
+%endif
 
 %description
 Improve arbitrary value generation for ADTs.
@@ -65,26 +69,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -109,9 +114,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/quickcheck-combinators.spec.golden b/test/golden-test-cases/quickcheck-combinators.spec.golden
--- a/test/golden-test-cases/quickcheck-combinators.spec.golden
+++ b/test/golden-test-cases/quickcheck-combinators.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package quickcheck-combinators
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name quickcheck-combinators
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Simple type-level combinators for augmenting QuickCheck instances
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-unfoldable-restricted-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-unfoldable-restricted-prof
+%endif
 
 %description
 Simply wrap the type you want to generate (assuming it satisfies all the
@@ -63,26 +65,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/rank1dynamic.spec.golden b/test/golden-test-cases/rank1dynamic.spec.golden
--- a/test/golden-test-cases/rank1dynamic.spec.golden
+++ b/test/golden-test-cases/rank1dynamic.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package rank1dynamic
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name rank1dynamic
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Like Data.Dynamic/Data.Typeable but with support for rank-1 polymorphic types
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
 %endif
+%endif
 
 %description
 "Data.Typeable" and "Data.Dynamic" only support monomorphic types. In this
@@ -64,26 +68,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,9 +115,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/rasterific-svg.spec.golden b/test/golden-test-cases/rasterific-svg.spec.golden
--- a/test/golden-test-cases/rasterific-svg.spec.golden
+++ b/test/golden-test-cases/rasterific-svg.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package rasterific-svg
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,57 +17,59 @@
 
 
 %global pkg_name rasterific-svg
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        SVG renderer based on Rasterific
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-FontyFruity-devel
-BuildRequires:  ghc-FontyFruity-prof
 BuildRequires:  ghc-JuicyPixels-devel
-BuildRequires:  ghc-JuicyPixels-prof
 BuildRequires:  ghc-Rasterific-devel
-BuildRequires:  ghc-Rasterific-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-linear-devel
-BuildRequires:  ghc-linear-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-svg-tree-devel
-BuildRequires:  ghc-svg-tree-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-FontyFruity-prof
+BuildRequires:  ghc-JuicyPixels-prof
+BuildRequires:  ghc-Rasterific-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-linear-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-primitive-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-svg-tree-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 SVG renderer that will let you render svg-tree parsed SVG file to a JuicyPixel
@@ -89,33 +91,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -134,9 +137,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ratio-int.spec.golden b/test/golden-test-cases/ratio-int.spec.golden
--- a/test/golden-test-cases/ratio-int.spec.golden
+++ b/test/golden-test-cases/ratio-int.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ratio-int
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name ratio-int
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Fast specialisation of Data.Ratio for Int
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Fast specialisation of Data.Ratio for Int.
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -93,8 +96,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/rawstring-qm.spec.golden b/test/golden-test-cases/rawstring-qm.spec.golden
--- a/test/golden-test-cases/rawstring-qm.spec.golden
+++ b/test/golden-test-cases/rawstring-qm.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package rawstring-qm
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name rawstring-qm
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Simple raw string quotation and dictionary interpolation
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Supply a couple of usefull QuasiQuotes so we can use functions to lookup values
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/reactive-banana.spec.golden b/test/golden-test-cases/reactive-banana.spec.golden
--- a/test/golden-test-cases/reactive-banana.spec.golden
+++ b/test/golden-test-cases/reactive-banana.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package reactive-banana
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name reactive-banana
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library for functional reactive programming (FRP)
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-pqueue-devel
-BuildRequires:  ghc-pqueue-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vault-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-pqueue-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vault-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-psqueues-devel
-BuildRequires:  ghc-psqueues-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-psqueues-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
 %endif
+%endif
 
 %description
 Reactive-banana is a library for Functional Reactive Programming (FRP).
@@ -88,26 +92,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -134,9 +139,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md doc
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/readline.spec.golden b/test/golden-test-cases/readline.spec.golden
--- a/test/golden-test-cases/readline.spec.golden
+++ b/test/golden-test-cases/readline.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package readline
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name readline
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        An interface to the GNU readline library
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 More information on readline can be found at
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -95,9 +98,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/rebase.spec.golden b/test/golden-test-cases/rebase.spec.golden
--- a/test/golden-test-cases/rebase.spec.golden
+++ b/test/golden-test-cases/rebase.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package rebase
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,68 +17,70 @@
 
 
 %global pkg_name rebase
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A more progressive alternative to the "base" package
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
 BuildRequires:  ghc-base-prelude-devel
-BuildRequires:  ghc-base-prelude-prof
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-contravariant-devel
 BuildRequires:  ghc-contravariant-extras-devel
+BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-dlist-devel
+BuildRequires:  ghc-either-devel
+BuildRequires:  ghc-fail-devel
+BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-scientific-devel
+BuildRequires:  ghc-semigroupoids-devel
+BuildRequires:  ghc-semigroups-devel
+BuildRequires:  ghc-stm-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-time-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unordered-containers-devel
+BuildRequires:  ghc-uuid-devel
+BuildRequires:  ghc-vector-devel
+BuildRequires:  ghc-void-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prelude-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-contravariant-extras-prof
 BuildRequires:  ghc-contravariant-prof
-BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-dlist-devel
 BuildRequires:  ghc-dlist-prof
-BuildRequires:  ghc-either-devel
 BuildRequires:  ghc-either-prof
-BuildRequires:  ghc-fail-devel
 BuildRequires:  ghc-fail-prof
-BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-profunctors-devel
 BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-scientific-prof
-BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroupoids-prof
-BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-semigroups-prof
-BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-stm-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
-BuildRequires:  ghc-uuid-devel
 BuildRequires:  ghc-uuid-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
-BuildRequires:  ghc-void-devel
 BuildRequires:  ghc-void-prof
+%endif
 
 %description
 This package is intended for those who are tired of keeping long lists of
@@ -116,26 +118,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -157,9 +160,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/reform-blaze.spec.golden b/test/golden-test-cases/reform-blaze.spec.golden
--- a/test/golden-test-cases/reform-blaze.spec.golden
+++ b/test/golden-test-cases/reform-blaze.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package reform-blaze
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name reform-blaze
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.4.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Add support for using blaze-html with Reform
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-blaze-markup-devel
-BuildRequires:  ghc-blaze-markup-prof
 BuildRequires:  ghc-reform-devel
-BuildRequires:  ghc-reform-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-blaze-markup-prof
+BuildRequires:  ghc-reform-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Reform is a library for building and validating forms using applicative
@@ -60,26 +62,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/reform-hsp.spec.golden b/test/golden-test-cases/reform-hsp.spec.golden
--- a/test/golden-test-cases/reform-hsp.spec.golden
+++ b/test/golden-test-cases/reform-hsp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package reform-hsp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name reform-hsp
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.7.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Add support for using HSP with Reform
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hsp-devel
-BuildRequires:  ghc-hsp-prof
 BuildRequires:  ghc-hsx2hs-devel
-BuildRequires:  ghc-hsx2hs-prof
 BuildRequires:  ghc-reform-devel
-BuildRequires:  ghc-reform-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-hsp-prof
+BuildRequires:  ghc-hsx2hs-prof
+BuildRequires:  ghc-reform-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Reform is a library for building and validating forms using applicative
@@ -60,26 +62,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -101,9 +104,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/regex-compat.spec.golden b/test/golden-test-cases/regex-compat.spec.golden
--- a/test/golden-test-cases/regex-compat.spec.golden
+++ b/test/golden-test-cases/regex-compat.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package regex-compat
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name regex-compat
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.95.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Replaces/Enhances Text.Regex
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-regex-base-devel
-BuildRequires:  ghc-regex-base-prof
 BuildRequires:  ghc-regex-posix-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-regex-base-prof
 BuildRequires:  ghc-regex-posix-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 One module layer over regex-posix to replace Text.Regex.
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/regex-pcre.spec.golden b/test/golden-test-cases/regex-pcre.spec.golden
--- a/test/golden-test-cases/regex-pcre.spec.golden
+++ b/test/golden-test-cases/regex-pcre.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package regex-pcre
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,29 +17,31 @@
 
 
 %global pkg_name regex-pcre
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.94.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Replaces/Enhances Text.Regex
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-regex-base-devel
-BuildRequires:  ghc-regex-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  pcre-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-regex-base-prof
+%endif
 
 %description
 The PCRE backend to accompany regex-base, see www.pcre.org.
@@ -61,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/relational-query.spec.golden b/test/golden-test-cases/relational-query.spec.golden
--- a/test/golden-test-cases/relational-query.spec.golden
+++ b/test/golden-test-cases/relational-query.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package relational-query
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,53 +17,57 @@
 
 
 %global pkg_name relational-query
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.11.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Typeful, Modular, Relational, algebraic query engine
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-dlist-devel
-BuildRequires:  ghc-dlist-prof
 BuildRequires:  ghc-names-th-devel
-BuildRequires:  ghc-names-th-prof
 BuildRequires:  ghc-persistable-record-devel
-BuildRequires:  ghc-persistable-record-prof
 BuildRequires:  ghc-product-isomorphic-devel
-BuildRequires:  ghc-product-isomorphic-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-sql-words-devel
-BuildRequires:  ghc-sql-words-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-th-reify-compat-devel
-BuildRequires:  ghc-th-reify-compat-prof
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-locale-compat-devel
+BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-dlist-prof
+BuildRequires:  ghc-names-th-prof
+BuildRequires:  ghc-persistable-record-prof
+BuildRequires:  ghc-product-isomorphic-prof
+BuildRequires:  ghc-sql-words-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-th-reify-compat-prof
 BuildRequires:  ghc-time-locale-compat-prof
 BuildRequires:  ghc-time-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-quickcheck-simple-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-quickcheck-simple-prof
 %endif
+%endif
 
 %description
 This package contiains typeful relation structure and relational-algebraic
@@ -87,26 +91,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -133,9 +138,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/relational-schemas.spec.golden b/test/golden-test-cases/relational-schemas.spec.golden
--- a/test/golden-test-cases/relational-schemas.spec.golden
+++ b/test/golden-test-cases/relational-schemas.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package relational-schemas
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name relational-schemas
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.6.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        RDBMSs' schema templates for relational-query
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-relational-query-devel
-BuildRequires:  ghc-relational-query-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-relational-query-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 This package contains some RDBMSs' schema structure definitions.
@@ -63,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/repa-io.spec.golden b/test/golden-test-cases/repa-io.spec.golden
--- a/test/golden-test-cases/repa-io.spec.golden
+++ b/test/golden-test-cases/repa-io.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package repa-io
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,32 +17,34 @@
 
 
 %global pkg_name repa-io
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        3.4.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Read and write Repa arrays in various formats
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bmp-devel
-BuildRequires:  ghc-bmp-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-old-time-devel
-BuildRequires:  ghc-old-time-prof
 BuildRequires:  ghc-repa-devel
-BuildRequires:  ghc-repa-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bmp-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-old-time-prof
+BuildRequires:  ghc-repa-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 Read and write Repa arrays in various formats.
@@ -63,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +107,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/repa.spec.golden b/test/golden-test-cases/repa.spec.golden
--- a/test/golden-test-cases/repa.spec.golden
+++ b/test/golden-test-cases/repa.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package repa
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name repa
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        3.4.1.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        High performance, regular, shape polymorphic parallel arrays
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 Repa provides high performance, regular, multi-dimensional, shape polymorphic
@@ -62,26 +64,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -103,9 +106,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/rosezipper.spec.golden b/test/golden-test-cases/rosezipper.spec.golden
--- a/test/golden-test-cases/rosezipper.spec.golden
+++ b/test/golden-test-cases/rosezipper.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package rosezipper
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name rosezipper
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generic zipper implementation for Data.Tree
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A Haskell datastructure for working with locations in trees or forests.
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -94,9 +97,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/rvar.spec.golden b/test/golden-test-cases/rvar.spec.golden
--- a/test/golden-test-cases/rvar.spec.golden
+++ b/test/golden-test-cases/rvar.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package rvar
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name rvar
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Random Variables
-License:        SUSE-Public-Domain
+License:        LicenseRef-SUSE-Public-Domain
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-MonadPrompt-devel
-BuildRequires:  ghc-MonadPrompt-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-random-source-devel
-BuildRequires:  ghc-random-source-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-MonadPrompt-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-random-source-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Random number generation based on modeling random variables by an abstract type
@@ -71,26 +73,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,8 +113,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/scalpel-core.spec.golden b/test/golden-test-cases/scalpel-core.spec.golden
--- a/test/golden-test-cases/scalpel-core.spec.golden
+++ b/test/golden-test-cases/scalpel-core.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package scalpel-core
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name scalpel-core
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A high level web scraping library for Haskell
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-devel
-BuildRequires:  ghc-data-default-prof
 BuildRequires:  ghc-fail-devel
-BuildRequires:  ghc-fail-prof
 BuildRequires:  ghc-regex-base-devel
-BuildRequires:  ghc-regex-base-prof
 BuildRequires:  ghc-regex-tdfa-devel
-BuildRequires:  ghc-regex-tdfa-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagsoup-devel
-BuildRequires:  ghc-tagsoup-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-prof
+BuildRequires:  ghc-fail-prof
+BuildRequires:  ghc-regex-base-prof
+BuildRequires:  ghc-regex-tdfa-prof
+BuildRequires:  ghc-tagsoup-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-HUnit-prof
 %endif
+%endif
 
 %description
 Scalpel core provides a subset of the scalpel web scraping library that is
@@ -76,26 +80,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -122,9 +127,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/sdl2.spec.golden b/test/golden-test-cases/sdl2.spec.golden
--- a/test/golden-test-cases/sdl2.spec.golden
+++ b/test/golden-test-cases/sdl2.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package sdl2
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,39 @@
 
 
 %global pkg_name sdl2
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        2.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Both high- and low-level bindings to the SDL library (version 2.0.4+)
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-StateVar-devel
-BuildRequires:  ghc-StateVar-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-linear-devel
-BuildRequires:  ghc-linear-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  libSDL2-devel
 BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(sdl2)
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-StateVar-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-linear-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 This package contains bindings to the SDL 2 library, in both high- and
@@ -80,26 +82,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +132,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/selda-sqlite.spec.golden b/test/golden-test-cases/selda-sqlite.spec.golden
--- a/test/golden-test-cases/selda-sqlite.spec.golden
+++ b/test/golden-test-cases/selda-sqlite.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package selda-sqlite
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,30 +17,32 @@
 
 
 %global pkg_name selda-sqlite
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.6.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        SQLite backend for the Selda database EDSL
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-direct-sqlite-devel
-BuildRequires:  ghc-direct-sqlite-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-selda-devel
-BuildRequires:  ghc-selda-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-direct-sqlite-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-selda-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 SQLite backend for the Selda database EDSL.
@@ -61,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/selda.spec.golden b/test/golden-test-cases/selda.spec.golden
--- a/test/golden-test-cases/selda.spec.golden
+++ b/test/golden-test-cases/selda.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package selda
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,36 +17,38 @@
 
 
 %global pkg_name selda
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.11.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Type-safe, high-level EDSL for interacting with relational databases
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-psqueues-devel
-BuildRequires:  ghc-psqueues-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unordered-containers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-psqueues-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unordered-containers-prof
+%endif
 
 %description
 This package provides an EDSL for writing portable, type-safe, high-level
@@ -73,26 +75,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +119,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/servant-checked-exceptions.spec.golden b/test/golden-test-cases/servant-checked-exceptions.spec.golden
--- a/test/golden-test-cases/servant-checked-exceptions.spec.golden
+++ b/test/golden-test-cases/servant-checked-exceptions.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package servant-checked-exceptions
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,59 +17,63 @@
 
 
 %global pkg_name servant-checked-exceptions
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Checked exceptions for Servant APIs
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-http-media-devel
-BuildRequires:  ghc-http-media-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-servant-client-devel
-BuildRequires:  ghc-servant-client-prof
 BuildRequires:  ghc-servant-devel
 BuildRequires:  ghc-servant-docs-devel
+BuildRequires:  ghc-servant-server-devel
+BuildRequires:  ghc-tagged-devel
+BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-http-media-prof
+BuildRequires:  ghc-profunctors-prof
+BuildRequires:  ghc-servant-client-prof
 BuildRequires:  ghc-servant-docs-prof
 BuildRequires:  ghc-servant-prof
-BuildRequires:  ghc-servant-server-devel
 BuildRequires:  ghc-servant-server-prof
-BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-tagged-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Glob-devel
-BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-hspec-wai-devel
-BuildRequires:  ghc-hspec-wai-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hspec-devel
-BuildRequires:  ghc-tasty-hspec-prof
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-wai-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Glob-prof
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-hspec-wai-prof
+BuildRequires:  ghc-tasty-hspec-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-prof
 %endif
+%endif
 
 %description
 Please see <https://github.com/cdepillabout/servant-checked-exceptions#readme
@@ -92,26 +96,27 @@
 This package provides the Haskell %{name} library
 development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -138,9 +143,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/set-cover.spec.golden b/test/golden-test-cases/set-cover.spec.golden
--- a/test/golden-test-cases/set-cover.spec.golden
+++ b/test/golden-test-cases/set-cover.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package set-cover
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name set-cover
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Solve exact set cover problems like Sudoku, 8 Queens, Soma Cube, Tetris Cube
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-enummapset-devel
-BuildRequires:  ghc-enummapset-prof
 BuildRequires:  ghc-psqueues-devel
-BuildRequires:  ghc-psqueues-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-utility-ht-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-enummapset-prof
+BuildRequires:  ghc-psqueues-prof
 BuildRequires:  ghc-utility-ht-prof
+%endif
 
 %description
 Solver for exact set cover problems. Included examples: Sudoku, Nonogram, 8
@@ -70,26 +72,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +116,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc Changes.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/sets.spec.golden b/test/golden-test-cases/sets.spec.golden
--- a/test/golden-test-cases/sets.spec.golden
+++ b/test/golden-test-cases/sets.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package sets
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,59 +17,63 @@
 
 
 %global pkg_name sets
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.5.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Ducktyped set interface for Haskell containers
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-commutative-devel
-BuildRequires:  ghc-commutative-prof
 BuildRequires:  ghc-composition-devel
-BuildRequires:  ghc-composition-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-contravariant-devel
-BuildRequires:  ghc-contravariant-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-keys-devel
-BuildRequires:  ghc-keys-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroupoids-devel
-BuildRequires:  ghc-semigroupoids-prof
 BuildRequires:  ghc-semigroups-devel
-BuildRequires:  ghc-semigroups-prof
 BuildRequires:  ghc-transformers-base-devel
-BuildRequires:  ghc-transformers-base-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-witherable-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-commutative-prof
+BuildRequires:  ghc-composition-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-contravariant-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-keys-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-semigroupoids-prof
+BuildRequires:  ghc-semigroups-prof
+BuildRequires:  ghc-transformers-base-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-witherable-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 Includes overloaded functions for common set operations. See 'Data.Set.Class'.
@@ -90,26 +94,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -134,9 +139,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/simple-smt.spec.golden b/test/golden-test-cases/simple-smt.spec.golden
--- a/test/golden-test-cases/simple-smt.spec.golden
+++ b/test/golden-test-cases/simple-smt.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package simple-smt
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name simple-smt
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.7.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A simple way to interact with an SMT solver process
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A simple way to interact with an SMT solver process.
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/slack-web.spec.golden b/test/golden-test-cases/slack-web.spec.golden
--- a/test/golden-test-cases/slack-web.spec.golden
+++ b/test/golden-test-cases/slack-web.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package slack-web
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,51 +17,55 @@
 
 
 %global pkg_name slack-web
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Bindings for the Slack web API
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-errors-devel
-BuildRequires:  ghc-errors-prof
 BuildRequires:  ghc-http-api-data-devel
-BuildRequires:  ghc-http-api-data-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-client-tls-devel
-BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-megaparsec-devel
-BuildRequires:  ghc-megaparsec-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-servant-client-devel
-BuildRequires:  ghc-servant-client-prof
 BuildRequires:  ghc-servant-devel
-BuildRequires:  ghc-servant-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-errors-prof
+BuildRequires:  ghc-http-api-data-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-client-tls-prof
+BuildRequires:  ghc-megaparsec-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-servant-client-prof
+BuildRequires:  ghc-servant-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Haskell bindings for the Slack web API.
@@ -82,26 +86,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -128,9 +133,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/slug.spec.golden b/test/golden-test-cases/slug.spec.golden
--- a/test/golden-test-cases/slug.spec.golden
+++ b/test/golden-test-cases/slug.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package slug
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name slug
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.7
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Type-safe slugs for Yesod ecosystem
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-http-api-data-devel
-BuildRequires:  ghc-http-api-data-prof
 BuildRequires:  ghc-path-pieces-devel
-BuildRequires:  ghc-path-pieces-prof
 BuildRequires:  ghc-persistent-devel
-BuildRequires:  ghc-persistent-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-http-api-data-prof
+BuildRequires:  ghc-path-pieces-prof
+BuildRequires:  ghc-persistent-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Type-safe slugs for Yesod ecosystem.
@@ -70,26 +74,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE.md
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/soxlib.spec.golden b/test/golden-test-cases/soxlib.spec.golden
--- a/test/golden-test-cases/soxlib.spec.golden
+++ b/test/golden-test-cases/soxlib.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package soxlib
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,38 +17,40 @@
 
 
 %global pkg_name soxlib
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Write, read, convert audio signals using libsox
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-explicit-exception-devel
-BuildRequires:  ghc-explicit-exception-prof
 BuildRequires:  ghc-extensible-exceptions-devel
-BuildRequires:  ghc-extensible-exceptions-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-sample-frame-devel
-BuildRequires:  ghc-sample-frame-prof
 BuildRequires:  ghc-storablevector-devel
-BuildRequires:  ghc-storablevector-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-utility-ht-devel
-BuildRequires:  ghc-utility-ht-prof
 BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(sox)
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-explicit-exception-prof
+BuildRequires:  ghc-extensible-exceptions-prof
+BuildRequires:  ghc-sample-frame-prof
+BuildRequires:  ghc-storablevector-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-utility-ht-prof
+%endif
 
 %description
 This is an FFI binding to 'libsox' of the Sox (Sound Exchanger) project
@@ -75,26 +77,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +119,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/speedy-slice.spec.golden b/test/golden-test-cases/speedy-slice.spec.golden
--- a/test/golden-test-cases/speedy-slice.spec.golden
+++ b/test/golden-test-cases/speedy-slice.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package speedy-slice
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name speedy-slice
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Speedy slice sampling
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-kan-extensions-devel
-BuildRequires:  ghc-kan-extensions-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-mcmc-types-devel
-BuildRequires:  ghc-mcmc-types-prof
 BuildRequires:  ghc-mwc-probability-devel
-BuildRequires:  ghc-mwc-probability-prof
 BuildRequires:  ghc-pipes-devel
-BuildRequires:  ghc-pipes-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-kan-extensions-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-mcmc-types-prof
+BuildRequires:  ghc-mwc-probability-prof
+BuildRequires:  ghc-pipes-prof
+BuildRequires:  ghc-primitive-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-containers-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-containers-prof
 %endif
+%endif
 
 %description
 Speedy slice sampling.
@@ -87,26 +91,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -131,9 +136,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/splice.spec.golden b/test/golden-test-cases/splice.spec.golden
--- a/test/golden-test-cases/splice.spec.golden
+++ b/test/golden-test-cases/splice.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package splice
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name splice
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.6.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Cross-platform Socket to Socket Data Splicing
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A library that implements most efficient socket to socket data transfer loops
@@ -68,26 +70,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -109,9 +112,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/spreadsheet.spec.golden b/test/golden-test-cases/spreadsheet.spec.golden
--- a/test/golden-test-cases/spreadsheet.spec.golden
+++ b/test/golden-test-cases/spreadsheet.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package spreadsheet
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name spreadsheet
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.3.7
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Read and write spreadsheets from and to CSV files in a lazy way
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-explicit-exception-devel
-BuildRequires:  ghc-explicit-exception-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-utility-ht-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-explicit-exception-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-utility-ht-prof
+%endif
 
 %description
 Read and write spreadsheets from and to files containing comma separated values
@@ -80,26 +82,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -123,9 +126,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/stack-type.spec.golden b/test/golden-test-cases/stack-type.spec.golden
--- a/test/golden-test-cases/stack-type.spec.golden
+++ b/test/golden-test-cases/stack-type.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package stack-type
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name stack-type
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        The basic stack type
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 The basic stack type.
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/state-codes.spec.golden b/test/golden-test-cases/state-codes.spec.golden
--- a/test/golden-test-cases/state-codes.spec.golden
+++ b/test/golden-test-cases/state-codes.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package state-codes
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name state-codes
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        ISO 3166-2:US state codes and i18n names
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-shakespeare-devel
-BuildRequires:  ghc-shakespeare-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-shakespeare-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 This package provides the ISO 3166-2:US state codes and i18n names.
@@ -64,26 +68,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,9 +115,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/stb-image-redux.spec.golden b/test/golden-test-cases/stb-image-redux.spec.golden
--- a/test/golden-test-cases/stb-image-redux.spec.golden
+++ b/test/golden-test-cases/stb-image-redux.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package stb-image-redux
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,31 @@
 
 
 %global pkg_name stb-image-redux
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Image loading and writing microlibrary
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 See <https://github.com/typedrat/stb-image-redux/blob/master/README.md>.
@@ -58,26 +62,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +107,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/stm-containers.spec.golden b/test/golden-test-cases/stm-containers.spec.golden
--- a/test/golden-test-cases/stm-containers.spec.golden
+++ b/test/golden-test-cases/stm-containers.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package stm-containers
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,51 +17,55 @@
 
 
 %global pkg_name stm-containers
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.16
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Containers for STM
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
 BuildRequires:  ghc-base-prelude-devel
+BuildRequires:  ghc-focus-devel
+BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-list-t-devel
+BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prelude-prof
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-focus-devel
 BuildRequires:  ghc-focus-prof
-BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-list-t-devel
 BuildRequires:  ghc-list-t-prof
-BuildRequires:  ghc-primitive-devel
 BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HTF-devel
-BuildRequires:  ghc-HTF-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-free-devel
-BuildRequires:  ghc-free-prof
 BuildRequires:  ghc-loch-th-devel
-BuildRequires:  ghc-loch-th-prof
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prelude-devel
+BuildRequires:  ghc-placeholders-devel
+BuildRequires:  ghc-unordered-containers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HTF-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-free-prof
+BuildRequires:  ghc-loch-th-prof
 BuildRequires:  ghc-mtl-prelude-prof
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-placeholders-devel
 BuildRequires:  ghc-placeholders-prof
-BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-unordered-containers-prof
 %endif
+%endif
 
 %description
 This library is based on an STM-specialized implementation of Hash Array Mapped
@@ -88,26 +92,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -132,9 +137,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/streaming-commons.spec.golden b/test/golden-test-cases/streaming-commons.spec.golden
--- a/test/golden-test-cases/streaming-commons.spec.golden
+++ b/test/golden-test-cases/streaming-commons.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package streaming-commons
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,55 +17,59 @@
 
 
 %global pkg_name streaming-commons
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.18
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Common lower-level functions needed by various streaming data libraries
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unix-devel
-BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-zlib-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Provides low-dependency functionality commonly needed by various streaming data
@@ -87,26 +91,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -133,9 +138,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/strict-base-types.spec.golden b/test/golden-test-cases/strict-base-types.spec.golden
--- a/test/golden-test-cases/strict-base-types.spec.golden
+++ b/test/golden-test-cases/strict-base-types.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package strict-base-types
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,36 +17,38 @@
 
 
 %global pkg_name strict-base-types
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.5.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Strict variants of the types provided in base
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-strict-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-strict-prof
+%endif
 
 %description
 It is common knowledge that lazy datastructures can lead to space-leaks.
@@ -132,26 +134,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -175,9 +178,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/strict-types.spec.golden b/test/golden-test-cases/strict-types.spec.golden
--- a/test/golden-test-cases/strict-types.spec.golden
+++ b/test/golden-test-cases/strict-types.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package strict-types
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,36 +17,38 @@
 
 
 %global pkg_name strict-types
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A type level predicate ranging over strict types
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 
 %description
 A type class for types T where forall x :: T . rnf x = ⊥ <=> rwhnf x = ⊥.
@@ -67,26 +69,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,9 +113,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/string-class.spec.golden b/test/golden-test-cases/string-class.spec.golden
--- a/test/golden-test-cases/string-class.spec.golden
+++ b/test/golden-test-cases/string-class.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package string-class
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name string-class
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.6.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        String class library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 String class library.
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/stripe-haskell.spec.golden b/test/golden-test-cases/stripe-haskell.spec.golden
--- a/test/golden-test-cases/stripe-haskell.spec.golden
+++ b/test/golden-test-cases/stripe-haskell.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package stripe-haskell
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name stripe-haskell
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        2.2.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Stripe API for Haskell
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-stripe-core-devel
-BuildRequires:  ghc-stripe-core-prof
 BuildRequires:  ghc-stripe-http-streams-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-stripe-core-prof
 BuildRequires:  ghc-stripe-http-streams-prof
+%endif
 
 %description
 For usage information please consult README.md.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/svg-tree.spec.golden b/test/golden-test-cases/svg-tree.spec.golden
--- a/test/golden-test-cases/svg-tree.spec.golden
+++ b/test/golden-test-cases/svg-tree.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package svg-tree
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,44 +17,46 @@
 
 
 %global pkg_name svg-tree
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.6.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        SVG file loader and serializer
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-JuicyPixels-devel
-BuildRequires:  ghc-JuicyPixels-prof
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-lens-devel
-BuildRequires:  ghc-lens-prof
 BuildRequires:  ghc-linear-devel
-BuildRequires:  ghc-linear-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-scientific-devel
-BuildRequires:  ghc-scientific-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-devel
-BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-xml-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-JuicyPixels-prof
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-lens-prof
+BuildRequires:  ghc-linear-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-scientific-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-vector-prof
 BuildRequires:  ghc-xml-prof
+%endif
 
 %description
 Svg-tree provides types representing a SVG document, and allows to load and
@@ -81,26 +83,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -122,8 +125,10 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/swagger.spec.golden b/test/golden-test-cases/swagger.spec.golden
--- a/test/golden-test-cases/swagger.spec.golden
+++ b/test/golden-test-cases/swagger.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package swagger
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,41 @@
 
 
 %global pkg_name swagger
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Implementation of swagger data model
 License:        Unknown
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
 %endif
+%endif
 
 %description
 Implementation of Swagger specification version 1.2 as defined in
@@ -69,26 +73,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -113,9 +118,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/system-argv0.spec.golden b/test/golden-test-cases/system-argv0.spec.golden
--- a/test/golden-test-cases/system-argv0.spec.golden
+++ b/test/golden-test-cases/system-argv0.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package system-argv0
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name system-argv0
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Get argv[0] as a FilePath
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-system-filepath-devel
-BuildRequires:  ghc-system-filepath-prof
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-system-filepath-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Get 'argv[0]' as a FilePath. This is how the program was invoked, and might not
@@ -61,26 +63,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/system-fileio.spec.golden b/test/golden-test-cases/system-fileio.spec.golden
--- a/test/golden-test-cases/system-fileio.spec.golden
+++ b/test/golden-test-cases/system-fileio.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package system-fileio
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name system-fileio
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.16.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Consistent filesystem interaction across GHC versions (deprecated)
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-system-filepath-devel
-BuildRequires:  ghc-system-filepath-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-system-filepath-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-unix-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-chell-devel
-BuildRequires:  ghc-chell-prof
 BuildRequires:  ghc-temporary-devel
-BuildRequires:  ghc-temporary-prof
 BuildRequires:  ghc-transformers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-chell-prof
+BuildRequires:  ghc-temporary-prof
 BuildRequires:  ghc-transformers-prof
 %endif
+%endif
 
 %description
 Please see: https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx.
@@ -70,26 +74,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/system-filepath.spec.golden b/test/golden-test-cases/system-filepath.spec.golden
--- a/test/golden-test-cases/system-filepath.spec.golden
+++ b/test/golden-test-cases/system-filepath.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package system-filepath
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,39 @@
 
 
 %global pkg_name system-filepath
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.13.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        High-level, byte-based file and directory path manipulations (deprecated)
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-chell-devel
-BuildRequires:  ghc-chell-prof
 BuildRequires:  ghc-chell-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-chell-prof
 BuildRequires:  ghc-chell-quickcheck-prof
 %endif
+%endif
 
 %description
 Please see: https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx.
@@ -66,26 +70,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license license.txt
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tagged.spec.golden b/test/golden-test-cases/tagged.spec.golden
--- a/test/golden-test-cases/tagged.spec.golden
+++ b/test/golden-test-cases/tagged.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tagged
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,30 @@
 
 
 %global pkg_name tagged
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.8.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Haskell 98 phantom types to avoid unsafely passing dummy arguments
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 Haskell 98 phantom types to avoid unsafely passing dummy arguments.
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/taggy.spec.golden b/test/golden-test-cases/taggy.spec.golden
--- a/test/golden-test-cases/taggy.spec.golden
+++ b/test/golden-test-cases/taggy.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package taggy
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,42 +17,46 @@
 
 
 %global pkg_name taggy
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Efficient and simple HTML/XML parsing library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-blaze-markup-devel
-BuildRequires:  ghc-blaze-markup-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-blaze-markup-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-hspec-attoparsec-devel
-BuildRequires:  ghc-hspec-attoparsec-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-hspec-attoparsec-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 /taggy/ is a simple package for parsing HTML (and should work with XML) written
@@ -102,33 +106,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -151,9 +156,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tagstream-conduit.spec.golden b/test/golden-test-cases/tagstream-conduit.spec.golden
--- a/test/golden-test-cases/tagstream-conduit.spec.golden
+++ b/test/golden-test-cases/tagstream-conduit.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tagstream-conduit
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,51 +17,55 @@
 
 
 %global pkg_name tagstream-conduit
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.5.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Streamlined html tag parser
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-conduit-devel
 BuildRequires:  ghc-conduit-extra-devel
+BuildRequires:  ghc-data-default-devel
+BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-xml-conduit-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-conduit-extra-prof
 BuildRequires:  ghc-conduit-prof
-BuildRequires:  ghc-data-default-devel
 BuildRequires:  ghc-data-default-prof
-BuildRequires:  ghc-resourcet-devel
 BuildRequires:  ghc-resourcet-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-xml-conduit-devel
 BuildRequires:  ghc-xml-conduit-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Tag-stream is a library for parsing HTML//XML to a token stream. It can parse
@@ -85,26 +89,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -129,9 +134,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tasty-hedgehog.spec.golden b/test/golden-test-cases/tasty-hedgehog.spec.golden
--- a/test/golden-test-cases/tasty-hedgehog.spec.golden
+++ b/test/golden-test-cases/tasty-hedgehog.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tasty-hedgehog
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,35 @@
 
 
 %global pkg_name tasty-hedgehog
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Integrates the hedgehog testing library with the tasty testing framework
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hedgehog-devel
-BuildRequires:  ghc-hedgehog-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-tasty-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-hedgehog-prof
+BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-tasty-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-tasty-expected-failure-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-tasty-expected-failure-prof
 %endif
+%endif
 
 %description
 Integrates the hedgehog testing library with the tasty testing framework.
@@ -62,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -108,9 +113,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tasty-rerun.spec.golden b/test/golden-test-cases/tasty-rerun.spec.golden
--- a/test/golden-test-cases/tasty-rerun.spec.golden
+++ b/test/golden-test-cases/tasty-rerun.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tasty-rerun
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,38 +17,40 @@
 
 
 %global pkg_name tasty-rerun
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        1.1.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Run tests by filtering the test tree depending on the result of previous test runs
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-optparse-applicative-devel
-BuildRequires:  ghc-optparse-applicative-prof
 BuildRequires:  ghc-reducers-devel
-BuildRequires:  ghc-reducers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-tagged-devel
-BuildRequires:  ghc-tagged-prof
 BuildRequires:  ghc-tasty-devel
-BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-optparse-applicative-prof
+BuildRequires:  ghc-reducers-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-tagged-prof
+BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This ingredient adds the ability to run tests by first filtering the test tree
@@ -110,26 +112,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -153,9 +156,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc Changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tce-conf.spec.golden b/test/golden-test-cases/tce-conf.spec.golden
--- a/test/golden-test-cases/tce-conf.spec.golden
+++ b/test/golden-test-cases/tce-conf.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tce-conf
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,28 +17,32 @@
 
 
 %global pkg_name tce-conf
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        1.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Very simple config file reading
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-HUnit-prof
 %endif
+%endif
 
 %description
 This package contains modules for runtime reading of very simple config files
@@ -62,33 +66,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -111,9 +116,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md TODO.md changelog.md doc
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/terminal-progress-bar.spec.golden b/test/golden-test-cases/terminal-progress-bar.spec.golden
--- a/test/golden-test-cases/terminal-progress-bar.spec.golden
+++ b/test/golden-test-cases/terminal-progress-bar.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package terminal-progress-bar
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name terminal-progress-bar
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A simple progress bar in the terminal
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-stm-chans-devel
-BuildRequires:  ghc-stm-chans-prof
 BuildRequires:  ghc-stm-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-stm-chans-prof
 BuildRequires:  ghc-stm-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
 %endif
+%endif
 
 %description
 A progress bar is used to convey the progress of a task. This package
@@ -73,26 +77,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -119,9 +124,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/test-fixture.spec.golden b/test/golden-test-cases/test-fixture.spec.golden
--- a/test/golden-test-cases/test-fixture.spec.golden
+++ b/test/golden-test-cases/test-fixture.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package test-fixture
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,43 +17,47 @@
 
 
 %global pkg_name test-fixture
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.5.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Test monadic side-effects
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-data-default-class-devel
-BuildRequires:  ghc-data-default-class-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-haskell-src-exts-devel
-BuildRequires:  ghc-haskell-src-exts-prof
 BuildRequires:  ghc-haskell-src-meta-devel
-BuildRequires:  ghc-haskell-src-meta-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-th-orphans-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-data-default-class-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-haskell-src-exts-prof
+BuildRequires:  ghc-haskell-src-meta-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-th-orphans-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-hspec-discover-devel
+BuildRequires:  ghc-transformers-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-hspec-discover-prof
 BuildRequires:  ghc-hspec-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
 %endif
+%endif
 
 %description
 Test monadic side-effects.
@@ -74,26 +78,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -120,9 +125,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/texmath.spec.golden b/test/golden-test-cases/texmath.spec.golden
--- a/test/golden-test-cases/texmath.spec.golden
+++ b/test/golden-test-cases/texmath.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package texmath
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,51 +17,55 @@
 
 
 %global pkg_name texmath
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.10.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Conversion between formats used to represent mathematics
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-pandoc-types-devel
-BuildRequires:  ghc-pandoc-types-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-syb-devel
-BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-xml-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-pandoc-types-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-xml-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-temporary-devel
-BuildRequires:  ghc-temporary-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-utf8-string-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-temporary-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-utf8-string-prof
 %endif
+%endif
 
 %description
 The texmath library provides functions to read and write TeX math, presentation
@@ -103,26 +107,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -149,9 +154,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown changelog
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/text-icu.spec.golden b/test/golden-test-cases/text-icu.spec.golden
--- a/test/golden-test-cases/text-icu.spec.golden
+++ b/test/golden-test-cases/text-icu.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package text-icu
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,46 +17,50 @@
 
 
 %global pkg_name text-icu
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.7.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Bindings to the ICU library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  libicu-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-text-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 Haskell bindings to the International Components for Unicode (ICU) libraries.
@@ -102,26 +106,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -148,9 +153,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.markdown changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/text-postgresql.spec.golden b/test/golden-test-cases/text-postgresql.spec.golden
--- a/test/golden-test-cases/text-postgresql.spec.golden
+++ b/test/golden-test-cases/text-postgresql.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package text-postgresql
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name text-postgresql
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.2.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Parser and Printer of PostgreSQL extended types
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-dlist-devel
-BuildRequires:  ghc-dlist-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-dlist-prof
+BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-quickcheck-simple-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-quickcheck-simple-prof
 %endif
+%endif
 
 %description
 This package involves parser and printer for text expressions of PostgreSQL
@@ -65,26 +69,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -109,9 +114,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/th-expand-syns.spec.golden b/test/golden-test-cases/th-expand-syns.spec.golden
--- a/test/golden-test-cases/th-expand-syns.spec.golden
+++ b/test/golden-test-cases/th-expand-syns.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package th-expand-syns
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,27 +17,29 @@
 
 
 %global pkg_name th-expand-syns
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.4.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Expands type synonyms in Template Haskell ASTs
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-syb-devel
-BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-template-haskell-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-syb-prof
 BuildRequires:  ghc-template-haskell-prof
+%endif
 
 %description
 Expands type synonyms in Template Haskell ASTs.
@@ -58,26 +60,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +107,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/these.spec.golden b/test/golden-test-cases/these.spec.golden
--- a/test/golden-test-cases/these.spec.golden
+++ b/test/golden-test-cases/these.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package these
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,63 +17,67 @@
 
 
 %global pkg_name these
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.7.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        An either-or-both data type & a generalized 'zip with padding' typeclass
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bifunctors-devel
-BuildRequires:  ghc-bifunctors-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-data-default-class-devel
-BuildRequires:  ghc-data-default-class-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-keys-devel
-BuildRequires:  ghc-keys-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-profunctors-devel
-BuildRequires:  ghc-profunctors-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-semigroupoids-devel
-BuildRequires:  ghc-semigroupoids-prof
 BuildRequires:  ghc-transformers-compat-devel
-BuildRequires:  ghc-transformers-compat-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-instances-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bifunctors-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-data-default-class-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-keys-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-profunctors-prof
+BuildRequires:  ghc-semigroupoids-prof
+BuildRequires:  ghc-transformers-compat-prof
+BuildRequires:  ghc-transformers-prof
+BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-vector-instances-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-quickcheck-instances-devel
-BuildRequires:  ghc-quickcheck-instances-prof
 BuildRequires:  ghc-tasty-devel
-BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-quickcheck-instances-prof
+BuildRequires:  ghc-tasty-prof
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 This package provides a data type 'These a b' which can hold a value of either
@@ -104,26 +108,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -150,9 +155,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/timezone-series.spec.golden b/test/golden-test-cases/timezone-series.spec.golden
--- a/test/golden-test-cases/timezone-series.spec.golden
+++ b/test/golden-test-cases/timezone-series.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package timezone-series
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name timezone-series
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.8
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Enhanced timezone handling for Data.Time
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-time-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-time-prof
+%endif
 
 %description
 This package endows Data.Time, from the time package, with several data types
@@ -59,26 +61,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -102,9 +105,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/transformers-compat.spec.golden b/test/golden-test-cases/transformers-compat.spec.golden
--- a/test/golden-test-cases/transformers-compat.spec.golden
+++ b/test/golden-test-cases/transformers-compat.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package transformers-compat
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name transformers-compat
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.5.1.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A small compatibility shim exposing the new types from transformers 0.3 and 0.4 to older Haskell platforms
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-transformers-prof
+%endif
 
 %description
 This package includes backported versions of types that were added to
@@ -63,26 +65,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/transformers-lift.spec.golden b/test/golden-test-cases/transformers-lift.spec.golden
--- a/test/golden-test-cases/transformers-lift.spec.golden
+++ b/test/golden-test-cases/transformers-lift.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package transformers-lift
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name transformers-lift
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Ad-hoc type classes for lifting
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-writer-cps-transformers-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-writer-cps-transformers-prof
+%endif
 
 %description
 This simple and lightweight library provides type classes for lifting monad
@@ -56,26 +58,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -97,9 +100,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tree-fun.spec.golden b/test/golden-test-cases/tree-fun.spec.golden
--- a/test/golden-test-cases/tree-fun.spec.golden
+++ b/test/golden-test-cases/tree-fun.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tree-fun
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name tree-fun
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.8.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Library for functions pertaining to tree exploration and manipulation
 License:        GPL-3.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Library for functions pertaining to tree exploration and manipulation.
@@ -55,26 +57,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -98,9 +101,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/ttrie.spec.golden b/test/golden-test-cases/ttrie.spec.golden
--- a/test/golden-test-cases/ttrie.spec.golden
+++ b/test/golden-test-cases/ttrie.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package ttrie
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name ttrie
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Contention-free STM hash map
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-atomic-primops-devel
-BuildRequires:  ghc-atomic-primops-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-stm-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-atomic-primops-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-primitive-prof
 BuildRequires:  ghc-stm-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-test-framework-devel
-BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-test-framework-prof
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 A contention-free STM hash map. "Contention-free" means that the map will never
@@ -78,26 +82,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -124,9 +129,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md changelog.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tuple-th.spec.golden b/test/golden-test-cases/tuple-th.spec.golden
--- a/test/golden-test-cases/tuple-th.spec.golden
+++ b/test/golden-test-cases/tuple-th.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tuple-th
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name tuple-th
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.5
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Generate (non-recursive) utility functions for tuples of statically known size
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-template-haskell-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-template-haskell-prof
+%endif
 
 %description
 Template Haskell functions for generating functions similar to those in
@@ -56,26 +58,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -97,9 +100,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/tuples-homogenous-h98.spec.golden b/test/golden-test-cases/tuples-homogenous-h98.spec.golden
--- a/test/golden-test-cases/tuples-homogenous-h98.spec.golden
+++ b/test/golden-test-cases/tuples-homogenous-h98.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package tuples-homogenous-h98
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name tuples-homogenous-h98
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Wrappers for n-ary tuples with Traversable and Applicative/Monad instances
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Provides 'newtype' wrappers for n-ary homogenous tuples of types '(a,...,a)'
@@ -54,26 +56,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -95,9 +98,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/turtle-options.spec.golden b/test/golden-test-cases/turtle-options.spec.golden
--- a/test/golden-test-cases/turtle-options.spec.golden
+++ b/test/golden-test-cases/turtle-options.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package turtle-options
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,34 +17,38 @@
 
 
 %global pkg_name turtle-options
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Collection of command line options and parsers for these options
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-optional-args-devel
-BuildRequires:  ghc-optional-args-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-turtle-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-optional-args-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-turtle-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-HUnit-prof
 %endif
+%endif
 
 %description
 Collection of command line options and parsers for these options.
@@ -65,33 +69,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -113,9 +118,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/type-operators.spec.golden b/test/golden-test-cases/type-operators.spec.golden
--- a/test/golden-test-cases/type-operators.spec.golden
+++ b/test/golden-test-cases/type-operators.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package type-operators
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,22 @@
 
 
 %global pkg_name type-operators
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.4
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Various type-level operators
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 A set of type-level operators meant to be helpful, e.g. ($) and a tightly
@@ -52,26 +54,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -93,9 +96,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/type-spec.spec.golden b/test/golden-test-cases/type-spec.spec.golden
--- a/test/golden-test-cases/type-spec.spec.golden
+++ b/test/golden-test-cases/type-spec.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package type-spec
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,25 @@
 
 
 %global pkg_name type-spec
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.0.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Type Level Specification by Example
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-pretty-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Type Level Specification by Example.
@@ -54,26 +56,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/unicode-show.spec.golden b/test/golden-test-cases/unicode-show.spec.golden
--- a/test/golden-test-cases/unicode-show.spec.golden
+++ b/test/golden-test-cases/unicode-show.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package unicode-show
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name unicode-show
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.1.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Print and show in unicode
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-quickcheck2-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-quickcheck2-devel
 BuildRequires:  ghc-test-framework-quickcheck2-prof
 %endif
+%endif
 
 %description
 This package provides variants of 'show' and 'print' functions that does not
@@ -72,26 +76,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +121,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/unique.spec.golden b/test/golden-test-cases/unique.spec.golden
--- a/test/golden-test-cases/unique.spec.golden
+++ b/test/golden-test-cases/unique.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package unique
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name unique
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Fully concurrent unique identifiers
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-hashable-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Fully concurrent unique identifiers.
@@ -53,26 +55,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -96,9 +99,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.markdown README.markdown
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/unix-bytestring.spec.golden b/test/golden-test-cases/unix-bytestring.spec.golden
--- a/test/golden-test-cases/unix-bytestring.spec.golden
+++ b/test/golden-test-cases/unix-bytestring.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package unix-bytestring
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,22 +17,24 @@
 
 
 %global pkg_name unix-bytestring
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.3.7.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Unix/Posix-specific functions for ByteStrings
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 
 %description
 Unix/Posix-specific functions for ByteStrings.
@@ -63,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -106,9 +109,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG README
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/unlit.spec.golden b/test/golden-test-cases/unlit.spec.golden
--- a/test/golden-test-cases/unlit.spec.golden
+++ b/test/golden-test-cases/unlit.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package unlit
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,25 +17,27 @@
 
 
 %global pkg_name unlit
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.4.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Tool to convert literate code between styles or to code
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-text-prof
+%endif
 
 %description
 Tool to convert literate code between styles or to code. Usage:
@@ -63,33 +65,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -106,9 +109,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/utility-ht.spec.golden b/test/golden-test-cases/utility-ht.spec.golden
--- a/test/golden-test-cases/utility-ht.spec.golden
+++ b/test/golden-test-cases/utility-ht.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package utility-ht
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,25 +17,29 @@
 
 
 %global pkg_name utility-ht
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.14
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Various small helper functions for Lists, Maybes, Tuples, Functions
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
 BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-QuickCheck-prof
 %endif
+%endif
 
 %description
 Various small helper functions for Lists, Maybes, Tuples, Functions.
@@ -68,26 +72,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +117,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/validity-aeson.spec.golden b/test/golden-test-cases/validity-aeson.spec.golden
--- a/test/golden-test-cases/validity-aeson.spec.golden
+++ b/test/golden-test-cases/validity-aeson.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package validity-aeson
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,32 +17,34 @@
 
 
 %global pkg_name validity-aeson
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Validity instances for aeson
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-validity-devel
-BuildRequires:  ghc-validity-prof
 BuildRequires:  ghc-validity-scientific-devel
-BuildRequires:  ghc-validity-scientific-prof
 BuildRequires:  ghc-validity-text-devel
-BuildRequires:  ghc-validity-text-prof
 BuildRequires:  ghc-validity-unordered-containers-devel
-BuildRequires:  ghc-validity-unordered-containers-prof
 BuildRequires:  ghc-validity-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-validity-prof
+BuildRequires:  ghc-validity-scientific-prof
+BuildRequires:  ghc-validity-text-prof
+BuildRequires:  ghc-validity-unordered-containers-prof
 BuildRequires:  ghc-validity-vector-prof
+%endif
 
 %description
 Validity instances for aeson.
@@ -63,26 +65,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -104,9 +107,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/validity-containers.spec.golden b/test/golden-test-cases/validity-containers.spec.golden
--- a/test/golden-test-cases/validity-containers.spec.golden
+++ b/test/golden-test-cases/validity-containers.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package validity-containers
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name validity-containers
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Validity instances for containers
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-validity-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-validity-prof
+%endif
 
 %description
 Validity instances for containers.
@@ -56,26 +58,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -97,9 +100,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/vector-mmap.spec.golden b/test/golden-test-cases/vector-mmap.spec.golden
--- a/test/golden-test-cases/vector-mmap.spec.golden
+++ b/test/golden-test-cases/vector-mmap.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package vector-mmap
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,37 @@
 
 
 %global pkg_name vector-mmap
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Memory map immutable and mutable vectors
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-mmap-devel
-BuildRequires:  ghc-mmap-prof
 BuildRequires:  ghc-primitive-devel
-BuildRequires:  ghc-primitive-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-mmap-prof
+BuildRequires:  ghc-primitive-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-temporary-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-temporary-prof
 %endif
+%endif
 
 %description
 Memory map immutable and mutable vectors.
@@ -64,26 +68,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -108,9 +113,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/vivid-supercollider.spec.golden b/test/golden-test-cases/vivid-supercollider.spec.golden
--- a/test/golden-test-cases/vivid-supercollider.spec.golden
+++ b/test/golden-test-cases/vivid-supercollider.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package vivid-supercollider
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name vivid-supercollider
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Implementation of SuperCollider server specifications
 License:        GPL-1.0-or-later
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-cereal-devel
-BuildRequires:  ghc-cereal-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-utf8-string-devel
-BuildRequires:  ghc-utf8-string-prof
 BuildRequires:  ghc-vivid-osc-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-cereal-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-utf8-string-prof
 BuildRequires:  ghc-vivid-osc-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-microspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-microspec-prof
 %endif
+%endif
 
 %description
 An interface-agnostic implementation of specs for SuperCollider server types
@@ -75,26 +79,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -117,8 +122,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/vty.spec.golden b/test/golden-test-cases/vty.spec.golden
--- a/test/golden-test-cases/vty.spec.golden
+++ b/test/golden-test-cases/vty.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package vty
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,84 +17,88 @@
 
 
 %global pkg_name vty
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        5.19.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A simple terminal UI library
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-microlens-devel
 BuildRequires:  ghc-microlens-mtl-devel
+BuildRequires:  ghc-microlens-th-devel
+BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-parallel-devel
+BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros >= 2.9.2
+BuildRequires:  ghc-stm-devel
+BuildRequires:  ghc-terminfo-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-transformers-devel
+BuildRequires:  ghc-unix-devel
+BuildRequires:  ghc-utf8-string-devel
+BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-microlens-mtl-prof
 BuildRequires:  ghc-microlens-prof
-BuildRequires:  ghc-microlens-th-devel
 BuildRequires:  ghc-microlens-th-prof
-BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-parallel-devel
 BuildRequires:  ghc-parallel-prof
-BuildRequires:  ghc-parsec-devel
 BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
-BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-stm-prof
-BuildRequires:  ghc-terminfo-devel
 BuildRequires:  ghc-terminfo-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-transformers-prof
-BuildRequires:  ghc-unix-devel
 BuildRequires:  ghc-unix-prof
-BuildRequires:  ghc-utf8-string-devel
 BuildRequires:  ghc-utf8-string-prof
-BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-Cabal-prof
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-quickcheck-assertions-devel
-BuildRequires:  ghc-quickcheck-assertions-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
 BuildRequires:  ghc-smallcheck-devel
-BuildRequires:  ghc-smallcheck-prof
 BuildRequires:  ghc-string-qq-devel
-BuildRequires:  ghc-string-qq-prof
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
+BuildRequires:  ghc-test-framework-smallcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Cabal-prof
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-quickcheck-assertions-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-smallcheck-prof
+BuildRequires:  ghc-string-qq-prof
 BuildRequires:  ghc-test-framework-hunit-prof
 BuildRequires:  ghc-test-framework-prof
-BuildRequires:  ghc-test-framework-smallcheck-devel
 BuildRequires:  ghc-test-framework-smallcheck-prof
 %endif
+%endif
 
 %description
 Vty is terminal GUI library in the niche of ncurses. It is intended to be easy
@@ -130,33 +134,34 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %check
 %cabal_test
@@ -179,9 +184,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc AUTHORS CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/wai-cors.spec.golden b/test/golden-test-cases/wai-cors.spec.golden
--- a/test/golden-test-cases/wai-cors.spec.golden
+++ b/test/golden-test-cases/wai-cors.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package wai-cors
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,61 +17,65 @@
 
 
 %global pkg_name wai-cors
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.6
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        CORS for WAI
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
-BuildRequires:  ghc-attoparsec-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base-unicode-symbols-devel
-BuildRequires:  ghc-base-unicode-symbols-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-wai-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-attoparsec-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base-unicode-symbols-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-wai-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-text-devel
+BuildRequires:  ghc-wai-extra-devel
+BuildRequires:  ghc-wai-websockets-devel
+BuildRequires:  ghc-warp-devel
+BuildRequires:  ghc-websockets-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof
-BuildRequires:  ghc-wai-extra-devel
 BuildRequires:  ghc-wai-extra-prof
-BuildRequires:  ghc-wai-websockets-devel
 BuildRequires:  ghc-wai-websockets-prof
-BuildRequires:  ghc-warp-devel
 BuildRequires:  ghc-warp-prof
-BuildRequires:  ghc-websockets-devel
 BuildRequires:  ghc-websockets-prof
 %endif
+%endif
 
 %description
 This package provides an implemenation of Cross-Origin resource sharing (CORS)
@@ -94,26 +98,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -148,9 +153,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/wai-middleware-auth.spec.golden b/test/golden-test-cases/wai-middleware-auth.spec.golden
--- a/test/golden-test-cases/wai-middleware-auth.spec.golden
+++ b/test/golden-test-cases/wai-middleware-auth.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package wai-middleware-auth
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,83 +17,85 @@
 
 
 %global pkg_name wai-middleware-auth
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.2.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Authentication middleware that secures WAI application
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  chrpath
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-base64-bytestring-devel
-BuildRequires:  ghc-base64-bytestring-prof
 BuildRequires:  ghc-binary-devel
-BuildRequires:  ghc-binary-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-blaze-html-devel
-BuildRequires:  ghc-blaze-html-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-cereal-devel
-BuildRequires:  ghc-cereal-prof
 BuildRequires:  ghc-clientsession-devel
-BuildRequires:  ghc-clientsession-prof
 BuildRequires:  ghc-cookie-devel
-BuildRequires:  ghc-cookie-prof
 BuildRequires:  ghc-exceptions-devel
-BuildRequires:  ghc-exceptions-prof
 BuildRequires:  ghc-hoauth2-devel
-BuildRequires:  ghc-hoauth2-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-http-client-tls-devel
-BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-http-conduit-devel
-BuildRequires:  ghc-http-conduit-prof
 BuildRequires:  ghc-http-reverse-proxy-devel
-BuildRequires:  ghc-http-reverse-proxy-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-optparse-simple-devel
-BuildRequires:  ghc-optparse-simple-prof
 BuildRequires:  ghc-regex-posix-devel
-BuildRequires:  ghc-regex-posix-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-safe-exceptions-devel
-BuildRequires:  ghc-safe-exceptions-prof
 BuildRequires:  ghc-shakespeare-devel
-BuildRequires:  ghc-shakespeare-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unix-compat-devel
-BuildRequires:  ghc-unix-compat-prof
 BuildRequires:  ghc-unordered-containers-devel
-BuildRequires:  ghc-unordered-containers-prof
 BuildRequires:  ghc-uri-bytestring-devel
-BuildRequires:  ghc-uri-bytestring-prof
 BuildRequires:  ghc-vault-devel
-BuildRequires:  ghc-vault-prof
 BuildRequires:  ghc-wai-app-static-devel
-BuildRequires:  ghc-wai-app-static-prof
 BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-extra-devel
+BuildRequires:  ghc-warp-devel
+BuildRequires:  ghc-yaml-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-base64-bytestring-prof
+BuildRequires:  ghc-binary-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-blaze-html-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-cereal-prof
+BuildRequires:  ghc-clientsession-prof
+BuildRequires:  ghc-cookie-prof
+BuildRequires:  ghc-exceptions-prof
+BuildRequires:  ghc-hoauth2-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-http-client-tls-prof
+BuildRequires:  ghc-http-conduit-prof
+BuildRequires:  ghc-http-reverse-proxy-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-optparse-simple-prof
+BuildRequires:  ghc-regex-posix-prof
+BuildRequires:  ghc-safe-exceptions-prof
+BuildRequires:  ghc-shakespeare-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unix-compat-prof
+BuildRequires:  ghc-unordered-containers-prof
+BuildRequires:  ghc-uri-bytestring-prof
+BuildRequires:  ghc-vault-prof
+BuildRequires:  ghc-wai-app-static-prof
 BuildRequires:  ghc-wai-extra-prof
 BuildRequires:  ghc-wai-prof
-BuildRequires:  ghc-warp-devel
 BuildRequires:  ghc-warp-prof
-BuildRequires:  ghc-yaml-devel
 BuildRequires:  ghc-yaml-prof
+%endif
 
 %description
 Authentication middleware that secures WAI application.
@@ -115,33 +117,34 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
 
 %install
 %ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
+%ghc_fix_rpath %pkg_name-%{version}
 
 %post -n ghc-%{name}-devel
 %ghc_pkg_recache
@@ -160,9 +163,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/wai-middleware-caching-redis.spec.golden b/test/golden-test-cases/wai-middleware-caching-redis.spec.golden
--- a/test/golden-test-cases/wai-middleware-caching-redis.spec.golden
+++ b/test/golden-test-cases/wai-middleware-caching-redis.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package wai-middleware-caching-redis
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,37 @@
 
 
 %global pkg_name wai-middleware-caching-redis
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Cache Wai Middleware using Redis backend
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-hedis-devel
-BuildRequires:  ghc-hedis-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-middleware-caching-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-hedis-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-wai-middleware-caching-prof
 BuildRequires:  ghc-wai-prof
+%endif
 
 %description
 Cache Wai Middleware using Redis backend.
@@ -67,26 +69,27 @@
 This package provides the Haskell %{name} library
 development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -111,9 +114,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/wai-middleware-prometheus.spec.golden b/test/golden-test-cases/wai-middleware-prometheus.spec.golden
--- a/test/golden-test-cases/wai-middleware-prometheus.spec.golden
+++ b/test/golden-test-cases/wai-middleware-prometheus.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package wai-middleware-prometheus
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name wai-middleware-prometheus
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.3.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        WAI middlware for exposing http://prometheus.io metrics
 License:        Apache-2.0
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-clock-devel
-BuildRequires:  ghc-clock-prof
 BuildRequires:  ghc-data-default-devel
-BuildRequires:  ghc-data-default-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-prometheus-client-devel
-BuildRequires:  ghc-prometheus-client-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-wai-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-clock-prof
+BuildRequires:  ghc-data-default-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-prometheus-client-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-wai-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
+%if %{with ghc_prof}
 BuildRequires:  ghc-doctest-prof
 %endif
+%endif
 
 %description
 WAI middlware for exposing http://prometheus.io metrics.
@@ -71,26 +75,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -115,9 +120,11 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/warp.spec.golden b/test/golden-test-cases/warp.spec.golden
--- a/test/golden-test-cases/warp.spec.golden
+++ b/test/golden-test-cases/warp.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package warp
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,91 +17,95 @@
 
 
 %global pkg_name warp
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        3.2.13
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        A fast, light-weight web server for WAI applications
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-array-prof
 BuildRequires:  ghc-async-devel
-BuildRequires:  ghc-async-prof
 BuildRequires:  ghc-auto-update-devel
-BuildRequires:  ghc-auto-update-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-blaze-builder-devel
-BuildRequires:  ghc-blaze-builder-prof
 BuildRequires:  ghc-bytestring-builder-devel
-BuildRequires:  ghc-bytestring-builder-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-case-insensitive-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-hashable-devel
-BuildRequires:  ghc-hashable-prof
 BuildRequires:  ghc-http-date-devel
-BuildRequires:  ghc-http-date-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-http2-devel
-BuildRequires:  ghc-http2-prof
 BuildRequires:  ghc-iproute-devel
-BuildRequires:  ghc-iproute-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-simple-sendfile-devel
-BuildRequires:  ghc-simple-sendfile-prof
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-streaming-commons-devel
-BuildRequires:  ghc-streaming-commons-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-unix-compat-devel
-BuildRequires:  ghc-unix-compat-prof
 BuildRequires:  ghc-unix-devel
-BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-vault-devel
-BuildRequires:  ghc-vault-prof
 BuildRequires:  ghc-wai-devel
-BuildRequires:  ghc-wai-prof
 BuildRequires:  ghc-word8-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-array-prof
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-auto-update-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-blaze-builder-prof
+BuildRequires:  ghc-bytestring-builder-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-case-insensitive-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-hashable-prof
+BuildRequires:  ghc-http-date-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-http2-prof
+BuildRequires:  ghc-iproute-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-simple-sendfile-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-streaming-commons-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-unix-compat-prof
+BuildRequires:  ghc-unix-prof
+BuildRequires:  ghc-vault-prof
+BuildRequires:  ghc-wai-prof
 BuildRequires:  ghc-word8-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HTTP-devel
-BuildRequires:  ghc-HTTP-prof
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-lifted-base-devel
-BuildRequires:  ghc-lifted-base-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-silently-devel
-BuildRequires:  ghc-silently-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HTTP-prof
+BuildRequires:  ghc-HUnit-prof
+BuildRequires:  ghc-QuickCheck-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-hspec-prof
+BuildRequires:  ghc-lifted-base-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-silently-prof
+BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-prof
 %endif
+%endif
 
 %description
 HTTP/1.0, HTTP/1.1 and HTTP/2 are supported. For HTTP/2, Warp supports direct
@@ -124,26 +128,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -170,9 +175,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/weigh.spec.golden b/test/golden-test-cases/weigh.spec.golden
--- a/test/golden-test-cases/weigh.spec.golden
+++ b/test/golden-test-cases/weigh.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package weigh
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,33 +17,35 @@
 
 
 %global pkg_name weigh
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.0.7
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Measure allocations of a Haskell functions/values
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-deepseq-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-split-devel
-BuildRequires:  ghc-split-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-temporary-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-deepseq-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-split-prof
+BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-temporary-prof
+%endif
 
 %description
 Measure allocations of a Haskell functions/values.
@@ -64,26 +66,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -110,9 +113,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGELOG README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/xml-hamlet.spec.golden b/test/golden-test-cases/xml-hamlet.spec.golden
--- a/test/golden-test-cases/xml-hamlet.spec.golden
+++ b/test/golden-test-cases/xml-hamlet.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package xml-hamlet
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,39 +17,43 @@
 
 
 %global pkg_name xml-hamlet
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.4.1.1
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Hamlet-style quasiquoter for XML content
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-parsec-devel
-BuildRequires:  ghc-parsec-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-shakespeare-devel
-BuildRequires:  ghc-shakespeare-prof
 BuildRequires:  ghc-template-haskell-devel
-BuildRequires:  ghc-template-haskell-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-xml-conduit-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-parsec-prof
+BuildRequires:  ghc-shakespeare-prof
+BuildRequires:  ghc-template-haskell-prof
+BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-xml-conduit-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-HUnit-prof
 BuildRequires:  ghc-hspec-prof
 %endif
+%endif
 
 %description
 Hamlet-style quasiquoter for XML content.
@@ -70,26 +74,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -116,9 +121,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/xmonad-contrib.spec.golden b/test/golden-test-cases/xmonad-contrib.spec.golden
--- a/test/golden-test-cases/xmonad-contrib.spec.golden
+++ b/test/golden-test-cases/xmonad-contrib.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package xmonad-contrib
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,50 +17,52 @@
 
 
 %global pkg_name xmonad-contrib
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.13
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Third party extensions for xmonad
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-X11-devel
-BuildRequires:  ghc-X11-prof
 BuildRequires:  ghc-X11-xft-devel
-BuildRequires:  ghc-X11-xft-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-containers-devel
-BuildRequires:  ghc-containers-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-extensible-exceptions-devel
-BuildRequires:  ghc-extensible-exceptions-prof
 BuildRequires:  ghc-filepath-devel
-BuildRequires:  ghc-filepath-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
 BuildRequires:  ghc-old-locale-devel
-BuildRequires:  ghc-old-locale-prof
 BuildRequires:  ghc-old-time-devel
-BuildRequires:  ghc-old-time-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
 BuildRequires:  ghc-random-devel
-BuildRequires:  ghc-random-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-unix-devel
-BuildRequires:  ghc-unix-prof
 BuildRequires:  ghc-utf8-string-devel
-BuildRequires:  ghc-utf8-string-prof
 BuildRequires:  ghc-xmonad-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-X11-prof
+BuildRequires:  ghc-X11-xft-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-containers-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-extensible-exceptions-prof
+BuildRequires:  ghc-filepath-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-old-locale-prof
+BuildRequires:  ghc-old-time-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-random-prof
+BuildRequires:  ghc-unix-prof
+BuildRequires:  ghc-utf8-string-prof
 BuildRequires:  ghc-xmonad-prof
+%endif
 
 %description
 Third party tiling algorithms, configurations and scripts to xmonad, a tiling
@@ -92,26 +94,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -135,9 +138,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc CHANGES.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/yahoo-finance-api.spec.golden b/test/golden-test-cases/yahoo-finance-api.spec.golden
--- a/test/golden-test-cases/yahoo-finance-api.spec.golden
+++ b/test/golden-test-cases/yahoo-finance-api.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package yahoo-finance-api
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,55 +17,59 @@
 
 
 %global pkg_name yahoo-finance-api
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.2.0.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Read quotes from Yahoo Finance API
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
-BuildRequires:  ghc-aeson-prof
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-either-devel
-BuildRequires:  ghc-either-prof
 BuildRequires:  ghc-http-api-data-devel
-BuildRequires:  ghc-http-api-data-prof
 BuildRequires:  ghc-http-client-devel
-BuildRequires:  ghc-http-client-prof
 BuildRequires:  ghc-mtl-devel
-BuildRequires:  ghc-mtl-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-servant-client-devel
-BuildRequires:  ghc-servant-client-prof
 BuildRequires:  ghc-servant-devel
-BuildRequires:  ghc-servant-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-time-devel
-BuildRequires:  ghc-time-prof
 BuildRequires:  ghc-transformers-devel
-BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-aeson-prof
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-either-prof
+BuildRequires:  ghc-http-api-data-prof
+BuildRequires:  ghc-http-client-prof
+BuildRequires:  ghc-mtl-prof
+BuildRequires:  ghc-servant-client-prof
+BuildRequires:  ghc-servant-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-time-prof
+BuildRequires:  ghc-transformers-prof
 BuildRequires:  ghc-vector-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-Glob-devel
-BuildRequires:  ghc-Glob-prof
 BuildRequires:  ghc-doctest-devel
-BuildRequires:  ghc-doctest-prof
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-hspec-prof
 BuildRequires:  ghc-http-client-tls-devel
-BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-safe-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-Glob-prof
+BuildRequires:  ghc-doctest-prof
+BuildRequires:  ghc-hspec-prof
+BuildRequires:  ghc-http-client-tls-prof
 BuildRequires:  ghc-safe-prof
 %endif
+%endif
 
 %description
 Haskell wrapper for the stock APIs provided by Yahoo Finance.
@@ -90,26 +94,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -136,9 +141,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/yesod-form-bootstrap4.spec.golden b/test/golden-test-cases/yesod-form-bootstrap4.spec.golden
--- a/test/golden-test-cases/yesod-form-bootstrap4.spec.golden
+++ b/test/golden-test-cases/yesod-form-bootstrap4.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package yesod-form-bootstrap4
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,26 @@
 
 
 %global pkg_name yesod-form-bootstrap4
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.1.0.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        RenderBootstrap4
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-classy-prelude-yesod-devel
-BuildRequires:  ghc-classy-prelude-yesod-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-yesod-form-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-classy-prelude-yesod-prof
 BuildRequires:  ghc-yesod-form-prof
+%endif
 
 %description
 RenderBootstrap4.
@@ -56,26 +58,27 @@
 This package provides the Haskell %{name} library development
 files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -95,8 +98,10 @@
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/yesod-gitrepo.spec.golden b/test/golden-test-cases/yesod-gitrepo.spec.golden
--- a/test/golden-test-cases/yesod-gitrepo.spec.golden
+++ b/test/golden-test-cases/yesod-gitrepo.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package yesod-gitrepo
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,38 +17,40 @@
 
 
 %global pkg_name yesod-gitrepo
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.1.0
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Host content provided by a Git repo
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-directory-devel
-BuildRequires:  ghc-directory-prof
 BuildRequires:  ghc-enclosed-exceptions-devel
-BuildRequires:  ghc-enclosed-exceptions-prof
 BuildRequires:  ghc-http-types-devel
-BuildRequires:  ghc-http-types-prof
 BuildRequires:  ghc-lifted-base-devel
-BuildRequires:  ghc-lifted-base-prof
 BuildRequires:  ghc-process-devel
-BuildRequires:  ghc-process-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-temporary-devel
-BuildRequires:  ghc-temporary-prof
 BuildRequires:  ghc-text-devel
-BuildRequires:  ghc-text-prof
 BuildRequires:  ghc-wai-devel
-BuildRequires:  ghc-wai-prof
 BuildRequires:  ghc-yesod-core-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-directory-prof
+BuildRequires:  ghc-enclosed-exceptions-prof
+BuildRequires:  ghc-http-types-prof
+BuildRequires:  ghc-lifted-base-prof
+BuildRequires:  ghc-process-prof
+BuildRequires:  ghc-temporary-prof
+BuildRequires:  ghc-text-prof
+BuildRequires:  ghc-wai-prof
 BuildRequires:  ghc-yesod-core-prof
+%endif
 
 %description
 Host content provided by a Git repo.
@@ -69,26 +71,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -112,9 +115,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/yesod-recaptcha2.spec.golden b/test/golden-test-cases/yesod-recaptcha2.spec.golden
--- a/test/golden-test-cases/yesod-recaptcha2.spec.golden
+++ b/test/golden-test-cases/yesod-recaptcha2.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package yesod-recaptcha2
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,26 +17,28 @@
 
 
 %global pkg_name yesod-recaptcha2
-%global pkgver %{pkg_name}-%{version}
-
-Name:           %{pkg_name}
+%bcond_with ghc_prof
+Name:           %pkg_name
 Version:        0.2.3
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Yesod recaptcha2
 License:        MIT
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-classy-prelude-yesod-devel
-BuildRequires:  ghc-classy-prelude-yesod-prof
 BuildRequires:  ghc-http-conduit-devel
-BuildRequires:  ghc-http-conduit-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-yesod-auth-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-classy-prelude-yesod-prof
+BuildRequires:  ghc-http-conduit-prof
 BuildRequires:  ghc-yesod-auth-prof
+%endif
 
 %description
 Recaptcha2 for yesod-form.
@@ -57,26 +59,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -100,9 +103,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
diff --git a/test/golden-test-cases/zlib.spec.golden b/test/golden-test-cases/zlib.spec.golden
--- a/test/golden-test-cases/zlib.spec.golden
+++ b/test/golden-test-cases/zlib.spec.golden
@@ -1,7 +1,7 @@
 #
 # spec file for package zlib
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2020 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,34 +17,38 @@
 
 
 %global pkg_name zlib
-%global pkgver %{pkg_name}-%{version}
-
+%bcond_with ghc_prof
 %bcond_with tests
-Name:           %{pkg_name}
+Name:           %pkg_name
 Version:        0.6.1.2
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        Compression and decompression in the gzip and zlib formats
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-ExcludeArch:    %{ix86}
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  zlib-devel
+ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+%endif
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
-BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
+BuildRequires:  ghc-tasty-quickcheck-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-QuickCheck-prof
 BuildRequires:  ghc-tasty-hunit-prof
 BuildRequires:  ghc-tasty-prof
-BuildRequires:  ghc-tasty-quickcheck-devel
 BuildRequires:  ghc-tasty-quickcheck-prof
 %endif
+%endif
 
 %description
 This package provides a pure interface for compressing and decompressing
@@ -73,26 +77,27 @@
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
-BuildArch:      noarch
 Requires:       ghc-filesystem
+BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
 
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %ghc_lib_build
@@ -119,9 +124,11 @@
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
 %doc changelog examples
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 
 %changelog
