diff --git a/Debian/Dpkg/DB.hsc b/Debian/Dpkg/DB.hsc
--- a/Debian/Dpkg/DB.hsc
+++ b/Debian/Dpkg/DB.hsc
@@ -1,6 +1,6 @@
 {-
  DB.hsc: Haskell bindings to libdpkg
-   Copyright (C) 2011 Clint Adams
+   Copyright (C) 2011, 2012 Clint Adams
 
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
 module Debian.Dpkg.DB (
     msdbInit
   , setDbDir
-  , pkgDbFind
   , pkgList
   , parseVersion
   , c'parseversion
@@ -48,7 +47,7 @@
 #callconv dpkg_db_set_dir , ccall unsafe , CString -> IO ()
 
 #callconv pkg_db_iter_new , ccall unsafe , IO (Ptr <pkgiterator>)
-#callconv pkg_db_iter_next , ccall unsafe , Ptr <pkgiterator> -> IO (Ptr <pkginfo>)
+#callconv pkg_db_iter_next_pkg , ccall unsafe , Ptr <pkgiterator> -> IO (Ptr <pkginfo>)
 
 msdbInit :: IO ()
 msdbInit = do
@@ -61,7 +60,7 @@
 
 pkgDbIterNext :: Ptr C'pkgiterator -> IO (Maybe (Ptr C'pkginfo, Ptr C'pkgiterator))
 pkgDbIterNext i = do
-         pptr <- c'pkg_db_iter_next i
+         pptr <- c'pkg_db_iter_next_pkg i
          if pptr == nullPtr
              then
                 return Nothing
@@ -73,11 +72,6 @@
 
 pkgList :: IO [C'pkginfo]
 pkgList = pkgpList >>= mapM peek
-
-#callconv pkg_db_find , ccall unsafe ,  CString -> IO (Ptr <pkginfo>)
-
-pkgDbFind :: String -> IO C'pkginfo
-pkgDbFind p = withCString p c'pkg_db_find >>= peek
 
 #callconv parseversion , ccall unsafe , Ptr C'versionrevision -> CString -> Ptr C'dpkg_error -> IO CInt
 #callconv versioncompare , ccall unsafe , Ptr C'versionrevision -> Ptr C'versionrevision -> IO CInt
diff --git a/Debian/Dpkg/PkgSpec.hsc b/Debian/Dpkg/PkgSpec.hsc
new file mode 100644
--- /dev/null
+++ b/Debian/Dpkg/PkgSpec.hsc
@@ -0,0 +1,45 @@
+{-
+ PkgSpec.hsc: Haskell bindings to libdpkg
+   Copyright (C) 2012 Clint Adams
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+-}
+
+{-# LANGUAGE CPP, ForeignFunctionInterface #-}
+
+#include <bindings.dsl.h>
+
+module Debian.Dpkg.PkgSpec (
+  pkgSpecParsePkg
+) where
+#strict_import
+
+import Foreign.Ptr (nullPtr)
+import Foreign.C.String (withCString, peekCString)
+import Foreign.Marshal.Utils (with)
+import Control.Monad (liftM, join)
+import Control.Monad.Loops (unfoldrM)
+import qualified Data.ByteString as BS
+import Debian.Dpkg.Types
+
+#include <dpkg/pkg-spec.h>
+
+type FIXME = C'dpkg_error
+#callconv pkg_spec_parse_pkg , ccall unsafe ,  CString -> Ptr FIXME -> IO (Ptr <pkginfo>)
+
+-- FIXME: if NULL return, handle error
+pkgSpecParsePkg :: String -> IO C'pkginfo
+pkgSpecParsePkg p = alloca $ \derr -> withCString p (\pcstr -> c'pkg_spec_parse_pkg pcstr derr) >>= peek
+
diff --git a/Debian/Dpkg/Types.hsc b/Debian/Dpkg/Types.hsc
--- a/Debian/Dpkg/Types.hsc
+++ b/Debian/Dpkg/Types.hsc
@@ -56,8 +56,8 @@
 #opaque_t struct pkgiterator
 
 #starttype struct pkginfo
-#field next , Ptr <pkginfo>
-#field name , CString
+#field set , Ptr <pkgset>
+#field arch_next , Ptr <pkginfo>
 #field want , <pkgwant>
 #field eflag , <pkgeflag>
 #field status , <pkgstatus>
@@ -69,6 +69,12 @@
 #field installed , <pkgbin>
 #field available , <pkgbin>
 #field clientdata , Ptr <perpackagestate>
+#stoptype
+
+#starttype struct pkgset
+#field next , Ptr <pkgset>
+#field name , CString
+#field pkg , <pkginfo>
 #stoptype
 
 #integral_t enum dpkg_msg_type
diff --git a/dpkg.cabal b/dpkg.cabal
--- a/dpkg.cabal
+++ b/dpkg.cabal
@@ -1,8 +1,8 @@
 Name:                dpkg
-Version:             0.0.1
+Version:             0.0.2
 Synopsis:            libdpkg bindings
 Description:         Haskell bindings to the libdpkg API
-Copyright:           (C) 2011 Clint Adams
+Copyright:           (C) 2011, 2012 Clint Adams
 License:             GPL-3
 License-file:        COPYING
 Author:              Clint Adams
@@ -20,21 +20,22 @@
                  , monad-loops
   exposed-modules: Debian.Dpkg
                  , Debian.Dpkg.DB
+                 , Debian.Dpkg.PkgSpec
                  , Debian.Dpkg.Types
                  , Debian.Dpkg.Enums
                  , Debian.Dpkg.VersionRevision
   other-extensions: ForeignFunctionInterface
-  pkgconfig-depends: libdpkg >= 1.16.1
+  pkgconfig-depends: libdpkg >= 1.16.2
   cpp-options: -DLIBDPKG_VOLATILE_API=1
-  default-language: Haskell98
+  default-language: Haskell2010
 
 Test-Suite test
   type:       exitcode-stdio-1.0
   main-is:    test.hs
   build-depends: base, HUnit, dpkg, bytestring
-  pkgconfig-depends: libdpkg >= 1.16.1
+  pkgconfig-depends: libdpkg >= 1.16.2
   extra-libraries: dpkg
-  default-language: Haskell98
+  default-language: Haskell2010
 
 
 source-repository head
diff --git a/test.hs b/test.hs
--- a/test.hs
+++ b/test.hs
@@ -1,6 +1,7 @@
 import Test.HUnit
 import Debian.Dpkg.DB
 import Debian.Dpkg.Enums
+import Debian.Dpkg.PkgSpec
 import Debian.Dpkg.Types
 import Debian.Dpkg.VersionRevision
 
@@ -10,7 +11,7 @@
 import Data.ByteString.Char8 (pack)
 
 test1 = TestCase (do
-	p <- pkgDbFind "testpkg"
+	p <- pkgSpecParsePkg "testpkg"
 	let want = fromIntegral $ c'pkginfo'want p
 	let eflag = fromIntegral $ c'pkginfo'eflag p
 	let status = fromIntegral $ c'pkginfo'status p
@@ -29,7 +30,8 @@
         pp <- pkgList
         let p = pp !! 2
 	let want = fromIntegral $ c'pkginfo'want p
-        name <- peekCString $ c'pkginfo'name p
+        set <- peek $ c'pkginfo'set p
+        name <- peekCString $ c'pkgset'name set
 	cv <- getConfigVersion p
         assertEqual "numpkgs" 4 (length pp)
         assertEqual "name" "testpkg2" name
@@ -71,7 +73,7 @@
              otherwise -> assertFailure"Failed to parse one of the versions"
         )
 
-tests = TestList [TestLabel "pkgDbFind" test1
+tests = TestList [TestLabel "pkgSpecParsePkg" test1
                 , TestLabel "pkgList" test2
                 , TestLabel "parseVersion good" test3
                 , TestLabel "parseVersion bad" test4
