diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 100644
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1,4 @@
+## 0.1.2
+
+* Fix setup for cabal 1.24
+* New maintainer and GitHub location - with many thanks to Bryan O'Sullivan for all of the past work on this module, and for facilitating the transfer of maintenance responsibility.
diff --git a/Database/MySQL/Base.hs b/Database/MySQL/Base.hs
--- a/Database/MySQL/Base.hs
+++ b/Database/MySQL/Base.hs
@@ -4,7 +4,7 @@
 -- Module:      Database.MySQL.Base
 -- Copyright:   (c) 2011 MailRank, Inc.
 -- License:     BSD3
--- Maintainer:  Bryan O'Sullivan <bos@serpentine.com>
+-- Maintainer:  Paul Rouse <pyr@doynton.org>
 -- Stability:   experimental
 -- Portability: portable
 --
diff --git a/Database/MySQL/Base/C.hsc b/Database/MySQL/Base/C.hsc
--- a/Database/MySQL/Base/C.hsc
+++ b/Database/MySQL/Base/C.hsc
@@ -4,7 +4,7 @@
 -- Module:      Database.MySQL.Base.C
 -- Copyright:   (c) 2011 MailRank, Inc.
 -- License:     BSD3
--- Maintainer:  Bryan O'Sullivan <bos@serpentine.com>
+-- Maintainer:  Paul Rouse <pyr@doynton.org>
 -- Stability:   experimental
 -- Portability: portable
 --
@@ -68,6 +68,7 @@
 #include "mysql_signals.h"
 #include "mysql.h"
 
+import Data.ByteString (useAsCString)
 import Data.ByteString.Unsafe (unsafeUseAsCString)
 import Database.MySQL.Base.Types
 import Foreign.C.String (CString, withCString)
@@ -93,7 +94,7 @@
       NamedPipe ->
         go (#const MYSQL_OPT_NAMED_PIPE) nullPtr
       InitCommand cmd ->
-        unsafeUseAsCString cmd $ go (#const MYSQL_INIT_COMMAND)
+        useAsCString cmd $ go (#const MYSQL_INIT_COMMAND)
       ReadDefaultFile path ->
         withCString path $ go (#const MYSQL_READ_DEFAULT_FILE)
       ReadDefaultGroup group ->
diff --git a/Database/MySQL/Base/Types.hsc b/Database/MySQL/Base/Types.hsc
--- a/Database/MySQL/Base/Types.hsc
+++ b/Database/MySQL/Base/Types.hsc
@@ -4,7 +4,7 @@
 -- Module:      Database.MySQL.Base.C
 -- Copyright:   (c) 2011 MailRank, Inc.
 -- License:     BSD3
--- Maintainer:  Bryan O'Sullivan <bos@serpentine.com>
+-- Maintainer:  Paul Rouse <pyr@doynton.org>
 -- Stability:   experimental
 -- Portability: portable
 --
diff --git a/README.markdown b/README.markdown
--- a/README.markdown
+++ b/README.markdown
@@ -30,19 +30,14 @@
 and other improvements.
 
 Please report bugs via the
-[github issue tracker](http://github.com/bos/mysql/issues).
-
-Master [git repository](http://github.com/bos/mysql):
-
-* `git clone git://github.com/bos/mysql.git`
-
-There's also a [Mercurial mirror](http://bitbucket.org/bos/mysql):
+[github issue tracker](http://github.com/paul-rouse/mysql/issues).
 
-* `hg clone http://bitbucket.org/bos/mysql`
+Master [git repository](http://github.com/paul-rouse/mysql):
 
-(You can create and contribute changes using either git or Mercurial.)
+* `git clone git://github.com/paul-rouse/mysql.git`
 
 # Authors
 
-This library is written and maintained by Bryan O'Sullivan,
-<bos@serpentine.com>.
+This library was written by Bryan O'Sullivan, <bos@serpentine.com>,
+to whom all of the credit is due.
+It is now being maintained by Paul Rouse, <pyr@doynton.org>.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,67 @@
+
+{-# LANGUAGE FlexibleInstances     #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE CPP                   #-}
+{- OPTIONS_GHC -Wall #-}
+
+#ifndef MIN_VERSION_Cabal
+#define MIN_VERSION_Cabal(x,y,z) 0 
+#endif
+
+import Control.Monad (liftM2, mplus)
+import Data.List (isPrefixOf)
+import Distribution.PackageDescription
+import Distribution.Simple
+import Distribution.Simple.LocalBuildInfo
+import Distribution.Simple.Program
+import Distribution.Verbosity
+
+-- A Cabal 1.16 vs 1.18 compatibility hack, as in 1.18
+-- findProgramLocation has a new (unused in this case) parameter.
+-- ConstOrId adds this parameter when types say it is mandatory.
+class ConstOrId a b where
+    constOrId :: a -> b
+
+instance ConstOrId a a where
+    constOrId = id
+
+instance ConstOrId a (b -> a) where
+    constOrId = const
+
+
+main = defaultMainWithHooks simpleUserHooks {
+  hookedPrograms = [mysqlConfigProgram],
+
+  confHook = \pkg flags -> do
+    lbi <- confHook simpleUserHooks pkg flags
+    bi  <- mysqlBuildInfo lbi
+    return lbi {
+      localPkgDescr = updatePackageDescription (Just bi, []) (localPkgDescr lbi)
+    }
+}
+
+mysqlConfigProgram = (simpleProgram "mysql_config") {
+    programFindLocation = \verbosity -> constOrId $ liftM2 mplus
+#if MIN_VERSION_Cabal(1,24,0)
+      (findProgramOnSearchPath verbosity [ProgramSearchPathDefault] "mysql_config")
+      (findProgramOnSearchPath verbosity [ProgramSearchPathDefault] "mysql_config5")
+#else
+      (findProgramLocation verbosity "mysql_config")
+      (findProgramLocation verbosity "mysql_config5")
+#endif
+  }
+
+mysqlBuildInfo :: LocalBuildInfo -> IO BuildInfo
+mysqlBuildInfo lbi = do
+  let mysqlConfig = fmap words . rawSystemProgramStdoutConf normal
+                    mysqlConfigProgram (withPrograms lbi)
+
+  include <- mysqlConfig ["--include"]
+  libs <- mysqlConfig ["--libs"]
+
+  return emptyBuildInfo {
+    extraLibDirs = map (drop 2) . filter ("-L" `isPrefixOf`) $ libs
+  , extraLibs = map (drop 2) . filter ("-l" `isPrefixOf`) .
+                filter (/= "-lmygcc") $ libs
+  , includeDirs = map (drop 2) include
+  }
diff --git a/Setup.lhs b/Setup.lhs
deleted file mode 100644
--- a/Setup.lhs
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env runhaskell
-
-\begin{code}
-{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
-{- OPTIONS_GHC -Wall #-}
-
-import Control.Monad (liftM2, mplus)
-import Data.List (isPrefixOf)
-import Distribution.PackageDescription
-import Distribution.Simple
-import Distribution.Simple.LocalBuildInfo
-import Distribution.Simple.Program
-import Distribution.Verbosity
-
--- A Cabal 1.16 vs 1.18 compatibility hack, as in 1.18
--- findProgramLocation has a new (unused in this case) parameter.
--- ConstOrId adds this parameter when types say it is mandatory.
-class ConstOrId a b where
-    constOrId :: a -> b
-
-instance ConstOrId a a where
-    constOrId = id
-
-instance ConstOrId a (b -> a) where
-    constOrId = const
-
-
-main = defaultMainWithHooks simpleUserHooks {
-  hookedPrograms = [mysqlConfigProgram],
-
-  confHook = \pkg flags -> do
-    lbi <- confHook simpleUserHooks pkg flags
-    bi  <- mysqlBuildInfo lbi
-    return lbi {
-      localPkgDescr = updatePackageDescription (Just bi, []) (localPkgDescr lbi)
-    }
-}
-
-mysqlConfigProgram = (simpleProgram "mysql_config") {
-    programFindLocation = \verbosity -> constOrId $ liftM2 mplus
-      (findProgramLocation verbosity "mysql_config")
-      (findProgramLocation verbosity "mysql_config5")
-  }
-
-mysqlBuildInfo :: LocalBuildInfo -> IO BuildInfo
-mysqlBuildInfo lbi = do
-  let mysqlConfig = fmap words . rawSystemProgramStdoutConf normal
-                    mysqlConfigProgram (withPrograms lbi)
-
-  include <- mysqlConfig ["--include"]
-  libs <- mysqlConfig ["--libs"]
-
-  return emptyBuildInfo {
-    extraLibDirs = map (drop 2) . filter ("-L" `isPrefixOf`) $ libs
-  , extraLibs = map (drop 2) . filter ("-l" `isPrefixOf`) .
-                filter (/= "-lmygcc") $ libs
-  , includeDirs = map (drop 2) include
-  }
-\end{code}
diff --git a/mysql.cabal b/mysql.cabal
--- a/mysql.cabal
+++ b/mysql.cabal
@@ -1,9 +1,9 @@
 name:           mysql
-version:        0.1.1.8
-homepage:       https://github.com/bos/mysql
-bug-reports:    https://github.com/bos/mysql/issues
+version:        0.1.2
+homepage:       https://github.com/paul-rouse/mysql
+bug-reports:    https://github.com/paul-rouse/mysql/issues
 synopsis:       A low-level MySQL client library.
-description:    
+description:
     A low-level client library for the MySQL database, implemented as
     bindings to the C @mysqlclient@ API.
     .
@@ -17,16 +17,21 @@
 license:        BSD3
 license-file:   LICENSE
 author:         Bryan O'Sullivan <bos@serpentine.com>
-maintainer:     Bryan O'Sullivan <bos@serpentine.com>
+maintainer:     Paul Rouse <pyr@doynton.org>
 copyright:      Copyright 2011 MailRank, Inc.
                 Copyright 2013 Bryan O'Sullivan <bos@serpentine.com>
 category:       Database
 build-type:     Custom
-cabal-version:  >= 1.6
+cabal-version:  >= 1.8
 extra-source-files:
     include/mysql_signals.h
+    ChangeLog.md
     README.markdown
 
+
+custom-setup
+  setup-depends: base, Cabal
+
 flag developer
   description: operate in developer mode
   default: False
@@ -55,10 +60,16 @@
     ghc-options: -Werror
     cpp-options: -DASSERTS
 
-source-repository head
-  type:     git
-  location: http://github.com/bos/mysql
+test-suite test
+    type:            exitcode-stdio-1.0
+    main-is:         main.hs
+    hs-source-dirs:  test
+    ghc-options:     -Wall
+    build-depends:   base                    >= 4 && < 5
+                   , bytestring
+                   , hspec
+                   , mysql
 
 source-repository head
-  type:     mercurial
-  location: http://bitbucket.org/bos/mysql
+  type:     git
+  location: http://github.com/paul-rouse/mysql
diff --git a/test/main.hs b/test/main.hs
new file mode 100644
--- /dev/null
+++ b/test/main.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE OverloadedStrings          #-}
+
+import Control.Exception     (bracket)
+import Database.MySQL.Base   (ConnectInfo (..), defaultConnectInfo,
+                              connect, close,
+                              query, useResult, fetchRow)
+import Test.Hspec
+
+-- This is how to connect to our test database
+testConn :: ConnectInfo
+testConn = defaultConnectInfo {
+               connectHost     = "127.0.0.1",
+               connectUser     = "test",
+               connectDatabase = "test"
+           }
+
+-- Only the most cursory test is done at the moment, simply showing that
+-- things hang together sufficiently well that we can talk to the database
+-- server.
+--
+main :: IO ()
+main = bracket (connect testConn) close $ \conn -> hspec $ do
+    describe "Database" $ do
+      it "seems to be connected" $ do
+        query conn "select 1 + 1"
+        result <- useResult conn
+        row <- fetchRow result
+        row `shouldBe` [Just "2"]
