diff --git a/Cabal2Ebuild.hs b/Cabal2Ebuild.hs
--- a/Cabal2Ebuild.hs
+++ b/Cabal2Ebuild.hs
@@ -32,8 +32,7 @@
 import qualified Distribution.Package as Cabal  (PackageIdentifier(..)
                                                 , Dependency(..)
                                                 , PackageName(..))
-import qualified Distribution.Version as Cabal  (VersionRange, foldVersionRange', versionBranch, Version)
-import qualified Distribution.License as Cabal  (License(..))
+import qualified Distribution.Version as Cabal  (VersionRange, foldVersionRange')
 import Distribution.Text (display)
 
 import Data.Char          (toLower,isUpper)
@@ -53,8 +52,8 @@
     E.version     = display (Cabal.pkgVersion (Cabal.package pkg)),
     E.description = if null (Cabal.synopsis pkg) then Cabal.description pkg
                                                else Cabal.synopsis pkg,
-    E.homepage        = Cabal.homepage pkg,
-    E.src_uri         = Cabal.pkgUrl pkg,
+    E.homepage        = thisHomepage,
+    E.src_uri         = thisSRC_URI,
     E.license         = Cabal.license pkg,
     E.my_pn           = if any isUpper cabalPkgName then Just cabalPkgName else Nothing,
     E.features        = E.features E.ebuildTemplate
@@ -65,6 +64,12 @@
   } where
         cabalPkgName = display $ Cabal.pkgName (Cabal.package pkg)
         hasExe = (not . null) (Cabal.executables pkg) 
+        thisHomepage = if (null $ Cabal.homepage pkg)
+                         then E.homepage E.ebuildTemplate
+                         else Cabal.homepage pkg
+        thisSRC_URI = if (null $ Cabal.pkgUrl pkg)
+                        then E.src_uri E.ebuildTemplate
+                        else Cabal.pkgUrl pkg
 
 convertDependencies :: Portage.Category -> [Cabal.Dependency] -> [Dependency]
 convertDependencies category = concatMap (convertDependency category)
diff --git a/DistroMap.hs b/DistroMap.hs
--- a/DistroMap.hs
+++ b/DistroMap.hs
@@ -47,20 +47,19 @@
 import Distribution.Verbosity
 import Distribution.Text ( display )
 import Distribution.Client.Types ( Repo, AvailablePackageDb(..), AvailablePackage(..) )
-import Distribution.Simple.Utils ( warn, notice, info )
+import Distribution.Simple.Utils ( info )
 
 import qualified Data.Version as Cabal
 import qualified Distribution.Package as Cabal
 import qualified Distribution.Client.PackageIndex as CabalInstall
 import qualified Distribution.Client.IndexUtils as CabalInstall
 
-import Portage.Overlay ( Overlay(..), readOverlayByPackage, getDirectoryTree, DirectoryTree )
+import Portage.Overlay (  readOverlayByPackage, getDirectoryTree )
 import qualified Portage.PackageId as Portage
 import qualified Portage.Version as Portage
 
 type PVU = (Cabal.PackageName, Cabal.Version, Maybe String)
 type PVU_Map = Map Portage.PackageName [(Cabal.Version, Maybe String)]
-type PVU_Item = (Portage.PackageName, [(Cabal.Version, Maybe String)])
 
 distroMap :: Verbosity -> Repo -> FilePath -> FilePath -> [String] -> IO ()
 distroMap verbosity repo portagePath overlayPath args = do
diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -11,7 +11,7 @@
 import Distribution.Simple.Setup
         ( Flag(..), fromFlag
         , trueArg
-        , flagToMaybe, flagToList
+        , flagToList
         , optionVerbosity
         )
 import Distribution.PackageDescription.Configuration
@@ -34,7 +34,7 @@
 import Portage.Host as Host ( getInfo, portage_dir )
 import Portage.PackageId ( normalizeCabalPackageId )
 
-import Network.URI
+import Network.URI ( URI(..), URIAuth(..), parseURI )
 import System.Environment ( getArgs, getProgName )
 import System.Directory ( doesDirectoryExist )
 import System.Exit ( exitFailure )
diff --git a/Merge/Dependencies.hs b/Merge/Dependencies.hs
--- a/Merge/Dependencies.hs
+++ b/Merge/Dependencies.hs
@@ -176,6 +176,7 @@
       , ("mysqlclient", Portage.LaterVersionOf (Portage.Version [4,0] Nothing [] 0) (Portage.mkPackageName "virtual" "mysql"))
       , ("pq", Portage.LaterVersionOf (Portage.Version [7] Nothing [] 0) (Portage.mkPackageName "virtual" "postgresql-base"))
       , ("ev", Portage.AnyVersionOf (Portage.mkPackageName "dev-libs" "libev"))
+      , ("expat", Portage.AnyVersionOf (Portage.mkPackageName "dev-libs" "expat"))
       ]
 
 ---------------------------------------------------------------
diff --git a/Portage/EBuild.hs b/Portage/EBuild.hs
--- a/Portage/EBuild.hs
+++ b/Portage/EBuild.hs
@@ -10,9 +10,13 @@
 
 import Distribution.License as Cabal
 
+import Data.Version(Version(..))
+import qualified Paths_hackport(version)
+
 data EBuild = EBuild {
     name :: String,
     version :: String,
+    hackportVersion :: String,
     description :: String,
     homepage :: String,
     src_uri :: String,
@@ -28,13 +32,18 @@
     my_pn :: Maybe String --If the package's name contains upper-case
   }
 
+getHackportVersion :: Version -> String
+getHackportVersion Version {versionBranch=(x:s)} = foldl (\y z -> y ++ "." ++ (show z)) (show x) s
+getHackportVersion Version {versionBranch=[]} = ""
+
 ebuildTemplate :: EBuild
 ebuildTemplate = EBuild {
     name = "foobar",
     version = "0.1",
+    hackportVersion = getHackportVersion Paths_hackport.version,
     description = "",
-    homepage = "",
-    src_uri = "",
+    homepage = "http://hackage.haskell.org/package/${PN}",
+    src_uri = "http://hackage.haskell.org/packages/archive/${PN}/${PV}/${P}.tar.gz",
     license = Cabal.UnknownLicense "xxx UNKNOWN xxx",
     slot = "0",
     keywords = ["~amd64","~x86"],
@@ -56,6 +65,8 @@
   ss "# Distributed under the terms of the GNU General Public License v2". nl.
   ss "# $Header:  $". nl.
   nl.
+  ss ("# ebuild generated by hackport " ++ hackportVersion ebuild). nl.
+  nl.
   ss "CABAL_FEATURES=". quote' (sepBy " " $ features ebuild). nl.
   ss "inherit haskell-cabal". nl.
   nl.
@@ -65,9 +76,7 @@
                 ss "MY_P=". quote "${MY_PN}-${PV}". nl. nl).
   ss "DESCRIPTION=". quote (description ebuild). nl.
   ss "HOMEPAGE=". quote (homepage ebuild). nl.
-  ss "SRC_URI=". quote (replaceVars (src_uri ebuild)).
-     (if null (src_uri ebuild) then ss "\t#Fixme: please fill in manually"
-         else id). nl.
+  ss "SRC_URI=". quote (replaceVars (src_uri ebuild)). nl.
   nl.
   ss "LICENSE=". quote (convertLicense . license $ ebuild).
      (if null (licenseComment . license $ ebuild) then id
@@ -78,7 +87,6 @@
   nl.
   dep_str "RDEPEND" (rdepend_extra ebuild) (rdepend ebuild).
   dep_str "DEPEND"  ( depend_extra ebuild) ( depend ebuild).
-  nl.
   (case my_pn ebuild of
      Nothing -> id
      Just _ -> nl. ss "S=". quote ("${WORKDIR}/${MY_P}"). nl)
diff --git a/cabal2ebuild.hs b/cabal2ebuild.hs
deleted file mode 100644
--- a/cabal2ebuild.hs
+++ /dev/null
@@ -1,17 +0,0 @@
-module Main where
-
-import System.Environment
-import qualified Distribution.PackageDescription as Cabal
-import Distribution.Verbosity (normal)
-import Cabal2Ebuild
-
-main :: IO ()
-main = do
-  args <- getArgs
-  case args of
-    [cabalFileName] -> do
-      pkg <- Cabal.readPackageDescription normal cabalFileName
-      let ebuild = cabal2ebuild (Cabal.flattenPackageDescription pkg)
-      let ebuildFileName = name ebuild ++ "-" ++ version ebuild ++ ".ebuild"
-      writeFile ebuildFileName (showEBuild ebuild)
-    _ -> putStrLn "usage: cabal2ebuild package.cabal"
diff --git a/hackport.cabal b/hackport.cabal
--- a/hackport.cabal
+++ b/hackport.cabal
@@ -1,5 +1,5 @@
 Name:           hackport
-Version:	0.2.7
+Version:	0.2.8
 License:	GPL
 License-file:   LICENSE
 Author:		Henning Günther, Duncan Coutts, Lennart Kolmodin
@@ -56,6 +56,7 @@
     CacheFile
     Diff
     Error
+    Paths_hackport
     Main
     MaybeRead
     Overlays
