diff --git a/suffixtree.cabal b/suffixtree.cabal
--- a/suffixtree.cabal
+++ b/suffixtree.cabal
@@ -1,5 +1,5 @@
 Name:                suffixtree
-Version:             0.2.1
+Version:             0.2.2
 Synopsis:            Efficient, lazy suffix tree implementation
 Description:         An efficient, lazy suffix tree implementation.
 Category:            Data Structures, Data
@@ -8,11 +8,34 @@
 Author:              Bryan O'Sullivan <bos@serpentine.com>
 Maintainer:          bos@serpentine.com
 Homepage:            http://www.serpentine.com/software/suffixtree/
--- add fps for ghc 6.4.2
-Build-Depends:       base, QuickCheck
-Exposed-modules:     Data.SuffixTree
-ghc-options:         -W -O2 -optc-O3 -funbox-strict-fields -fno-warn-incomplete-patterns
-extra-source-files:  Makefile
+Build-Type:          Simple
+Cabal-Version:       >= 1.2
+Extra-Source-Files:  Makefile
                      examples/Makefile
                      examples/Tiny.hs
                      examples/UniqueMatch.hs
+
+Flag bytestring-in-base
+  Description: Is ByteString in the base or bytestring package?
+  Default: False
+
+Flag split-base
+  Description: Has the base package been split up?
+  Default: True
+
+Library
+  if flag(bytestring-in-base)
+    -- bytestring was in base-2.0 and 2.1.1
+    Build-Depends: base >= 2.0 && < 2.2
+  else
+    -- in base 1.0 and 3.0, bytestring is a separate package
+    Build-Depends: base < 2.0 || >= 3, bytestring >= 0.9
+
+  if flag(split-base)
+    Build-Depends: base >= 3.0, containers
+  else
+    Build-Depends: base < 3.0
+
+  Build-Depends:     QuickCheck
+  Exposed-Modules:   Data.SuffixTree
+  GHC-Options:       -Wall -O2 -funbox-strict-fields -fno-warn-incomplete-patterns
