diff --git a/SHA.cabal b/SHA.cabal
--- a/SHA.cabal
+++ b/SHA.cabal
@@ -1,6 +1,6 @@
 name:       SHA
 category:   Cryptography, Codec
-version:    1.0.3
+version:    1.0.4
 license:    BSD3
 license-file: LICENSE
 author:     Adam Wick <awick@galois.com>
@@ -16,6 +16,10 @@
              for the various functions. However, only slight attention has
              been paid to the speed of the functions.  
 
+Flag Test
+ Description: Build the SHA test suite.
+ Default: False
+
 Library
  build-depends: base >= 3, bytestring
  exposed-modules: Data.Digest.Pure.SHA
@@ -29,6 +33,8 @@
   Main-Is: Test.hs
   Other-Modules: Data.Digest.Pure.SHA
   extensions: CPP, BangPatterns
+  if !flag(test)
+    buildable: False
 
 source-repository head
   type:		git
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,25 +1,2 @@
-import Distribution.PackageDescription
 import Distribution.Simple
-import Distribution.Simple.LocalBuildInfo
-import System.Cmd
-import System.FilePath
-
-main :: IO ()
-main = defaultMainWithHooks shaUserHooks
- where  
-  shaUserHooks = simpleUserHooks { 
-    runTests = runLMTests
-  , instHook = filter_test $ instHook defaultUserHooks 
-  }
-
-type Hook a = PackageDescription -> LocalBuildInfo -> UserHooks -> a -> IO ()
-
-filter_test :: Hook a -> Hook a
-filter_test f pd lbi uhs x = f pd' lbi uhs x
- where
-  pd'  = pd { executables = [] }
-
-runLMTests :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
-runLMTests _args _unknown descr _lbi = system test_exe >> return ()
- where
-  test_exe = "dist" </> "build" </> "test_sha" </> (exeName $ head $ executables descr)
+main = defaultMain
