-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Create a debianization for a cabal package -- -- Tool for creating debianizations of Haskell packages based on the -- .cabal file. If apt-file is installed it will use it to discover what -- is the debian package name of a C library. @package cabal-debian @version 3.4 module Distribution.Version.Invert -- | This function belongs in Cabal, see -- http:hackage.haskell.orgtrachackageticket935. invertVersionRange :: VersionRange -> VersionRange invertVersionIntervals :: [(LowerBound, UpperBound)] -> [(LowerBound, UpperBound)] module Debian.Orphans dropPrefix :: String -> String -> Maybe String instance Show (Field' String) instance Read NameAddr instance Typeable NameAddr instance Data NameAddr instance Data License instance Data Version instance Typeable License instance Ord ChangeLogEntry instance Ord ChangeLog instance Typeable VersionReq instance Typeable SrcPkgName instance Typeable Relation instance Typeable ChangeLogEntry instance Typeable ChangeLog instance Typeable BinPkgName instance Typeable ArchitectureReq instance Data VersionReq instance Data SrcPkgName instance Data Relation instance Data ChangeLogEntry instance Data ChangeLog instance Data BinPkgName instance Data ArchitectureReq instance Show ChangeLogEntry instance Show ChangeLog instance Read VersionReq instance Read SrcPkgName instance Read Relation instance Read ChangeLogEntry instance Read ChangeLog instance Read BinPkgName instance Read ArchitectureReq instance Ord License instance Ord NameAddr instance Ord Compiler instance Eq Compiler instance Ord Extension instance Ord KnownExtension instance Ord Language instance Data CompilerFlavor instance Data CompilerId instance Data Compiler instance Data Language instance Data KnownExtension instance Data Extension instance Typeable KnownExtension instance Typeable Extension instance Typeable Language instance Typeable CompilerFlavor instance Typeable CompilerId instance Typeable Compiler instance Pretty DebianVersion instance Pretty Version instance Pretty VersionRange instance Pretty NameAddr instance Pretty License instance Pretty Text instance Ord PackageDescription instance Ord Executable -- | Code pulled out of cabal-debian that straightforwardly implements -- parts of the Debian policy manual, or other bits of Linux standards. module Debian.Policy databaseDirectory :: BinPkgName -> String apacheLogDirectory :: BinPkgName -> String apacheErrorLog :: BinPkgName -> String apacheAccessLog :: BinPkgName -> String serverLogDirectory :: BinPkgName -> String serverAppLog :: BinPkgName -> String serverAccessLog :: BinPkgName -> String errorLogBaseName :: String appLogBaseName :: String accessLogBaseName :: String debianPackageVersion :: String -> IO DebianVersion -- | Assumes debhelper is installed getDebhelperCompatLevel :: IO Int data StandardsVersion StandardsVersion :: Int -> Int -> Int -> (Maybe Int) -> StandardsVersion -- | Assumes debian-policy is installed getDebianStandardsVersion :: IO StandardsVersion parseStandardsVersion :: String -> StandardsVersion data SourceFormat Native3 :: SourceFormat Quilt3 :: SourceFormat readSourceFormat :: Text -> Either Text SourceFormat data PackagePriority Required :: PackagePriority Important :: PackagePriority Standard :: PackagePriority Optional :: PackagePriority Extra :: PackagePriority readPriority :: String -> PackagePriority -- | The architectures for which a binary deb can be built. data PackageArchitectures -- | The package is architecture independenct All :: PackageArchitectures -- | The package can be built for any architecture Any :: PackageArchitectures -- | The list of suitable architectures Names :: [String] -> PackageArchitectures parsePackageArchitectures :: String -> PackageArchitectures data Section MainSection :: String -> Section AreaSection :: Area -> String -> Section readSection :: String -> Section data Area Main :: Area Contrib :: Area NonFree :: Area parseUploaders :: String -> Either String [NameAddr] parseMaintainer :: String -> Either String NameAddr getDebianMaintainer :: IO (Maybe NameAddr) haskellMaintainer :: NameAddr instance Typeable StandardsVersion instance Typeable SourceFormat instance Typeable PackagePriority instance Typeable PackageArchitectures instance Typeable Area instance Typeable Section instance Eq StandardsVersion instance Ord StandardsVersion instance Show StandardsVersion instance Data StandardsVersion instance Eq SourceFormat instance Ord SourceFormat instance Show SourceFormat instance Data SourceFormat instance Eq PackagePriority instance Ord PackagePriority instance Read PackagePriority instance Show PackagePriority instance Data PackagePriority instance Read PackageArchitectures instance Eq PackageArchitectures instance Ord PackageArchitectures instance Show PackageArchitectures instance Data PackageArchitectures instance Read Area instance Eq Area instance Ord Area instance Show Area instance Data Area instance Read Section instance Eq Section instance Ord Section instance Show Section instance Data Section instance Pretty Area instance Pretty Section instance Pretty PackageArchitectures instance Pretty PackagePriority instance Pretty SourceFormat instance Pretty StandardsVersion -- | Functions used by but not related to cabal-debian, these could -- conceivably be moved into more general libraries. module Debian.Debianize.Utility type DebMap = Map BinPkgName (Maybe DebianVersion) -- | Read and parse the status file for installed debian packages. buildDebVersionMap :: IO DebMap (!) :: DebMap -> BinPkgName -> DebianVersion trim :: String -> String strictReadF :: (Text -> r) -> FilePath -> IO r -- | Write a file which we might still be reading from in order to compute -- the text argument. replaceFile :: FilePath -> String -> IO () -- | Compute the new file contents from the old. If f returns Nothing do -- not write. modifyFile :: FilePath -> (String -> IO (Maybe String)) -> IO () diffFile :: FilePath -> Text -> IO (Maybe String) removeIfExists :: FilePath -> IO () -- | Create a map from pathname to the names of the packages that contains -- that pathname. We need to make sure we consume all the files, so dpkgFileMap :: IO (Map FilePath (Set BinPkgName)) cond :: t -> t -> Bool -> t -- | Given a path, return the name of the package that owns it. debOfFile :: FilePath -> ReaderT (Map FilePath (Set BinPkgName)) IO (Maybe BinPkgName) readFile' :: FilePath -> IO Text readFileMaybe :: FilePath -> IO (Maybe Text) showDeps :: [[Relation]] -> String showDeps' :: [a] -> [[Relation]] -> String -- | From Darcs.Utils withCurrentDirectory :: FilePath -> IO a -> IO a getDirectoryContents' :: FilePath -> IO [FilePath] setMapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b zipMaps :: Ord k => (k -> Maybe a -> Maybe b -> Maybe c) -> Map k a -> Map k b -> Map k c foldEmpty :: r -> ([a] -> r) -> [a] -> r -- | If the current value of getL x is Nothing, replace it with f. maybeL :: Lens a (Maybe b) -> Maybe b -> a -> a indent :: [Char] -> String -> String module Debian.Debianize.Types newtype Top Top :: FilePath -> Top unTop :: Top -> FilePath data PackageInfo PackageInfo :: PackageName -> Maybe (BinPkgName, DebianVersion) -> Maybe (BinPkgName, DebianVersion) -> Maybe (BinPkgName, DebianVersion) -> PackageInfo cabalName :: PackageInfo -> PackageName devDeb :: PackageInfo -> Maybe (BinPkgName, DebianVersion) profDeb :: PackageInfo -> Maybe (BinPkgName, DebianVersion) docDeb :: PackageInfo -> Maybe (BinPkgName, DebianVersion) -- | Information about the web site we are packaging. data Site Site :: String -> String -> Server -> Site -- | The domain name assigned to the server. An apache configuration will -- be generated to redirect requests from this domain to hostname:port domain :: Site -> String -- | Apache ServerAdmin parameter serverAdmin :: Site -> String -- | The hint to install the server job server :: Site -> Server -- | Information about the server we are packaging. data Server Server :: String -> Int -> String -> String -> [String] -> InstallFile -> Server -- | Host on which the server will run hostname :: Server -> String -- | Port on which the server will run. Obviously, this must assign each -- and every server package to a different port. port :: Server -> Int -- | A comment that will be inserted to explain how the file was generated headerMessage :: Server -> String -- | start-stop-daemon --retry argument retry :: Server -> String -- | Extra flags to pass to the server via the init script serverFlags :: Server -> [String] -- | The hint to install the server executable installFile :: Server -> InstallFile data InstallFile InstallFile :: String -> Maybe FilePath -> Maybe FilePath -> String -> InstallFile -- | The name of the executable file execName :: InstallFile -> String -- | where to find it, default is distbuildexecName/ sourceDir :: InstallFile -> Maybe FilePath -- | where to put it, default is usrbinexecName destDir :: InstallFile -> Maybe FilePath -- | name to give installed executable destName :: InstallFile -> String -- | A redundant data type, too lazy to expunge. data DebType Dev :: DebType Prof :: DebType Doc :: DebType data DebAction Usage :: DebAction Debianize :: DebAction SubstVar :: DebType -> DebAction instance Eq PackageInfo instance Ord PackageInfo instance Show PackageInfo instance Read InstallFile instance Show InstallFile instance Eq InstallFile instance Ord InstallFile instance Read Server instance Show Server instance Eq Server instance Ord Server instance Read Site instance Show Site instance Eq Site instance Ord Site instance Eq DebType instance Ord DebType instance Read DebType instance Show DebType instance Read DebAction instance Show DebAction instance Eq DebAction instance Ord DebAction -- | A class used while converting Cabal dependencies into Debian -- dependencies. module Debian.Debianize.Interspersed -- | A class of Bs insterspersed with Cs. It is used when converting the -- cabal dependencies to debian, where the around type is the -- binary package name and the between type is the version number. -- -- Minimum implementation is a method to return the leftmost B, and -- another to return the following (C,B) pairs. Its unfortunate to -- require lists in the implementation, a fold function would be better -- (though I find implementing such folds to be a pain in the -- you-know-what.) -- -- The class provides implementations of three folds, each of which -- exposes slightly different views of the data. class Interspersed t around between | t -> around, t -> between where foldTriples f r0 x = snd $ foldl (\ (b1, r) (c, b2) -> (b1, f b1 c b2 r)) (leftmost x, r0) (pairs x) foldInverted f r0 x = (\ (bn, an, r) -> f bn an Nothing r) $ foldl g (Nothing, leftmost x, r0) (pairs x) where g (b1, a1, r) (b2, a2) = (Just b2, a2, f b1 a1 (Just b2) r) foldArounds f r0 x = snd $ foldl (\ (a1, r) (_, a2) -> (a2, f a1 a2 r)) (leftmost x, r0) (pairs x) foldBetweens f r0 x = foldl (\ r (b, _) -> (f b r)) r0 (pairs x) leftmost :: Interspersed t around between => t -> around pairs :: Interspersed t around between => t -> [(between, around)] foldTriples :: Interspersed t around between => (around -> between -> around -> r -> r) -> r -> t -> r foldInverted :: Interspersed t around between => (Maybe between -> around -> Maybe between -> r -> r) -> r -> t -> r foldArounds :: Interspersed t around between => (around -> around -> r -> r) -> r -> t -> r foldBetweens :: Interspersed t around between => (between -> r -> r) -> r -> t -> r instance Show Splits instance Interspersed Splits Double String module Debian.Debianize.Types.VersionSplits -- | Describes a mapping from cabal package name and version to debian -- package names. For example, versions of the cabal QuickCheck package -- less than 2 are mapped to quickcheck1, while version 2 or -- greater is mapped to quickcheck2. data VersionSplits packageRangesFromVersionSplits :: VersionSplits -> [(String, VersionRange)] makePackage :: String -> VersionSplits -- | Split the version range and give the older packages a new name. insertSplit :: Version -> String -> VersionSplits -> VersionSplits doSplits :: VersionSplits -> Maybe VersionReq -> String -- | These are the instances of debian names changing that I know about. I -- know they really shouldn't be hard coded. Send a patch. Note that this -- inherits the lack of type safety of the mkPkgName function. knownVersionSplits :: Map PackageName VersionSplits instance Eq VersionSplits instance Ord VersionSplits instance Show VersionSplits instance Interspersed VersionSplits String Version -- | Preliminary. module Debian.Debianize.ControlFile -- | This type represents the debian/control file, which is the core of the -- source package debianization. It includes the information that goes in -- the first, or source, section, and then a list of the succeeding -- binary package sections. data SourceDebDescription SourceDebDescription :: Maybe SrcPkgName -> Maybe NameAddr -> Maybe NameAddr -> [NameAddr] -> Bool -> Maybe PackagePriority -> Maybe Section -> Maybe StandardsVersion -> Maybe Text -> Set VersionControlSpec -> Set XField -> Relations -> Relations -> Relations -> Relations -> [BinaryDebDescription] -> SourceDebDescription -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source source :: SourceDebDescription -> Maybe SrcPkgName -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Maintainer maintainer :: SourceDebDescription -> Maybe NameAddr -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Changed-By changedBy :: SourceDebDescription -> Maybe NameAddr -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Uploaders uploaders :: SourceDebDescription -> [NameAddr] -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-DM-Upload-Allowed dmUploadAllowed :: SourceDebDescription -> Bool -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority priority :: SourceDebDescription -> Maybe PackagePriority -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section section :: SourceDebDescription -> Maybe Section -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-Version standardsVersion :: SourceDebDescription -> Maybe StandardsVersion -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Homepage homepage :: SourceDebDescription -> Maybe Text -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-VCS-fields vcsFields :: SourceDebDescription -> Set VersionControlSpec -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.7 xFields :: SourceDebDescription -> Set XField buildDepends :: SourceDebDescription -> Relations buildConflicts :: SourceDebDescription -> Relations buildDependsIndep :: SourceDebDescription -> Relations buildConflictsIndep :: SourceDebDescription -> Relations binaryPackages :: SourceDebDescription -> [BinaryDebDescription] newSourceDebDescription :: SourceDebDescription newSourceDebDescription' :: SrcPkgName -> NameAddr -> SourceDebDescription data VersionControlSpec VCSBrowser :: Text -> VersionControlSpec VCSArch :: Text -> VersionControlSpec VCSBzr :: Text -> VersionControlSpec VCSCvs :: Text -> VersionControlSpec VCSDarcs :: Text -> VersionControlSpec VCSGit :: Text -> VersionControlSpec VCSHg :: Text -> VersionControlSpec VCSMtn :: Text -> VersionControlSpec VCSSvn :: Text -> VersionControlSpec -- | User defined fields. Parse the line XBS-Comment: I stand between -- the candle and the star. to get XField (fromList BS) -- Comment I stand between the candle and the star. data XField XField :: (Set XFieldDest) -> Text -> Text -> XField data XFieldDest -- | Field will be copied to the binary packgae control files B :: XFieldDest -- | Field will be copied to the source packgae control files S :: XFieldDest -- | Field will be copied to the upload control (.changes) file C :: XFieldDest -- | This type represents a section of the control file other than the -- first, which in turn represent one of the binary packages or debs -- produced by this debianization. data BinaryDebDescription BinaryDebDescription :: BinPkgName -> PackageArchitectures -> Maybe Section -> Maybe PackagePriority -> Bool -> Text -> PackageRelations -> BinaryDebDescription -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Package package :: BinaryDebDescription -> BinPkgName -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Architecture architecture :: BinaryDebDescription -> PackageArchitectures binarySection :: BinaryDebDescription -> Maybe Section binaryPriority :: BinaryDebDescription -> Maybe PackagePriority -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Essential essential :: BinaryDebDescription -> Bool -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description description :: BinaryDebDescription -> Text -- | -- http://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10 relations :: BinaryDebDescription -> PackageRelations newBinaryDebDescription :: BinPkgName -> PackageArchitectures -> BinaryDebDescription -- | Package interrelationship information. -- -- Modify the description of one of the binary debs without changing the -- package order. modifyBinaryDeb :: BinPkgName -> (Maybe BinaryDebDescription -> BinaryDebDescription) -> SourceDebDescription -> SourceDebDescription data PackageRelations PackageRelations :: Relations -> Relations -> Relations -> Relations -> Relations -> Relations -> Relations -> Relations -> Relations -> PackageRelations depends :: PackageRelations -> Relations recommends :: PackageRelations -> Relations suggests :: PackageRelations -> Relations preDepends :: PackageRelations -> Relations breaks :: PackageRelations -> Relations conflicts :: PackageRelations -> Relations provides_ :: PackageRelations -> Relations replaces_ :: PackageRelations -> Relations builtUsing :: PackageRelations -> Relations data PackageType -- | The libghc-foo-dev package. Development :: PackageType -- | The libghc-foo-prof package. Profiling :: PackageType -- | The libghc-foo-doc package. Documentation :: PackageType -- | A package related to a particular executable, perhaps but not -- necessarily a server. Exec :: PackageType -- | A package that holds the package's data files and any executables not -- assigned to other packages. Utilities :: PackageType -- | The source package (not a binary deb actually.) Source' :: PackageType -- | This is used to construct the value for DEB_CABAL_PACKAGE in the rules -- file Cabal :: PackageType packageArch :: PackageType -> PackageArchitectures instance Typeable VersionControlSpec instance Typeable XFieldDest instance Typeable XField instance Typeable PackageRelations instance Typeable BinaryDebDescription instance Typeable SourceDebDescription instance Eq VersionControlSpec instance Ord VersionControlSpec instance Show VersionControlSpec instance Data VersionControlSpec instance Eq XFieldDest instance Ord XFieldDest instance Read XFieldDest instance Show XFieldDest instance Data XFieldDest instance Eq XField instance Ord XField instance Show XField instance Data XField instance Eq PackageRelations instance Ord PackageRelations instance Read PackageRelations instance Show PackageRelations instance Data PackageRelations instance Eq BinaryDebDescription instance Ord BinaryDebDescription instance Read BinaryDebDescription instance Show BinaryDebDescription instance Data BinaryDebDescription instance Eq SourceDebDescription instance Ord SourceDebDescription instance Show SourceDebDescription instance Data SourceDebDescription instance Eq PackageType instance Show PackageType -- | Determine whether a specific version of a Haskell package is bundled -- with into this particular version of the given compiler. module Debian.Debianize.Bundled ghcBuiltIn :: Compiler -> PackageName -> Bool module Debian.Debianize.Atoms -- | Bits and pieces of information about the mapping from cabal package -- names and versions to debian package names and versions. In essence, -- an Atoms value represents a package's debianization. The lenses -- in this module are used to get and set the values hidden in this Atoms -- value. Many of the values should be left alone to be set when the -- debianization is finalized. data Atoms -- | Set how much progress messages get generated. verbosity :: Lens Atoms Int -- | Don't write anything, just output a description of what would have -- happened dryRun :: Lens Atoms Bool -- | Make sure the version number and package names of the supplied and -- generated debianizations match. validate :: Lens Atoms Bool -- | Debianize, SubstVars, or Usage. I'm no longer sure what SubstVars -- does, but someone may still be using it. debAction :: Lens Atoms DebAction -- | Obsolete record containing verbosity, dryRun, validate, and debAction. flags :: Lens Atoms Flags -- | Unused warning :: Lens Atoms (Set Text) -- | Set the compiler version, this is used when loading the cabal file to compilerVersion :: Lens Atoms (Maybe Version) -- | The information loaded from the cabal file. packageDescription :: Lens Atoms (Maybe PackageDescription) -- | The build directory. This can be set by an argument to the -- Setup script. When Setup is run manually it is just -- dist, when it is run by dpkg-buildpackage the -- compiler name is appended, so it is typically dist-ghc. -- Cabal-debian needs the correct value of buildDir to find the build -- results. buildDir :: Lens Atoms (Maybe FilePath) -- | The data directory for the package, generated from the -- packageDescription dataDir :: Lens Atoms (Maybe FilePath) -- | The Compiler value returned when the cabal file was loaded. compiler :: Lens Atoms (Maybe Compiler) -- | Map from cabal Extra-Lib names to debian binary package names. extraLibMap :: Lens Atoms (Map String (Set BinPkgName)) -- | Map from cabal Build-Tool names to debian binary package names. execMap :: Lens Atoms (Map String BinPkgName) -- | Cabal flag assignments to use when loading the cabal file. cabalFlagAssignments :: Lens Atoms (Set (FlagName, Bool)) -- | Map from cabal version number ranges to debian package names. This is -- a result of the fact that only one version of a debian package can be -- installed at a given time, while multiple versions of a cabal packages -- can. debianNameMap :: Lens Atoms (Map PackageName VersionSplits) -- | Map of Debian epoch numbers assigned to cabal packages. epochMap :: Lens Atoms (Map PackageName Int) -- | Map of binary deb descriptions. description :: Lens Atoms (Map BinPkgName Text) -- | Create a package to hold a cabal executable executable :: Lens Atoms (Map BinPkgName InstallFile) -- | Create a package for an operating service using the given executable serverInfo :: Lens Atoms (Map BinPkgName Server) -- | Create a package for a website using the given executable as the -- server website :: Lens Atoms (Map BinPkgName Site) -- | Generate a backups package using the given cabal executable backups :: Lens Atoms (Map BinPkgName String) -- | Create an apache configuration file with the given (domain, logdir, -- filetext). This is called when expanding the result of the website -- lens above. apacheSite :: Lens Atoms (Map BinPkgName (String, FilePath, Text)) -- | List if packages that should be omitted from any dependency list - -- e.g. a profiling package missing due to use of noProfilingPackage lens -- elsewhere. missingDependencies :: Lens Atoms (Set BinPkgName) -- | Override the package name used to hold left over data files and -- executables utilsPackageName :: Lens Atoms (Maybe BinPkgName) -- | Override the debian source package name constructed from the cabal -- name sourcePackageName :: Lens Atoms (Maybe SrcPkgName) -- | Revision string used in constructing the debian verison number from -- the cabal version revision :: Lens Atoms (Maybe String) -- | Exact debian version number, overrides the version generated from the -- cabal version debVersion :: Lens Atoms (Maybe DebianVersion) -- | Maintainer field. Overrides any value found in the cabal file, or in -- the DEBIANMAINTAINER environment variable. maintainer :: Lens Atoms (Maybe NameAddr) -- | No longer sure what the purpose of this lens is. packageInfo :: Lens Atoms (Map PackageName PackageInfo) -- | Set this to filter any less-than dependencies out of the generated -- debian dependencies. (Not sure if this is implemented.) omitLTDeps :: Lens Atoms Bool -- | Set this to omit the prof library deb. noProfilingLibrary :: Lens Atoms Bool -- | Set this to omit the doc library deb. noDocumentationLibrary :: Lens Atoms Bool -- | The copyright information copyright :: Lens Atoms (Maybe (Either License Text)) -- | The source package architecture - Any, All, or some -- list of specific architectures. sourceArchitecture :: Lens Atoms (Maybe PackageArchitectures) -- | Map of the binary package architectures binaryArchitectures :: Lens Atoms (Map BinPkgName PackageArchitectures) -- | The source package priority sourcePriority :: Lens Atoms (Maybe PackagePriority) -- | Map of the binary package priorities binaryPriorities :: Lens Atoms (Map BinPkgName PackagePriority) -- | The source package's section assignment sourceSection :: Lens Atoms (Maybe Section) -- | Map of the binary deb section assignments binarySections :: Lens Atoms (Map BinPkgName Section) -- | Build dependencies. FIXME: This should be a Set (Set Relation) so we -- can build or relations, right now we just assume that each Relation is -- a singleton set. buildDeps :: Lens Atoms (Set Relation) -- | Architecture independent buildDepsIndep :: Lens Atoms (Set Relation) -- | Map of extra install dependencies for the package's binary debs. This -- should be [[Relation]] for full generality, or Set (Set Relation) depends :: Lens Atoms (Map BinPkgName (Set Relation)) -- | Map of extra install conflicts for the package's binary debs. We -- should support all the other dependency fields - provides, replaces, -- etc. conflicts :: Lens Atoms (Map BinPkgName (Set Relation)) -- | Map of extra install replaces for the package's binary debs. We should -- support all the other dependency fields - provides, replaces, etc. replaces :: Lens Atoms (Map BinPkgName (Set Relation)) -- | Map of extra install provides for the package's binary debs. We should -- support all the other dependency fields - provides, replaces, etc. provides :: Lens Atoms (Map BinPkgName (Set Relation)) -- | Extra install dependencies for the devel library. Redundant with -- depends, but kept for backwards compatibility. Also, I think maybe -- this is or was needed because it can be set before the exact name of -- the library package is known. extraDevDeps :: Lens Atoms (Set Relation) -- | The beginning of the rules file rulesHead :: Lens Atoms (Maybe Text) -- | Additional fragments of the rules file rulesFragments :: Lens Atoms (Set Text) -- | Map of debian/postinst scripts postInst :: Lens Atoms (Map BinPkgName Text) -- | Map of debian/postrm scripts postRm :: Lens Atoms (Map BinPkgName Text) -- | Map of debian/preinst scripts preInst :: Lens Atoms (Map BinPkgName Text) -- | Map of debian/prerm scripts preRm :: Lens Atoms (Map BinPkgName Text) -- | The debian/compat file, contains the minimum compatible -- version of the debhelper package compat :: Lens Atoms (Maybe Int) -- | The debiansourceformat file. sourceFormat :: Lens Atoms (Maybe SourceFormat) -- | the debian/watch file watch :: Lens Atoms (Maybe Text) -- | the debian/changelog file changelog :: Lens Atoms (Maybe ChangeLog) -- | Comment entries for the latest changelog entry (DebLogComments -- [[Text]]) comments :: Lens Atoms (Maybe [[Text]]) -- | The debian/control file. control :: Lens Atoms SourceDebDescription -- | The Standards-Version field of the debian/control -- file standards :: Lens Atoms (Maybe StandardsVersion) -- | Add a stanza to the binary package's logrotate script. logrotateStanza :: Lens Atoms (Map BinPkgName (Set Text)) -- | Add entries to a binary deb's debian/foo.links file. link :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath))) -- | Install files into directories by adding entries to the binary deb's -- debian/foo.install file. install :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath))) -- | Rename and install files. This is done by adding rules to -- debian/rules. installTo :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath))) -- | Install files into the a binary deb's data directory, -- usrshare/packagename-version. This expands to either an install -- or an installTo. installData :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath))) -- | Create a file in the binary deb with the given text. This is done by -- writing the file into the cabalInstall directory and adding an entry -- to the binary deb's .install file. file :: Lens Atoms (Map BinPkgName (Set (FilePath, Text))) -- | Install a cabal executable into a binary deb. installCabalExec :: Lens Atoms (Map BinPkgName (Set (String, FilePath))) -- | Rename and install a cabal executable installCabalExecTo :: Lens Atoms (Map BinPkgName (Set (String, FilePath))) -- | Create directories in the package installDir :: Lens Atoms (Map BinPkgName (Set FilePath)) -- | Create an etcinit.d file in the package installInit :: Lens Atoms (Map BinPkgName Text) -- | Create a file in the debianization. This is used to implement the file -- lens above. intermediateFiles :: Lens Atoms (Set (FilePath, Text)) instance Typeable DebAtomKey instance Typeable DebAtom instance Eq DebAtomKey instance Ord DebAtomKey instance Data DebAtomKey instance Show DebAtomKey instance Eq Flags instance Ord Flags instance Show Flags instance Eq DebAtom instance Ord DebAtom instance Show DebAtom instance Eq Atoms instance Show Atoms instance Monoid Atoms module Debian.Debianize.Dependencies cabalDependencies :: Atoms -> [Dependency] -- | In cabal a self dependency probably means the library is needed while -- building the executables. In debian it would mean that the package -- needs an earlier version of itself to build, so we use this to filter -- such dependencies out. selfDependency :: PackageIdentifier -> Dependency_ -> Bool -- | Debian packages don't have per binary package build dependencies, so -- we just gather them all up here. allBuildDepends :: Atoms -> [Dependency] -> [Dependency] -> [Dependency] -> [String] -> [Dependency_] debDeps :: DebType -> Atoms -> Control' String -> Relations putBuildDeps :: Atoms -> Atoms -- | Turn a cabal dependency into debian dependencies. The result needs to -- correspond to a single debian package to be installed, so we will -- return just an OrRelation. dependencies :: Atoms -> PackageType -> PackageName -> VersionRange -> Relations debianName :: PkgName name => Atoms -> PackageType -> PackageIdentifier -> name -- | Function that applies the mapping from cabal names to debian names -- based on version numbers. If a version split happens at v, this will -- return the ltName if < v, and the geName if the relation is >= -- v. debianName' :: PkgName name => Maybe VersionSplits -> PackageType -> PackageIdentifier -> name -- | Given a control file and a DebType, look for the binary deb with the -- corresponding suffix and return its name. debNameFromType :: Control' String -> DebType -> Maybe BinPkgName getRulesHead :: Atoms -> Text filterMissing :: Atoms -> [[Relation]] -> [[Relation]] binaryPackageDeps :: BinPkgName -> Atoms -> [[Relation]] binaryPackageConflicts :: BinPkgName -> Atoms -> [[Relation]] binaryPackageProvides :: BinPkgName -> Atoms -> [[Relation]] binaryPackageReplaces :: BinPkgName -> Atoms -> [[Relation]] instance Eq Dependency_ instance Show Dependency_ instance Show a => Show (Rels a) -- | Convert a Debianization into a list of files that can then be written -- out. module Debian.Debianize.Files -- | Turn the Debianization into a list of files, making sure the text -- associated with each path is unique. Assumes that -- finalizeDebianization has already been called. (Yes, I'm considering -- building one into the other, but it is handy to look at the -- Debianization produced by finalizeDebianization in the unit tests.) toFileMap :: Atoms -> Map FilePath Text -- | Things that seem like they could be clients of this library, but are -- instead included as part of the library. module Debian.Debianize.Goodies -- | Create equals dependencies. For each pair (A, B), use dpkg-query to -- find out B's version number, version B. Then write a rule into P's -- .substvar that makes P require that that exact version of A, and -- another that makes P conflict with any older version of A. tightDependencyFixup :: [(BinPkgName, BinPkgName)] -> BinPkgName -> Atoms -> Atoms -- | Add a debian binary package to the debianization containing a cabal -- executable file set up to be a server. doServer :: BinPkgName -> Server -> Atoms -> Atoms -- | Add a debian binary package to the debianization containing a cabal -- executable file set up to be a web site. doWebsite :: BinPkgName -> Site -> Atoms -> Atoms -- | Add a debian binary package to the debianization containing a cabal -- executable file set up to be a backup script. doBackups :: BinPkgName -> String -> Atoms -> Atoms -- | Add a debian binary package to the debianization containing a cabal -- executable file. doExecutable :: BinPkgName -> InstallFile -> Atoms -> Atoms debianDescription :: String -> String -> String -> String -> String -> PackageType -> PackageIdentifier -> Text describe :: Atoms -> PackageType -> PackageIdentifier -> Text watchAtom :: PackageName -> Text oldClckwrksSiteFlags :: Site -> [String] oldClckwrksServerFlags :: Server -> [String] siteAtoms :: BinPkgName -> Site -> Atoms -> Atoms serverAtoms :: BinPkgName -> Server -> Bool -> Atoms -> Atoms backupAtoms :: BinPkgName -> String -> Atoms -> Atoms execAtoms :: BinPkgName -> InstallFile -> Atoms -> Atoms -- | Convert a Debianization into a list of files that can then be written -- out. module Debian.Debianize.Finalize -- | Now that we know the build and data directories, we can expand some -- atoms into sets of simpler atoms which can eventually be turned into -- the files of the debianization. The original atoms are not removed -- from the list because they may contribute to the debianization in -- other ways, so be careful not to do this twice, this function is not -- idempotent. (Exported for use in unit tests.) finalizeDebianization :: Atoms -> Atoms -- | Read an existing Debianization from a directory file. module Debian.Debianize.Input inputDebianization :: Top -> IO Atoms -- | Try to input a file and if successful add it to the debianization. inputDebianizationFile :: Top -> FilePath -> Atoms -> IO Atoms inputChangeLog :: Top -> IO ChangeLog inputCabalization :: Top -> Atoms -> IO Atoms -- | Try to read the license file specified in the cabal package, otherwise -- return a text representation of the License field. inputLicenseFile :: PackageDescription -> IO (Maybe Text) -- | Try to compute the debian maintainer from the maintainer field of the -- cabal package, or from the value returned by getDebianMaintainer. inputMaintainer :: Atoms -> IO (Maybe NameAddr) module Debian.Debianize.Options compileArgs :: [String] -> Atoms -> Atoms -- | Options that modify other atoms. options :: [OptDescr (Atoms -> Atoms)] -- | Support for generating Debianization from Cabal data. module Debian.Debianize.SubstVars -- | Expand the contents of the .substvars file for a library package. Each -- cabal package corresponds to a directory name-version, -- either in usrlib or in -- usrlibhaskell-packagesghc/lib. In that directory is a -- compiler subdirectory such as ghc-6.8.2. In the ghc subdirectory is -- one or two library files of the form libHSname-version.a -- and libHSname-version_p.a. We can determine the debian -- package names by running dpkg -S on these names, or examining the -- varlibdpkginfo/*.list files. From these we can determine -- the source package name, and from that the documentation package name. substvars :: Atoms -> DebType -> IO () module Debian.Debianize.VersionSplits -- | Add a VersionSplits value to atoms that maps the given cabal -- name pname to the given debian name dname. mapCabal :: PackageName -> String -> Atoms -> Atoms -- | Map the versions of pname less than ver to the given -- debian name ltname. splitCabal :: PackageName -> String -> Version -> Atoms -> Atoms module Data.Algorithm.Diff.Pretty -- | Format the output of contextDiff to look approximately like -- the output of the unix diff command. prettyDiff :: (Pretty a, Pretty b, Pretty c) => a -> b -> [[Diff [c]]] -> Doc module Data.Algorithm.Diff.Context -- | Do a grouped diff and then turn it into a list of hunks, where each -- hunk is a grouped diff with at most N elements of common context -- around each one. contextDiff :: Eq a => Int -> [a] -> [a] -> [[Diff [a]]] -- | Group the elements whose adjacent pairs satisfy the predicate. Differs -- from groupBy because the predicate does not have to define a total -- ordering. groups :: Eq a => (a -> a -> Bool) -> [a] -> [[a]] -- | Generate a package Debianization from Cabal data and command line -- options. module Debian.Debianize.Debianize -- | The main function for the cabal-debian executable. cabalDebian :: Atoms -> IO () -- | Compile the given arguments into an Atoms value and run the debianize -- function. This is basically equivalent to cabal-debian -- --debianize, except that the command line arguments come from the -- function parameter. callDebianize :: [String] -> Atoms -> IO () -- | Put an argument list into the CABALDEBIAN environment -- variable and then run the script in debian/Debianize.hs. If this -- exists and succeeds the return value is True, it may be assumed that a -- debianization was created in the debian subdirectory of the current -- directory. This is used to create customized debianizations that are -- to sophisticated for the command line argument interface available to -- the cabal-debian executable. runDebianize :: [String] -> IO Bool -- | Call runDebianize with the given working directory. runDebianize' :: Top -> [String] -> IO Bool -- | Depending on the options in atoms, either validate, describe, -- or write the generated debianization. debianize :: Top -> (Atoms -> IO Atoms) -> Atoms -> IO () -- | Given an Atoms value, get any additional configuration information -- from the environment, read the cabal package description and possibly -- the debian/changelog file, then generate and return the new -- debianization (along with the data directory computed from the cabal -- package description.) debianization :: Top -> (Atoms -> IO Atoms) -> Atoms -> IO Atoms -- | Write the files of the debianization d to the directory -- top. writeDebianization :: Top -> Atoms -> IO () describeDebianization :: Atoms -> String -- | Compare the existing debianization in top to the generated -- one new, returning a string describing the differences. compareDebianization :: Atoms -> Atoms -> String -- | Don't change anything, just make sure the new debianization matches -- the existing debianization in several particulars - specifically, -- version number, and source and binary package names. validateDebianization :: Atoms -> Atoms -> () module Debian.Debianize.Tests tests :: Test instance (Eq k, Eq a) => Eq (Change k a) instance (Show k, Show a) => Show (Change k a) -- | QUICK START: You can either run the cabal-debian --debianize, -- or for more power and flexibility you can put a Debianize.hs -- script in the package's debian subdirectory. Atoms -- value and pass it to the debianize function. The -- callDebianize function retrieves extra arguments from the -- CABALDEBIAN environment variable and calls debianize -- with the build directory set as it would be when the packages is built -- by dpkg-buildpackage. -- -- To see what your debianization would produce, or how it differs from -- the debianization already present: -- --
--   % cabal-debian --debianize -n
--   
-- -- This is equivalent to the library call -- --
--   % ghc -e 'Debian.Debianize.callDebianize ["-n"]'
--   
-- -- To actually create the debianization and then build the debs, -- --
--   % ghc -e 'Debian.Debianize.callDebianize []'
--   % sudo dpkg-buildpackage
--   
-- -- At this point you may need to modify Cabal.defaultFlags to achieve -- specific packaging goals. Create a module for this in -- debian/Debianize.hs: -- --
--   import Data.Lens.Lazy
--   import Data.Map as Map (insertWith)
--   import Data.Set as Set (union, singleton)
--   import Debian.Relation (BinPkgName(BinPkgName), Relation(Rel))
--   import Debian.Debianize (defaultAtoms, depends, debianization, writeDebianization)
--   main = debianization "." defaultAtoms >>=
--          return . modL depends (insertWith union (BinPkgName "cabal-debian") (singleton (Rel (BinPkgName "debian-policy") Nothing Nothing))) >>=
--          writeDebianization "."
--   
-- -- Then to test it, -- --
--   % CABALDEBIAN='["-n"]' runhaskell debian/Debianize.hs
--   
-- -- or equivalently -- --
--   % ghc -e 'Debian.Debianize.runDebianize ["-n"]'
--   
-- -- and to run it for real: -- --
--   % runhaskell debian/Debianize.hs
--   
module Debian.Debianize module Debian.Debianize.Details debianDefaultAtoms :: Atoms seereasonDefaultAtoms :: Atoms