diff --git a/cabal2spec.cabal b/cabal2spec.cabal
--- a/cabal2spec.cabal
+++ b/cabal2spec.cabal
@@ -1,5 +1,5 @@
 name:                   cabal2spec
-version:                2.0.2
+version:                2.1
 synopsis:               Convert Cabal files into rpm spec files
 homepage:               https://github.com/peti/cabal2spec
 license:                GPL-3
@@ -9,7 +9,7 @@
 category:               Distribution
 build-type:             Simple
 cabal-version:          >=1.10
-tested-with:            GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
+tested-with:            GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.2
 
 extra-source-files:
   README.md
diff --git a/src/Cabal2Spec.hs b/src/Cabal2Spec.hs
--- a/src/Cabal2Spec.hs
+++ b/src/Cabal2Spec.hs
@@ -70,6 +70,8 @@
       name = unPackageName (packageName pkg)
       hasExec = hasExes pkgDesc
       hasLib = hasLibs pkgDesc
+      hasSubLib = not (null (subLibraries pkgDesc))
+      hasPublicModules = maybe False (not . null . exposedModules) (library pkgDesc)
   (pkgname, binlib) <- getPkgName (Just specFile) pkgDesc forceBinary
 
   let pkg_name = if pkgname == name then "%{name}" else "%{pkg_name}"
@@ -96,7 +98,7 @@
     now <- getCurrentTime
     let year = formatTime defaultTimeLocale "%Y" now
     put "#"
-    put $ "# spec file for package " ++ pkgname
+    put $ "# spec file for package " ++ pkgname ++ ".spec"
     put "#"
     put $ "# Copyright (c) " ++ year ++ " SUSE LINUX GmbH, Nuernberg, Germany."
     put "#"
@@ -112,6 +114,7 @@
     put "# Please submit bugfixes or comments via http://bugs.opensuse.org/"
     put "#"
   putNewline
+  putNewline
 
   -- Some packages conflate the synopsis and description fields.  Ugh.
   let syn = synopsis pkgDesc
@@ -129,13 +132,15 @@
           '\\' -> head cs: filterSymbols (tail cs)
           _ -> c: filterSymbols cs
       filterSymbols [] = []
-  when hasLib $ do
+  when hasLib $
     putDef "pkg_name" name
+
+  when hasSubLib $ do
+    putDef "has_internal_sub_libraries" "1"
     putNewline
 
-  unless (null testsuiteDeps) $ do
+  unless (null testsuiteDeps) $
     put "%bcond_with tests"
-    putNewline
 
   let version = packageVersion pkg
       revision = show $ maybe (0::Int) read (lookup "x-revision" (customFieldsPD pkgDesc))
@@ -143,19 +148,15 @@
   putHdr "Version" (display version)
   putHdr "Release" "0"
   putHdr "Summary" summary
-  putHdr "Group" "Development/Libraries/Haskell"
-  putNewline
   putHdr "License" $ either (show . pretty) showLicense (licenseRaw pkgDesc)
-  putHdr "Url" $ "https://hackage.haskell.org/package/" ++ pkg_name
+  putHdr "Group" "Development/Libraries/Haskell"
+  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"
-  putNewline
-  putHdr "BuildRequires" "ghc-Cabal-devel"
-  putHdr "BuildRequires" "ghc-rpm-macros"
 
-  let isa = ""
-  let alldeps = sort $ deps ++ tools ++ map (++ isa) clibs ++ pkgcfgs
+  let fixedDeps = ["ghc-Cabal-devel", "ghc-rpm-macros"]
+  let alldeps = sort $ fixedDeps ++ deps ++ tools ++ clibs ++ pkgcfgs ++ ["pkgconfig" | not (null pkgcfgs)]
   let extraTestDeps = sort $ testsuiteDeps \\ deps
   unless (null $ alldeps ++ extraTestDeps) $ do
     mapM_ (putHdr "BuildRequires") alldeps
@@ -168,7 +169,6 @@
 
   put "%description"
   mapM_ put descLines
-  putNewline
 
   let wrapGenDesc = wordwrap (79 - max 0 (length pkgname - length pkg_name))
 
@@ -180,20 +180,18 @@
       putNewline
       put $ "%description" +-+ ghcPkg
       put $ wrapGenDesc $ "This package provides the Haskell" +-+ pkg_name +-+ "shared library."
-      putNewline
     put $ "%package" +-+ ghcPkgDevel
     putHdr "Summary" $ "Haskell" +-+ pkg_name +-+ "library development files"
     putHdr "Group" "Development/Libraries/Haskell"
+    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)])
     putHdr "Requires(post)" "ghc-compiler = %{ghc_version}"
     putHdr "Requires(postun)" "ghc-compiler = %{ghc_version}"
-    putHdr "Requires" $ (if binlib then "ghc-%{name}" else "%{name}") ++ isa +-+ "= %{version}-%{release}"
-    unless (null $ clibs ++ pkgcfgs) $
-      mapM_ (putHdr "Requires") $ sort $ map (++ isa) clibs ++ pkgcfgs ++ ["pkgconfig" | not $ null pkgcfgs]
     putNewline
     put $ "%description" +-+ ghcPkgDevel
     put $ wrapGenDesc $ "This package provides the Haskell" +-+ pkg_name +-+ "library development files."
-    putNewline
 
   put "%prep"
   put $ "%setup -q" ++ (if pkgname /= name then " -n %{pkg_name}-%{version}" else "")
@@ -206,7 +204,8 @@
     let cabalFlags = [ "-f" ++ (if b then "" else "-") ++ unFlagName n | (n, b) <- unFlagAssignment flagAssignment ]
     put $ "%define cabal_configure_options " ++ unwords (sort cabalFlags)
   let pkgType = if hasLib then "lib" else "bin"
-  put $ "%ghc_" ++ pkgType ++ "_build"
+      noHaddockModifier = if hasSubLib || (hasLib && not hasPublicModules) then "_without_haddock" else ""
+  put $ "%ghc_" ++ pkgType ++ "_build" ++ noHaddockModifier -- https://github.com/haskell/cabal/issues/4969
   putNewline
 
   put "%install"
@@ -241,7 +240,7 @@
     put $ "%postun" +-+ ghcPkgDevel
     putInstallScript
 
-  let license_macro = "%doc"
+  let license_macro = "%license"
   let execs :: [String]
       execs = sort $ map (unUnqualComponentName . exeName) $ filter isBuildable $ executables pkgDesc
 
@@ -268,14 +267,12 @@
     let baseFiles = if binlib then "-f ghc-%{name}.files" else "-f %{name}.files"
         develFiles = if binlib then "-f ghc-%{name}-devel.files" else "-f %{name}-devel.files"
     put $ "%files" +-+ ghcPkg +-+ baseFiles
-    put "%defattr(-,root,root,-)"
     mapM_ (\ l -> put $ license_macro +-+ l) licensefiles
     unless binlib $
       mapM_ (\ p -> put $ "%{_bindir}/" ++ (if p == name then "%{pkg_name}" else p)) (sort execs)
     unless hasExecPkg listDataFiles
     putNewline
     put $ "%files" +-+ ghcPkgDevel +-+ develFiles
-    put "%defattr(-,root,root,-)"
     unless (null docs) $
       put $ "%doc" +-+ unwords (sort docs)
     putNewline
@@ -304,10 +301,10 @@
                        _   -> v
 
 showLicense :: License -> String
-showLicense (GPL Nothing) = "GPL-1.0+"
-showLicense (GPL (Just ver)) = "GPL-" ++ display (normalizeVersion ver) ++ "+"
-showLicense (LGPL Nothing) = "LGPL-2.0+"
-showLicense (LGPL (Just ver)) = "LGPL-" ++ display (normalizeVersion ver) ++ "+"
+showLicense (GPL Nothing) = "GPL-1.0-or-later"
+showLicense (GPL (Just ver)) = "GPL-" ++ display (normalizeVersion ver) ++ "-or-later"
+showLicense (LGPL Nothing) = "LGPL-2.0-or-later"
+showLicense (LGPL (Just ver)) = "LGPL-" ++ display (normalizeVersion ver) ++ "-or-later"
 showLicense BSD3 = "BSD-3-Clause"
 showLicense BSD4 = "BSD-4-Clause"
 showLicense MIT = "MIT"
@@ -317,8 +314,8 @@
 showLicense (UnknownLicense l) = "Unknown" +-+ l
 showLicense (Apache Nothing) = "Apache-2.0"
 showLicense (Apache (Just ver)) = "Apache-" ++ display (normalizeVersion ver)
-showLicense (AGPL Nothing) = "AGPLv?"
-showLicense (AGPL (Just ver)) = "AGPLv" ++ display ver
+showLicense (AGPL Nothing) = "AGPL-1.0-or-later"
+showLicense (AGPL (Just ver)) = "AGPL-" ++ display (normalizeVersion ver) ++ "-or-later"
 showLicense BSD2 = "BSD-2-Clause"
 showLicense (MPL ver) = "MPL-" ++ display (normalizeVersion ver)
 showLicense ISC = "ISC"
@@ -368,8 +365,11 @@
 s +-+ "" = s
 s +-+ t = s ++ " " ++ t
 
-excludedPkgs :: String -> Bool
-excludedPkgs = flip notElem ["Cabal", "base", "ghc-prim", "integer-gmp"]
+excludedPkgs :: PackageDescription -> String -> Bool
+excludedPkgs pkgDesc = flip notElem (subLibs ++ ["Cabal", "base", "ghc-prim", "integer-gmp"])
+  where
+    subLibs :: [String]
+    subLibs = [ unUnqualComponentName ln | l <- subLibraries pkgDesc, Just ln <- [libName l] ]
 
 -- returns list of deps and whether package is self-dependent
 buildDependencies :: PackageDescription -> String -> ([String], Bool)
@@ -378,7 +378,7 @@
       sdeps = maybe [] (map depName . setupDepends) (setupBuildInfo pkgDesc)
       deps  = nub $ bdeps ++ sdeps
   in
-    (filter excludedPkgs (delete self deps), self `elem` deps && hasExes pkgDesc)
+    (filter (excludedPkgs pkgDesc) (delete self deps), self `elem` deps && hasExes pkgDesc)
 
 class IsDependency a where
   depName :: a -> String
@@ -446,7 +446,7 @@
                       -> String             -- ^self
                       -> [String]           -- ^depends
 testsuiteDependencies pkgDesc self =
-  map showDep . delete self . filter excludedPkgs . nub . map depName $ concatMap (targetBuildDepends . testBuildInfo) (testSuites pkgDesc)
+  map showDep . delete self . filter (excludedPkgs pkgDesc) . nub . map depName $ concatMap (targetBuildDepends . 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,5 +1,5 @@
 #
-# spec file for package ChasingBottoms
+# spec file for package ChasingBottoms.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ChasingBottoms
 
+%global pkg_name ChasingBottoms
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.3.1.3
 Release:        0
 Summary:        For testing partial and infinite values
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 %if %{with tests}
 BuildRequires:  ghc-array-devel
@@ -123,7 +120,6 @@
 require preemptive scheduling, and most of the rest requires 'Data.Generics';
 'isBottom' only requires exceptions, though.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -131,19 +127,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -163,13 +157,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENCE
+%license LICENCE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENCE
+%license LICENCE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package Clipboard
+# spec file for package Clipboard.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name Clipboard
 
+%global pkg_name Clipboard
 Name:           %{pkg_name}
 Version:        2.3.2.0
 Release:        0
 Summary:        System clipboard interface
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-X11-devel
 BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-unix-devel
 BuildRequires:  ghc-utf8-string-devel
 
@@ -57,7 +55,6 @@
 development library available on your system at compile time. You can install
 it by 'sudo apt-get install libxrandr-dev' (or the equivalent on your system).
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +62,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -94,15 +89,13 @@
 %ghc_pkg_recache
 
 %files
-%doc license
+%license license
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license
+%license license
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package FenwickTree
+# spec file for package FenwickTree.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name FenwickTree
 
+%global pkg_name FenwickTree
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.2.1
 Release:        0
 Summary:        Data structure for fast query and update of cumulative sums
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 
 %description
@@ -40,7 +37,6 @@
 real-valued cumulative sum reaches certain value, and allows for storage of
 arbitrary information in the nodes.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,16 +74,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %dir %{_datadir}/%{name}-%{version}
 %{_datadir}/%{name}-%{version}/README.md
 %{_datadir}/%{name}-%{version}/changelog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package GPipe-GLFW
+# spec file for package GPipe-GLFW.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name GPipe-GLFW
 
+%global pkg_name GPipe-GLFW
 Name:           %{pkg_name}
 Version:        1.4.1.1
 Release:        0
 Summary:        GLFW OpenGL context creation for GPipe
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-GLFW-b-devel
 BuildRequires:  ghc-GPipe-devel
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-stm-devel
 
 %description
@@ -40,7 +38,6 @@
 and context handler for GPipe. GPipe is a typesafe functional API based on the
 conceptual model of OpenGL.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %dir %{_datadir}/%{name}-%{version}
 %{_datadir}/%{name}-%{version}/CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package GenericPretty
+# spec file for package GenericPretty.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name GenericPretty
 
+%global pkg_name GenericPretty
 Name:           %{pkg_name}
 Version:        1.2.1
 Release:        0
 Summary:        A generic, derivable, haskell pretty printer
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 GenericPretty is a Haskell library that supports automatic derivation of pretty
@@ -63,7 +61,6 @@
 also see the README file or this page:
 <http://www.haskell.org/haskellwiki/Cabal/How_to_install_a_Cabal_package>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -71,19 +68,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -100,15 +95,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README
 
 %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,5 +1,5 @@
 #
-# spec file for package HPDF
+# spec file for package HPDF.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name HPDF
 
+%global pkg_name HPDF
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.4.10
 Release:        0
 Summary:        Generation of PDF documents
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-base64-bytestring-devel
 BuildRequires:  ghc-binary-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-errors-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-zlib-devel
 %if %{with tests}
@@ -52,7 +49,6 @@
 it. Or, download the package and look at the test.hs file in the Test folder.
 That file is giving an example of each feature.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -60,19 +56,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -92,15 +86,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc NEWS.txt README.txt TODO.txt changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc NEWS.txt README.txt TODO.txt changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package HTF
+# spec file for package HTF.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name HTF
 
+%global pkg_name HTF
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.13.2.2
 Release:        0
 Summary:        The Haskell Test Framework
+License:        LGPL-2.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        LGPL-2.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-Diff-devel
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-QuickCheck-devel
@@ -51,6 +47,7 @@
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-random-devel
 BuildRequires:  ghc-regex-compat-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-unix-devel
@@ -80,7 +77,6 @@
 (<http://factisresearch.blogspot.de/2011/10/new-version-of-htf-with-diffs-colors.html>)
 demonstrating HTF's coloring, pretty-printing and diff functionality.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -88,19 +84,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -121,16 +115,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog README.md TODO.org
 %{_bindir}/htfpp
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog README.md TODO.org
 
 %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,5 +1,5 @@
 #
-# spec file for package HTTP
+# spec file for package HTTP.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name HTTP
 
+%global pkg_name HTTP
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        4000.3.9
 Release:        0
 Summary:        A library for client-side HTTP
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-network-uri-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -92,7 +89,6 @@
 
 * <http://hackage.haskell.org/package/wreq wreq> .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -100,19 +96,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -132,15 +126,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES
 
 %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,5 +1,5 @@
 #
-# spec file for package Hclip
+# spec file for package Hclip.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name Hclip
 
+%global pkg_name Hclip
 Name:           %{pkg_name}
 Version:        3.0.0.4
 Release:        0
 Summary:        A small cross-platform library for reading and modifying the system clipboard
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-strict-devel
 
 %description
@@ -46,7 +44,6 @@
 
 * Linux: Requires xclip or xsel installed.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -54,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package MissingH
+# spec file for package MissingH.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name MissingH
 
+%global pkg_name MissingH
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.4.0.1
 Release:        0
 Summary:        Large utility library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-containers-devel
@@ -45,6 +41,7 @@
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-random-devel
 BuildRequires:  ghc-regex-compat-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-unix-devel
 %if %{with tests}
@@ -58,7 +55,6 @@
 programmers. It is written in pure Haskell and thus should be extremely
 portable and easy to use.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -66,19 +62,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -98,15 +92,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc TODO examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc TODO examples
 
 %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,5 +1,5 @@
 #
-# spec file for package ObjectName
+# spec file for package ObjectName.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ObjectName
 
+%global pkg_name ObjectName
 Name:           %{pkg_name}
 Version:        1.1.0.1
 Release:        0
 Summary:        Explicitly handled object names
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
@@ -36,7 +34,6 @@
 general notion of explicitly handled identifiers for API objects, e.g.
 a texture object name in OpenGL or a buffer object name in OpenAL.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,15 +68,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package Only
+# spec file for package Only.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name Only
 
+%global pkg_name Only
 Name:           %{pkg_name}
 Version:        0.1
 Release:        0
 Summary:        The 1-tuple type or single-value "collection"
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 This package provides the canonical anonymous 1-tuple type missing from Haskell
 for attaching typeclass instances.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,13 +67,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package QuasiText
+# spec file for package QuasiText.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name QuasiText
 
+%global pkg_name QuasiText
 Name:           %{pkg_name}
 Version:        0.1.2.6
 Release:        0
 Summary:        A QuasiQuoter for Text
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-haskell-src-meta-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-th-lift-instances-devel
@@ -38,7 +36,6 @@
 %description
 A QuasiQuoter for interpolating values into Text strings.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,13 +70,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package QuickCheck
+# spec file for package QuickCheck.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name QuickCheck
 
+%global pkg_name QuickCheck
 Name:           %{pkg_name}
 Version:        2.10.1
 Release:        0
 Summary:        Automatic testing of Haskell programs
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-tf-random-devel
 BuildRequires:  ghc-transformers-devel
@@ -55,7 +53,6 @@
 you can find at
 <https://begriffs.com/posts/2017-01-14-design-use-quickcheck.html>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +60,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -92,15 +87,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README changelog examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README changelog examples
 
 %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,5 +1,5 @@
 #
-# spec file for package ReadArgs
+# spec file for package ReadArgs.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ReadArgs
 
+%global pkg_name ReadArgs
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.2.3
 Release:        0
 Summary:        Simple command line argument parsing
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-system-filepath-devel
@@ -81,7 +78,6 @@
 ' ( a :: Int , NonGreedy b :: NonGreedy Maybe String , NonGreedy c :: NonGreedy
 [] Float ) <- readArgs '.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -89,19 +85,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -121,14 +115,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/ReadArgsEx
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package SHA
+# spec file for package SHA.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name SHA
 
+%global pkg_name SHA
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.6.4.2
 Release:        0
 Summary:        Implementations of the SHA suite of message digest functions
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-test-framework-devel
@@ -48,7 +45,6 @@
 performance, these do not presently reach the speed of well-tuned libraries,
 like OpenSSL.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,13 +82,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package Strafunski-StrategyLib
+# spec file for package Strafunski-StrategyLib.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name Strafunski-StrategyLib
 
+%global pkg_name Strafunski-StrategyLib
 Name:           %{pkg_name}
 Version:        5.0.0.10
 Release:        0
 Summary:        Library for strategic programming
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-transformers-devel
 
@@ -40,7 +38,6 @@
 much of StrategyLib can be found in the paper "Design Patterns for Functional
 Strategic Programming.".
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,20 +45,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -78,13 +73,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package accelerate-fftw
+# spec file for package accelerate-fftw.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,31 +15,28 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name accelerate-fftw
 
+%global pkg_name accelerate-fftw
 Name:           %{pkg_name}
 Version:        1.0
 Release:        0
 Summary:        Accelerate frontend to the FFTW library (Fourier transform)
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-accelerate-devel
 BuildRequires:  ghc-accelerate-io-devel
 BuildRequires:  ghc-carray-devel
 BuildRequires:  ghc-fft-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-storable-complex-devel
 
 %description
 An interface to the Fastest Fourier Transform in the West (FFTW) for the
 'accelerate' framework.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,13 +71,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package accelerate
+# spec file for package accelerate.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name accelerate
 
+%global pkg_name accelerate
 Name:           %{pkg_name}
 Version:        1.1.1.0
 Release:        0
 Summary:        An embedded language for accelerated array processing
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-ansi-wl-pprint-devel
 BuildRequires:  ghc-base-orphans-devel
 BuildRequires:  ghc-containers-devel
@@ -40,6 +37,7 @@
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-hashtables-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-transformers-devel
@@ -148,7 +146,6 @@
 * Bug reports and issue tracking:
 <https://github.com/AccelerateHS/accelerate/issues> .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -156,19 +153,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -185,15 +180,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package active
+# spec file for package active.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name active
 
+%global pkg_name active
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.13
 Release:        0
 Summary:        Abstractions for animation
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-lens-devel
 BuildRequires:  ghc-linear-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-vector-devel
@@ -43,7 +40,6 @@
 %description
 "Active" abstraction for animated things with finite start and end times.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package adjunctions
+# spec file for package adjunctions.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name adjunctions
 
+%global pkg_name adjunctions
 Name:           %{pkg_name}
 Version:        4.3
 Release:        0
 Summary:        Adjunctions and representable functors
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-comonad-devel
 BuildRequires:  ghc-containers-devel
@@ -37,6 +34,7 @@
 BuildRequires:  ghc-free-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-tagged-devel
@@ -47,7 +45,6 @@
 %description
 Adjunctions and representable functors.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package aeson-diff
+# spec file for package aeson-diff.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name aeson-diff
 
+%global pkg_name aeson-diff
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.1.0.4
 Release:        0
 Summary:        Extract and apply patches to JSON documents
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-edit-distance-vector-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-optparse-applicative-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
@@ -57,7 +54,6 @@
 a library and two command-line executables in the style of the diff(1) and
 patch(1) commands available on many systems. .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -98,17 +92,15 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 %{_bindir}/json-diff
 %{_bindir}/json-patch
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package aeson-pretty
+# spec file for package aeson-pretty.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name aeson-pretty
 
+%global pkg_name aeson-pretty
 Name:           %{pkg_name}
 Version:        0.8.5
 Release:        0
 Summary:        JSON pretty-printing library and command-line tool
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base-compat-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cmdargs-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
@@ -55,7 +53,6 @@
 
 the command-line tool will NOT be installed.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +60,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -93,16 +88,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package algebraic-graphs
+# spec file for package algebraic-graphs.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name algebraic-graphs
 
+%global pkg_name algebraic-graphs
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.5
 Release:        0
 Summary:        A library for algebraic graph construction and transformation
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-extra-devel
@@ -70,7 +67,6 @@
 1.0.0. Please consider contributing to the on-going
 <https://github.com/snowleopard/alga/issues discussions on the library API>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -78,19 +74,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -110,15 +104,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-cloudtrail
+# spec file for package amazonka-cloudtrail.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-cloudtrail
 
+%global pkg_name amazonka-cloudtrail
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon CloudTrail SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.CloudTrail" or <https://aws.amazon.com/documentation/ the AWS
 documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,20 +61,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -98,15 +92,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-cloudwatch-logs
+# spec file for package amazonka-cloudwatch-logs.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-cloudwatch-logs
 
+%global pkg_name amazonka-cloudwatch-logs
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon CloudWatch Logs SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.CloudWatchLogs" or <https://aws.amazon.com/documentation/ the
 AWS documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,20 +61,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -98,15 +92,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-codedeploy
+# spec file for package amazonka-codedeploy.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-codedeploy
 
+%global pkg_name amazonka-codedeploy
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon CodeDeploy SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.CodeDeploy" or <https://aws.amazon.com/documentation/ the AWS
 documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,20 +61,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -98,15 +92,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-cognito-idp
+# spec file for package amazonka-cognito-idp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-cognito-idp
 
+%global pkg_name amazonka-cognito-idp
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon Cognito Identity Provider SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.CognitoIdentityProvider" or
 <https://aws.amazon.com/documentation/ the AWS documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,20 +61,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -98,15 +92,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-ecs
+# spec file for package amazonka-ecs.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-ecs
 
+%global pkg_name amazonka-ecs
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon EC2 Container Service SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.ECS" or <https://aws.amazon.com/documentation/ the AWS
 documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-kms
+# spec file for package amazonka-kms.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-kms
 
+%global pkg_name amazonka-kms
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon Key Management Service SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.KMS" or <https://aws.amazon.com/documentation/ the AWS
 documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-lightsail
+# spec file for package amazonka-lightsail.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-lightsail
 
+%global pkg_name amazonka-lightsail
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon Lightsail SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.Lightsail" or <https://aws.amazon.com/documentation/ the AWS
 documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-route53-domains
+# spec file for package amazonka-route53-domains.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-route53-domains
 
+%global pkg_name amazonka-route53-domains
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon Route 53 Domains SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.Route53Domains" or <https://aws.amazon.com/documentation/ the
 AWS documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,20 +61,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -98,15 +92,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package amazonka-waf
+# spec file for package amazonka-waf.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name amazonka-waf
 
+%global pkg_name amazonka-waf
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.0
 Release:        0
 Summary:        Amazon WAF SDK
-Group:          Development/Libraries/Haskell
-
 License:        MPL-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-core-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-amazonka-test-devel
 BuildRequires:  ghc-bytestring-devel
@@ -57,7 +54,6 @@
 See "Network.AWS.WAF" or <https://aws.amazon.com/documentation/ the AWS
 documentation> to get started.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package api-field-json-th
+# spec file for package api-field-json-th.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name api-field-json-th
 
+%global pkg_name api-field-json-th
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.2
 Release:        0
 Summary:        Option of aeson's deriveJSON
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-lens-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
@@ -43,7 +40,6 @@
 %description
 Utils for using aeson's deriveJSON with lens's makeFields.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,13 +77,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package app-settings
+# spec file for package app-settings.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name app-settings
 
+%global pkg_name app-settings
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.11
 Release:        0
 Summary:        A library to manage application settings (INI file-like)
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -118,7 +115,6 @@
 You can also look at the tests of the library on the github project for sample
 use.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -126,19 +122,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -158,13 +152,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package apply-refact
+# spec file for package apply-refact.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name apply-refact
 
+%global pkg_name apply-refact
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.1.0
 Release:        0
 Summary:        Perform refactorings specified by the refact library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-filemanip-devel
@@ -41,6 +37,7 @@
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-refact-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-temporary-devel
 BuildRequires:  ghc-transformers-devel
@@ -56,7 +53,6 @@
 Perform refactorings specified by the refact library. It is primarily used with
 HLint's --refactor flag.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -64,19 +60,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -96,16 +90,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG README.md
 %{_bindir}/refactor
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package async
+# spec file for package async.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name async
 
+%global pkg_name async
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        2.1.1.1
 Release:        0
 Summary:        Run IO operations asynchronously and wait for their results
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-stm-devel
@@ -53,7 +50,6 @@
 * The API makes it possible to build a tree of threads that are automatically
 killed when their parent dies (see 'withAsync').
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,19 +57,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -93,15 +87,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package attoparsec-expr
+# spec file for package attoparsec-expr.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name attoparsec-expr
 
+%global pkg_name attoparsec-expr
 Name:           %{pkg_name}
 Version:        0.1.1.2
 Release:        0
 Summary:        Port of parsec's expression parser to attoparsec
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Port of parsec's expression parser to attoparsec.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package attoparsec-time
+# spec file for package attoparsec-time.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name attoparsec-time
 
+%global pkg_name attoparsec-time
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1
 Release:        0
 Summary:        Attoparsec parsers of time
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base-prelude-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cabal-doctest-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
@@ -47,7 +44,6 @@
 %description
 A collection of Attoparsec parsers for the "time" library.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -87,13 +81,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package avers-server
+# spec file for package avers-server.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name avers-server
 
+%global pkg_name avers-server
 Name:           %{pkg_name}
 Version:        0.1.0
 Release:        0
 Summary:        Server implementation of the Avers API
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-avers-api-devel
 BuildRequires:  ghc-avers-devel
@@ -43,6 +40,7 @@
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-resource-pool-devel
 BuildRequires:  ghc-rethinkdb-client-driver-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-servant-devel
 BuildRequires:  ghc-servant-server-devel
 BuildRequires:  ghc-stm-devel
@@ -56,7 +54,6 @@
 %description
 Server implementation of the Avers API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -64,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -93,13 +88,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package aws
+# spec file for package aws.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name aws
 
+%global pkg_name aws
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.18
 Release:        0
 Summary:        Amazon Web Services (AWS) for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base16-bytestring-devel
@@ -56,6 +52,7 @@
 BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-old-locale-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-tagged-devel
@@ -84,7 +81,6 @@
 services. To see a high level overview of the library, see the README at
 <https://github.com/aristidb/aws/blob/master/README.md>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -92,19 +88,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -124,15 +118,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package bbdb
+# spec file for package bbdb.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name bbdb
 
+%global pkg_name bbdb
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.8
 Release:        0
 Summary:        Ability to read, write, and modify BBDB files
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
 %endif
@@ -43,7 +40,6 @@
 to get at and manipulate the data all from within Haskell. See the hackage docs
 for usage and examples.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package benchpress
+# spec file for package benchpress.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name benchpress
 
+%global pkg_name benchpress
 Name:           %{pkg_name}
 Version:        0.2.2.10
 Release:        0
 Summary:        Micro-benchmarking with detailed statistics
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
 
 %description
@@ -38,7 +36,6 @@
 deviation, and max execution time. Also computes execution time percentiles.
 Comes with functions to pretty-print the results.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,14 +70,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/example
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package binary-bits
+# spec file for package binary-bits.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name binary-bits
 
+%global pkg_name binary-bits
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5
 Release:        0
 Summary:        Bit parsing/writing on top of binary
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-random-devel
@@ -44,7 +41,6 @@
 Bit parsing/writing on top of binary. Provides functions to read and write bits
 to and from 8/16/32/64 words.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package binary-tagged
+# spec file for package binary-tagged.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name binary-tagged
 
+%global pkg_name binary-tagged
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.4.2
 Release:        0
 Summary:        Tagged binary serialisation
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-SHA-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-array-devel
@@ -41,6 +37,7 @@
 BuildRequires:  ghc-generics-sop-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-nats-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-tagged-devel
@@ -59,7 +56,6 @@
 %description
 Check <https://github.com/phadej/binary-tagged#readme README on Github>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -67,19 +63,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -99,15 +93,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package bindings-uname
+# spec file for package bindings-uname.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name bindings-uname
 
+%global pkg_name bindings-uname
 Name:           %{pkg_name}
 Version:        0.1
 Release:        0
 Summary:        Low-level binding to POSIX uname(3)
-Group:          Development/Libraries/Haskell
-
 License:        SUSE-Public-Domain
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -34,7 +32,6 @@
 This is a low-level binding to POSIX uname(3) function. Perhaps it shoule be
 part of unix package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,9 +68,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package bioalign
+# spec file for package bioalign.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name bioalign
 
+%global pkg_name bioalign
 Name:           %{pkg_name}
 Version:        0.0.5
 Release:        0
 Summary:        Data structures and helper functions for calculating alignments
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-biocore-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Data structures and helper functions for calculating alignments.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,13 +67,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package bits
+# spec file for package bits.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name bits
 
+%global pkg_name bits
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.1
 Release:        0
 Summary:        Various bit twiddling and bitwise serialization primitives
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytes-devel
 BuildRequires:  ghc-cabal-doctest-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
@@ -42,7 +39,6 @@
 %description
 Various bit twiddling and bitwise serialization primitives.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,15 +76,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package blank-canvas
+# spec file for package blank-canvas.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name blank-canvas
 
+%global pkg_name blank-canvas
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.6.1
 Release:        0
 Summary:        HTML5 Canvas Graphics Library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-base-compat-devel
 BuildRequires:  ghc-base64-bytestring-devel
@@ -41,6 +37,7 @@
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-kansas-comet-devel
 BuildRequires:  ghc-mime-types-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scotty-devel
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-text-devel
@@ -79,7 +76,6 @@
 For more details, read the <https://github.com/ku-fpg/blank-canvas/wiki
 blank-canvas wiki>. .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -87,19 +83,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -119,7 +113,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc Changelog.md README.md
 %dir %{_datadir}/%{name}-%{version}
 %dir %{_datadir}/%{name}-%{version}/static
@@ -128,11 +122,9 @@
 %{_datadir}/%{name}-%{version}/static/jquery.js
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc Changelog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package blaze-html
+# spec file for package blaze-html.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name blaze-html
 
+%global pkg_name blaze-html
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.9.0.1
 Release:        0
 Summary:        A blazingly fast HTML combinator library for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-blaze-markup-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -49,7 +46,6 @@
 The Text.Blaze module is a good starting point, as well as this tutorial:
 <http://jaspervdj.be/blaze/tutorial.html>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,15 +83,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG
 
 %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,5 +1,5 @@
 #
-# spec file for package blaze-markup
+# spec file for package blaze-markup.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name blaze-markup
 
+%global pkg_name blaze-markup
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.8.0.0
 Release:        0
 Summary:        A blazingly fast markup combinator library for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -48,7 +45,6 @@
 programming language. The Text.Blaze module is a good starting point, as well
 as this tutorial: <http://jaspervdj.be/blaze/tutorial.html>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,15 +82,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG
 
 %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,5 +1,5 @@
 #
-# spec file for package blaze-svg
+# spec file for package blaze-svg.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name blaze-svg
 
+%global pkg_name blaze-svg
 Name:           %{pkg_name}
 Version:        0.3.6.1
 Release:        0
 Summary:        SVG combinator library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-blaze-markup-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 A blazingly fast SVG combinator library for the Haskell programming language.
@@ -46,7 +44,6 @@
 gives a good overview on how to use the combinators in "Text.Blaze.Svg11" and
 "Text.Blaze.Svg11.Attributes": <http://jaspervdj.be/blaze/tutorial.html>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -54,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +78,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package blosum
+# spec file for package blosum.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name blosum
 
+%global pkg_name blosum
 Name:           %{pkg_name}
 Version:        0.1.1.4
 Release:        0
 Summary:        BLOSUM generator
+License:        GPL-2.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-2.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-fasta-devel
 BuildRequires:  ghc-lens-devel
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-pipes-devel
 BuildRequires:  ghc-pipes-text-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-show-devel
@@ -43,7 +41,6 @@
 %description
 Generates BLOSUMs for use with finding the degree of amino acid conservation.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,14 +76,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package boomerang
+# spec file for package boomerang.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name boomerang
 
+%global pkg_name boomerang
 Name:           %{pkg_name}
 Version:        1.4.5.3
 Release:        0
 Summary:        Library for invertible parsing and printing
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
 
@@ -37,7 +35,6 @@
 Specify a single unified grammar which can be used for parsing and
 pretty-printing.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,13 +69,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package boxes
+# spec file for package boxes.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name boxes
 
+%global pkg_name boxes
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.4
 Release:        0
 Summary:        2D text pretty-printing library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
@@ -40,7 +37,6 @@
 A pretty-printing library for laying out text in two dimensions, using a simple
 box model.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,15 +74,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package brittany
+# spec file for package brittany.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name brittany
 
+%global pkg_name brittany
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.9.0.0
 Release:        0
 Summary:        Haskell source code formatter
+License:        AGPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        AGPLv3
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-butcher-devel
 BuildRequires:  ghc-bytestring-devel
@@ -53,6 +49,7 @@
 BuildRequires:  ghc-multistate-devel
 BuildRequires:  ghc-neat-interpolation-devel
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-strict-devel
@@ -77,7 +74,6 @@
 <https://github.com/lspitzner/brittany/blob/master/doc/implementation/index.md
 here>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -85,19 +81,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -118,16 +112,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md doc
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md doc
 
 %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,5 +1,5 @@
 #
-# spec file for package broadcast-chan
+# spec file for package broadcast-chan.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name broadcast-chan
 
+%global pkg_name broadcast-chan
 Name:           %{pkg_name}
 Version:        0.1.1
 Release:        0
 Summary:        Broadcast channel type that avoids 0 reader space leaks
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -42,7 +40,6 @@
 ends. As a result, any messages written to the write end can be immediately
 garbage collected if there are no active read ends, avoding space leaks.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -79,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package butcher
+# spec file for package butcher.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name butcher
 
+%global pkg_name butcher
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.2.1.0
 Release:        0
 Summary:        Chops a command or program invocation into digestable pieces
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bifunctors-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deque-devel
@@ -42,6 +38,7 @@
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-multistate-devel
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-unsafe-devel
 BuildRequires:  ghc-void-devel
@@ -50,7 +47,6 @@
 See the <https://github.com/lspitzner/butcher/blob/master/README.md README> (it
 is properly formatted on github).
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,19 +54,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,15 +84,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package bzlib
+# spec file for package bzlib.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name bzlib
 
+%global pkg_name bzlib
 Name:           %{pkg_name}
 Version:        0.5.0.5
 Release:        0
 Summary:        Compression and decompression in the bzip2 format
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  libbz2-devel
 
 %description
@@ -41,7 +39,6 @@
 cases where more control is needed it provides access to the full bzip2 feature
 set.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,20 +46,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
+Requires:       libbz2-devel
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
-Requires:       libbz2-devel
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -79,15 +74,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc examples
 
 %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,5 +1,5 @@
 #
-# spec file for package case-insensitive
+# spec file for package case-insensitive.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name case-insensitive
 
+%global pkg_name case-insensitive
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.2.0.10
 Release:        0
 Summary:        Case insensitive string comparison
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -46,7 +43,6 @@
 be parameterised by a string-like type like: 'String', 'ByteString', 'Text',
 etc.. Comparisons of values of the resulting type will be insensitive to cases.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -54,19 +50,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -86,15 +80,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package cassava-conduit
+# spec file for package cassava-conduit.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name cassava-conduit
 
+%global pkg_name cassava-conduit
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.0.1
 Release:        0
 Summary:        Conduit interface for cassava package
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bifunctors-devel
 BuildRequires:  ghc-bytestring-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-conduit-extra-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -49,7 +46,6 @@
 
 PRs welcome.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,15 +83,13 @@
 %ghc_pkg_recache
 
 %files
-%doc etc/LICENCE.md
+%license etc/LICENCE.md
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc etc/LICENCE.md
+%license etc/LICENCE.md
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package cassette
+# spec file for package cassette.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name cassette
 
+%global pkg_name cassette
 Name:           %{pkg_name}
 Version:        0.1.0
 Release:        0
 Summary:        A combinator library for simultaneously defining parsers and pretty printers
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -36,7 +34,6 @@
 printers are implemented in CPS and because arguments are always curried,
 rather than packed into nested tuples.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,13 +68,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package cereal-text
+# spec file for package cereal-text.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name cereal-text
 
+%global pkg_name cereal-text
 Name:           %{pkg_name}
 Version:        0.1.0.2
 Release:        0
 Summary:        Data.Text instances for the cereal serialization library
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-cereal-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
@@ -40,7 +38,6 @@
 
 Use 'import Data.Serialize.Text ()' to import instances.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package cheapskate
+# spec file for package cheapskate.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name cheapskate
 
+%global pkg_name cheapskate
 Name:           %{pkg_name}
 Version:        0.1.1
 Release:        0
 Summary:        Experimental markdown processor
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-blaze-html-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-data-default-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-uniplate-devel
@@ -51,7 +49,6 @@
 significant list start numbers, and autolinked URLs. See README.markdown for
 details.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,19 +56,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,16 +84,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown changelog
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown changelog
 
 %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,5 +1,5 @@
 #
-# spec file for package chell
+# spec file for package chell.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name chell
 
+%global pkg_name chell
 Name:           %{pkg_name}
 Version:        0.4.0.2
 Release:        0
 Summary:        A simple and intuitive library for automated testing
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-ansi-terminal-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-options-devel
 BuildRequires:  ghc-patience-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
@@ -63,7 +61,6 @@
 ' $ ghc --make chell-example.hs $ ./chell-example PASS: 2 tests run, 2 tests
 passed '.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -71,19 +68,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -100,13 +95,11 @@
 %ghc_pkg_recache
 
 %files
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package clumpiness
+# spec file for package clumpiness.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name clumpiness
 
+%global pkg_name clumpiness
 Name:           %{pkg_name}
 Version:        0.17.0.0
 Release:        0
 Summary:        Calculate the clumpiness of leaf properties in a tree
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tree-fun-devel
 
 %description
 Calculate the clumpiness of leaf properties in a tree.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,13 +67,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package code-page
+# spec file for package code-page.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name code-page
 
+%global pkg_name code-page
 Name:           %{pkg_name}
 Version:        0.1.3
 Release:        0
 Summary:        Windows code page library for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -40,7 +38,6 @@
 setting, and analyzing code pages. On other operating systems, this module
 exports nothing.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package colorize-haskell
+# spec file for package colorize-haskell.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name colorize-haskell
 
+%global pkg_name colorize-haskell
 Name:           %{pkg_name}
 Version:        1.0.1
 Release:        0
 Summary:        Highligt Haskell source
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-ansi-terminal-devel
 BuildRequires:  ghc-haskell-lexer-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Highligt Haskell source.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,14 +67,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/hscolor
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package countable
+# spec file for package countable.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name countable
 
+%global pkg_name countable
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0
 Release:        0
 Summary:        Countable, Searchable, Finite, Empty classes
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 %if %{with tests}
@@ -66,7 +63,6 @@
 
 * '(Show a,Finite a,Show b) => Show (a -> b)' / /.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -74,19 +70,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -106,13 +100,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package cpu
+# spec file for package cpu.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name cpu
 
+%global pkg_name cpu
 Name:           %{pkg_name}
 Version:        0.1.2
 Release:        0
 Summary:        Cpu information and properties helpers
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -34,7 +32,6 @@
 Lowlevel cpu routines to get basic properties of the cpu platform, like
 endianness and architecture.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %dir %{_datadir}/%{name}-%{version}
 %{_datadir}/%{name}-%{version}/README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package criterion
+# spec file for package criterion.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name criterion
 
+%global pkg_name criterion
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.2.6.0
 Release:        0
 Summary:        Robust, reliable performance measurement and analysis
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-Glob-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-ansi-wl-pprint-devel
@@ -52,6 +48,7 @@
 BuildRequires:  ghc-mwc-random-devel
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-statistics-devel
 BuildRequires:  ghc-text-devel
@@ -81,7 +78,6 @@
 For examples of the kinds of reports that criterion generates, see
 <http://www.serpentine.com/criterion the home page>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -89,19 +85,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -122,7 +116,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown changelog.md examples
 %{_bindir}/criterion-report
 %dir %{_datadir}/%{name}-%{version}
@@ -133,11 +127,9 @@
 %{_datadir}/%{name}-%{version}/templates/js/jquery.criterion.js
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown changelog.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package crypt-sha512
+# spec file for package crypt-sha512.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name crypt-sha512
 
+%global pkg_name crypt-sha512
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0
 Release:        0
 Summary:        Pure Haskell implelementation for GNU SHA512 crypt algorithm
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cryptohash-sha512-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-quickcheck-instances-devel
 BuildRequires:  ghc-tasty-devel
@@ -48,7 +45,6 @@
 
 This package provides a pure Haskell implementation of SHA512 crypt scheme.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,15 +82,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package crypto-random-api
+# spec file for package crypto-random-api.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name crypto-random-api
 
+%global pkg_name crypto-random-api
 Name:           %{pkg_name}
 Version:        0.2.0
 Release:        0
 Summary:        Simple random generators API for cryptography related code
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-entropy-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Simple random generators API for cryptography related code.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,13 +67,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package csv
+# spec file for package csv.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name csv
 
+%global pkg_name csv
 Name:           %{pkg_name}
 Version:        0.1.2
 Release:        0
 Summary:        CSV loader and dumper
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 CSV loader and dumper
@@ -40,7 +38,6 @@
 This format is used, among many other things, as a lingua franca for
 spreadsheets, and for certain web services.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,13 +72,11 @@
 %ghc_pkg_recache
 
 %files
-%doc COPYING
+%license COPYING
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc COPYING
+%license COPYING
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package data-accessor
+# spec file for package data-accessor.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name data-accessor
 
+%global pkg_name data-accessor
 Name:           %{pkg_name}
 Version:        0.2.2.7
 Release:        0
 Summary:        Utilities for accessing and manipulating fields of records
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 
 %description
@@ -83,7 +81,6 @@
 the 'arr' method of the 'Arrow' class, that conflicts with the two-way nature
 (set and get) of accessors.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -91,19 +88,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -120,13 +115,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package data-default-instances-containers
+# spec file for package data-default-instances-containers.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name data-default-instances-containers
 
+%global pkg_name data-default-instances-containers
 Name:           %{pkg_name}
 Version:        0.0.1
 Release:        0
 Summary:        Default instances for types in containers
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-data-default-class-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Default instances for types in containers.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,20 +41,18 @@
 This package provides the Haskell %{name} shared
 library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library
 development files.
 
-
 %prep
 %setup -q
 
@@ -74,13 +69,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package data-endian
+# spec file for package data-endian.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name data-endian
 
+%global pkg_name data-endian
 Name:           %{pkg_name}
 Version:        0.1.1
 Release:        0
 Summary:        Endian-sensitive data
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
 %description
 This package provides helpers for converting endian-sensitive data.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -41,19 +38,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -70,13 +65,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package data-msgpack
+# spec file for package data-msgpack.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name data-msgpack
 
+%global pkg_name data-msgpack
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.10
 Release:        0
 Summary:        A Haskell implementation of MessagePack
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
@@ -40,6 +36,7 @@
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-groom-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vector-devel
@@ -55,7 +52,6 @@
 since the original author is unreachable. This fork incorporates a number of
 bugfixes and is actively being developed.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +59,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -96,14 +90,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/msgpack-parser
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package data-serializer
+# spec file for package data-serializer.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name data-serializer
 
+%global pkg_name data-serializer
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.2
 Release:        0
 Summary:        Common API for serialization libraries
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cereal-devel
 BuildRequires:  ghc-data-endian-devel
 BuildRequires:  ghc-parsers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-split-devel
 %if %{with tests}
@@ -48,7 +45,6 @@
 <http://hackage.haskell.org/package/binary binary> and
 <http://hackage.haskell.org/package/cereal cereal>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,15 +82,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package deque
+# spec file for package deque.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name deque
 
+%global pkg_name deque
 Name:           %{pkg_name}
 Version:        0.2
 Release:        0
 Summary:        Double-ended queue
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -34,7 +32,6 @@
 An implementation of Double-Ended Queue (aka Dequeue or Deque) based on the
 head-tail linked list.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,13 +66,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package dhall-bash
+# spec file for package dhall-bash.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name dhall-bash
 
+%global pkg_name dhall-bash
 Name:           %{pkg_name}
 Version:        1.0.6
 Release:        0
 Summary:        Compile Dhall to Bash
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-dhall-devel
 BuildRequires:  ghc-neat-interpolation-devel
 BuildRequires:  ghc-optparse-generic-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-shell-escape-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-format-devel
@@ -51,7 +49,6 @@
 
 The "Dhall.Bash" module also contains instructions for how to use this package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,19 +56,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,14 +84,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/dhall-to-bash
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package diagrams-solve
+# spec file for package diagrams-solve.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name diagrams-solve
 
+%global pkg_name diagrams-solve
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.1
 Release:        0
 Summary:        Pure Haskell solver routines used by diagrams
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 %if %{with tests}
@@ -43,7 +40,6 @@
 finding real roots of low-degree (n < 5) polynomials, and solving tridiagonal
 and cyclic tridiagonal linear systems.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package discrimination
+# spec file for package discrimination.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name discrimination
 
+%global pkg_name discrimination
 Name:           %{pkg_name}
 Version:        0.3
 Release:        0
 Summary:        Fast generic linear-time sorting, joins and container construction
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-contravariant-devel
@@ -37,6 +34,7 @@
 BuildRequires:  ghc-primitive-devel
 BuildRequires:  ghc-profunctors-devel
 BuildRequires:  ghc-promises-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-devel
@@ -53,7 +51,6 @@
 papers> and <https://www.youtube.com/watch?v=sz9ZlZIRDAg talks> by
 <http://www.diku.dk/hjemmesider/ansatte/henglein/ Fritz Henglein>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package dotenv
+# spec file for package dotenv.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name dotenv
 
+%global pkg_name dotenv
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.2.1
 Release:        0
 Summary:        Loads environment variables from dotenv files
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-compat-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-megaparsec-devel
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-yaml-devel
@@ -72,7 +69,6 @@
 See the <https://github.com/stackbuilders/dotenv-hs Github> page for more
 information on this package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -80,19 +76,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -113,7 +107,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 %{_bindir}/%{name}
 %dir %{_datadir}/%{name}-%{version}
@@ -122,11 +116,9 @@
 %{_datadir}/%{name}-%{version}/.scheme.yml
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package dotnet-timespan
+# spec file for package dotnet-timespan.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name dotnet-timespan
 
+%global pkg_name dotnet-timespan
 Name:           %{pkg_name}
 Version:        0.0.1.0
 Release:        0
 Summary:        .NET TimeSpan
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
 %description
 .NET TimeSpan.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -41,19 +38,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -70,15 +65,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package dpor
+# spec file for package dpor.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name dpor
 
+%global pkg_name dpor
 Name:           %{pkg_name}
 Version:        0.2.0.0
 Release:        0
 Summary:        A generic implementation of dynamic partial-order reduction (DPOR) for testing arbitrary models of concurrency
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 
 %description
@@ -63,7 +61,6 @@
 McKinley (2013), available at
 <http://research.microsoft.com/pubs/202164/bpor-oopsla-2013.pdf>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -71,19 +68,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -100,13 +95,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package drawille
+# spec file for package drawille.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name drawille
 
+%global pkg_name drawille
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.2.0
 Release:        0
 Summary:        A port of asciimoo's drawille to haskell
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-hspec-devel
@@ -40,7 +37,6 @@
 %description
 A tiny library for drawing with braille.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package drifter-postgresql
+# spec file for package drifter-postgresql.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name drifter-postgresql
 
+%global pkg_name drifter-postgresql
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.1
 Release:        0
 Summary:        PostgreSQL support for the drifter schema migration tool
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-drifter-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-postgresql-simple-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-devel
@@ -49,7 +46,6 @@
 Support for postgresql-simple Query migrations as well as arbitrary Haskell IO
 functions. Be sure to check the examples dir for a usage example.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,15 +83,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package ede
+# spec file for package ede.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ede
 
+%global pkg_name ede
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.8.7
 Release:        0
 Summary:        Templating language with similar syntax and features to Liquid or Jinja2
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-ansi-wl-pprint-devel
 BuildRequires:  ghc-bifunctors-devel
@@ -43,6 +39,7 @@
 BuildRequires:  ghc-lens-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-parsers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-text-devel
@@ -81,7 +78,6 @@
 unprintable expressions, implicit type coercion, and unbound variable access
 are all treated as errors.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -89,19 +85,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -121,7 +115,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 %dir %{_datadir}/%{name}-%{version}
 %dir %{_datadir}/%{name}-%{version}/test
@@ -130,11 +124,9 @@
 %{_datadir}/%{name}-%{version}/test/resources/*.golden
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package ekg-cloudwatch
+# spec file for package ekg-cloudwatch.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ekg-cloudwatch
 
+%global pkg_name ekg-cloudwatch
 Name:           %{pkg_name}
 Version:        0.0.1.6
 Release:        0
 Summary:        An ekg backend for Amazon Cloudwatch
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-amazonka-cloudwatch-devel
 BuildRequires:  ghc-amazonka-core-devel
 BuildRequires:  ghc-amazonka-devel
@@ -36,6 +33,7 @@
 BuildRequires:  ghc-ekg-core-devel
 BuildRequires:  ghc-lens-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
@@ -44,7 +42,6 @@
 %description
 Push ekg metrics to Amazon Cloudwatch.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,15 +76,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package emailaddress
+# spec file for package emailaddress.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name emailaddress
 
+%global pkg_name emailaddress
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.0
 Release:        0
 Summary:        Wrapper around email-validate library adding instances for common type classes
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bifunctors-devel
 BuildRequires:  ghc-bytestring-devel
@@ -42,6 +38,7 @@
 BuildRequires:  ghc-postgresql-simple-devel
 BuildRequires:  ghc-product-profunctors-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-Glob-devel
@@ -51,7 +48,6 @@
 %description
 Wrapper around email-validate library adding instances for common type classes.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,19 +55,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package envelope
+# spec file for package envelope.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name envelope
 
+%global pkg_name envelope
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.2.0
 Release:        0
 Summary:        Defines generic 'Envelope' type to wrap reponses from a JSON API
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-http-api-data-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-Glob-devel
@@ -43,7 +40,6 @@
 %description
 Defines generic 'Envelope' type to wrap reponses from a JSON API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package eventful-sqlite
+# spec file for package eventful-sqlite.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name eventful-sqlite
 
+%global pkg_name eventful-sqlite
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0
 Release:        0
 Summary:        SQLite implementations for eventful
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-eventful-core-devel
 BuildRequires:  ghc-eventful-sql-common-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-persistent-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-uuid-devel
 %if %{with tests}
@@ -49,7 +46,6 @@
 %description
 SQLite implementations for eventful.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,15 +83,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE.md
+%license LICENSE.md
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE.md
+%license LICENSE.md
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package exact-pi
+# spec file for package exact-pi.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name exact-pi
 
+%global pkg_name exact-pi
 Name:           %{pkg_name}
 Version:        0.4.1.2
 Release:        0
 Summary:        Exact rational multiples of pi (and integer powers of pi)
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-numtype-dk-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Provides an exact representation for rational multiples of pi alongside an
 approximate representation of all reals. Useful for storing and computing with
 conversion factors between physical units.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,15 +68,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package expiring-cache-map
+# spec file for package expiring-cache-map.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name expiring-cache-map
 
+%global pkg_name expiring-cache-map
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.6.1
 Release:        0
 Summary:        General purpose simple caching
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-unordered-containers-devel
 %if %{with tests}
 BuildRequires:  ghc-bytestring-devel
@@ -45,7 +42,6 @@
 With variations for Ord and Hashable keys using "Data.Map.Strict" and
 "Data.HashMap.Strict", respectively.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package explicit-exception
+# spec file for package explicit-exception.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name explicit-exception
 
+%global pkg_name explicit-exception
 Name:           %{pkg_name}
 Version:        0.1.9
 Release:        0
 Summary:        Exceptions which are explicit in the type signature
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 
 %description
@@ -53,7 +51,6 @@
 
 See also: 'unexceptionalio'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,13 +85,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package fdo-notify
+# spec file for package fdo-notify.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name fdo-notify
 
+%global pkg_name fdo-notify
 Name:           %{pkg_name}
 Version:        0.3.1
 Release:        0
 Summary:        Desktop Notifications client
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-dbus-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 A library for issuing notifications using FreeDesktop.org's Desktop
 Notifications protcol. This protocol is supported by services such as Ubuntu's
 NotifyOSD.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,15 +69,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc examples
 
 %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,5 +1,5 @@
 #
-# spec file for package fgl
+# spec file for package fgl.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name fgl
 
+%global pkg_name fgl
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        5.5.4.0
 Release:        0
 Summary:        Martin Erwig's Functional Graph Library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -46,7 +43,6 @@
 Original website can be found at
 <http://web.engr.oregonstate.edu/~erwig/fgl/haskell>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -54,19 +50,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -86,15 +80,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog
 
 %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,5 +1,5 @@
 #
-# spec file for package file-modules
+# spec file for package file-modules.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name file-modules
 
+%global pkg_name file-modules
 Name:           %{pkg_name}
 Version:        0.1.2.4
 Release:        0
 Summary:        Takes a Haskell source-code file and outputs its modules
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-MissingH-devel
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-directory-devel
@@ -36,12 +33,12 @@
 BuildRequires:  ghc-haskell-src-exts-devel
 BuildRequires:  ghc-regex-compat-devel
 BuildRequires:  ghc-regex-pcre-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Uses 'haskell-src-exts' to parse module imports and follows links . to local
 modules in order to build a list of module dependencies.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -78,14 +73,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package fingertree
+# spec file for package fingertree.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name fingertree
 
+%global pkg_name fingertree
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.3.1
 Release:        0
 Summary:        Generic finger-tree structure, with example instances
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 %if %{with tests}
@@ -51,7 +48,6 @@
 For a tuned sequence type, see 'Data.Sequence' in the 'containers' package,
 which is a specialization of this structure.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,19 +55,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc changelog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog
 
 %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,5 +1,5 @@
 #
-# spec file for package fixed-vector
+# spec file for package fixed-vector.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name fixed-vector
 
+%global pkg_name fixed-vector
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.0.0
 Release:        0
 Summary:        Generic vectors with statically known size
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
 BuildRequires:  ghc-filemanip-devel
@@ -72,7 +69,6 @@
 
 * Data.Vector.Fixed.Primitive Unboxed vectors based on pritimive package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -80,19 +76,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -112,15 +106,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package fixed
+# spec file for package fixed.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name fixed
 
+%global pkg_name fixed
 Name:           %{pkg_name}
 Version:        0.2.1.1
 Release:        0
 Summary:        Signed 15.16 precision fixed point arithmetic
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
 %description
 Signed 15.16 precision fixed point arithmetic.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -41,19 +38,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -70,15 +65,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package foundation
+# spec file for package foundation.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name foundation
 
+%global pkg_name foundation
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.17
 Release:        0
 Summary:        Alternative prelude with batteries and no dependencies
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-basement-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 A custom prelude with no dependencies apart from base.
@@ -54,7 +51,6 @@
 
 * Usual partial functions distinguished through type system.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -62,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -94,15 +88,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package frisby
+# spec file for package frisby.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name frisby
 
+%global pkg_name frisby
 Name:           %{pkg_name}
 Version:        0.2.2
 Release:        0
 Summary:        Linear time composable parser for PEG grammars
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 
 %description
@@ -47,7 +45,6 @@
 In addition to many standard combinators, frisby provides routines to translate
 standard regex syntax into frisby parsers.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc Changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc Changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package funcmp
+# spec file for package funcmp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name funcmp
 
+%global pkg_name funcmp
 Name:           %{pkg_name}
 Version:        1.8
 Release:        0
 Summary:        Functional MetaPost
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Functional MetaPost is a Haskell frontend to the MetaPost language by John
@@ -55,7 +53,6 @@
 English at
 <http://download.savannah.nongnu.org/releases/funcmp/Tutorial_eng.ps>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +60,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -92,7 +87,7 @@
 %ghc_pkg_recache
 
 %files
-%doc COPYING
+%license COPYING
 %dir %{_datadir}/%{name}-%{version}
 %dir %{_datadir}/%{name}-%{version}/doc
 %dir %{_datadir}/%{name}-%{version}/texmf
@@ -110,10 +105,8 @@
 %{_datadir}/%{name}-%{version}/texmf/fmp8.mf
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc COPYING
+%license COPYING
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package functor-classes-compat
+# spec file for package functor-classes-compat.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name functor-classes-compat
 
+%global pkg_name functor-classes-compat
 Name:           %{pkg_name}
 Version:        1
 Release:        0
 Summary:        Data.Functor.Classes instances for core packages
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vector-devel
 
@@ -43,7 +41,6 @@
 
 * unordered-containers.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,20 +48,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -81,15 +76,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package general-games
+# spec file for package general-games.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name general-games
 
+%global pkg_name general-games
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.5
 Release:        0
 Summary:        Library supporting simulation of a number of games
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-MonadRandom-devel
 BuildRequires:  ghc-monad-loops-devel
 BuildRequires:  ghc-random-devel
 BuildRequires:  ghc-random-shuffle-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-hspec-devel
@@ -44,7 +41,6 @@
 Library providing framework for simulating outcomes of a variety of games,
 including Poker.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,15 +78,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package generic-lens
+# spec file for package generic-lens.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name generic-lens
 
+%global pkg_name generic-lens
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.1.0
 Release:        0
 Summary:        Generic data-structure operations exposed as lenses
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
@@ -45,7 +42,6 @@
 relationship between records and positional indexing into arbitrary product
 types.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package genvalidity-aeson
+# spec file for package genvalidity-aeson.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name genvalidity-aeson
 
+%global pkg_name genvalidity-aeson
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.0
 Release:        0
 Summary:        GenValidity support for aeson
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-genvalidity-devel
@@ -38,6 +34,7 @@
 BuildRequires:  ghc-genvalidity-text-devel
 BuildRequires:  ghc-genvalidity-unordered-containers-devel
 BuildRequires:  ghc-genvalidity-vector-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-validity-aeson-devel
 BuildRequires:  ghc-validity-devel
 %if %{with tests}
@@ -48,7 +45,6 @@
 %description
 GenValidity support for aeson.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,13 +82,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package genvalidity-hspec-aeson
+# spec file for package genvalidity-hspec-aeson.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name genvalidity-hspec-aeson
 
+%global pkg_name genvalidity-hspec-aeson
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.1
 Release:        0
 Summary:        Standard spec's for aeson-related instances
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
@@ -38,6 +34,7 @@
 BuildRequires:  ghc-genvalidity-devel
 BuildRequires:  ghc-genvalidity-hspec-devel
 BuildRequires:  ghc-hspec-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
 BuildRequires:  ghc-genvalidity-aeson-devel
@@ -48,7 +45,6 @@
 %description
 Standard spec's for aeson-related Instances.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,20 +52,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -89,13 +83,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package genvalidity-hspec-binary
+# spec file for package genvalidity-hspec-binary.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name genvalidity-hspec-binary
 
+%global pkg_name genvalidity-hspec-binary
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.0
 Release:        0
 Summary:        Standard spec's for binary-related Instances
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-genvalidity-devel
 BuildRequires:  ghc-genvalidity-hspec-devel
 BuildRequires:  ghc-hspec-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
 %endif
@@ -45,7 +42,6 @@
 Standard spec's for cereal-related Instances, see
 https://hackage.haskell.org/package/binary.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,20 +49,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -86,15 +80,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package genvalidity-scientific
+# spec file for package genvalidity-scientific.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name genvalidity-scientific
 
+%global pkg_name genvalidity-scientific
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.0
 Release:        0
 Summary:        GenValidity support for Scientific
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-genvalidity-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-validity-devel
 BuildRequires:  ghc-validity-scientific-devel
@@ -44,7 +41,6 @@
 %description
 GenValidity support for Scientific.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,20 +48,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -85,13 +79,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package genvalidity-uuid
+# spec file for package genvalidity-uuid.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name genvalidity-uuid
 
+%global pkg_name genvalidity-uuid
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.0.0
 Release:        0
 Summary:        GenValidity support for UUID
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-genvalidity-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-uuid-devel
 BuildRequires:  ghc-validity-devel
 BuildRequires:  ghc-validity-uuid-devel
@@ -44,7 +41,6 @@
 %description
 GenValidity support for UUID.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package ghc-syb-utils
+# spec file for package ghc-syb-utils.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ghc-syb-utils
 
+%global pkg_name ghc-syb-utils
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.3.3
 Release:        0
 Summary:        Scrap Your Boilerplate utilities for the GHC API
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-ghc-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
@@ -42,7 +39,6 @@
 %description
 Scrap Your Boilerplate utilities for the GHC API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,13 +76,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package ghcid
+# spec file for package ghcid.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ghcid
 
+%global pkg_name ghcid
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.6.8
 Release:        0
 Summary:        GHCi based bare bones IDE
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-ansi-terminal-devel
 BuildRequires:  ghc-cmdargs-devel
 BuildRequires:  ghc-containers-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-fsnotify-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-terminal-size-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-unix-devel
@@ -55,7 +52,6 @@
 command to start GHCi on your project (defaults to 'ghci' if you have a '.ghci'
 file, or else to 'cabal repl').
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +59,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -95,16 +89,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.txt README.md
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.txt README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package giphy-api
+# spec file for package giphy-api.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name giphy-api
 
+%global pkg_name giphy-api
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.2.0
 Release:        0
 Summary:        Giphy HTTP API wrapper and CLI search tool
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-http-api-data-devel
@@ -40,6 +36,7 @@
 BuildRequires:  ghc-microlens-th-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-network-uri-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-servant-client-devel
 BuildRequires:  ghc-servant-devel
 BuildRequires:  ghc-text-devel
@@ -55,7 +52,6 @@
 %description
 Giphy HTTP API wrapper and CLI search tool.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +59,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -95,15 +89,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package github
+# spec file for package github.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name github
 
+%global pkg_name github
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.18
 Release:        0
 Summary:        Access to the GitHub API, v3
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-compat-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-base-compat-devel
@@ -52,6 +48,7 @@
 BuildRequires:  ghc-iso8601-time-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-network-uri-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
@@ -80,7 +77,6 @@
 For more of an overview please see the README:
 <https://github.com/phadej/github/blob/master/README.md>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -88,19 +84,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -120,15 +114,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gl
+# spec file for package gl.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,33 +15,30 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gl
 
+%global pkg_name gl
 Name:           %{pkg_name}
 Version:        0.8.0
 Release:        0
 Summary:        Complete OpenGL raw bindings
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  Mesa-libGL-devel
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-fixed-devel
 BuildRequires:  ghc-half-devel
 BuildRequires:  ghc-hxt-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 
 %description
 Complete OpenGL raw bindings.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,20 +46,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+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}
-Requires:       ghc-%{name} = %{version}-%{release}
-Requires:       Mesa-libGL-devel
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -79,15 +74,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown TODO.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown TODO.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-adexchange-buyer
+# spec file for package gogol-adexchange-buyer.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-adexchange-buyer
 
+%global pkg_name gogol-adexchange-buyer
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Ad Exchange Buyer SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Accesses your bidding-account information, submits creatives for validation,
@@ -40,7 +38,6 @@
 
 This library is compatible with version 'v1.4' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,20 +45,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -78,15 +73,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-admin-emailmigration
+# spec file for package gogol-admin-emailmigration.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-admin-emailmigration
 
+%global pkg_name gogol-admin-emailmigration
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Email Migration API v2 SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Email Migration API lets you migrate emails of users to Google backends.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'email_migration_v2' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,20 +44,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library
 development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-affiliates
+# spec file for package gogol-affiliates.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-affiliates
 
+%global pkg_name gogol-affiliates
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Affiliate Network SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Lets you have programmatic access to your Google Affiliate Network data.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v1beta1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-apps-tasks
+# spec file for package gogol-apps-tasks.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-apps-tasks
 
+%global pkg_name gogol-apps-tasks
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Tasks SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Lets you manage your tasks and task lists.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-appstate
+# spec file for package gogol-appstate.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-appstate
 
+%global pkg_name gogol-appstate
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google App State SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 The Google App State API.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-blogger
+# spec file for package gogol-blogger.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-blogger
 
+%global pkg_name gogol-blogger
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Blogger SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 API for access to the data within Blogger.
@@ -43,7 +41,6 @@
 
 * Limited Availability.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,15 +75,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-datastore
+# spec file for package gogol-datastore.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-datastore
 
+%global pkg_name gogol-datastore
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Cloud Datastore SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Accesses the schemaless NoSQL database to provide fully managed, robust,
@@ -40,7 +38,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-dfareporting
+# spec file for package gogol-dfareporting.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-dfareporting
 
+%global pkg_name gogol-dfareporting
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google DCM/DFA Reporting And Trafficking SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Manages your DoubleClick Campaign Manager ad campaigns and reports.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v2.7' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-firebase-rules
+# spec file for package gogol-firebase-rules.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-firebase-rules
 
+%global pkg_name gogol-firebase-rules
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Firebase Rules SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Creates and manages rules that determine when a Firebase Rules-enabled service
@@ -40,7 +38,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,20 +45,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -78,15 +73,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-gmail
+# spec file for package gogol-gmail.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-gmail
 
+%global pkg_name gogol-gmail
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Gmail SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Access Gmail mailboxes including sending user email.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-kgsearch
+# spec file for package gogol-kgsearch.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-kgsearch
 
+%global pkg_name gogol-kgsearch
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Knowledge Graph Search SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Searches the Google Knowledge Graph for entities.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-maps-engine
+# spec file for package gogol-maps-engine.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-maps-engine
 
+%global pkg_name gogol-maps-engine
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Maps Engine SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 The Google Maps Engine API allows developers to store and query geospatial
@@ -40,7 +38,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-plus
+# spec file for package gogol-plus.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-plus
 
+%global pkg_name gogol-plus
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google + SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Builds on top of the Google+ platform.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v1' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-resourceviews
+# spec file for package gogol-resourceviews.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-resourceviews
 
+%global pkg_name gogol-resourceviews
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Compute Engine Instance Groups SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 The Resource View API allows users to create and manage logical sets of Google
@@ -44,7 +42,6 @@
 
 * Limited Availability.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,20 +49,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -82,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-translate
+# spec file for package gogol-translate.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-translate
 
+%global pkg_name gogol-translate
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Translate SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Translates text from one language to another.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v2' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-webmaster-tools
+# spec file for package gogol-webmaster-tools.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-webmaster-tools
 
+%global pkg_name gogol-webmaster-tools
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google Search Console SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 View Google Search Console data for your verified sites.
@@ -39,7 +37,6 @@
 
 This library is compatible with version 'v3' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,20 +44,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package gogol-youtube
+# spec file for package gogol-youtube.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gogol-youtube
 
+%global pkg_name gogol-youtube
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Google YouTube Data SDK
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-gogol-core-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Supports core YouTube features, such as uploading videos, creating and managing
@@ -40,7 +38,6 @@
 
 This library is compatible with version 'v3' of the API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package groundhog-mysql
+# spec file for package groundhog-mysql.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name groundhog-mysql
 
+%global pkg_name groundhog-mysql
 Name:           %{pkg_name}
 Version:        0.8
 Release:        0
 Summary:        MySQL backend for the groundhog library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-groundhog-devel
@@ -38,6 +35,7 @@
 BuildRequires:  ghc-mysql-simple-devel
 BuildRequires:  ghc-resource-pool-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-transformers-devel
@@ -45,7 +43,6 @@
 %description
 This package uses mysql-simple and mysql.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +50,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc changelog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog
 
 %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,5 +1,5 @@
 #
-# spec file for package gsasl
+# spec file for package gsasl.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name gsasl
 
+%global pkg_name gsasl
 Name:           %{pkg_name}
 Version:        0.3.6
 Release:        0
 Summary:        Bindings for GNU libgsasl
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
+BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(libgsasl)
 
 %description
 Bindings for GNU libgsasl.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,21 +42,19 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
-Requires:       ghc-compiler = %{ghc_version}
-Requires(post): ghc-compiler = %{ghc_version}
-Requires(postun): ghc-compiler = %{ghc_version}
 Requires:       ghc-%{name} = %{version}-%{release}
+Requires:       ghc-compiler = %{ghc_version}
 Requires:       pkgconfig
 Requires:       pkgconfig(libgsasl)
+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.
 
-
 %prep
 %setup -q
 
@@ -75,13 +71,11 @@
 %ghc_pkg_recache
 
 %files
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hOpenPGP
+# spec file for package hOpenPGP.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hOpenPGP
 
+%global pkg_name hOpenPGP
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        2.5.5
 Release:        0
 Summary:        Native Haskell implementation of OpenPGP (RFC4880)
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base16-bytestring-devel
@@ -60,6 +56,7 @@
 BuildRequires:  ghc-newtype-devel
 BuildRequires:  ghc-openpgp-asciiarmor-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-securemem-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-split-devel
@@ -81,7 +78,6 @@
 %description
 Native Haskell implementation of OpenPGP (RFC4880), plus Camellia (RFC5581).
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -89,19 +85,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -121,13 +115,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hPDB-examples
+# spec file for package hPDB-examples.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%bcond_with tests
 
+%bcond_with tests
 Name:           hPDB-examples
 Version:        1.2.0.8
 Release:        0
 Summary:        Examples for hPDB library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-AC-Vector-devel
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-GLUT-devel
 BuildRequires:  ghc-Octree-devel
 BuildRequires:  ghc-OpenGL-devel
@@ -41,6 +38,7 @@
 BuildRequires:  ghc-hPDB-devel
 BuildRequires:  ghc-iterable-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-format-devel
@@ -54,7 +52,6 @@
 %description
 Examples for handling Protein Data Bank file format.
 
-
 %prep
 %setup -q
 
@@ -68,7 +65,7 @@
 %cabal_test
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc AUTHORS README.md
 %{_bindir}/CanonicalAxes
 %{_bindir}/CleanPDB
diff --git a/test/golden-test-cases/haddock-library.cabal b/test/golden-test-cases/haddock-library.cabal
new file mode 100644
--- /dev/null
+++ b/test/golden-test-cases/haddock-library.cabal
@@ -0,0 +1,156 @@
+cabal-version:        2.0
+name:                 haddock-library
+version:              1.5.0.1
+synopsis:             Library exposing some functionality of Haddock.
+description:          Haddock is a documentation-generation tool for Haskell
+                      libraries. These modules expose some functionality of it
+                      without pulling in the GHC dependency. Please note that the
+                      API is likely to change so specify upper bounds in your
+                      project if you can't release often. For interacting with Haddock
+                      itself, see the ‘haddock’ package.
+license:              BSD3
+license-files:        LICENSE
+                      vendor/attoparsec-0.13.1.0/LICENSE
+maintainer:           Alex Biehl <alexbiehl@gmail.com>, Simon Hengel <sol@typeful.net>, Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
+homepage:             http://www.haskell.org/haddock/
+bug-reports:          https://github.com/haskell/haddock/issues
+category:             Documentation
+build-type:           Simple
+extra-source-files:
+  CHANGES.md
+
+library
+  default-language:     Haskell2010
+
+  build-depends:
+      base         >= 4.5     && < 4.12
+    , bytestring   >= 0.9.2.1 && < 0.11
+    , containers   >= 0.4.2.1 && < 0.6
+    , transformers >= 0.3.0   && < 0.6
+
+  -- internal sub-lib
+  build-depends:        attoparsec
+
+  hs-source-dirs:       src
+  ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs -O2
+
+  exposed-modules:
+    Documentation.Haddock.Doc
+    Documentation.Haddock.Markup
+    Documentation.Haddock.Parser
+    Documentation.Haddock.Parser.Monad
+    Documentation.Haddock.Types
+    Documentation.Haddock.Utf8
+
+  other-modules:
+    Documentation.Haddock.Parser.Util
+
+  ghc-options: -Wall
+  if impl(ghc >= 8.0)
+    ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
+
+library attoparsec
+  default-language:     Haskell2010
+
+  build-depends:
+      base         >= 4.5     && < 4.12
+    , bytestring   >= 0.9.2.1 && < 0.11
+    , deepseq      >= 1.3     && < 1.5
+
+  hs-source-dirs:       vendor/attoparsec-0.13.1.0
+
+  -- NB: haddock-library needs only small part of lib:attoparsec
+  --     internally, so we only bundle that subset here
+  exposed-modules:
+    Data.Attoparsec.ByteString
+    Data.Attoparsec.ByteString.Char8
+    Data.Attoparsec.Combinator
+
+  other-modules:
+    Data.Attoparsec
+    Data.Attoparsec.ByteString.Buffer
+    Data.Attoparsec.ByteString.FastSet
+    Data.Attoparsec.ByteString.Internal
+    Data.Attoparsec.Internal
+    Data.Attoparsec.Internal.Fhthagn
+    Data.Attoparsec.Internal.Types
+    Data.Attoparsec.Number
+
+  ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs -O2
+
+  ghc-options: -Wall
+  if impl(ghc >= 8.0)
+    ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
+  else
+    build-depends: semigroups ^>= 0.18.3, fail ^>= 4.9.0.0
+
+
+test-suite spec
+  type:             exitcode-stdio-1.0
+  default-language: Haskell2010
+  main-is:          Spec.hs
+  hs-source-dirs:
+      test
+    , src
+  ghc-options: -Wall
+
+  cpp-options:
+      -DTEST
+
+  other-modules:
+      Documentation.Haddock.Doc
+      Documentation.Haddock.Parser
+      Documentation.Haddock.Parser.Monad
+      Documentation.Haddock.Parser.Util
+      Documentation.Haddock.Parser.UtilSpec
+      Documentation.Haddock.ParserSpec
+      Documentation.Haddock.Types
+      Documentation.Haddock.Utf8
+      Documentation.Haddock.Utf8Spec
+
+  build-depends:
+      base-compat   ^>= 0.9.3
+    , containers   >= 0.4.2.1 && < 0.6
+    , transformers   >= 0.3.0   && < 0.6
+    , hspec         ^>= 2.4.4
+    , QuickCheck    ^>= 2.11
+
+  -- internal sub-lib
+  build-depends: attoparsec
+
+  -- Versions for the dependencies below are transitively pinned by
+  -- dependency on haddock-library:lib:attoparsec
+  build-depends:
+      base
+    , bytestring
+    , deepseq
+
+  build-tool-depends:
+    hspec-discover:hspec-discover ^>= 2.4.4
+
+test-suite fixtures
+  type:             exitcode-stdio-1.0
+  default-language: Haskell2010
+  main-is:          Fixtures.hs
+  ghc-options:      -Wall
+  hs-source-dirs:   fixtures
+  build-depends:
+      base-compat           ^>= 0.9.3
+    , directory             ^>= 1.3.0.2
+    , filepath              ^>= 1.4.1.2
+    , optparse-applicative  ^>= 0.14.0.0
+    , tree-diff             ^>= 0.0.0.1
+
+  -- Depend on the library.
+  build-depends:
+    haddock-library
+
+  -- Versions for the dependencies below are transitively pinned by
+  -- dependency on haddock-library:lib:attoparsec
+  build-depends:
+      base
+
+source-repository head
+  type:     git
+  subdir:   haddock-library
+  location: https://github.com/haskell/haddock.git
diff --git a/test/golden-test-cases/haddock-library.spec.golden b/test/golden-test-cases/haddock-library.spec.golden
new file mode 100644
--- /dev/null
+++ b/test/golden-test-cases/haddock-library.spec.golden
@@ -0,0 +1,102 @@
+#
+# spec file for package haddock-library.spec
+#
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+%global pkg_name haddock-library
+%global has_internal_sub_libraries 1
+
+%bcond_with tests
+Name:           %{pkg_name}
+Version:        1.5.0.1
+Release:        0
+Summary:        Library exposing some functionality of Haddock
+License:        BSD-3-Clause
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
+Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
+BuildRequires:  ghc-Cabal-devel
+BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-transformers-devel
+%if %{with tests}
+BuildRequires:  ghc-QuickCheck-devel
+BuildRequires:  ghc-base-compat-devel
+BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-filepath-devel
+BuildRequires:  ghc-hspec-devel
+BuildRequires:  ghc-optparse-applicative-devel
+BuildRequires:  ghc-tree-diff-devel
+%endif
+
+%description
+Haddock is a documentation-generation tool for Haskell libraries.
+These modules expose some functionality of it without pulling in the GHC
+dependency. Please note that the API is likely to change so specify upper
+bounds in your project if you can't release often. For interacting with Haddock
+itself, see the ‘haddock’ package.
+
+%package -n ghc-%{name}
+Summary:        Haskell %{name} library
+Group:          System/Libraries
+
+%description -n ghc-%{name}
+This package provides the Haskell %{name} shared library.
+
+%package -n ghc-%{name}-devel
+Summary:        Haskell %{name} library development files
+Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
+Requires:       ghc-compiler = %{ghc_version}
+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.
+
+%prep
+%setup -q
+
+%build
+%ghc_lib_build_without_haddock
+
+%install
+%ghc_lib_install
+
+%check
+%cabal_test
+
+%post -n ghc-%{name}-devel
+%ghc_pkg_recache
+
+%postun -n ghc-%{name}-devel
+%ghc_pkg_recache
+
+%files
+%license LICENSE
+%license vendor/attoparsec-0.13.1.0/LICENSE
+%doc CHANGES.md
+
+%files -n ghc-%{name} -f ghc-%{name}.files
+%license LICENSE
+%license vendor/attoparsec-0.13.1.0/LICENSE
+
+%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
+%doc CHANGES.md
+
+%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,5 +1,5 @@
 #
-# spec file for package hakyll
+# spec file for package hakyll.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hakyll
 
+%global pkg_name hakyll
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        4.10.0.0
 Release:        0
 Summary:        A static website compiler library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-blaze-html-devel
 BuildRequires:  ghc-blaze-markup-devel
@@ -58,6 +54,7 @@
 BuildRequires:  ghc-regex-base-devel
 BuildRequires:  ghc-regex-tdfa-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-system-filepath-devel
 BuildRequires:  ghc-tagsoup-devel
@@ -94,7 +91,6 @@
 Additionally, there's the Haddock documentation in the different modules, meant
 as a reference.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -102,19 +98,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -135,7 +129,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 %{_bindir}/hakyll-init
 %dir %{_datadir}/%{name}-%{version}
@@ -165,11 +159,9 @@
 %{_datadir}/%{name}-%{version}/templates/rss.xml
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package happstack-hsp
+# spec file for package happstack-hsp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name happstack-hsp
 
+%global pkg_name happstack-hsp
 Name:           %{pkg_name}
 Version:        7.3.7.3
 Release:        0
 Summary:        Support for using HSP templates in Happstack
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-happstack-server-devel
 BuildRequires:  ghc-harp-devel
 BuildRequires:  ghc-hsp-devel
 BuildRequires:  ghc-hsx2hs-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-utf8-string-devel
@@ -43,7 +41,6 @@
 Happstack is a web application framework. HSP is an XML templating solution.
 This package makes it easy to use HSP templates with Happstack.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,13 +75,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package happy
+# spec file for package happy.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%bcond_with tests
 
+%bcond_with tests
 Name:           happy
 Version:        1.19.8
 Release:        0
 Summary:        Happy is a parser generator for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-process-devel
 %endif
@@ -43,7 +41,6 @@
 Happy generates Haskell code to parse the grammar. Happy works in a similar way
 to the 'yacc' tool for C.
 
-
 %prep
 %setup -q
 
@@ -57,7 +54,7 @@
 %cabal_test
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES README.md TODO doc examples
 %{_bindir}/%{name}
 
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,5 +1,5 @@
 #
-# spec file for package harp
+# spec file for package harp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name harp
 
+%global pkg_name harp
 Name:           %{pkg_name}
 Version:        0.4.3
 Release:        0
 Summary:        HaRP allows pattern-matching with regular expressions
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -40,7 +38,6 @@
 
 For details on usage, please see the website.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,13 +72,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hashtables
+# spec file for package hashtables.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hashtables
 
+%global pkg_name hashtables
 Name:           %{pkg_name}
 Version:        1.2.2.1
 Release:        0
 Summary:        Mutable hash tables in the ST monad
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
 
 %description
@@ -107,7 +105,6 @@
 Please send bug reports to
 <https://github.com/gregorycollins/hashtables/issues>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -115,19 +112,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -144,15 +139,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package haskell-tools-debug
+# spec file for package haskell-tools-debug.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name haskell-tools-debug
 
+%global pkg_name haskell-tools-debug
 Name:           %{pkg_name}
 Version:        1.0.0.3
 Release:        0
 Summary:        Debugging Tools for Haskell-tools
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-ghc-devel
 BuildRequires:  ghc-ghc-paths-devel
@@ -39,13 +36,13 @@
 BuildRequires:  ghc-haskell-tools-prettyprint-devel
 BuildRequires:  ghc-haskell-tools-refactor-devel
 BuildRequires:  ghc-references-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-template-haskell-devel
 
 %description
 Debugging Tools for Haskell-tools.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,20 +50,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -84,14 +79,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/ht-debug
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package haskell-tools-rewrite
+# spec file for package haskell-tools-rewrite.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name haskell-tools-rewrite
 
+%global pkg_name haskell-tools-rewrite
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.0.3
 Release:        0
 Summary:        Facilities for generating new parts of the Haskell-Tools AST
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-ghc-devel
 BuildRequires:  ghc-haskell-tools-ast-devel
 BuildRequires:  ghc-haskell-tools-prettyprint-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-references-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-filepath-devel
@@ -51,7 +48,6 @@
 language elements can the given module generate. This packages should be used
 during the transformations to generate parts of the new AST.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,20 +55,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -92,13 +86,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hasql
+# spec file for package hasql.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hasql
 
+%global pkg_name hasql
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.1.1
 Release:        0
 Summary:        An efficient PostgreSQL driver and a flexible mapping API
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base-prelude-devel
 BuildRequires:  ghc-bytestring-devel
@@ -47,6 +43,7 @@
 BuildRequires:  ghc-postgresql-binary-devel
 BuildRequires:  ghc-postgresql-libpq-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
@@ -70,7 +67,6 @@
 
 The version 1 is completely backward-compatible with 0.19.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -78,19 +74,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -110,13 +104,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hformat
+# spec file for package hformat.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hformat
 
+%global pkg_name hformat
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.1.0
 Release:        0
 Summary:        Simple Haskell formatting
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-ansi-terminal-devel
 BuildRequires:  ghc-base-unicode-symbols-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
@@ -41,7 +38,6 @@
 %description
 String formatting.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,13 +75,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package highlighting-kate
+# spec file for package highlighting-kate.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name highlighting-kate
 
+%global pkg_name highlighting-kate
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.6.4
 Release:        0
 Summary:        Syntax highlighting
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-blaze-html-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-parsec-devel
 BuildRequires:  ghc-regex-pcre-builtin-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-utf8-string-devel
 %if %{with tests}
 BuildRequires:  ghc-Diff-devel
@@ -52,7 +49,6 @@
 utility for generating new parsers from Kate XML syntax descriptions.
 __This library has been deprecated. Please use skylighting instead.__.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -60,19 +56,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -92,15 +86,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog
 
 %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,5 +1,5 @@
 #
-# spec file for package hit
+# spec file for package hit.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hit
 
+%global pkg_name hit
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.6.3
 Release:        0
 Summary:        Git operations in haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-byteable-devel
 BuildRequires:  ghc-bytestring-devel
@@ -41,6 +37,7 @@
 BuildRequires:  ghc-parsec-devel
 BuildRequires:  ghc-patience-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-system-fileio-devel
 BuildRequires:  ghc-system-filepath-devel
 BuildRequires:  ghc-unix-compat-devel
@@ -64,7 +61,6 @@
 directory), and doesn't do anything with the index or your working directory
 files. .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -72,19 +68,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -104,15 +98,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %dir %{_datadir}/%{name}-%{version}
 %{_datadir}/%{name}-%{version}/README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hjson
+# spec file for package hjson.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hjson
 
+%global pkg_name hjson
 Name:           %{pkg_name}
 Version:        1.3.2
 Release:        0
 Summary:        JSON parsing library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 JSON parsing library with simple and sane API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,13 +67,11 @@
 %ghc_pkg_recache
 
 %files
-%doc COPYING
+%license COPYING
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc COPYING
+%license COPYING
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hmpfr
+# spec file for package hmpfr.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hmpfr
 
+%global pkg_name hmpfr
 Name:           %{pkg_name}
 Version:        0.4.3
 Release:        0
 Summary:        Haskell binding to the MPFR library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  mpfr-devel
@@ -39,7 +37,6 @@
 
 Some simple examples of usage can be found in demo/Demo.hs.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,20 +44,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
+Requires:       mpfr-devel
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
-Requires:       mpfr-devel
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,17 +72,15 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %dir %{_datadir}/%{name}-%{version}
 %{_datadir}/%{name}-%{version}/ChangeLog
 %{_datadir}/%{name}-%{version}/README.md
 %{_datadir}/%{name}-%{version}/dict.txt
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hoogle
+# spec file for package hoogle.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hoogle
 
+%global pkg_name hoogle
 Name:           %{pkg_name}
 Version:        5.0.14
 Release:        0
 Summary:        Haskell API Search
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-binary-devel
@@ -55,6 +52,7 @@
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-process-extras-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-storable-tuple-devel
 BuildRequires:  ghc-tar-devel
 BuildRequires:  ghc-template-haskell-devel
@@ -74,7 +72,6 @@
 Hoogle is a Haskell API search engine, which allows you to search many standard
 Haskell libraries by either function name, or by approximate type signature.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -82,19 +79,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -112,7 +107,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.txt README.md
 %{_bindir}/%{name}
 %dir %{_datadir}/%{name}-%{version}
@@ -130,11 +125,9 @@
 %{_datadir}/%{name}-%{version}/misc/settings.txt
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.txt README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package hostname-validate
+# spec file for package hostname-validate.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hostname-validate
 
+%global pkg_name hostname-validate
 Name:           %{pkg_name}
 Version:        1.0.0
 Release:        0
 Summary:        Validate hostnames e.g. localhost or foo.co.uk
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Validate hostnames e.g. localhost or foo.co.uk. See also RFC 1123, RFC 952, and
 RFC 1035.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,13 +68,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hsinstall
+# spec file for package hsinstall.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hsinstall
 
+%global pkg_name hsinstall
 Name:           %{pkg_name}
 Version:        1.6
 Release:        0
 Summary:        Install Haskell software
-Group:          Development/Libraries/Haskell
-
 License:        ISC
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-filepath-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 This is a utility to install Haskell programs on a system using stack.
@@ -40,7 +38,6 @@
 the resources directory if it finds one. There is also an optional library
 component to assist with locating installed data files at runtime.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -78,7 +73,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md doc
 %{_bindir}/an-app
 %dir %{_datadir}/%{name}-%{version}
@@ -86,11 +81,9 @@
 %{_datadir}/%{name}-%{version}/resources/foo
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md doc
 
 %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,5 +1,5 @@
 #
-# spec file for package hstatsd
+# spec file for package hstatsd.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hstatsd
 
+%global pkg_name hstatsd
 Name:           %{pkg_name}
 Version:        0.1
 Release:        0
 Summary:        Quick and dirty statsd interface
-Group:          Development/Libraries/Haskell
-
 License:        SUSE-Public-Domain
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
 Quick and dirty statsd interface.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,9 +71,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hsx-jmacro
+# spec file for package hsx-jmacro.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hsx-jmacro
 
+%global pkg_name hsx-jmacro
 Name:           %{pkg_name}
 Version:        7.3.8
 Release:        0
 Summary:        Hsp+jmacro support
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-hsp-devel
 BuildRequires:  ghc-jmacro-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-wl-pprint-text-devel
 
@@ -41,7 +39,6 @@
 This library makes it easy to embed JMacro generated javascript in HSX
 templates.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -78,15 +73,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md example.hs example2.hs
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md example.hs example2.hs
 
 %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,5 +1,5 @@
 #
-# spec file for package hsyslog
+# spec file for package hsyslog.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hsyslog
 
+%global pkg_name hsyslog
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        5.0.1
 Release:        0
 Summary:        FFI interface to syslog(3) from POSIX.1-2001
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-cabal-doctest-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-doctest-devel
 %endif
@@ -49,7 +46,6 @@
 the <https://github.com/peti/hsyslog/blob/master/example/Main.hs examples>
 directory of this package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,13 +83,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package htoml
+# spec file for package htoml.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name htoml
 
+%global pkg_name htoml
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.0.3
 Release:        0
 Summary:        Parser for TOML files
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-old-locale-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-unordered-containers-devel
@@ -53,7 +50,6 @@
 This package provides a TOML parser, build with the Parsec library. It exposes
 a JSON interface using the Aeson library.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,19 +57,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -93,15 +87,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package http-conduit
+# spec file for package http-conduit.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name http-conduit
 
+%global pkg_name http-conduit
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        2.2.4
 Release:        0
 Summary:        HTTP client package with conduit interface and HTTPS support
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-conduit-devel
@@ -43,6 +39,7 @@
 BuildRequires:  ghc-monad-control-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -68,7 +65,6 @@
 Hackage documentation generation is not reliable. For up to date documentation,
 please see: <http://www.stackage.org/package/http-conduit>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -76,19 +72,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -108,15 +102,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package http-link-header
+# spec file for package http-link-header.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name http-link-header
 
+%global pkg_name http-link-header
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.3
 Release:        0
 Summary:        A parser and writer for the HTTP Link header as specified in RFC 5988 "Web Linking"
-Group:          Development/Libraries/Haskell
-
 License:        SUSE-Public-Domain
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-conversion-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-errors-devel
 BuildRequires:  ghc-http-api-data-devel
 BuildRequires:  ghc-network-uri-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -47,7 +44,6 @@
 %description
 Https://github.com/myfreeweb/http-link-header.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -87,15 +81,13 @@
 %ghc_pkg_recache
 
 %files
-%doc UNLICENSE
+%license UNLICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc UNLICENSE
+%license UNLICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package http-media
+# spec file for package http-media.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name http-media
 
+%global pkg_name http-media
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.7.1.1
 Release:        0
 Summary:        Processing HTTP Content-Type and Accept headers
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-case-insensitive-devel
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-utf8-string-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -64,7 +61,6 @@
 
 The API is agnostic to your choice of server.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -72,19 +68,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -104,15 +98,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.md
 
 %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,5 +1,5 @@
 #
-# spec file for package hxt-charproperties
+# spec file for package hxt-charproperties.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hxt-charproperties
 
+%global pkg_name hxt-charproperties
 Name:           %{pkg_name}
 Version:        9.2.0.1
 Release:        0
 Summary:        Character properties and classes for XML and Unicode
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -35,7 +33,6 @@
 predicates for Unicode blocks and char proprties and character predicates
 defined by XML. Supported Unicode version is 7.0.0.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,13 +67,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package hxt-expat
+# spec file for package hxt-expat.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hxt-expat
 
+%global pkg_name hxt-expat
 Name:           %{pkg_name}
 Version:        9.1.1
 Release:        0
 Summary:        Expat parser for HXT
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-hexpat-devel
 BuildRequires:  ghc-hxt-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 The Expat interface for the HXT.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,15 +68,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc examples
 
 %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,5 +1,5 @@
 #
-# spec file for package hxt-tagsoup
+# spec file for package hxt-tagsoup.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name hxt-tagsoup
 
+%global pkg_name hxt-tagsoup
 Name:           %{pkg_name}
 Version:        9.1.4
 Release:        0
 Summary:        TagSoup parser for HXT
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-hxt-charproperties-devel
 BuildRequires:  ghc-hxt-devel
 BuildRequires:  ghc-hxt-unicode-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagsoup-devel
 
 %description
 The Tagsoup interface for the HXT lazy HTML parser.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,15 +69,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc examples
 
 %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,5 +1,5 @@
 #
-# spec file for package iconv
+# spec file for package iconv.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name iconv
 
+%global pkg_name iconv
 Name:           %{pkg_name}
 Version:        0.4.1.3
 Release:        0
 Summary:        String encoding conversion
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Provides an interface to the POSIX iconv library functions for string encoding
 conversion.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,15 +67,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package incremental-parser
+# spec file for package incremental-parser.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name incremental-parser
 
+%global pkg_name incremental-parser
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.5.2
 Release:        0
 Summary:        Generic parser library capable of providing partial results from partial input
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-monoid-subclasses-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-checkers-devel
@@ -47,7 +44,6 @@
 package defines instances. If the parser result is also a monoid, its chunks
 can be extracted incrementally, before the complete input is parsed.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -87,15 +81,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE.txt
+%license LICENSE.txt
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE.txt
+%license LICENSE.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package indentation-core
+# spec file for package indentation-core.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name indentation-core
 
+%global pkg_name indentation-core
 Name:           %{pkg_name}
 Version:        0.0.0.1
 Release:        0
 Summary:        Indentation sensitive parsing combinators core library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Indentation sensitive parsing combinators core library
@@ -38,7 +36,6 @@
 the front-ends: indentation-parsec or indentation-trifecta. For both, or for
 backward compatability, install indentation.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,15 +70,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package indentation-parsec
+# spec file for package indentation-parsec.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name indentation-parsec
 
+%global pkg_name indentation-parsec
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.0.1
 Release:        0
 Summary:        Indentation sensitive parsing combinators for Parsec
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-indentation-core-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
 BuildRequires:  ghc-tasty-hunit-devel
@@ -54,7 +51,6 @@
 indentation-trifecta. For backward compatability or to install both, install
 indentation.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -62,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -94,15 +88,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package inline-c-cpp
+# spec file for package inline-c-cpp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name inline-c-cpp
 
+%global pkg_name inline-c-cpp
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.1.0
 Release:        0
 Summary:        Lets you embed C++ code into Haskell
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-inline-c-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-safe-exceptions-devel
 BuildRequires:  ghc-template-haskell-devel
 %if %{with tests}
@@ -42,7 +39,6 @@
 Utilities to inline C++ code into Haskell using inline-c. See tests for example
 on how to build.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,13 +76,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package integer-logarithms
+# spec file for package integer-logarithms.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name integer-logarithms
 
+%global pkg_name integer-logarithms
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.2
 Release:        0
 Summary:        Integer logarithms
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-smallcheck-devel
@@ -49,7 +46,6 @@
 "Math.NumberTheory.Power.Natural" modules, as well as some additional functions
 in migrated modules.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,15 +83,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc changelog.md readme.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog.md readme.md
 
 %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,5 +1,5 @@
 #
-# spec file for package intero
+# spec file for package intero.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%bcond_with tests
 
+%bcond_with tests
 Name:           intero
 Version:        0.1.24
 Release:        0
 Summary:        Complete interactive development program for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
@@ -40,6 +37,7 @@
 BuildRequires:  ghc-ghci-devel
 BuildRequires:  ghc-haskeline-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-transformers-devel
@@ -53,7 +51,6 @@
 %description
 Complete interactive development program for Haskell.
 
-
 %prep
 %setup -q
 
@@ -67,7 +64,7 @@
 %cabal_test
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG README.md
 %{_bindir}/%{name}
 %dir %{_datadir}/%{name}-%{version}
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,5 +1,5 @@
 #
-# spec file for package invariant
+# spec file for package invariant.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name invariant
 
+%global pkg_name invariant
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5
 Release:        0
 Summary:        Haskell98 invariant functors
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-StateVar-devel
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bifunctors-devel
@@ -38,6 +34,7 @@
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-contravariant-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-tagged-devel
@@ -58,7 +55,6 @@
 
 <http://comonad.com/reader/2008/rotten-bananas/>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -66,19 +62,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -98,15 +92,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package io-machine
+# spec file for package io-machine.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name io-machine
 
+%global pkg_name io-machine
 Name:           %{pkg_name}
 Version:        0.2.0.0
 Release:        0
 Summary:        Easy I/O model to learn IO monad
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
@@ -34,7 +32,6 @@
 %description
 Easy I/O model to learn IO monad.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,13 +66,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package io-streams-haproxy
+# spec file for package io-streams-haproxy.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name io-streams-haproxy
 
+%global pkg_name io-streams-haproxy
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.0.2
 Release:        0
 Summary:        HAProxy protocol 1.5 support for io-streams
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-io-streams-devel
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -49,7 +46,6 @@
 (like remote address and port) to be propagated through a forwarding proxy that
 is configured to speak this protocol.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,15 +83,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CONTRIBUTORS
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CONTRIBUTORS
 
 %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,5 +1,5 @@
 #
-# spec file for package ip
+# spec file for package ip.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ip
 
+%global pkg_name ip
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.1.1
 Release:        0
 Summary:        Library for IP and MAC addresses
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-vector-devel
 %if %{with tests}
@@ -69,7 +66,6 @@
 * `yesod-ip`: Provides orphan instances needed to work with yesod and
 persistent. Also, provides a `yesod-form` helper.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -77,19 +73,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -109,13 +103,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package iso639
+# spec file for package iso639.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name iso639
 
+%global pkg_name iso639
 Name:           %{pkg_name}
 Version:        0.1.0.3
 Release:        0
 Summary:        ISO-639-1 language codes
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -39,7 +37,6 @@
 
 Special thanks to Petter Bergman for the suggestions and bug fixing .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,13 +71,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package iso8601-time
+# spec file for package iso8601-time.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name iso8601-time
 
+%global pkg_name iso8601-time
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.4
 Release:        0
 Summary:        Convert to/from the ISO 8601 time format
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
@@ -41,7 +38,6 @@
 Conversion functions between Haskell time types and the ISO 8601 format, which
 is often used for printing times, e.g. JavaScript's 'new Date().toISOString()'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,9 +77,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package jmacro-rpc-happstack
+# spec file for package jmacro-rpc-happstack.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name jmacro-rpc-happstack
 
+%global pkg_name jmacro-rpc-happstack
 Name:           %{pkg_name}
 Version:        0.3.2
 Release:        0
 Summary:        Happstack backend for jmacro-rpc
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-blaze-html-devel
 BuildRequires:  ghc-bytestring-devel
@@ -37,11 +34,11 @@
 BuildRequires:  ghc-jmacro-devel
 BuildRequires:  ghc-jmacro-rpc-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Provides functions for serving jmacro-rpc json rpcs and panels from Happstack.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,20 +46,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -79,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package jmacro-rpc
+# spec file for package jmacro-rpc.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name jmacro-rpc
 
+%global pkg_name jmacro-rpc
 Name:           %{pkg_name}
 Version:        0.3.2
 Release:        0
 Summary:        JSON-RPC clients and servers using JMacro, and evented client-server Reactive Programming
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-blaze-html-devel
@@ -37,6 +34,7 @@
 BuildRequires:  ghc-contravariant-devel
 BuildRequires:  ghc-jmacro-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-text-devel
@@ -46,7 +44,6 @@
 %description
 Base jmacro-rpc package. Provides server-independent functions.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -54,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package jose
+# spec file for package jose.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name jose
 
+%global pkg_name jose
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.6.0.3
 Release:        0
 Summary:        Javascript Object Signing and Encryption and JSON Web Token library
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
@@ -46,6 +42,7 @@
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-network-uri-devel
 BuildRequires:  ghc-quickcheck-instances-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-template-haskell-devel
@@ -76,7 +73,6 @@
 The __ECDSA implementation is vulnerable to timing attacks__ and should only be
 used for verification.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -84,19 +80,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -117,16 +111,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 %{_bindir}/example
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package katip-elasticsearch
+# spec file for package katip-elasticsearch.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name katip-elasticsearch
 
+%global pkg_name katip-elasticsearch
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.0.3
 Release:        0
 Summary:        ElasticSearch scribe for the Katip logging framework
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-bloodhound-devel
@@ -41,6 +37,7 @@
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-katip-devel
 BuildRequires:  ghc-retry-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-stm-chans-devel
 BuildRequires:  ghc-stm-devel
@@ -64,7 +61,6 @@
 %description
 ElasticSearch scribe for the Katip logging framework.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -72,20 +68,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -105,15 +99,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package katip
+# spec file for package katip.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name katip
 
+%global pkg_name katip
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.2.0
 Release:        0
 Summary:        A structured logging framework
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-auto-update-devel
@@ -44,6 +40,7 @@
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-old-locale-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-safe-exceptions-devel
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-semigroups-devel
@@ -71,7 +68,6 @@
 %description
 Katip is a structured logging framework. See README.md for more details.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -79,19 +75,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -111,15 +105,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package katydid
+# spec file for package katydid.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name katydid
 
+%global pkg_name katydid
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.1.0
 Release:        0
 Summary:        A haskell implementation of Katydid
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-hxt-devel
 BuildRequires:  ghc-json-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-parsec-devel
 BuildRequires:  ghc-regex-tdfa-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-directory-devel
@@ -62,7 +59,6 @@
 If you want to implement your own parser then you can look at the Parsers
 module .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -70,19 +66,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -103,16 +97,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 %{_bindir}/katydid-exe
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package kawhi
+# spec file for package kawhi.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name kawhi
 
+%global pkg_name kawhi
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Stats.NBA.com library
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-exceptions-devel
@@ -38,6 +34,7 @@
 BuildRequires:  ghc-http-conduit-devel
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
@@ -52,7 +49,6 @@
 %description
 Functions and types for interacting with stats.NBA.com.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -60,19 +56,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -92,15 +86,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package kraken
+# spec file for package kraken.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,31 +15,28 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name kraken
 
+%global pkg_name kraken
 Name:           %{pkg_name}
 Version:        0.1.0
 Release:        0
 Summary:        Kraken.io API client
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-http-client-devel
 BuildRequires:  ghc-http-client-tls-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Kraken is a robust, ultra-fast image optimizer and compressor with
 best-in-class algorithms.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,13 +71,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package l10n
+# spec file for package l10n.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name l10n
 
+%global pkg_name l10n
 Name:           %{pkg_name}
 Version:        0.1.0.1
 Release:        0
 Summary:        Enables providing localization as typeclass instances in separate files
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
@@ -35,7 +33,6 @@
 %description
 Enables providing localization as typeclass instances in separate files.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,15 +67,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package lambdabot-social-plugins
+# spec file for package lambdabot-social-plugins.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name lambdabot-social-plugins
 
+%global pkg_name lambdabot-social-plugins
 Name:           %{pkg_name}
 Version:        5.1.0.1
 Release:        0
 Summary:        Social plugins for Lambdabot
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-lambdabot-core-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-time-devel
 
@@ -53,7 +51,6 @@
 
 [tell] Leave messages for other users.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,20 +58,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -91,13 +86,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package lazy-csv
+# spec file for package lazy-csv.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name lazy-csv
 
+%global pkg_name lazy-csv
 Name:           %{pkg_name}
 Version:        0.5.1
 Release:        0
 Summary:        Efficient lazy parsers for CSV (comma-separated values)
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 The CSV format is defined by RFC 4180. These efficient lazy parsers (String and
@@ -39,7 +37,6 @@
 original location in the input, so a secondary parser from textual fields to
 typed values can give intelligent error messages.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,16 +71,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENCE-BSD3
+%license LICENCE-BSD3
 %doc changelog.html
 %{_bindir}/csvSelect
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENCE-BSD3
+%license LICENCE-BSD3
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog.html
 
 %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,5 +1,5 @@
 #
-# spec file for package lens-aeson
+# spec file for package lens-aeson.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name lens-aeson
 
+%global pkg_name lens-aeson
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.2
 Release:        0
 Summary:        Law-abiding lenses for aeson
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cabal-doctest-devel
 BuildRequires:  ghc-lens-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
@@ -50,7 +47,6 @@
 %description
 Law-abiding lenses for aeson.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,19 +54,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,15 +84,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package lens
+# spec file for package lens.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name lens
 
+%global pkg_name lens
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        4.15.4
 Release:        0
 Summary:        Lenses, Folds and Traversals
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-base-orphans-devel
 BuildRequires:  ghc-bifunctors-devel
@@ -50,6 +46,7 @@
 BuildRequires:  ghc-parallel-devel
 BuildRequires:  ghc-profunctors-devel
 BuildRequires:  ghc-reflection-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-tagged-devel
@@ -162,7 +159,6 @@
 common haskell types, a wide array of combinators for working them, and more
 exotic functionality, (/e.g./ getters, setters, indexed folds, isomorphisms).
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -170,19 +166,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -202,15 +196,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc AUTHORS.markdown CHANGELOG.markdown README.markdown examples
 
 %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,5 +1,5 @@
 #
-# spec file for package libgit
+# spec file for package libgit.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name libgit
 
+%global pkg_name libgit
 Name:           %{pkg_name}
 Version:        0.3.1
 Release:        0
 Summary:        Simple Git Wrapper
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Simple git wrapper to access common git functions in a simple haskell way.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,15 +67,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package librato
+# spec file for package librato.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name librato
 
+%global pkg_name librato
 Name:           %{pkg_name}
 Version:        0.2.0.1
 Release:        0
 Summary:        Bindings to the Librato API
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
@@ -38,6 +35,7 @@
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-uri-templater-devel
@@ -46,7 +44,6 @@
 %description
 Bindings to the Librato API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -54,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +78,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package lifted-async
+# spec file for package lifted-async.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name lifted-async
 
+%global pkg_name lifted-async
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.9.3.2
 Release:        0
 Summary:        Run lifted IO operations asynchronously and wait for their results
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-constraints-devel
 BuildRequires:  ghc-lifted-base-devel
 BuildRequires:  ghc-monad-control-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-base-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
@@ -48,7 +45,6 @@
 This package provides IO operations from 'async' package lifted to any instance
 of 'MonadBase' or 'MonadBaseControl'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,15 +82,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package lmdb
+# spec file for package lmdb.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name lmdb
 
+%global pkg_name lmdb
 Name:           %{pkg_name}
 Version:        0.2.5
 Release:        0
 Summary:        Lightning MDB bindings
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  lmdb-devel
 
 %description
@@ -45,7 +43,6 @@
 use LMDB rather than further develop its bindings. If a higher level API is
 desired, please consider contributing, or develop a separate package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,20 +50,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
+Requires:       lmdb-devel
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
-Requires:       lmdb-devel
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package logging-effect-extra-file
+# spec file for package logging-effect-extra-file.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name logging-effect-extra-file
 
+%global pkg_name logging-effect-extra-file
 Name:           %{pkg_name}
 Version:        1.1.1
 Release:        0
 Summary:        TH splices to augment log messages with file info
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-logging-effect-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-wl-pprint-text-devel
 
 %description
 TH splices to augment log messages with file info.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,20 +42,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -81,10 +76,8 @@
 %{_bindir}/log-file-and-severity
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md LICENSE.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package lucid
+# spec file for package lucid.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name lucid
 
+%global pkg_name lucid
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        2.9.9
 Release:        0
 Summary:        Clear to write, read and edit DSL for HTML
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-mmorph-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-unordered-containers-devel
@@ -51,7 +48,6 @@
 Clear to write, read and edit DSL for HTML. See the 'Lucid' module for
 description and documentation.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,19 +55,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package mainland-pretty
+# spec file for package mainland-pretty.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name mainland-pretty
 
+%global pkg_name mainland-pretty
 Name:           %{pkg_name}
 Version:        0.6.1
 Release:        0
 Summary:        Pretty printing designed for printing source code
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-srcloc-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
@@ -41,7 +39,6 @@
 and output appropriate #line pragmas and its ability to produce output in the
 form of lazy text using a builder.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -78,13 +73,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package matrices
+# spec file for package matrices.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name matrices
 
+%global pkg_name matrices
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.5
 Release:        0
 Summary:        Native matrix based on vector
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
@@ -44,7 +41,6 @@
 Pure Haskell matrix library, supporting creating, indexing, and modifying
 dense/sparse matrices.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package median-stream
+# spec file for package median-stream.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name median-stream
 
+%global pkg_name median-stream
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.7.0.0
 Release:        0
 Summary:        Constant-time queries for the median of a stream of numeric data
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-heap-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 %endif
@@ -40,7 +37,6 @@
 Uses the two-heap approach to support O(lg n) insertions and O(1) queries for
 the median.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package megaparsec
+# spec file for package megaparsec.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name megaparsec
 
+%global pkg_name megaparsec
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        6.3.0
 Release:        0
 Summary:        Monadic parser combinators
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-case-insensitive-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-parser-combinators-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
@@ -50,7 +47,6 @@
 This is industrial-strength monadic parser combinator library.
 Megaparsec is a fork of Parsec library originally written by Daan Leijen.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,19 +54,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,15 +84,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE.md
+%license LICENSE.md
 %doc AUTHORS.md CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE.md
+%license LICENSE.md
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc AUTHORS.md CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package mersenne-random
+# spec file for package mersenne-random.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name mersenne-random
 
+%global pkg_name mersenne-random
 Name:           %{pkg_name}
 Version:        1.0.0.1
 Release:        0
 Summary:        Generate high quality pseudorandom numbers using a SIMD Fast Mersenne Twister
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-old-time-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 The Mersenne twister is a pseudorandom number generator developed by Makoto
@@ -60,7 +58,6 @@
 
 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/sfmt.pdf> .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -68,19 +65,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,13 +92,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package messagepack
+# spec file for package messagepack.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name messagepack
 
+%global pkg_name messagepack
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.4
 Release:        0
 Summary:        Serialize instance for Message Pack Object
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cereal-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-test-framework-devel
@@ -45,7 +42,6 @@
 %description
 Serialize instance for Message Pack Object.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package microlens-ghc
+# spec file for package microlens-ghc.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name microlens-ghc
 
+%global pkg_name microlens-ghc
 Name:           %{pkg_name}
 Version:        0.4.8.0
 Release:        0
 Summary:        Microlens + array, bytestring, containers, transformers
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-microlens-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 
 %description
@@ -54,7 +52,6 @@
 microlens> family; see the readme <https://github.com/aelve/microlens#readme on
 Github>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -62,19 +59,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,15 +86,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package microlens
+# spec file for package microlens.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name microlens
 
+%global pkg_name microlens
 Name:           %{pkg_name}
 Version:        0.4.8.1
 Release:        0
 Summary:        A tiny lens library with no dependencies. If you're writing an app, you probably want microlens-platform, not this
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -88,7 +86,6 @@
 Note that microlens has no dependencies starting from GHC 7.10 (base-4.8).
 Prior to that, it depends on transformers-0.2 or above.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -96,19 +93,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -125,15 +120,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package minio-hs
+# spec file for package minio-hs.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name minio-hs
 
+%global pkg_name minio-hs
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.2
 Release:        0
 Summary:        A Minio Haskell Library for Amazon S3 compatible cloud storage
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-base64-bytestring-devel
@@ -54,6 +50,7 @@
 BuildRequires:  ghc-monad-control-devel
 BuildRequires:  ghc-protolude-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-format-devel
 BuildRequires:  ghc-time-devel
@@ -75,7 +72,6 @@
 The Minio Haskell client library provides simple APIs to access Minio, Amazon
 S3 and other API compatible cloud storage servers.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -83,19 +79,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -115,13 +109,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package mmorph
+# spec file for package mmorph.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name mmorph
 
+%global pkg_name mmorph
 Name:           %{pkg_name}
 Version:        1.1.0
 Release:        0
 Summary:        Monad morphisms
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-devel
 
@@ -37,7 +35,6 @@
 This library provides monad morphism utilities, most commonly used for
 manipulating monad transformer stacks.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,15 +69,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package mnist-idx
+# spec file for package mnist-idx.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name mnist-idx
 
+%global pkg_name mnist-idx
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.2.8
 Release:        0
 Summary:        Read and write IDX data that is used in e.g. the MNIST database
+License:        LGPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        LGPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
@@ -44,7 +41,6 @@
 format. This format is relevant for machine learning applications, like the
 MNIST handwritten digit database.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package mole
+# spec file for package mole.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%bcond_with tests
 
+%bcond_with tests
 Name:           mole
 Version:        0.0.6
 Release:        0
 Summary:        A glorified string replacement tool
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base64-bytestring-devel
 BuildRequires:  ghc-bytestring-devel
@@ -44,6 +41,7 @@
 BuildRequires:  ghc-network-uri-devel
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-snap-core-devel
 BuildRequires:  ghc-snap-server-devel
 BuildRequires:  ghc-stm-devel
@@ -66,7 +64,6 @@
 Mole inspects source, builds a complete dependency tree, minifies and
 compresses the files, adds fingerprints and writes the result to a directory.
 
-
 %prep
 %setup -q
 
@@ -80,7 +77,7 @@
 %cabal_test
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/%{name}
 
 %changelog
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,5 +1,5 @@
 #
-# spec file for package monad-products
+# spec file for package monad-products.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name monad-products
 
+%global pkg_name monad-products
 Name:           %{pkg_name}
 Version:        4.0.1
 Release:        0
 Summary:        Monad products
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
@@ -34,7 +32,6 @@
 %description
 Monad products.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package monadcryptorandom
+# spec file for package monadcryptorandom.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name monadcryptorandom
 
+%global pkg_name monadcryptorandom
 Name:           %{pkg_name}
 Version:        0.7.1
 Release:        0
 Summary:        A monad for using CryptoRandomGen
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-crypto-api-devel
 BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-devel
@@ -40,7 +38,6 @@
 %description
 A monad for using CryptoRandomGen.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,13 +72,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package monadloc
+# spec file for package monadloc.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name monadloc
 
+%global pkg_name monadloc
 Name:           %{pkg_name}
 Version:        0.7.1
 Release:        0
 Summary:        A class for monads which can keep a monadic call trace
-Group:          Development/Libraries/Haskell
-
 License:        SUSE-Public-Domain
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
@@ -56,7 +54,6 @@
 * 0.6 - Extracted the preprocessor to a separate package 'monadloc-pp' to
 minimize the set of dependencies.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -64,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -95,9 +90,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package mongoDB
+# spec file for package mongoDB.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name mongoDB
 
+%global pkg_name mongoDB
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        2.3.0.1
 Release:        0
 Summary:        Driver (client) for MongoDB, a free, scalable, fast, document DBMS
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-base16-bytestring-devel
 BuildRequires:  ghc-base64-bytestring-devel
@@ -53,6 +49,7 @@
 BuildRequires:  ghc-random-devel
 BuildRequires:  ghc-random-shuffle-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
@@ -69,7 +66,6 @@
 Please see the example in Database.MongoDB and the tutorial from the homepage.
 For information about MongoDB itself, see www.mongodb.org.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -77,19 +73,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -109,15 +103,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md
 
 %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,5 +1,5 @@
 #
-# spec file for package monoid-extras
+# spec file for package monoid-extras.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name monoid-extras
 
+%global pkg_name monoid-extras
 Name:           %{pkg_name}
 Version:        0.4.2
 Release:        0
 Summary:        Various extra monoid-related definitions and utilities
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-groups-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroups-devel
 
@@ -38,7 +36,6 @@
 monoid coproducts, semi-direct products, "deletable" monoids, "split" monoids,
 and "cut" monoids.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,15 +70,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES
 
 %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,5 +1,5 @@
 #
-# spec file for package mwc-random-monad
+# spec file for package mwc-random-monad.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,30 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name mwc-random-monad
 
+%global pkg_name mwc-random-monad
 Name:           %{pkg_name}
 Version:        0.7.3.1
 Release:        0
 Summary:        Monadic interface for mwc-random
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-monad-primitive-devel
 BuildRequires:  ghc-mwc-random-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-vector-devel
 
 %description
 Simple monadic interface for mwc-random.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,15 +70,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog
 
 %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,5 +1,5 @@
 #
-# spec file for package mwc-random
+# spec file for package mwc-random.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name mwc-random
 
+%global pkg_name mwc-random
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.13.6.0
 Release:        0
 Summary:        Fast, high quality pseudo random number generation
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-math-functions-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-vector-devel
 %if %{with tests}
@@ -57,7 +54,6 @@
 Compared to the mersenne-random package, this package has a more convenient
 API, is faster, and supports more statistical distributions.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package nanospec
+# spec file for package nanospec.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name nanospec
 
+%global pkg_name nanospec
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.1
 Release:        0
 Summary:        A lightweight implementation of a subset of Hspec's API
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 %if %{with tests}
@@ -40,7 +37,6 @@
 A lightweight implementation of a subset of Hspec's API with minimal
 dependencies.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %changelog
diff --git a/test/golden-test-cases/nats.cabal b/test/golden-test-cases/nats.cabal
new file mode 100644
--- /dev/null
+++ b/test/golden-test-cases/nats.cabal
@@ -0,0 +1,89 @@
+name:          nats
+category:      Numeric, Algebra
+version:       1.1.2
+license:       BSD3
+cabal-version: >= 1.10
+license-file:  LICENSE
+author:        Edward A. Kmett
+maintainer:    Edward A. Kmett <ekmett@gmail.com>
+stability:     provisional
+homepage:      http://github.com/ekmett/nats/
+bug-reports:   http://github.com/ekmett/nats/issues
+copyright:     Copyright (C) 2011-2014 Edward A. Kmett
+synopsis:      Natural numbers
+description:   Natural numbers.
+build-type:    Simple
+tested-with:   GHC == 7.0.4
+             , GHC == 7.2.2
+             , GHC == 7.4.2
+             , GHC == 7.6.3
+             , GHC == 7.8.4
+             , GHC == 7.10.3
+             , GHC == 8.0.2
+             , GHC == 8.2.2
+             , GHC == 8.4.1
+extra-source-files:
+  .ghci
+  .gitignore
+  .vim.custom
+  .travis.yml
+  README.markdown
+  CHANGELOG.markdown
+
+source-repository head
+  type: git
+  location: git://github.com/ekmett/nats.git
+
+flag hashable
+  description:
+    You can disable the use of the `hashable` package using `-f-hashable`.
+    .
+    Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+    .
+    If disabled we will not supply an instance of `Hashable`.
+  default: True
+  manual: True
+
+flag binary
+  description:
+    You can disable the use of the `binary` package using `-f-binary`.
+    .
+    Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+    .
+    If disabled we will not supply an instance of `Binary`.
+  default: True
+  manual: True
+
+flag template-haskell
+  description:
+    You can disable the use of the `template-haskell` package using `-f-template-haskell`.
+    .
+    Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+    .
+    If disabled we will not supply an instance of `Lift`.
+  default: True
+  manual: True
+
+library
+  default-language: Haskell98
+  if impl(ghc<7)
+    -- {-# LANGUAGE DeriveDataTypeable #-} is only understood starting w/ GHC-7.0
+    default-extensions: DeriveDataTypeable
+
+  if impl(ghc<7.9)
+    -- Starting with GHC 7.10/base-4.8, "Numeric.Natural" lives in `base`
+    hs-source-dirs: src
+    exposed-modules: Numeric.Natural
+    ghc-options: -Wall
+
+    -- the needlessly relaxed bound here is to due to stack shenanigans
+    build-depends: base >= 2 && < 5
+
+    if flag(binary)
+      build-depends: binary >= 0.2 && < 0.9
+
+    if flag(template-haskell)
+      build-depends: template-haskell >= 2.2 && < 2.12
+
+    if flag(hashable)
+      build-depends: hashable >= 1.1 && < 1.3
diff --git a/test/golden-test-cases/nats.spec.golden b/test/golden-test-cases/nats.spec.golden
new file mode 100644
--- /dev/null
+++ b/test/golden-test-cases/nats.spec.golden
@@ -0,0 +1,77 @@
+#
+# spec file for package nats.spec
+#
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+%global pkg_name nats
+Name:           %{pkg_name}
+Version:        1.1.2
+Release:        0
+Summary:        Natural numbers
+License:        BSD-3-Clause
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
+Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
+BuildRequires:  ghc-Cabal-devel
+BuildRequires:  ghc-rpm-macros
+
+%description
+Natural numbers.
+
+%package -n ghc-%{name}
+Summary:        Haskell %{name} library
+Group:          System/Libraries
+
+%description -n ghc-%{name}
+This package provides the Haskell %{name} shared library.
+
+%package -n ghc-%{name}-devel
+Summary:        Haskell %{name} library development files
+Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
+Requires:       ghc-compiler = %{ghc_version}
+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.
+
+%prep
+%setup -q
+
+%build
+%ghc_lib_build_without_haddock
+
+%install
+%ghc_lib_install
+
+%post -n ghc-%{name}-devel
+%ghc_pkg_recache
+
+%postun -n ghc-%{name}-devel
+%ghc_pkg_recache
+
+%files
+%license LICENSE
+%doc CHANGELOG.markdown README.markdown
+
+%files -n ghc-%{name} -f ghc-%{name}.files
+%license LICENSE
+
+%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
+%doc CHANGELOG.markdown README.markdown
+
+%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,5 +1,5 @@
 #
-# spec file for package netpbm
+# spec file for package netpbm.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name netpbm
 
+%global pkg_name netpbm
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.0.2
 Release:        0
 Summary:        Loading PBM, PGM, PPM image files
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-binary-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-storable-record-devel
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vector-devel
@@ -63,7 +60,6 @@
 * Use storable instead of unboxed vectors to allow easier integration with Ptr
 based APIs.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -71,19 +67,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -105,9 +99,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package network-protocol-xmpp
+# spec file for package network-protocol-xmpp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name network-protocol-xmpp
 
+%global pkg_name network-protocol-xmpp
 Name:           %{pkg_name}
 Version:        0.4.8
 Release:        0
 Summary:        Client library for the XMPP protocol
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-gnuidn-devel
 BuildRequires:  ghc-gnutls-devel
@@ -36,6 +33,7 @@
 BuildRequires:  ghc-libxml-sax-devel
 BuildRequires:  ghc-monads-tf-devel
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-xml-types-devel
@@ -43,7 +41,6 @@
 %description
 Client library for the XMPP protocol.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,20 +48,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -81,13 +76,11 @@
 %ghc_pkg_recache
 
 %files
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package network-transport-tcp
+# spec file for package network-transport-tcp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name network-transport-tcp
 
+%global pkg_name network-transport-tcp
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.6.0
 Release:        0
 Summary:        TCP instantiation of Network.Transport
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-data-accessor-devel
 BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-network-transport-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-network-transport-tests-devel
 %endif
@@ -43,7 +40,6 @@
 %description
 TCP instantiation of Network.Transport.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,20 +47,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -84,15 +78,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog
 
 %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,5 +1,5 @@
 #
-# spec file for package nix-paths
+# spec file for package nix-paths.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name nix-paths
 
+%global pkg_name nix-paths
 Name:           %{pkg_name}
 Version:        1.0.1
 Release:        0
 Summary:        Knowledge of Nix's installation directories
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  nix-build
 BuildRequires:  nix-env
 BuildRequires:  nix-hash
@@ -40,7 +38,6 @@
 This module provides full paths to various Nix utilities, like 'nix-store',
 'nix-instantiate', and 'nix-env'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,13 +72,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package nvim-hs
+# spec file for package nvim-hs.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name nvim-hs
 
+%global pkg_name nvim-hs
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.5
 Release:        0
 Summary:        Haskell plugin backend for neovim
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-ansi-wl-pprint-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cereal-conduit-devel
@@ -56,6 +52,7 @@
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-setenv-devel
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-streaming-commons-devel
@@ -95,7 +92,6 @@
 If you spot any errors or if you have great ideas, feel free to open an issue
 on github.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -103,19 +99,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -136,16 +130,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package once
+# spec file for package once.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name once
 
+%global pkg_name once
 Name:           %{pkg_name}
 Version:        0.2
 Release:        0
 Summary:        Memoization for IO actions and functions
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-unordered-containers-devel
 
 %description
 Please see Control.Once for examples.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,13 +69,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package one-liner
+# spec file for package one-liner.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name one-liner
 
+%global pkg_name one-liner
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.9.2
 Release:        0
 Summary:        Constraint-based generics
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bifunctors-devel
 BuildRequires:  ghc-contravariant-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
@@ -44,7 +41,6 @@
 Write short and concise generic instances of type classes. one-liner is
 particularly useful for writing default implementations of type class methods.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,15 +78,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc examples
 
 %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,5 +1,5 @@
 #
-# spec file for package online
+# spec file for package online.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name online
 
+%global pkg_name online
 Name:           %{pkg_name}
 Version:        0.2.0
 Release:        0
 Summary:        Online statistics
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-foldl-devel
 BuildRequires:  ghc-numhask-devel
 BuildRequires:  ghc-protolude-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tdigest-devel
 BuildRequires:  ghc-vector-algorithms-devel
 BuildRequires:  ghc-vector-devel
@@ -39,7 +37,6 @@
 %description
 Transformation of statistics to online algorithms.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc readme.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc readme.md
 
 %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,5 +1,5 @@
 #
-# spec file for package openexr-write
+# spec file for package openexr-write.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name openexr-write
 
+%global pkg_name openexr-write
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.1
 Release:        0
 Summary:        Library for writing images in OpenEXR HDR file format
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-data-binary-ieee754-devel
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-vector-devel
 BuildRequires:  ghc-vector-split-devel
@@ -48,7 +45,6 @@
 OpenEXR allows to store pixels as floating point numbers and thus can capture
 high dynamic range.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,15 +82,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package openpgp-asciiarmor
+# spec file for package openpgp-asciiarmor.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name openpgp-asciiarmor
 
+%global pkg_name openpgp-asciiarmor
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1
 Release:        0
 Summary:        OpenPGP (RFC4880) ASCII Armor codec
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base64-bytestring-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cereal-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-test-framework-devel
@@ -44,7 +41,6 @@
 %description
 OpenPGP (RFC4880) ASCII Armor codec.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,13 +78,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package pager
+# spec file for package pager.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pager
 
+%global pkg_name pager
 Name:           %{pkg_name}
 Version:        0.1.1.0
 Release:        0
 Summary:        Open up a pager, like 'less' or 'more'
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-bytestring-devel
 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
 BuildRequires:  ghc-safe-devel
 BuildRequires:  ghc-terminfo-devel
 BuildRequires:  ghc-text-devel
@@ -50,7 +48,6 @@
 
 [0.1.1.0] Add 'printOrPage' function and 'sendToPagerStrict' function.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,19 +55,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,18 +83,16 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 %{_bindir}/hs-pager-test-pager
 %dir %{_datadir}/%{name}-%{version}
 %{_datadir}/%{name}-%{version}/LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package partial-isomorphisms
+# spec file for package partial-isomorphisms.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name partial-isomorphisms
 
+%global pkg_name partial-isomorphisms
 Name:           %{pkg_name}
 Version:        0.2.2.1
 Release:        0
 Summary:        Partial isomorphisms
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
@@ -41,7 +39,6 @@
 for parsers and pretty printers. These are distributed separately in the
 /invertible-syntax/ package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,20 +46,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -79,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package partial-semigroup
+# spec file for package partial-semigroup.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name partial-semigroup
 
+%global pkg_name partial-semigroup
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.0.2
 Release:        0
 Summary:        A partial binary associative operator
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 %if %{with tests}
@@ -40,7 +37,6 @@
 A partial semigroup is like a semigroup, but the operator is partial.
 We represent this in Haskell as a total function '(<>?) :: a -> a -> Maybe a'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -80,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package pathtype
+# spec file for package pathtype.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pathtype
 
+%global pkg_name pathtype
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.8
 Release:        0
 Summary:        Type-safe replacement for System.FilePath etc
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-old-time-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-transformers-devel
@@ -82,7 +79,6 @@
 
 * 'data-filepath': Requires 'Typeable' and Template Haskell.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -90,19 +86,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -122,15 +116,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package pcap
+# spec file for package pcap.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pcap
 
+%global pkg_name pcap
 Name:           %{pkg_name}
 Version:        0.4.5.2
 Release:        0
 Summary:        A system-independent interface for user-level packet capture
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
 
 %description
 A system-independent interface for user-level packet capture.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,15 +68,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package pdfinfo
+# spec file for package pdfinfo.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pdfinfo
 
+%global pkg_name pdfinfo
 Name:           %{pkg_name}
 Version:        1.5.4
 Release:        0
 Summary:        Wrapper around the pdfinfo command
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-old-locale-devel
 BuildRequires:  ghc-process-extras-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-time-locale-compat-devel
@@ -40,7 +38,6 @@
 Just a wrapper around the pdfinfo command (for collecting PDF file info).
 See man pdfinfo.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,13 +72,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package pell
+# spec file for package pell.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pell
 
+%global pkg_name pell
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.1.0
 Release:        0
 Summary:        Package to solve the Generalized Pell Equation
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-arithmoi-devel
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-cabal-test-quickcheck-devel
@@ -42,7 +39,6 @@
 %description
 Finds all solutions of the generalized Pell Equation.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,15 +76,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package persistable-types-HDBC-pg
+# spec file for package persistable-types-HDBC-pg.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name persistable-types-HDBC-pg
 
+%global pkg_name persistable-types-HDBC-pg
 Name:           %{pkg_name}
 Version:        0.0.1.5
 Release:        0
 Summary:        HDBC and Relational-Record instances of PostgreSQL extended types
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-HDBC-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-convertible-devel
 BuildRequires:  ghc-persistable-record-devel
 BuildRequires:  ghc-relational-query-HDBC-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-postgresql-devel
 
 %description
@@ -41,7 +39,6 @@
 persistable instances of PostgreSQL extended types Supported extended types:
 inet, cidr.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,20 +46,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -79,15 +74,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc example
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc example
 
 %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,5 +1,5 @@
 #
-# spec file for package persistent-mysql-haskell
+# spec file for package persistent-mysql-haskell.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name persistent-mysql-haskell
 
+%global pkg_name persistent-mysql-haskell
 Name:           %{pkg_name}
 Version:        0.3.6
 Release:        0
 Summary:        A pure haskell backend for the persistent library using MySQL database server
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-conduit-devel
@@ -43,6 +40,7 @@
 BuildRequires:  ghc-persistent-template-devel
 BuildRequires:  ghc-resource-pool-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-tls-devel
@@ -60,7 +58,6 @@
 
 * This package does not support statements inside other statements.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -68,20 +65,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -99,16 +94,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 %{_bindir}/persistent-mysql-haskell-example
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package picosat
+# spec file for package picosat.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name picosat
 
+%global pkg_name picosat
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.4
 Release:        0
 Summary:        Bindings to the PicoSAT solver
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
 BuildRequires:  ghc-random-devel
@@ -41,7 +38,6 @@
 %description
 `picosat` provides bindings for the fast PicoSAT solver library.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,13 +75,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package pinch
+# spec file for package pinch.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pinch
 
+%global pkg_name pinch
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.2.0
 Release:        0
 Summary:        An alternative implementation of Thrift for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vector-devel
@@ -59,7 +56,6 @@
 programming languages to interact with the generated code. Pinch aims to
 provide an alternative implementation of Thrift for Haskell.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -67,19 +63,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -99,15 +93,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.md README.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.md README.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package pipes-network
+# spec file for package pipes-network.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pipes-network
 
+%global pkg_name pipes-network
 Name:           %{pkg_name}
 Version:        0.6.4.1
 Release:        0
 Summary:        Use network sockets together with the pipes library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-network-simple-devel
 BuildRequires:  ghc-pipes-devel
 BuildRequires:  ghc-pipes-safe-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 
 %description
@@ -53,7 +51,6 @@
 See the 'changelog' file in the source distribution to learn about any
 important changes between version.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package pipes-safe
+# spec file for package pipes-safe.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pipes-safe
 
+%global pkg_name pipes-safe
 Name:           %{pkg_name}
 Version:        2.2.6
 Release:        0
 Summary:        Safety for the pipes ecosystem
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-monad-control-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-pipes-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-base-devel
 BuildRequires:  ghc-transformers-devel
 
@@ -56,7 +54,6 @@
 
 * /No Buy-in/: Mix resource-safe pipes with unmanaged pipes using 'hoist'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -64,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -93,15 +88,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package pointed
+# spec file for package pointed.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pointed
 
+%global pkg_name pointed
 Name:           %{pkg_name}
 Version:        5
 Release:        0
 Summary:        Pointed and copointed data
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-comonad-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-data-default-class-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-kan-extensions-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-stm-devel
@@ -45,7 +43,6 @@
 %description
 Pointed and copointed data.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +50,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package poly-arity
+# spec file for package poly-arity.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name poly-arity
 
+%global pkg_name poly-arity
 Name:           %{pkg_name}
 Version:        0.1.0
 Release:        0
 Summary:        Tools for working with functions of undetermined arity
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-constraints-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Tools for working with functions of undetermined arity.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,13 +66,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package polynomials-bernstein
+# spec file for package polynomials-bernstein.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name polynomials-bernstein
 
+%global pkg_name polynomials-bernstein
 Name:           %{pkg_name}
 Version:        1.1.2
 Release:        0
 Summary:        A solver for systems of polynomial equations in bernstein form
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
@@ -36,7 +34,6 @@
 Bernstein form, as well as instances of numeric classes and other manipulation
 functions, and a solver of systems of polynomial equations in this form.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,20 +41,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -74,13 +69,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package postgresql-simple-url
+# spec file for package postgresql-simple-url.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name postgresql-simple-url
 
+%global pkg_name postgresql-simple-url
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.0
 Release:        0
 Summary:        Parse postgres:// url into ConnectInfo
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-network-uri-devel
 BuildRequires:  ghc-postgresql-simple-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 %if %{with tests}
 BuildRequires:  ghc-tasty-devel
@@ -43,7 +40,6 @@
 The 'Database.PostgreSQL.Simple.URL' module in this package exports two helper
 functions 'parseDatabaseUrl' and 'urlToConnectInfo'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,20 +47,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -84,15 +78,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package prelude-safeenum
+# spec file for package prelude-safeenum.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name prelude-safeenum
 
+%global pkg_name prelude-safeenum
 Name:           %{pkg_name}
 Version:        0.1.1.2
 Release:        0
 Summary:        A redefinition of the Prelude's Enum class in order to render it safe
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -37,7 +35,6 @@
 We define a new type-class hierarchy for enumeration which is safe and also
 generalizes to cover types which can only be enumerated in one direction.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,15 +69,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc AUTHORS CHANGELOG README
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc AUTHORS CHANGELOG README
 
 %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,5 +1,5 @@
 #
-# spec file for package presburger
+# spec file for package presburger.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name presburger
 
+%global pkg_name presburger
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.3.1
 Release:        0
 Summary:        A decision procedure for quantifier-free linear arithmetic
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 %endif
@@ -41,7 +38,6 @@
 The decision procedure is based on the algorithm used in CVC4, which is itself
 based on the Omega test.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,13 +75,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package prettyclass
+# spec file for package prettyclass.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name prettyclass
 
+%global pkg_name prettyclass
 Name:           %{pkg_name}
 Version:        1.0.0.0
 Release:        0
 Summary:        Pretty printing class similar to Show
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Pretty printing class similar to Show, based on the HughesPJ pretty printing
 library. Provides the pretty printing class and instances for the Prelude
 types.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,9 +70,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package prettyprinter-compat-ansi-wl-pprint
+# spec file for package prettyprinter-compat-ansi-wl-pprint.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name prettyprinter-compat-ansi-wl-pprint
 
+%global pkg_name prettyprinter-compat-ansi-wl-pprint
 Name:           %{pkg_name}
 Version:        1.0.1
 Release:        0
 Summary:        Drop-in compatibility package to migrate from »ansi-wl-pprint« to »prettyprinter«
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-prettyprinter-ansi-terminal-devel
 BuildRequires:  ghc-prettyprinter-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
 Drop-in compatibility package to migrate from »ansi-wl-pprint« to
 »prettyprinter«.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,20 +43,18 @@
 This package provides the Haskell %{name} shared
 library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library
 development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE.md
+%license LICENSE.md
 %doc CONTRIBUTORS.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE.md
+%license LICENSE.md
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CONTRIBUTORS.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package prettyprinter-compat-wl-pprint
+# spec file for package prettyprinter-compat-wl-pprint.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name prettyprinter-compat-wl-pprint
 
+%global pkg_name prettyprinter-compat-wl-pprint
 Name:           %{pkg_name}
 Version:        1.0.0.1
 Release:        0
 Summary:        Prettyprinter compatibility module for previous users of the wl-pprint package
-Group:          Development/Libraries/Haskell
-
 License:        BSD-2-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-prettyprinter-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
 Prettyprinter compatibility module for previous users of the wl-pprint package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,20 +41,18 @@
 This package provides the Haskell %{name} shared
 library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library
 development files.
 
-
 %prep
 %setup -q
 
@@ -74,15 +69,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE.md
+%license LICENSE.md
 %doc CONTRIBUTORS.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE.md
+%license LICENSE.md
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CONTRIBUTORS.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package primitive
+# spec file for package primitive.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name primitive
 
+%global pkg_name primitive
 Name:           %{pkg_name}
 Version:        0.6.2.0
 Release:        0
 Summary:        Primitive memory-related operations
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
@@ -34,7 +32,6 @@
 %description
 This package provides various primitive memory-related operations.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package product-profunctors
+# spec file for package product-profunctors.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,31 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name product-profunctors
 
+%global pkg_name product-profunctors
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.8.0.3
 Release:        0
 Summary:        Product-profunctors
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-contravariant-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-template-haskell-devel
 
 %description
 Product profunctors.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,20 +43,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -80,13 +74,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package profiterole
+# spec file for package profiterole.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           profiterole
 Version:        0.1
 Release:        0
 Summary:        Restructure GHC profile reports
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-extra-devel
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-ghc-prof-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
 
@@ -40,7 +39,6 @@
 Given a GHC profile output, this tool generates alternative views on the data,
 which are typically more concise and may reveal new insights.
 
-
 %prep
 %setup -q
 
@@ -51,7 +49,7 @@
 %ghc_bin_install
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.txt README.md
 %{_bindir}/%{name}
 
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,5 +1,5 @@
 #
-# spec file for package projectroot
+# spec file for package projectroot.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name projectroot
 
+%global pkg_name projectroot
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.1
 Release:        0
 Summary:        Bindings to the projectroot C logic
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-hspec-devel
@@ -42,7 +39,6 @@
 provides bindings to the <https://github.com/yamadapc/projectroot projectroot>
 C library.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,13 +76,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package proto-lens-optparse
+# spec file for package proto-lens-optparse.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,29 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name proto-lens-optparse
 
+%global pkg_name proto-lens-optparse
 Name:           %{pkg_name}
 Version:        0.1.0.4
 Release:        0
 Summary:        Adapting proto-lens to optparse-applicative ReadMs
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-proto-lens-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
 A package adapting proto-lens to optparse-applicative ReadMs. This gives an
 easy way to define options and arguments for text-format protobuf types.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,20 +42,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -75,15 +70,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc Changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc Changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package proto-lens
+# spec file for package proto-lens.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name proto-lens
 
+%global pkg_name proto-lens
 Name:           %{pkg_name}
 Version:        0.2.2.0
 Release:        0
 Summary:        A lens-based implementation of protocol buffers in Haskell
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
@@ -36,6 +33,7 @@
 BuildRequires:  ghc-lens-family-devel
 BuildRequires:  ghc-parsec-devel
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-void-devel
@@ -50,7 +48,6 @@
 
 * Type-safe reflection and encoding/decoding of messages via GADTs.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,19 +55,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -87,15 +82,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc Changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc Changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package psqueues
+# spec file for package psqueues.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name psqueues
 
+%global pkg_name psqueues
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.4.0
 Release:        0
 Summary:        Pure priority search queues
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-QuickCheck-devel
@@ -83,7 +80,6 @@
 
 * Pathfinding algorithms, such as Dijkstra's and A*.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -91,19 +87,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -123,15 +117,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG
 
 %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,5 +1,5 @@
 #
-# spec file for package pusher-http-haskell
+# spec file for package pusher-http-haskell.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name pusher-http-haskell
 
+%global pkg_name pusher-http-haskell
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.5.1.0
 Release:        0
 Summary:        Haskell client library for the Pusher HTTP API
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-base16-bytestring-devel
 BuildRequires:  ghc-bytestring-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-http-client-devel
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-memory-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-transformers-devel
@@ -56,7 +53,6 @@
 Additionally there are functions for authenticating users of private and
 presence channels.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -64,20 +60,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -97,13 +91,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package quickcheck-arbitrary-adt
+# spec file for package quickcheck-arbitrary-adt.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name quickcheck-arbitrary-adt
 
+%global pkg_name quickcheck-arbitrary-adt
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.0
 Release:        0
 Summary:        Generic typeclasses for generating arbitrary ADTs
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
 BuildRequires:  ghc-lens-devel
@@ -42,7 +39,6 @@
 %description
 Improve arbitrary value generation for ADTs.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,20 +46,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -83,13 +77,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package quickcheck-combinators
+# spec file for package quickcheck-combinators.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name quickcheck-combinators
 
+%global pkg_name quickcheck-combinators
 Name:           %{pkg_name}
 Version:        0.0.2
 Release:        0
 Summary:        Simple type-level combinators for augmenting QuickCheck instances
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-unfoldable-restricted-devel
 
 %description
@@ -42,7 +40,6 @@
 &#32;&#32;&#32;&#32;vars <- arbitrary :: Gen (AtLeast 3 Set String)
 &#32;&#32;&#32;&#32;&#45;&#45; ... ' .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,20 +47,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -80,15 +75,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package rank1dynamic
+# spec file for package rank1dynamic.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name rank1dynamic
 
+%global pkg_name rank1dynamic
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.0
 Release:        0
 Summary:        Like Data.Dynamic/Data.Typeable but with support for rank-1 polymorphic types
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-test-framework-devel
@@ -43,7 +40,6 @@
 package we provide similar functionality but with support for rank-1
 polymorphic types.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog
 
 %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,5 +1,5 @@
 #
-# spec file for package rasterific-svg
+# spec file for package rasterific-svg.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name rasterific-svg
 
+%global pkg_name rasterific-svg
 Name:           %{pkg_name}
 Version:        0.3.3
 Release:        0
 Summary:        SVG renderer based on Rasterific
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-FontyFruity-devel
 BuildRequires:  ghc-JuicyPixels-devel
 BuildRequires:  ghc-Rasterific-devel
@@ -43,6 +40,7 @@
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-svg-tree-devel
 BuildRequires:  ghc-text-devel
@@ -53,7 +51,6 @@
 SVG renderer that will let you render svg-tree parsed SVG file to a JuicyPixel
 image or Rasterific Drawing.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,16 +86,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 %{_bindir}/svgrender
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package ratio-int
+# spec file for package ratio-int.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ratio-int
 
+%global pkg_name ratio-int
 Name:           %{pkg_name}
 Version:        0.1.2
 Release:        0
 Summary:        Fast specialisation of Data.Ratio for Int
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -36,7 +34,6 @@
 Runs about ten times faster than Data.Int while being half as fast as
 floating-point types.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,9 +70,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package rawstring-qm
+# spec file for package rawstring-qm.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name rawstring-qm
 
+%global pkg_name rawstring-qm
 Name:           %{pkg_name}
 Version:        0.2.3.0
 Release:        0
 Summary:        Simple raw string quotation and dictionary interpolation
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
 
@@ -37,7 +35,6 @@
 Supply a couple of usefull QuasiQuotes so we can use functions to lookup values
 It has quasiquotes for Strings, Text and Builders.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,15 +69,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES
 
 %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,5 +1,5 @@
 #
-# spec file for package reactive-banana
+# spec file for package reactive-banana.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name reactive-banana
 
+%global pkg_name reactive-banana
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.1.0.1
 Release:        0
 Summary:        Library for functional reactive programming (FRP)
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-pqueue-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vault-devel
@@ -61,7 +58,6 @@
 
 /API guide./ Start with the "Reactive.Banana" module.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -69,19 +65,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -101,15 +95,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md doc
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md doc
 
 %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,5 +1,5 @@
 #
-# spec file for package readline
+# spec file for package readline.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name readline
 
+%global pkg_name readline
 Name:           %{pkg_name}
 Version:        1.0.3.0
 Release:        0
 Summary:        An interface to the GNU readline library
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 More information on readline can be found at
 http://www.gnu.org/directory/readline.html.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,13 +67,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package rebase
+# spec file for package rebase.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name rebase
 
+%global pkg_name rebase
 Name:           %{pkg_name}
 Version:        1.1.1
 Release:        0
 Summary:        A more progressive alternative to the "base" package
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-base-prelude-devel
 BuildRequires:  ghc-bifunctors-devel
 BuildRequires:  ghc-bytestring-devel
@@ -42,6 +39,7 @@
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroups-devel
@@ -74,7 +72,6 @@
 The package is intended to rapidly evolve with the contribution from the
 community, with the missing features being added with pull-requests.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -82,19 +79,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -111,13 +106,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package reform-blaze
+# spec file for package reform-blaze.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,30 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name reform-blaze
 
+%global pkg_name reform-blaze
 Name:           %{pkg_name}
 Version:        0.2.4.3
 Release:        0
 Summary:        Add support for using blaze-html with Reform
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-blaze-html-devel
 BuildRequires:  ghc-blaze-markup-devel
 BuildRequires:  ghc-reform-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
 Reform is a library for building and validating forms using applicative
 functors. This package add support for using reform with blaze-html.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,13 +70,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package reform-hsp
+# spec file for package reform-hsp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,30 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name reform-hsp
 
+%global pkg_name reform-hsp
 Name:           %{pkg_name}
 Version:        0.2.7.1
 Release:        0
 Summary:        Add support for using HSP with Reform
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-hsp-devel
 BuildRequires:  ghc-hsx2hs-devel
 BuildRequires:  ghc-reform-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
 Reform is a library for building and validating forms using applicative
 functors. This package add support for using reform with HSP.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,13 +70,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package regex-compat
+# spec file for package regex-compat.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name regex-compat
 
+%global pkg_name regex-compat
 Name:           %{pkg_name}
 Version:        0.95.1
 Release:        0
 Summary:        Replaces/Enhances Text.Regex
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-regex-base-devel
 BuildRequires:  ghc-regex-posix-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 One module layer over regex-posix to replace Text.Regex.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,13 +68,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package regex-pcre
+# spec file for package regex-pcre.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,30 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name regex-pcre
 
+%global pkg_name regex-pcre
 Name:           %{pkg_name}
 Version:        0.94.4
 Release:        0
 Summary:        Replaces/Enhances Text.Regex
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-regex-base-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  pcre-devel
 
 %description
 The PCRE backend to accompany regex-base, see www.pcre.org.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,20 +43,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
+Requires:       pcre-devel
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
-Requires:       pcre-devel
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,13 +71,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package relational-query
+# spec file for package relational-query.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name relational-query
 
+%global pkg_name relational-query
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.11.0.0
 Release:        0
 Summary:        Typeful, Modular, Relational, algebraic query engine
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
@@ -38,6 +34,7 @@
 BuildRequires:  ghc-names-th-devel
 BuildRequires:  ghc-persistable-record-devel
 BuildRequires:  ghc-product-isomorphic-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-sql-words-devel
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
@@ -55,7 +52,6 @@
 are below: - Type safe query building - Restriction, Join, Aggregation -
 Modularized relations - Typed placeholders.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +59,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -95,15 +89,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package relational-schemas
+# spec file for package relational-schemas.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name relational-schemas
 
+%global pkg_name relational-schemas
 Name:           %{pkg_name}
 Version:        0.1.6.1
 Release:        0
 Summary:        RDBMSs' schema templates for relational-query
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-relational-query-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-time-devel
 
@@ -40,7 +38,6 @@
 Supported RDBMS schemas are below: - IBM DB2 - PostgreSQL - Microsoft SQLServer
 - SQLite3 - Oracle - MySQL.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package repa-io
+# spec file for package repa-io.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,31 +15,28 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name repa-io
 
+%global pkg_name repa-io
 Name:           %{pkg_name}
 Version:        3.4.1.1
 Release:        0
 Summary:        Read and write Repa arrays in various formats
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bmp-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-old-time-devel
 BuildRequires:  ghc-repa-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
 
 %description
 Read and write Repa arrays in various formats.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,13 +71,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package repa
+# spec file for package repa.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name repa
 
+%global pkg_name repa
 Name:           %{pkg_name}
 Version:        3.4.1.3
 Release:        0
 Summary:        High performance, regular, shape polymorphic parallel arrays
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-vector-devel
 
@@ -40,7 +38,6 @@
 Repa combinators are automatically parallel provided you supply +RTS -Nwhatever
 on the command line when running the program.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,13 +72,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package rosezipper
+# spec file for package rosezipper.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name rosezipper
 
+%global pkg_name rosezipper
 Name:           %{pkg_name}
 Version:        0.2
 Release:        0
 Summary:        Generic zipper implementation for Data.Tree
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 A Haskell datastructure for working with locations in trees or forests.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,13 +66,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package rvar
+# spec file for package rvar.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name rvar
 
+%global pkg_name rvar
 Name:           %{pkg_name}
 Version:        0.2.0.3
 Release:        0
 Summary:        Random Variables
-Group:          Development/Libraries/Haskell
-
 License:        SUSE-Public-Domain
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-MonadPrompt-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-random-source-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 
 %description
@@ -49,7 +47,6 @@
 
 Changes in 0.2.0.1: Version bump for transformers dependency.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +54,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -88,9 +83,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package scalpel-core
+# spec file for package scalpel-core.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name scalpel-core
 
+%global pkg_name scalpel-core
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.1
 Release:        0
 Summary:        A high level web scraping library for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-data-default-devel
 BuildRequires:  ghc-fail-devel
 BuildRequires:  ghc-regex-base-devel
 BuildRequires:  ghc-regex-tdfa-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagsoup-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-vector-devel
@@ -49,7 +46,6 @@
 intended to have lightweight dependencies and to be free of all non-Haskell
 dependencies.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -89,15 +83,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package sdl2
+# spec file for package sdl2.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name sdl2
 
+%global pkg_name sdl2
 Name:           %{pkg_name}
 Version:        2.3.0
 Release:        0
 Summary:        Both high- and low-level bindings to the SDL library (version 2.0.4+)
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-StateVar-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-linear-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-vector-devel
 BuildRequires:  libSDL2-devel
+BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(sdl2)
 
 %description
@@ -51,7 +50,6 @@
 Thus this namespace is suitable for building your own abstraction over SDL, but
 is not recommended for day-to-day programming.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,22 +57,20 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
-Requires:       ghc-compiler = %{ghc_version}
-Requires(post): ghc-compiler = %{ghc_version}
-Requires(postun): ghc-compiler = %{ghc_version}
 Requires:       ghc-%{name} = %{version}-%{release}
+Requires:       ghc-compiler = %{ghc_version}
 Requires:       libSDL2-devel
 Requires:       pkgconfig
 Requires:       pkgconfig(sdl2)
+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.
 
-
 %prep
 %setup -q
 
@@ -91,7 +87,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md
 %dir %{_datadir}/%{name}-%{version}
 %dir %{_datadir}/%{name}-%{version}/examples
@@ -101,11 +97,9 @@
 %{_datadir}/%{name}-%{version}/examples/twinklebear/*.bmp
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package selda-sqlite
+# spec file for package selda-sqlite.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,30 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name selda-sqlite
 
+%global pkg_name selda-sqlite
 Name:           %{pkg_name}
 Version:        0.1.6.0
 Release:        0
 Summary:        SQLite backend for the Selda database EDSL
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-direct-sqlite-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-exceptions-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-selda-devel
 BuildRequires:  ghc-text-devel
 
 %description
 SQLite backend for the Selda database EDSL.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -75,13 +70,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package selda
+# spec file for package selda.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name selda
 
+%global pkg_name selda
 Name:           %{pkg_name}
 Version:        0.1.11.2
 Release:        0
 Summary:        Type-safe, high-level EDSL for interacting with relational databases
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-psqueues-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-unordered-containers-devel
@@ -47,7 +45,6 @@
 There are currently two different backend packages: selda-sqlite and
 selda-postgresql.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +52,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package servant-checked-exceptions
+# spec file for package servant-checked-exceptions.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name servant-checked-exceptions
 
+%global pkg_name servant-checked-exceptions
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.1.0
 Release:        0
 Summary:        Checked exceptions for Servant APIs
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-http-media-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-servant-client-devel
 BuildRequires:  ghc-servant-devel
 BuildRequires:  ghc-servant-docs-devel
@@ -56,7 +53,6 @@
 Please see <https://github.com/cdepillabout/servant-checked-exceptions#readme
 README.md>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -64,20 +60,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library
 development files.
 
-
 %prep
 %setup -q
 
@@ -97,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package set-cover
+# spec file for package set-cover.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name set-cover
 
+%global pkg_name set-cover
 Name:           %{pkg_name}
 Version:        0.0.8
 Release:        0
 Summary:        Solve exact set cover problems like Sudoku, 8 Queens, Soma Cube, Tetris Cube
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-enummapset-devel
 BuildRequires:  ghc-psqueues-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-utility-ht-devel
 
 %description
@@ -48,7 +46,6 @@
 
 The package needs only Haskell 98.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -56,19 +53,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,15 +80,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc Changes.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc Changes.md
 
 %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,5 +1,5 @@
 #
-# spec file for package sets
+# spec file for package sets.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name sets
 
+%global pkg_name sets
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.5.2
 Release:        0
 Summary:        Ducktyped set interface for Haskell containers
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-commutative-devel
 BuildRequires:  ghc-composition-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-keys-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-semigroups-devel
 BuildRequires:  ghc-transformers-base-devel
@@ -55,7 +52,6 @@
 %description
 Includes overloaded functions for common set operations. See 'Data.Set.Class'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -63,19 +59,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -95,13 +89,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package simple-smt
+# spec file for package simple-smt.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name simple-smt
 
+%global pkg_name simple-smt
 Name:           %{pkg_name}
 Version:        0.7.1
 Release:        0
 Summary:        A simple way to interact with an SMT solver process
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 A simple way to interact with an SMT solver process.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES
 
 %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,5 +1,5 @@
 #
-# spec file for package slack-web
+# spec file for package slack-web.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name slack-web
 
+%global pkg_name slack-web
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.1
 Release:        0
 Summary:        Bindings for the Slack web API
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-errors-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-http-client-tls-devel
 BuildRequires:  ghc-megaparsec-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-servant-client-devel
 BuildRequires:  ghc-servant-devel
 BuildRequires:  ghc-text-devel
@@ -51,7 +48,6 @@
 %description
 Haskell bindings for the Slack web API.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,19 +55,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE.md
+%license LICENSE.md
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE.md
+%license LICENSE.md
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package slug
+# spec file for package slug.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name slug
 
+%global pkg_name slug
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.7
 Release:        0
 Summary:        Type-safe slugs for Yesod ecosystem
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-http-api-data-devel
 BuildRequires:  ghc-path-pieces-devel
 BuildRequires:  ghc-persistent-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-hspec-devel
@@ -45,7 +42,6 @@
 %description
 Type-safe slugs for Yesod ecosystem.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE.md
+%license LICENSE.md
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE.md
+%license LICENSE.md
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package soxlib
+# spec file for package soxlib.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,27 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name soxlib
 
+%global pkg_name soxlib
 Name:           %{pkg_name}
 Version:        0.0.3
 Release:        0
 Summary:        Write, read, convert audio signals using libsox
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-explicit-exception-devel
 BuildRequires:  ghc-extensible-exceptions-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-sample-frame-devel
 BuildRequires:  ghc-storablevector-devel
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-utility-ht-devel
+BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(sox)
 
 %description
@@ -46,7 +45,6 @@
 
 The package 'sox' has similar functionality but calls the 'sox' shell command.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -54,21 +52,19 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
-Requires:       ghc-compiler = %{ghc_version}
-Requires(post): ghc-compiler = %{ghc_version}
-Requires(postun): ghc-compiler = %{ghc_version}
 Requires:       ghc-%{name} = %{version}-%{release}
+Requires:       ghc-compiler = %{ghc_version}
 Requires:       pkgconfig
 Requires:       pkgconfig(sox)
+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.
 
-
 %prep
 %setup -q
 
@@ -85,13 +81,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package speedy-slice
+# spec file for package speedy-slice.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name speedy-slice
 
+%global pkg_name speedy-slice
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Speedy slice sampling
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-kan-extensions-devel
 BuildRequires:  ghc-lens-devel
 BuildRequires:  ghc-mcmc-types-devel
 BuildRequires:  ghc-mwc-probability-devel
 BuildRequires:  ghc-pipes-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
 BuildRequires:  ghc-containers-devel
@@ -62,7 +59,6 @@
 2 - 8 * x0 - 8 * x1) where > x0 = index xs 0 > x1 = index xs 1 > > main :: IO
 () > main = withSystemRandom . asGenIO $ mcmc 10000 1 (fromList [0, 0]) bnn.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -70,19 +66,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -102,13 +96,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package splice
+# spec file for package splice.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name splice
 
+%global pkg_name splice
 Name:           %{pkg_name}
 Version:        0.6.1.1
 Release:        0
 Summary:        Cross-platform Socket to Socket Data Splicing
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 A library that implements most efficient socket to socket data transfer loops
@@ -49,7 +47,6 @@
 
 * 'PackagingOnly' changes are made for quality assurance reasons.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,19 +54,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -86,13 +81,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package spreadsheet
+# spec file for package spreadsheet.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name spreadsheet
 
+%global pkg_name spreadsheet
 Name:           %{pkg_name}
 Version:        0.1.3.7
 Release:        0
 Summary:        Read and write spreadsheets from and to CSV files in a lazy way
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-explicit-exception-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-utility-ht-devel
 
@@ -59,7 +57,6 @@
 * 'cassava': high-level CSV parser that treats rows as records, parses
 ByteStrings and is biased towards UTF-8 encoding.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -67,19 +64,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -96,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package stack-type
+# spec file for package stack-type.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name stack-type
 
+%global pkg_name stack-type
 Name:           %{pkg_name}
 Version:        0.1.0.0
 Release:        0
 Summary:        The basic stack type
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
@@ -34,7 +32,6 @@
 %description
 The basic stack type.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package state-codes
+# spec file for package state-codes.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name state-codes
 
+%global pkg_name state-codes
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.3
 Release:        0
 Summary:        ISO 3166-2:US state codes and i18n names
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-shakespeare-devel
 BuildRequires:  ghc-text-devel
 %if %{with tests}
@@ -42,7 +39,6 @@
 %description
 This package provides the ISO 3166-2:US state codes and i18n names.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,15 +76,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package stb-image-redux
+# spec file for package stb-image-redux.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name stb-image-redux
 
+%global pkg_name stb-image-redux
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.1.2
 Release:        0
 Summary:        Image loading and writing microlibrary
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
@@ -39,7 +36,6 @@
 %description
 See <https://github.com/typedrat/stb-image-redux/blob/master/README.md>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +43,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -79,13 +73,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package stm-containers
+# spec file for package stm-containers.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name stm-containers
 
+%global pkg_name stm-containers
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.16
 Release:        0
 Summary:        Containers for STM
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 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
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
 BuildRequires:  ghc-HTF-devel
@@ -57,7 +54,6 @@
 For details on performance of the library see
 <http://nikita-volkov.github.io/stm-containers/ this blog post>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,13 +91,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package streaming-commons
+# spec file for package streaming-commons.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name streaming-commons
 
+%global pkg_name streaming-commons
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.18
 Release:        0
 Summary:        Common lower-level functions needed by various streaming data libraries
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-blaze-builder-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-network-devel
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
@@ -54,7 +51,6 @@
 Provides low-dependency functionality commonly needed by various streaming data
 libraries, such as conduit and pipes.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -62,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -94,15 +88,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package strict-base-types
+# spec file for package strict-base-types.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name strict-base-types
 
+%global pkg_name strict-base-types
 Name:           %{pkg_name}
 Version:        0.5.0
 Release:        0
 Summary:        Strict variants of the types provided in base
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bifunctors-devel
@@ -36,6 +33,7 @@
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-lens-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-strict-devel
 
 %description
@@ -106,7 +104,6 @@
 datatype are identified by suffixing 'Strict' or 'Lazy' in the module
 hierarchy.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -114,19 +111,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -143,15 +138,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES
 
 %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,5 +1,5 @@
 #
-# spec file for package strict-types
+# spec file for package strict-types.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name strict-types
 
+%global pkg_name strict-types
 Name:           %{pkg_name}
 Version:        0.1.2
 Release:        0
 Summary:        A type level predicate ranging over strict types
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vector-devel
@@ -41,7 +39,6 @@
 %description
 A type class for types T where forall x :: T . rnf x = ⊥ <=> rwhnf x = ⊥.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -78,15 +73,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package string-class
+# spec file for package string-class.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name string-class
 
+%global pkg_name string-class
 Name:           %{pkg_name}
 Version:        0.1.6.5
 Release:        0
 Summary:        String class library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-text-devel
 
 %description
 String class library.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,15 +68,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package stripe-haskell
+# spec file for package stripe-haskell.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name stripe-haskell
 
+%global pkg_name stripe-haskell
 Name:           %{pkg_name}
 Version:        2.2.3
 Release:        0
 Summary:        Stripe API for Haskell
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-stripe-core-devel
@@ -35,7 +33,6 @@
 %description
 For usage information please consult README.md.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,15 +67,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package svg-tree
+# spec file for package svg-tree.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name svg-tree
 
+%global pkg_name svg-tree
 Name:           %{pkg_name}
 Version:        0.6.2.1
 Release:        0
 Summary:        SVG file loader and serializer
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-JuicyPixels-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-bytestring-devel
@@ -36,6 +33,7 @@
 BuildRequires:  ghc-lens-devel
 BuildRequires:  ghc-linear-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-scientific-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
@@ -51,7 +49,6 @@
 
 To render an svg document you can use the `rasterific-svg` package.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -59,19 +56,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,10 +86,8 @@
 %doc changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package swagger
+# spec file for package swagger.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name swagger
 
+%global pkg_name swagger
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        Implementation of swagger data model
-Group:          Development/Libraries/Haskell
-
 License:        Unknown
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
 BuildRequires:  ghc-transformers-devel
@@ -45,7 +42,6 @@
 Implementation of Swagger specification version 1.2 as defined in
 <https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,13 +79,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package system-argv0
+# spec file for package system-argv0.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name system-argv0
 
+%global pkg_name system-argv0
 Name:           %{pkg_name}
 Version:        0.1.1
 Release:        0
 Summary:        Get argv[0] as a FilePath
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-system-filepath-devel
 BuildRequires:  ghc-text-devel
 
@@ -40,7 +38,6 @@
 Use this instead of 'System.Environment.getProgName' if you want the full path,
 and not just the last component.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -77,13 +72,11 @@
 %ghc_pkg_recache
 
 %files
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package system-fileio
+# spec file for package system-fileio.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name system-fileio
 
+%global pkg_name system-fileio
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.16.3
 Release:        0
 Summary:        Consistent filesystem interaction across GHC versions (deprecated)
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-system-filepath-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-time-devel
@@ -45,7 +42,6 @@
 %description
 Please see: https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc license.txt
+%license license.txt
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package system-filepath
+# spec file for package system-filepath.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name system-filepath
 
+%global pkg_name system-filepath
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.13.4
 Release:        0
 Summary:        High-level, byte-based file and directory path manipulations (deprecated)
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -43,7 +40,6 @@
 %description
 Please see: https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,15 +77,13 @@
 %ghc_pkg_recache
 
 %files
-%doc license.txt
+%license license.txt
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc license.txt
+%license license.txt
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package tagged
+# spec file for package tagged.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tagged
 
+%global pkg_name tagged
 Name:           %{pkg_name}
 Version:        0.8.5
 Release:        0
 Summary:        Haskell 98 phantom types to avoid unsafely passing dummy arguments
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-devel
@@ -37,7 +35,6 @@
 %description
 Haskell 98 phantom types to avoid unsafely passing dummy arguments.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -45,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -74,15 +69,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package taggy
+# spec file for package taggy.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name taggy
 
+%global pkg_name taggy
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.1
 Release:        0
 Summary:        Efficient and simple HTML/XML parsing library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-blaze-html-devel
 BuildRequires:  ghc-blaze-markup-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-unordered-containers-devel
 BuildRequires:  ghc-vector-devel
@@ -76,7 +73,6 @@
 want to turn it into a 'Data.Text.Lazy.Text' head to "Text.Taggy.Renderer" and
 look at 'Text.Taggy.Renderer.render'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -84,19 +80,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -117,17 +111,15 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/%{name}
 %dir %{_datadir}/%{name}-%{version}
 %dir %{_datadir}/%{name}-%{version}/html_files
 %{_datadir}/%{name}-%{version}/html_files/*.html
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package tagstream-conduit
+# spec file for package tagstream-conduit.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tagstream-conduit
 
+%global pkg_name tagstream-conduit
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.5.3
 Release:        0
 Summary:        Streamlined html tag parser
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-bytestring-devel
@@ -39,6 +35,7 @@
 BuildRequires:  ghc-conduit-extra-devel
 BuildRequires:  ghc-data-default-devel
 BuildRequires:  ghc-resourcet-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-xml-conduit-devel
@@ -54,7 +51,6 @@
 which can parse streamline html, which means it consumes constant memory.
 You can start from the `tests/Tests.hs` module to see what it can do.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -62,19 +58,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -94,13 +88,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package tasty-hedgehog
+# spec file for package tasty-hedgehog.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tasty-hedgehog
 
+%global pkg_name tasty-hedgehog
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.1
 Release:        0
 Summary:        Integrates the hedgehog testing library with the tasty testing framework
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-hedgehog-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-tagged-devel
 BuildRequires:  ghc-tasty-devel
 %if %{with tests}
@@ -41,7 +38,6 @@
 %description
 Integrates the hedgehog testing library with the tasty testing framework.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -49,19 +45,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,15 +75,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package tasty-rerun
+# spec file for package tasty-rerun.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tasty-rerun
 
+%global pkg_name tasty-rerun
 Name:           %{pkg_name}
 Version:        1.1.8
 Release:        0
 Summary:        Run tests by filtering the test tree depending on the result of previous test runs
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-optparse-applicative-devel
 BuildRequires:  ghc-reducers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-tagged-devel
@@ -83,7 +81,6 @@
 
 Defaults to all filters, which means all tests will be ran.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -91,19 +88,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -120,15 +115,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc Changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc Changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package tce-conf
+# spec file for package tce-conf.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tce-conf
 
+%global pkg_name tce-conf
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        1.3
 Release:        0
 Summary:        Very simple config file reading
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
 %endif
@@ -43,7 +40,6 @@
 `Read`. The modules support files with blank lines and simple single-line
 comments, but nothing else.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,17 +78,15 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md TODO.md changelog.md doc
 %{_bindir}/KVConf-example
 %{_bindir}/ReadConf-example
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md TODO.md changelog.md doc
 
 %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,5 +1,5 @@
 #
-# spec file for package terminal-progress-bar
+# spec file for package terminal-progress-bar.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name terminal-progress-bar
 
+%global pkg_name terminal-progress-bar
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.1.1
 Release:        0
 Summary:        A simple progress bar in the terminal
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-stm-chans-devel
@@ -50,7 +47,6 @@
 carriage return character ('\r'). If your terminal interprets it as something
 else than "move cursor to beginning of line", the animation won't work.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,20 +54,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -91,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package test-fixture
+# spec file for package test-fixture.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name test-fixture
 
+%global pkg_name test-fixture
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.5.1.0
 Release:        0
 Summary:        Test monadic side-effects
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-data-default-class-devel
 BuildRequires:  ghc-exceptions-devel
 BuildRequires:  ghc-haskell-src-exts-devel
 BuildRequires:  ghc-haskell-src-meta-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-th-orphans-devel
 %if %{with tests}
@@ -47,7 +44,6 @@
 %description
 Test monadic side-effects.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -87,15 +81,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package texmath
+# spec file for package texmath.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name texmath
 
+%global pkg_name texmath
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.10.1
 Release:        0
 Summary:        Conversion between formats used to represent mathematics
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-pandoc-types-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-xml-devel
 %if %{with tests}
@@ -72,7 +69,6 @@
 optionally 'inline', and return a JSON object with either 'error' and a message
 or 'success' and the converted result.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -80,19 +76,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -112,15 +106,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown changelog
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown changelog
 
 %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,5 +1,5 @@
 #
-# spec file for package text-icu
+# spec file for package text-icu.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name text-icu
 
+%global pkg_name text-icu
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.7.0.1
 Release:        0
 Summary:        Bindings to the ICU library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  libicu-devel
 %if %{with tests}
@@ -73,7 +70,6 @@
 
 * Regular expression search and replace.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -81,20 +77,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
+Requires:       libicu-devel
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
-Requires:       libicu-devel
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -114,15 +108,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.markdown changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.markdown changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package text-postgresql
+# spec file for package text-postgresql.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name text-postgresql
 
+%global pkg_name text-postgresql
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.2.3
 Release:        0
 Summary:        Parser and Printer of PostgreSQL extended types
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-dlist-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-devel
 %if %{with tests}
@@ -43,7 +40,6 @@
 This package involves parser and printer for text expressions of PostgreSQL
 extended types. - inet type, cidr type.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -83,13 +77,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package th-expand-syns
+# spec file for package th-expand-syns.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,30 +15,26 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name th-expand-syns
 
+%global pkg_name th-expand-syns
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.4.0
 Release:        0
 Summary:        Expands type synonyms in Template Haskell ASTs
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-syb-devel
 BuildRequires:  ghc-template-haskell-devel
 
 %description
 Expands type synonyms in Template Haskell ASTs.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -46,19 +42,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -78,15 +72,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc changelog.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package these
+# spec file for package these.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name these
 
+%global pkg_name these
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.7.4
 Release:        0
 Summary:        An either-or-both data type & a generalized 'zip with padding' typeclass
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-bifunctors-devel
@@ -42,6 +38,7 @@
 BuildRequires:  ghc-keys-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-profunctors-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-semigroupoids-devel
 BuildRequires:  ghc-transformers-compat-devel
 BuildRequires:  ghc-transformers-devel
@@ -67,7 +64,6 @@
 Also included is 'ChronicleT', a monad transformer based on the Monad instance
 for 'These a', along with the usual monad transformer bells and whistles.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -75,19 +71,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -107,15 +101,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package timezone-series
+# spec file for package timezone-series.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name timezone-series
 
+%global pkg_name timezone-series
 Name:           %{pkg_name}
 Version:        0.1.8
 Release:        0
 Summary:        Enhanced timezone handling for Data.Time
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-time-devel
 
 %description
@@ -39,7 +37,6 @@
 (<http://hackage.haskell.org/package/timezone-olson>) and timezone-olson-th
 (<http://hackage.haskell.org/package/timezone-olson-th>) packages.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,15 +71,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package transformers-compat
+# spec file for package transformers-compat.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name transformers-compat
 
+%global pkg_name transformers-compat
 Name:           %{pkg_name}
 Version:        0.5.1.4
 Release:        0
 Summary:        A small compatibility shim exposing the new types from transformers 0.3 and 0.4 to older Haskell platforms
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
@@ -43,7 +41,6 @@
 Note: missing methods are not supplied, but this at least permits the types to
 be used.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,20 +48,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -81,15 +76,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package transformers-lift
+# spec file for package transformers-lift.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name transformers-lift
 
+%global pkg_name transformers-lift
 Name:           %{pkg_name}
 Version:        0.2.0.1
 Release:        0
 Summary:        Ad-hoc type classes for lifting
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
@@ -36,7 +34,6 @@
 This simple and lightweight library provides type classes for lifting monad
 transformer operations.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,13 +68,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package tree-fun
+# spec file for package tree-fun.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tree-fun
 
+%global pkg_name tree-fun
 Name:           %{pkg_name}
 Version:        0.8.1.0
 Release:        0
 Summary:        Library for functions pertaining to tree exploration and manipulation
+License:        GPL-3.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-3.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Library for functions pertaining to tree exploration and manipulation.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,19 +40,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -72,15 +67,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package ttrie
+# spec file for package ttrie.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name ttrie
 
+%global pkg_name ttrie
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.2.1
 Release:        0
 Summary:        Contention-free STM hash map
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-atomic-primops-devel
 BuildRequires:  ghc-hashable-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-stm-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -53,7 +50,6 @@
 including an evaluation of its performance, see Chapter 4 of
 <https://github.com/mcschroeder/thesis my master's thesis>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -61,19 +57,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -93,15 +87,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md changelog.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md changelog.md
 
 %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,5 +1,5 @@
 #
-# spec file for package tuple-th
+# spec file for package tuple-th.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tuple-th
 
+%global pkg_name tuple-th
 Name:           %{pkg_name}
 Version:        0.2.5
 Release:        0
 Summary:        Generate (non-recursive) utility functions for tuples of statically known size
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-template-haskell-devel
 
 %description
 Template Haskell functions for generating functions similar to those in
 Data.List for tuples of statically known size.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,13 +68,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package tuples-homogenous-h98
+# spec file for package tuples-homogenous-h98.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name tuples-homogenous-h98
 
+%global pkg_name tuples-homogenous-h98
 Name:           %{pkg_name}
 Version:        0.1.1.0
 Release:        0
 Summary:        Wrappers for n-ary tuples with Traversable and Applicative/Monad instances
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -35,7 +33,6 @@
 and instances for 'Functor', 'Applicative' (zipping), 'Monad', 'Foldable' and
 'Traversable'. The package aims to be Haskell98 compliant.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,20 +40,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -73,13 +68,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package turtle-options
+# spec file for package turtle-options.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name turtle-options
 
+%global pkg_name turtle-options
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.4
 Release:        0
 Summary:        Collection of command line options and parsers for these options
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-optional-args-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-turtle-devel
 %if %{with tests}
@@ -43,7 +40,6 @@
 %description
 Collection of command line options and parsers for these options.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -84,16 +78,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 %{_bindir}/example
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package type-operators
+# spec file for package type-operators.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,18 +15,16 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name type-operators
 
+%global pkg_name type-operators
 Name:           %{pkg_name}
 Version:        0.1.0.4
 Release:        0
 Summary:        Various type-level operators
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 
@@ -34,7 +32,6 @@
 A set of type-level operators meant to be helpful, e.g. ($) and a tightly
 binding (->).
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,13 +66,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package type-spec
+# spec file for package type-spec.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name type-spec
 
+%global pkg_name type-spec
 Name:           %{pkg_name}
 Version:        0.3.0.1
 Release:        0
 Summary:        Type Level Specification by Example
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-pretty-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Type Level Specification by Example.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md examples
 
 %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,5 +1,5 @@
 #
-# spec file for package unicode-show
+# spec file for package unicode-show.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name unicode-show
 
+%global pkg_name unicode-show
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.1.0.2
 Release:        0
 Summary:        Print and show in unicode
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 %if %{with tests}
@@ -50,7 +47,6 @@
 <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/interactive-evaluation.html#ghci-interactive-print
 Using a custom interactive printing function> section in the GHC manual.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,19 +54,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,13 +84,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package unique
+# spec file for package unique.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,26 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name unique
 
+%global pkg_name unique
 Name:           %{pkg_name}
 Version:        0
 Release:        0
 Summary:        Fully concurrent unique identifiers
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-hashable-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Fully concurrent unique identifiers.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -42,19 +39,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -71,15 +66,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.markdown README.markdown
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.markdown README.markdown
 
 %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,5 +1,5 @@
 #
-# spec file for package unix-bytestring
+# spec file for package unix-bytestring.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name unix-bytestring
 
+%global pkg_name unix-bytestring
 Name:           %{pkg_name}
 Version:        0.3.7.3
 Release:        0
 Summary:        Unix/Posix-specific functions for ByteStrings
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 
 %description
 Unix/Posix-specific functions for ByteStrings.
@@ -44,7 +42,6 @@
 But you'll need it in order to get your hands on an 'Fd', so we're not offering
 a complete replacement.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -52,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,15 +76,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG README
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG README
 
 %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,5 +1,5 @@
 #
-# spec file for package unlit
+# spec file for package unlit.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name unlit
 
+%global pkg_name unlit
 Name:           %{pkg_name}
 Version:        0.4.0.0
 Release:        0
 Summary:        Tool to convert literate code between styles or to code
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 
 %description
@@ -43,7 +41,6 @@
 (optional) > -l LANGUAGE --language=LANGUAGE Programming language (restrict
 fenced code blocks) > -h --help Show help > -v --version Show version .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -51,19 +48,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -81,14 +76,12 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %{_bindir}/%{name}
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package utility-ht
+# spec file for package utility-ht.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name utility-ht
 
+%global pkg_name utility-ht
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.14
 Release:        0
 Summary:        Various small helper functions for Lists, Maybes, Tuples, Functions
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-rpm-macros
 %if %{with tests}
@@ -50,7 +47,6 @@
 
 Alternative packages: 'Useful', 'MissingH'.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,19 +54,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -90,13 +84,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package validity-aeson
+# spec file for package validity-aeson.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name validity-aeson
 
+%global pkg_name validity-aeson
 Name:           %{pkg_name}
 Version:        0.1.0.0
 Release:        0
 Summary:        Validity instances for aeson
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-validity-devel
 BuildRequires:  ghc-validity-scientific-devel
 BuildRequires:  ghc-validity-text-devel
@@ -39,7 +37,6 @@
 %description
 Validity instances for aeson.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -47,19 +44,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -76,13 +71,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package validity-containers
+# spec file for package validity-containers.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name validity-containers
 
+%global pkg_name validity-containers
 Name:           %{pkg_name}
 Version:        0.2.0.0
 Release:        0
 Summary:        Validity instances for containers
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-validity-devel
 
 %description
 Validity instances for containers.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,20 +40,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -73,13 +68,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package vector-mmap
+# spec file for package vector-mmap.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name vector-mmap
 
+%global pkg_name vector-mmap
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.3
 Release:        0
 Summary:        Memory map immutable and mutable vectors
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-mmap-devel
 BuildRequires:  ghc-primitive-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-vector-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -42,7 +39,6 @@
 %description
 Memory map immutable and mutable vectors.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +46,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -82,13 +76,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package vivid-supercollider
+# spec file for package vivid-supercollider.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name vivid-supercollider
 
+%global pkg_name vivid-supercollider
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.0.0
 Release:        0
 Summary:        Implementation of SuperCollider server specifications
+License:        GPL-1.0-or-later
 Group:          Development/Libraries/Haskell
-
-License:        GPL-1.0+
-Url:            https://hackage.haskell.org/package/%{name}
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-binary-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-cereal-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-utf8-string-devel
 BuildRequires:  ghc-vivid-osc-devel
@@ -49,7 +46,6 @@
 Note this is an in-progress (incomplete) implementation. Currently only the
 server commands needed for the "vivid" package are supported.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -57,20 +53,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -92,9 +86,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package vty
+# spec file for package vty.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name vty
 
+%global pkg_name vty
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        5.19.1
 Release:        0
 Summary:        A simple terminal UI library
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
@@ -45,6 +41,7 @@
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-parallel-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-terminfo-devel
 BuildRequires:  ghc-text-devel
@@ -82,7 +79,6 @@
 
 &#169; Jonathan Daugherty; BSD3 license.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -90,19 +86,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -123,17 +117,15 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc AUTHORS CHANGELOG.md README.md
 %{_bindir}/vty-demo
 %{_bindir}/vty-mode-demo
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc AUTHORS CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package wai-cors
+# spec file for package wai-cors.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name wai-cors
 
+%global pkg_name wai-cors
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.6
 Release:        0
 Summary:        CORS for WAI
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-attoparsec-devel
 BuildRequires:  ghc-base-unicode-symbols-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-case-insensitive-devel
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-transformers-devel
 BuildRequires:  ghc-wai-devel
 %if %{with tests}
@@ -58,7 +55,6 @@
 for <http://hackage.haskell.org/package/wai Wai> that aims to be compliant with
 <http://www.w3.org/TR/cors>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -66,19 +62,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -98,7 +92,7 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %dir %{_datadir}/%{name}-%{version}
 %dir %{_datadir}/%{name}-%{version}/examples
 %dir %{_datadir}/%{name}-%{version}/test
@@ -111,10 +105,8 @@
 %{_datadir}/%{name}-%{version}/test/phantomjs.js
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package wai-middleware-auth
+# spec file for package wai-middleware-auth.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,21 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name wai-middleware-auth
 
+%global pkg_name wai-middleware-auth
 Name:           %{pkg_name}
 Version:        0.1.2.1
 Release:        0
 Summary:        Authentication middleware that secures WAI application
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
-BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  chrpath
+BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-base64-bytestring-devel
 BuildRequires:  ghc-binary-devel
@@ -49,6 +46,7 @@
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-optparse-simple-devel
 BuildRequires:  ghc-regex-posix-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-safe-exceptions-devel
 BuildRequires:  ghc-shakespeare-devel
 BuildRequires:  ghc-text-devel
@@ -65,7 +63,6 @@
 %description
 Authentication middleware that secures WAI application.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -73,20 +70,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -104,16 +99,14 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG.md README.md
 %{_bindir}/wai-auth
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package wai-middleware-caching-redis
+# spec file for package wai-middleware-caching-redis.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name wai-middleware-caching-redis
 
+%global pkg_name wai-middleware-caching-redis
 Name:           %{pkg_name}
 Version:        0.2.0.0
 Release:        0
 Summary:        Cache Wai Middleware using Redis backend
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-hedis-devel
 BuildRequires:  ghc-http-types-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-wai-devel
 BuildRequires:  ghc-wai-middleware-caching-devel
@@ -40,7 +38,6 @@
 %description
 Cache Wai Middleware using Redis backend.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -48,20 +45,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library
 development files.
 
-
 %prep
 %setup -q
 
@@ -78,13 +73,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package wai-middleware-prometheus
+# spec file for package wai-middleware-prometheus.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name wai-middleware-prometheus
 
+%global pkg_name wai-middleware-prometheus
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.3.0
 Release:        0
 Summary:        WAI middlware for exposing http://prometheus.io metrics
-Group:          Development/Libraries/Haskell
-
 License:        Apache-2.0
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-clock-devel
 BuildRequires:  ghc-data-default-devel
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-prometheus-client-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-wai-devel
 %if %{with tests}
@@ -45,7 +42,6 @@
 %description
 WAI middlware for exposing http://prometheus.io metrics.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,20 +49,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -86,13 +80,11 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package warp
+# spec file for package warp.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,22 +15,18 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name warp
 
+%global pkg_name warp
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        3.2.13
 Release:        0
 Summary:        A fast, light-weight web server for WAI applications
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-auto-update-devel
@@ -45,6 +41,7 @@
 BuildRequires:  ghc-http2-devel
 BuildRequires:  ghc-iproute-devel
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-simple-sendfile-devel
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-streaming-commons-devel
@@ -73,7 +70,6 @@
 and ALPN (in TLS) but not upgrade. API docs and the README are available at
 <http://www.stackage.org/package/warp>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -81,19 +77,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -113,15 +107,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package weigh
+# spec file for package weigh.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,22 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name weigh
 
+%global pkg_name weigh
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.0.7
 Release:        0
 Summary:        Measure allocations of a Haskell functions/values
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-deepseq-devel
 BuildRequires:  ghc-mtl-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-temporary-devel
@@ -47,7 +44,6 @@
 %description
 Measure allocations of a Haskell functions/values.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -55,19 +51,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -87,15 +81,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGELOG README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGELOG README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package xml-hamlet
+# spec file for package xml-hamlet.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,24 +15,21 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name xml-hamlet
 
+%global pkg_name xml-hamlet
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.4.1.1
 Release:        0
 Summary:        Hamlet-style quasiquoter for XML content
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-containers-devel
 BuildRequires:  ghc-parsec-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-shakespeare-devel
 BuildRequires:  ghc-template-haskell-devel
 BuildRequires:  ghc-text-devel
@@ -45,7 +42,6 @@
 %description
 Hamlet-style quasiquoter for XML content.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -53,19 +49,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -85,15 +79,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package xmonad-contrib
+# spec file for package xmonad-contrib.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,20 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name xmonad-contrib
 
+%global pkg_name xmonad-contrib
 Name:           %{pkg_name}
 Version:        0.13
 Release:        0
 Summary:        Third party extensions for xmonad
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-X11-devel
 BuildRequires:  ghc-X11-xft-devel
 BuildRequires:  ghc-bytestring-devel
@@ -41,6 +38,7 @@
 BuildRequires:  ghc-old-time-devel
 BuildRequires:  ghc-process-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-unix-devel
 BuildRequires:  ghc-utf8-string-devel
 BuildRequires:  ghc-xmonad-devel
@@ -59,7 +57,6 @@
 "XMonad.Doc.Developing", introduction to xmonad internals and writing your own
 extensions. .
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -67,19 +64,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -96,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc CHANGES.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc CHANGES.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package yahoo-finance-api
+# spec file for package yahoo-finance-api.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name yahoo-finance-api
 
+%global pkg_name yahoo-finance-api
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.2.0.3
 Release:        0
 Summary:        Read quotes from Yahoo Finance API
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-aeson-devel
 BuildRequires:  ghc-either-devel
 BuildRequires:  ghc-http-api-data-devel
 BuildRequires:  ghc-http-client-devel
 BuildRequires:  ghc-mtl-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-servant-client-devel
 BuildRequires:  ghc-servant-devel
 BuildRequires:  ghc-text-devel
@@ -57,7 +54,6 @@
 This package is no longer usable. See
 <https://github.com/cdepillabout/yahoo-finance-api/issues/5 this issue>.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -65,19 +61,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -97,15 +91,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package yesod-form-bootstrap4
+# spec file for package yesod-form-bootstrap4.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,27 +15,24 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name yesod-form-bootstrap4
 
+%global pkg_name yesod-form-bootstrap4
 Name:           %{pkg_name}
 Version:        0.1.0.2
 Release:        0
 Summary:        RenderBootstrap4
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-classy-prelude-yesod-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-yesod-form-devel
 
 %description
 RenderBootstrap4.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -43,20 +40,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development
 files.
 
-
 %prep
 %setup -q
 
@@ -75,9 +70,7 @@
 %files
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 
 %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,5 +1,5 @@
 #
-# spec file for package yesod-gitrepo
+# spec file for package yesod-gitrepo.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,25 +15,23 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name yesod-gitrepo
 
+%global pkg_name yesod-gitrepo
 Name:           %{pkg_name}
 Version:        0.2.1.0
 Release:        0
 Summary:        Host content provided by a Git repo
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-enclosed-exceptions-devel
 BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-lifted-base-devel
 BuildRequires:  ghc-process-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-temporary-devel
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-wai-devel
@@ -42,7 +40,6 @@
 %description
 Host content provided by a Git repo.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -50,19 +47,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -79,15 +74,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc ChangeLog.md README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc ChangeLog.md README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package yesod-recaptcha2
+# spec file for package yesod-recaptcha2.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,28 +15,25 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name yesod-recaptcha2
 
+%global pkg_name yesod-recaptcha2
 Name:           %{pkg_name}
 Version:        0.2.3
 Release:        0
 Summary:        Yesod recaptcha2
-Group:          Development/Libraries/Haskell
-
 License:        MIT
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-classy-prelude-yesod-devel
 BuildRequires:  ghc-http-conduit-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-yesod-auth-devel
 
 %description
 Recaptcha2 for yesod-form.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -44,19 +41,17 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -73,15 +68,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc README.md
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc README.md
 
 %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,5 +1,5 @@
 #
-# spec file for package zlib
+# spec file for package zlib.spec
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -15,23 +15,20 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-%global pkg_name zlib
 
+%global pkg_name zlib
 %bcond_with tests
-
 Name:           %{pkg_name}
 Version:        0.6.1.2
 Release:        0
 Summary:        Compression and decompression in the gzip and zlib formats
-Group:          Development/Libraries/Haskell
-
 License:        BSD-3-Clause
-Url:            https://hackage.haskell.org/package/%{name}
+Group:          Development/Libraries/Haskell
+URL:            https://hackage.haskell.org/package/%{name}
 Source0:        https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
-
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-bytestring-devel
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  zlib-devel
 %if %{with tests}
 BuildRequires:  ghc-QuickCheck-devel
@@ -50,7 +47,6 @@
 cases where more control is needed it provides access to the full zlib feature
 set.
 
-
 %package -n ghc-%{name}
 Summary:        Haskell %{name} library
 Group:          System/Libraries
@@ -58,20 +54,18 @@
 %description -n ghc-%{name}
 This package provides the Haskell %{name} shared library.
 
-
 %package -n ghc-%{name}-devel
 Summary:        Haskell %{name} library development files
 Group:          Development/Libraries/Haskell
+Requires:       ghc-%{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
+Requires:       zlib-devel
 Requires(post): ghc-compiler = %{ghc_version}
 Requires(postun): ghc-compiler = %{ghc_version}
-Requires:       ghc-%{name} = %{version}-%{release}
-Requires:       zlib-devel
 
 %description -n ghc-%{name}-devel
 This package provides the Haskell %{name} library development files.
 
-
 %prep
 %setup -q
 
@@ -91,15 +85,13 @@
 %ghc_pkg_recache
 
 %files
-%doc LICENSE
+%license LICENSE
 %doc changelog examples
 
 %files -n ghc-%{name} -f ghc-%{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
 
 %files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
 %doc changelog examples
 
 %changelog
