module Debian.Debianize.Details
( debianDefaults
) where
import Control.Lens
import Data.Map as Map (insert)
import Debian.Debianize.DebianName (mapCabal, splitCabal)
import Debian.Debianize.Monad (CabalT)
import Debian.Debianize.CabalInfo as A (epochMap, debInfo)
import Debian.Debianize.DebInfo as D (execMap)
import Debian.Debianize.VersionSplits (DebBase(DebBase))
import Debian.Relation (BinPkgName(BinPkgName), Relation(Rel))
#if MIN_VERSION_Cabal(2,0,0)
import Distribution.Package (mkPackageName)
import Distribution.Version (mkVersion)
#else
import Data.Version (Version(Version))
import Distribution.Package (PackageName(PackageName))
#endif
debianDefaults :: Monad m => CabalT m ()
debianDefaults =
do
#if MIN_VERSION_Cabal(2,0,0)
A.epochMap %= Map.insert (mkPackageName "HaXml") 1
A.epochMap %= Map.insert (mkPackageName "HTTP") 1
#else
A.epochMap %= Map.insert (PackageName "HaXml") 1
A.epochMap %= Map.insert (PackageName "HTTP") 1
#endif
mapM_ (\name -> (A.debInfo . D.execMap) %= Map.insert name [[Rel (BinPkgName name) Nothing Nothing]])
["ghc", "happy", "alex", "hsx2hs"]
#if MIN_VERSION_Cabal(2,0,0)
mapCabal (mkPackageName "parsec") (DebBase "parsec3")
#else
mapCabal (PackageName "parsec") (DebBase "parsec3")
#endif
#if MIN_VERSION_Cabal(2,0,0)
mapCabal (mkPackageName "QuickCheck") (DebBase "quickcheck2")
#else
mapCabal (PackageName "QuickCheck") (DebBase "quickcheck2")
#endif
#if MIN_VERSION_Cabal(2,0,0)
mapCabal (mkPackageName "gtk2hs-buildtools") (DebBase "gtk2hs-buildtools")
#else
mapCabal (PackageName "gtk2hs-buildtools") (DebBase "gtk2hs-buildtools")
#endif
#if MIN_VERSION_Cabal(2,0,0)
mapCabal (mkPackageName "haskell-src-exts") (DebBase "src-exts")
mapCabal (mkPackageName "haskell-src-meta") (DebBase "src-meta")
mapCabal (mkPackageName "Cabal") (DebBase "cabal")
mapCabal (mkPackageName "happstack-authenticate") (DebBase "happstack-authenticate")
splitCabal (mkPackageName "happstack-authenticate") (DebBase "happstack-authenticate-0") (mkVersion [2])
#else
mapCabal (PackageName "haskell-src-exts") (DebBase "src-exts")
mapCabal (PackageName "haskell-src-meta") (DebBase "src-meta")
mapCabal (PackageName "Cabal") (DebBase "cabal")
mapCabal (PackageName "happstack-authenticate") (DebBase "happstack-authenticate")
splitCabal (PackageName "happstack-authenticate") (DebBase "happstack-authenticate-0") (Version [2] [])
#endif