diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,6 +1,11 @@
 cabal2spec
 ==========
 
+[![hackage release](https://img.shields.io/hackage/v/cabal2spec.svg?label=hackage)](http://hackage.haskell.org/package/cabal2spec)
+[![stackage LTS package](http://stackage.org/package/cabal2spec/badge/lts)](http://stackage.org/lts/package/cabal2spec)
+[![stackage Nightly package](http://stackage.org/package/cabal2spec/badge/nightly)](http://stackage.org/nightly/package/cabal2spec)
+[![travis build status](https://img.shields.io/travis/peti/cabal2spec/master.svg?label=travis+build)](https://travis-ci.org/peti/cabal2spec)
+
 The `cabal2spec` utility converts a given Cabal file into an [RPM spec
 file](http://ftp.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html) that
 builds that package with the RPM package manager. This tool is used to generate
diff --git a/cabal2spec.cabal b/cabal2spec.cabal
--- a/cabal2spec.cabal
+++ b/cabal2spec.cabal
@@ -1,65 +1,57 @@
-name:                   cabal2spec
-version:                2.1.1
-synopsis:               Convert Cabal files into rpm spec files
-homepage:               https://github.com/peti/cabal2spec
-license:                GPL-3
-license-file:           LICENSE
-author:                 Peter Simons, Bryan O'Sullivan, Jens Petersen
-maintainer:             simons@cryp.to
-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.2
-
-extra-source-files:
-  README.md
-  test/golden-test-cases/*.cabal
-  test/golden-test-cases/*.spec.golden
-
-description:
-  Convert Cabal files into a
-  <http://ftp.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html spec file>
-  suitable for building the package with the RPM package manager. This tool
-  primarily targets the <http://www.suse.com/ SUSE> and
-  <http://www.opensuse.org openSUSE> familiy of distributions. Support for
-  other RPM-based distributions is currently not available. Check out
-  <http://hackage.haskell.org/package/cabal-rpm cabal-rpm> if you need this.
+name:               cabal2spec
+version:            2.2.0
+synopsis:           Convert Cabal files into rpm spec files
+description:        Convert
+                    Cabal files into a
+                    <http://ftp.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html spec file>
+                    suitable for building the package with the RPM package manager. This
+                    tool primarily targets the <http://www.suse.com/ SUSE> and
+                    <http://www.opensuse.org openSUSE> familiy of distributions. Support
+                    for other RPM-based distributions is currently not available. Check
+                    out <http://hackage.haskell.org/package/cabal-rpm cabal-rpm> if you
+                    need this.
+license:            GPL-3
+license-file:       LICENSE
+author:             Peter Simons, Bryan O'Sullivan, Jens Petersen
+maintainer:         simons@cryp.to
+tested-with:        GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3
+category:           Distribution
+homepage:           https://github.com/peti/cabal2spec
+build-type:         Simple
+extra-source-files: README.md
+                    test/golden-test-cases/*.cabal
+                    test/golden-test-cases/*.spec.golden
+cabal-version:      >= 1.10
 
 source-repository head
-  type:                 git
-  location:             git://github.com/peti/cabal2spec.git
+  type:     git
+  location: git://github.com/peti/cabal2spec.git
 
 library
-  hs-source-dirs:       src
-  ghc-options:          -Wall
-  build-depends:        base < 5
-                      , Cabal > 2.2
-                      , filepath
-                      , time >= 1.5
-  exposed-modules:      Cabal2Spec
-  default-language:     Haskell2010
+  exposed-modules:    Cabal2Spec
+  hs-source-dirs:     src
+  build-depends:      base < 5, Cabal > 2.2, filepath, time >= 1.5
+  default-language:   Haskell2010
+  default-extensions: MonadFailDesugaring
+  ghc-options:        -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
+                      -Wredundant-constraints
 
 executable cabal2spec
-  main-is:              Main.hs
-  hs-source-dirs:       cabal2spec
-  other-modules:        Paths_cabal2spec
-  build-depends:        base < 5
-                      , Cabal > 2.2
-                      , cabal2spec
-                      , filepath
-                      , optparse-applicative
-  default-language:     Haskell2010
-  ghc-options:          -Wall
+  main-is:            Main.hs
+  other-modules:      Paths_cabal2spec
+  hs-source-dirs:     cabal2spec
+  build-depends:      base < 5, Cabal > 2.2, cabal2spec, filepath, optparse-applicative
+  default-language:   Haskell2010
+  default-extensions: MonadFailDesugaring
+  ghc-options:        -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
+                      -Wredundant-constraints
 
 test-suite regression-test
-  type:                 exitcode-stdio-1.0
-  main-is:              Main.hs
-  hs-source-dirs:       test
-  build-depends:        base
-                      , Cabal > 2.2
-                      , cabal2spec
-                      , filepath
-                      , tasty
-                      , tasty-golden
-  ghc-options:          -Wall
-  default-language:     Haskell2010
+  type:               exitcode-stdio-1.0
+  main-is:            Main.hs
+  hs-source-dirs:     test
+  build-depends:      base, Cabal > 2.2, cabal2spec, filepath, tasty, tasty-golden
+  default-language:   Haskell2010
+  default-extensions: MonadFailDesugaring
+  ghc-options:        -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates
+                      -Wredundant-constraints
diff --git a/cabal2spec/Main.hs b/cabal2spec/Main.hs
--- a/cabal2spec/Main.hs
+++ b/cabal2spec/Main.hs
@@ -18,6 +18,7 @@
   { optPlatform   :: Platform
   , optCompiler   :: CompilerId
   , optForceExe   :: ForceBinary
+  , optRunTests   :: RunTests
   , optFlags      :: [(FlagName, Bool)]
   , optOutputFile :: Maybe FilePath
   , optCabalFile  :: FilePath
@@ -29,7 +30,8 @@
   <$> option (maybeReader simpleParse) (long "platform" <> help "target build platform" <> value buildPlatform <> showDefaultWith (show . display))
   <*> option (maybeReader simpleParse) (long "compiler" <> help "compiler to use when evaluating the Cabal file" <> value buildCompilerId <> showDefaultWith (show . display))
   <*> switch (long "force-exe" <> help "treat this package as a executable-only build even if it defined a library")
-  <*> many (option (parseFlag) (short 'f' <> long "flag" <> help "Cabal flag (may be specified multiple times)"))
+  <*> switch (long "enable-tests" <> help "enable the test suite in the generated build")
+  <*> many (option parseFlag (short 'f' <> long "flag" <> help "Cabal flag (may be specified multiple times)"))
   <*> optional (strOption (short 'o' <> long "output" <> metavar "FILE" <> help "write generated spec file to this path"))
   <*> strArgument (metavar "CABAL-FILE")
 
@@ -55,4 +57,4 @@
   Options {..} <- execParser pinfo
   let specFile = fromMaybe (optCabalFile `replaceExtension` "spec") optOutputFile
   putStrLn $ "Writing spec file to " ++ show specFile ++ " ..."
-  cabal2spec buildPlatform buildCompilerId (mkFlagAssignment optFlags) True optCabalFile specFile
+  cabal2spec buildPlatform buildCompilerId (mkFlagAssignment optFlags) optForceExe optRunTests optCabalFile specFile
diff --git a/src/Cabal2Spec.hs b/src/Cabal2Spec.hs
--- a/src/Cabal2Spec.hs
+++ b/src/Cabal2Spec.hs
@@ -1,4 +1,4 @@
-module Cabal2Spec ( cabal2spec, createSpecFile, ForceBinary ) where
+module Cabal2Spec ( cabal2spec, createSpecFile, ForceBinary, RunTests ) where
 
 import Control.Monad
 import Data.Char
@@ -25,13 +25,15 @@
 import System.IO
 
 type ForceBinary = Bool
+type RunTests = Bool
 
-cabal2spec :: Platform -> CompilerId -> FlagAssignment -> ForceBinary -> FilePath -> FilePath -> IO ()
-cabal2spec platform compilerId flags forceBinary cabalFile specFile = do
+cabal2spec :: Platform -> CompilerId -> FlagAssignment -> ForceBinary -> RunTests
+           -> FilePath -> FilePath -> IO ()
+cabal2spec platform compilerId flags forceBinary runTests cabalFile specFile = do
   gpd <- readGenericPackageDescription silent cabalFile
   case finalizePD flags requestedComponents (const True) platform (unknownCompilerInfo compilerId NoAbiTag) [] gpd of
     Left missing -> fail ("finalizePD: " ++ show missing)
-    Right (pd,_) -> createSpecFile specFile pd forceBinary flags
+    Right (pd,_) -> createSpecFile specFile pd forceBinary runTests flags
 
 requestedComponents :: ComponentRequestedSpec
 requestedComponents = defaultComponentRequestedSpec
@@ -48,8 +50,8 @@
     mapTools "gtk2hsTypeGen" = "gtk2hs-buildtools"
     mapTools tool = tool
 
-createSpecFile :: FilePath -> PackageDescription -> ForceBinary -> FlagAssignment -> IO ()
-createSpecFile specFile pkgDesc forceBinary flagAssignment = do
+createSpecFile :: FilePath -> PackageDescription -> ForceBinary -> RunTests -> FlagAssignment -> IO ()
+createSpecFile specFile pkgDesc forceBinary runTests flagAssignment = do
   let deps :: [String]
       deps = map showDep deps'
       deps' :: [String]
@@ -139,7 +141,9 @@
     putDef "has_internal_sub_libraries" "1"
 
   unless (null testsuiteDeps) $
-    put "%bcond_with tests"
+    if runTests
+       then put "%bcond_without tests"
+       else put "%bcond_with tests"
 
   let version = packageVersion pkg
       revision = show $ maybe (0::Int) read (lookup "x-revision" (customFieldsPD pkgDesc))
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -24,4 +24,4 @@
                    (\ref new -> ["diff", "-u", ref, new])
                    goldenFile
                    specFile
-                   (cabal2spec pid cid mempty True cabalFile specFile)
+                   (cabal2spec pid cid mempty True False cabalFile specFile)
