-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Debian package build sequence tools
--   
--   This package provides build sequence functions for debian package, and
--   includes on-the-fly build command <a>odebuild</a>.
@package debian-build
@version 0.10.1.1


-- | This module provides monad types to control build scripts.
module Debian.Package.Build.Monad

-- | Action type with trace flag
type Trace = ReaderT Bool IO

-- | Run <a>Trace</a> monad
runTrace :: Trace a -> Bool -> IO a

-- | Command string trace print along with trace flag
traceCommand :: String -> Trace ()

-- | Output string trace print along with trace flag
traceOut :: String -> Trace ()

-- | Put log stinrg with flush.
putLog :: String -> Trace ()

-- | bracket for <a>Trace</a> monad
bracketTrace :: Trace a -> (a -> Trace b) -> (a -> Trace c) -> Trace c

-- | bracket_ for <a>Trace</a> monad
bracketTrace_ :: Trace a -> Trace b -> Trace c -> Trace c

-- | Type to specify base directory filepath
type BaseDir = FilePath

-- | Get base directory in <a>Build</a> monad
askBaseDir :: Build FilePath

-- | Get build working directory in <a>Build</a> monad
askBuildDir :: Build FilePath

-- | Type to specify build working directory
data BuildDir

-- | Use relative path from base-dir as build workding directory
buildDirRelative :: FilePath -> BuildDir

-- | Use absolute path as build workding directory
buildDirAbsolute :: FilePath -> BuildDir

-- | Build configuration type
data Config

-- | Default configuration
defaultConfig :: (Config, Bool)

-- | Specify build dir
buildDir :: Config -> BuildDir

-- | Name of debian directory
debianDirName :: Config -> FilePath

-- | Exclude directories to setup source directory
sourceExcludes :: Config -> [FilePath]

-- | Monad type with build base directory and build configuration.
type Build = ReaderT BaseDir (ReaderT Config Trace)

-- | Lift from <a>Trace</a> monad into monad with <a>Build</a>
--   configuration.
liftTrace :: Trace a -> Build a

-- | Unpack <a>Build</a> configuration monad into <a>Trace</a>.
unBuild :: Build a -> BaseDir -> Config -> Trace a

-- | Run <a>Build</a> configuration monad
runBuild :: Build a -> BaseDir -> Config -> Bool -> IO a

-- | Get build configuration in <a>Build</a> monad
askConfig :: Build Config

-- | bracket for <a>Build</a> monad
bracketBuild :: Build a -> (a -> Build b) -> (a -> Build c) -> Build c

-- | bracket_ for <a>Build</a> monad
bracketBuild_ :: Build a -> Build b -> Build c -> Build c
instance GHC.Show.Show Debian.Package.Build.Monad.Config
instance GHC.Show.Show Debian.Package.Build.Monad.BuildDir


-- | This module provides data types of hackage meta information.
module Debian.Package.Data.Hackage

-- | Hackage version type
data HackageVersion

-- | Make <a>HackageVersion</a>
mkHackageVersion :: Int -> Int -> Int -> Int -> HackageVersion

-- | Make <a>HackageVersion</a>
mkHackageVersion' :: [Int] -> HackageVersion

-- | Extract hackage version numbers.
hackageVersionNumbers :: HackageVersion -> [Int]

-- | Hackage name and version type with debian short name. e.g.
--   <i>src-ext</i>.
data Hackage

-- | Make <a>Hackage</a>
mkHackage :: String -> HackageVersion -> String -> Hackage

-- | Get package name of <a>Hackage</a>
hackageName :: Hackage -> String

-- | Get version of <a>Hackage</a>
hackageVersion :: Hackage -> HackageVersion

-- | Get debian short name of <a>Hackage</a>
debianShortName :: Hackage -> String

-- | Generate <a>Hackage</a> type from package name and version using
--   <a>NameRule</a>
mkHackageDefault :: NameRule -> String -> HackageVersion -> Hackage

-- | Debian short name generate rule
data NameRule
Suggest :: NameRule
Simple :: NameRule

-- | Make debian short name from package name using <a>NameRule</a>
debianNamesFromSourceName :: NameRule -> String -> (String, String)

-- | Package name string with version
hackageLongName :: Hackage -> String

-- | Package archive basename
hackageArchiveName :: Hackage -> FilePath

-- | Package archive pathname
hackageArchive :: Hackage -> FilePath

-- | Debian library binary package names for GHC
ghcLibraryBinPackages :: Hackage -> [String]

-- | Debian library document package name for GHC
ghcLibraryDocPackage :: Hackage -> String

-- | Debian library package names for GHC
ghcLibraryPackages :: Hackage -> [String]
instance GHC.Show.Show Debian.Package.Data.Hackage.NameRule
instance GHC.Classes.Eq Debian.Package.Data.Hackage.NameRule
instance GHC.Show.Show Debian.Package.Data.Hackage.Hackage
instance GHC.Show.Show Debian.Package.Data.Hackage.HackageVersion
instance GHC.Read.Read Debian.Package.Data.Hackage.HackageVersion


-- | This module provides data types of debian packages meta information.
module Debian.Package.Data.Packages

-- | Version type for Debian
data DebianVersion

-- | Make deebian version from hackage version
versionFromHackageVersion :: HackageVersion -> Maybe String -> DebianVersion

-- | Try to read debian package version
readDebianVersion :: String -> Maybe DebianVersion

-- | Version without debian revision
origVersion' :: DebianVersion -> Version

-- | Is debian-native or not
isNative' :: DebianVersion -> Bool

-- | Debian source package type, name with version
data Source

-- | Make <a>Source</a>
mkSource :: String -> DebianVersion -> Source

-- | Source package name of <a>Source</a>
sourceName :: Source -> String

-- | Debian version of <a>Source</a>
version :: Source -> DebianVersion

-- | Version without debian revision
origVersion :: Source -> Version

-- | Is debian-native or not
isNative :: Source -> Bool

-- | Original source archive basename
origArchiveName :: Source -> FilePath

-- | Debian native archive basename
nativeArchiveName :: Source -> String

-- | Source directory basename
sourceDirName :: Source -> FilePath

-- | Try to make <a>HackageVersion</a> from <a>Source</a>
deriveHackageVersion :: Source -> HackageVersion

-- | Try to generate <a>Source</a> from debian changelog string
parseChangeLog :: String -> Maybe Source

-- | Debian package types
data PackageType
PackageArch :: (Maybe String) -> PackageType
PackageAll :: PackageType
PackageSource :: PackageType

-- | Take <a>PackageType</a> from debian .changes file path
takeChangesType :: FilePath -> Maybe PackageType

-- | Test package type is source package.
isSourcePackage :: PackageType -> Bool

-- | Test package type is binary package.
isBinaryPackage :: PackageType -> Bool

-- | Type for debian control meta-data.
data Control
Control :: String -> [String] -> [String] -> Control
[controlSource] :: Control -> String
[controlArch] :: Control -> [String]
[controlAll] :: Control -> [String]

-- | Parse an package entry in control file.
parseControlEntry :: [String] -> Maybe (PackageType, String)

-- | Parse debian control file into package list.
parseControl :: String -> Maybe Control

-- | Debian source package type for Haskell
data HaskellPackage

-- | <a>Hackage</a> meta-info of <a>HaskellPackage</a>
hackage :: HaskellPackage -> Hackage

-- | Debian source package meta-info of <a>HaskellPackage</a>
package :: HaskellPackage -> Source

-- | Generate <a>HaskellPackage</a> type from debian package name and
--   version using <a>NameRule</a>
haskellPackageDefault :: NameRule -> String -> HackageVersion -> Maybe String -> HaskellPackage

-- | Generate <a>HaskellPackage</a> with hackage name and debian package
--   meta-info
haskellPackageFromPackage :: String -> Source -> HaskellPackage
instance GHC.Show.Show Debian.Package.Data.Packages.HaskellPackage
instance GHC.Show.Show Debian.Package.Data.Packages.Control
instance GHC.Classes.Eq Debian.Package.Data.Packages.Control
instance GHC.Show.Show Debian.Package.Data.Packages.PackageType
instance GHC.Classes.Eq Debian.Package.Data.Packages.PackageType
instance GHC.Show.Show Debian.Package.Data.Packages.Source
instance GHC.Show.Show Debian.Package.Data.Packages.DebianVersion
instance GHC.Read.Read Debian.Package.Data.Packages.DebianVersion


-- | This module provides data-type namespace.
module Debian.Package.Data


-- | This module provides trace-able action instances like commands.
module Debian.Package.Build.Command

-- | Change directory action
chdir :: String -> Trace ()

-- | Action to get current working directory
pwd :: IO String

-- | Create directory if missing
createDirectoryIfMissing :: String -> Trace ()

-- | Rename directory action. e.g. <i>renameDirectory from to</i>
renameDirectory :: String -> String -> Trace ()

-- | Rename file action. e.g. <i>renameFile from to</i>
renameFile :: String -> String -> Trace ()

-- | Confirm filepath using <i>ls</i> command
confirmPath :: String -> Trace ()

-- | Unpack .tar.gz under directory.
unpackInDir :: FilePath -> FilePath -> Trace ()

-- | Unpack .tar.gz under archive place.
unpack :: FilePath -> Trace ()

-- | Pack directory into .tar.gz under working directory
packInDir' :: FilePath -> FilePath -> FilePath -> Trace ()

-- | Pack directory into same location .tar.gz under working directory
packInDir :: FilePath -> FilePath -> Trace ()

-- | Just call <i>cabal-debian</i> command
cabalDebian' :: Maybe String -> [String] -> Trace ()

-- | Call <i>cabal-debian</i> command under specified directory
cabalDebian :: FilePath -> Maybe String -> [String] -> Trace ()

-- | Query debian package version
packageVersion :: String -> Trace DebianVersion

-- | Read debian changelog file and try to parse into <a>Source</a>
dpkgParseChangeLog :: FilePath -> Trace Source

-- | Read debian control file
dpkgParseControl :: FilePath -> Trace Control

-- | Call <i>debuild</i> under specified directory, with command line
--   options
debuild :: FilePath -> [String] -> Trace ()

-- | Just run debi with root user
debi' :: [String] -> Trace ()

-- | Install packages under specified source package directory
debi :: FilePath -> [String] -> Trace ()

-- | Install build-depends
aptGetBuildDepends :: FilePath -> Trace ()

-- | Build mode, all or binary only
data BuildMode
All :: BuildMode
Bin :: BuildMode
Src :: BuildMode
Dep :: BuildMode
Indep :: BuildMode

-- | Infer all build mode list from debian control file data
modeListFromControl :: Control -> [BuildMode]

-- | Build package using <i>debuild</i> under specified directory
buildPackage :: FilePath -> BuildMode -> [String] -> Trace ()

-- | Build package with specified mode list. Calculated mode list from
--   control is used when not specified build modes.
build :: FilePath -> [BuildMode] -> Bool -> [String] -> Trace ()

-- | Clean and build package using <i>debuild</i> under specified directory
rebuild :: FilePath -> [BuildMode] -> [String] -> Trace ()

-- | Remove ghc library packages under specified source package directory
removeGhcLibrary :: BuildMode -> Hackage -> Trace ()

-- | Run action under specified directory
withCurrentDir' :: FilePath -> Trace a -> Trace a

-- | Run command without shell and get standard output string.
readProcess' :: String -> [String] -> String -> Trace String

-- | Run command without shell
rawSystem' :: String -> [String] -> Trace ()

-- | Run command with shell
system' :: String -> Trace ()
instance GHC.Read.Read Debian.Package.Build.Command.BuildMode
instance GHC.Show.Show Debian.Package.Build.Command.BuildMode
instance GHC.Classes.Eq Debian.Package.Build.Command.BuildMode


-- | This module wraps cabal library interfaces to keep sparse dependency
--   to it.
module Debian.Package.Build.Cabal

-- | Find .cabal file
findDescriptionFile :: FilePath -> IO (Maybe FilePath)
fillSetupHs :: FilePath -> IO ()

-- | Call cabal library defaultMain like Setup.hs
setupCmd :: String -> [String] -> Trace ()

-- | Cabal library defaultMain with sub-command clean
clean :: [String] -> Trace ()

-- | Cabal library defaultMain with sub-command sdist
sdist :: [String] -> Trace ()

-- | Cabal library defaultMain with sub-command configure
configure :: [String] -> Trace ()

-- | Cabal library defaultMain with sub-command build
build :: [String] -> Trace ()

-- | Cabal library defaultMain with sub-command install
install :: [String] -> Trace ()

-- | Cabal library defaultMain with sub-command register
register :: [String] -> Trace ()


-- | This module provides build-sequence actions.
module Debian.Package.Build.Sequence

-- | Take original source archive name from <a>Build</a> action context.
origArchive :: Source -> Build FilePath

-- | Take debian native source archive name from <a>Build</a> action
--   context.
nativeArchive :: Source -> Build FilePath

-- | Take source directory from <a>Build</a> action context.
sourceDir :: Source -> Build FilePath

-- | Run <tt>Bulid</tt> action under specified directory.
withCurrentDir :: FilePath -> Build a -> Build a

-- | Run <a>Build</a> action under base-directory.
withBaseCurrentDir :: Build a -> Build a

-- | Take build-directory from <a>Build</a> action context.
getBuildDir :: Build FilePath

-- | Remove build-directory.
removeBuildDir :: Build ()

-- | Find debian .changes files
findDebianChanges :: Build [(FilePath, PackageType)]

-- | Action to copy debian directory from base-directory into specified
--   directory.
copyDebianDir :: FilePath -> Build ()

-- | Setup source directory and original source archive under
--   build-directory using rsync.
rsyncGenOrigSources :: Source -> Build (FilePath, FilePath)

-- | Setup native source directory and native source archive under
--   build-directory using rsync.
rsyncGenNativeSources :: Source -> Build (FilePath, FilePath)

-- | Setup debian source directory and source archive.
rsyncGenSources :: Source -> Build (FilePath, FilePath)

-- | Setup original source directory and archive using Cabal.
cabalGenOrigSources :: HaskellPackage -> Build (FilePath, FilePath)

-- | Setup source directory and archive using Cabal.
cabalGenSources :: HaskellPackage -> Build (FilePath, FilePath)

-- | Setup source directory and archive using Cabal and cabal-debian.
cabalAutogenSources :: String -> Maybe String -> [String] -> Build ((FilePath, FilePath), HaskellPackage)

-- | On the fly setup of source directory and archive.
genSources :: Maybe String -> [String] -> Build (Maybe ((FilePath, FilePath), Source, Maybe Hackage))

-- | Probe generated source directory path.
findGeneratedSourceDir :: MaybeT Build FilePath

-- | Probe generated source informations
findGeneratedSource :: MaybeT Build (FilePath, Source, Hackage)


-- | This module provides build-tool namespace.
module Debian.Package.Build
