cabal-debian-4.0.5: Create a debianization for a cabal package

Safe HaskellNone

Debian.Debianize.Types.Atoms

Contents

Description

This module holds a long list of lenses that access the Atoms record, the record that holds the input data from which the debianization is to be constructed.

Synopsis

Documentation

data Atoms Source

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.

Constructors

Atoms 

Fields

noDocumentationLibrary_ :: Set Bool

Do not produce a libghc-foo-doc package. FIXME: make this Bool or Maybe Bool

noProfilingLibrary_ :: Set Bool

Do not produce a libghc-foo-prof package. FIXME: make this Bool or Maybe Bool

omitLTDeps_ :: Set Bool

If present, don't generate the << dependency when we see a cabal equals dependency. (The implementation of this was somehow lost.) FIXME: make this Bool or Maybe Bool

compilerVersion_ :: Maybe Version

Specify the version number of the GHC compiler in the build environment. The default is to assume that version is the same as the one in the environment where cabal-debian is running. This is used to look up hard coded lists of packages bundled with the compiler and their version numbers. (This could certainly be done in a more beautiful way.)

buildDir_ :: Set FilePath

The build directory used by cabal, typically dist/build when building manually or dist-ghc/build when building using GHC and haskell-devscripts. This value is used to locate files produced by cabal so we can move them into the deb. Note that the --builddir option of runhaskell Setup appends the /build to the value it receives, so, yes, try not to get confused. FIXME: make this FilePath or Maybe FilePath

flags_ :: Flags

Information regarding mode of operation - verbosity, dry-run, usage, etc

debianNameMap_ :: Map PackageName VersionSplits

Mapping from cabal package name and version to debian source package name. This allows different ranges of cabal versions to map to different debian source package names.

control_ :: SourceDebDescription

The parsed contents of the control file

sourcePackageName_ :: Maybe SrcPkgName

Name to give to the debian source package. If not supplied the name is constructed from the cabal package name. Note that DebianNameMap could encode this information if we already knew the cabal package name, but we can't assume that.

revision_ :: Maybe String

Specify the revision string to use when converting the cabal version to debian.

debVersion_ :: Maybe DebianVersion

Specify the exact debian version of the resulting package, including epoch. One use case is to work around the the buildN versions that are often uploaded to the debian and ubuntu repositories. Say the latest cabal version of transformers is 0.3.0.0, but the debian repository contains version 0.3.0.0-1build3, we need to specify debVersion=0.3.0.0-1build3 or the version we produce will look older than the one already available upstream.

maintainerOld_ :: Maybe NameAddr

Value for the maintainer field in the control file. Note that the cabal maintainer field can have multiple addresses, but debian only one. If this is not explicitly set, it is obtained from the cabal file, and if it is not there then from the environment. As a last resort, there is a hard coded string in here somewhere.

cabalFlagAssignments_ :: Set (FlagName, Bool)

Flags to pass to Cabal function finalizePackageDescription, this can be used to control the flags in the cabal file. It can be supplied to the cabal-debian binary using the --flags option.

sourceFormat_ :: Maybe SourceFormat

Write debiansourceformat

watch_ :: Maybe Text

Write debian/watch

intermediateFiles_ :: Set (FilePath, Text)

Put this text into a file with the given name in the debianization.

rulesHead_ :: Maybe Text

The header of the debian/rules file. The remainder is assembled from DebRulesFragment values in the atom list.

rulesFragments_ :: Set Text

A Fragment of debian/rules

warning_ :: Set Text

A warning to be reported later

utilsPackageNames_ :: Set BinPkgName

Name of a package that will get left-over data files and executables. If there are more than one, each package will get those files.

changelog_ :: Maybe ChangeLog

The changelog, first entry contains the source package name and version

comments_ :: Maybe [[Text]]

Each element is a comment to be added to the changelog, where the element's text elements are the lines of the comment.

missingDependencies_ :: Set BinPkgName

Lets cabal-debian know that a package it might expect to exist actually does not, so omit all uses in resulting debianization.

extraLibMap_ :: Map String Relations

Map a cabal Extra-Library name to a debian binary package name, e.g. ExtraLibMapping extraLibMap cryptopp libcrypto-dev adds a build dependency *and* a regular dependency on libcrypto-dev to any package that has cryptopp in its cabal Extra-Library list.

execMap_ :: Map String Relations

Map a cabal Build-Tool name to a debian binary package name, e.g. ExecMapping trhsx haskell-hsx-utils adds a build dependency on haskell-hsx-utils to any package that has trhsx in its cabal build-tool list.

epochMap_ :: Map PackageName Int

Specify epoch numbers for the debian package generated from a cabal package. Example: EpochMapping (PackageName HTTP) 1.

packageInfo_ :: Map PackageName PackageInfo

Supply some info about a cabal package.

compat_ :: Maybe Int

The debhelper compatibility level, from debian/compat.

copyright_ :: Maybe Text

Copyright information

license_ :: Maybe License

License information Cabal License value

licenseFile_ :: Maybe Text

The contents of the file specified in the cabal license-file: field

apacheSite_ :: Map BinPkgName (String, FilePath, Text)

Have Apache configure a site using PACKAGE, DOMAIN, LOGDIR, and APACHECONFIGFILE

logrotateStanza_ :: Map BinPkgName (Set Text)

Add a stanza of a logrotate file to the binary package

link_ :: Map BinPkgName (Set (FilePath, FilePath))

Create a symbolic link in the binary package

postInst_ :: Map BinPkgName Text

Script to run after install, should contain line before exit 0

postRm_ :: Map BinPkgName Text

Script to run after remove, should contain line before exit 0

preInst_ :: Map BinPkgName Text

Script to run before install, should contain line before exit 0

preRm_ :: Map BinPkgName Text

Script to run before remove, should contain line before exit 0

sourceArchitecture_ :: Maybe PackageArchitectures

Set the Architecture field of the source package

binaryArchitectures_ :: Map BinPkgName PackageArchitectures

Set the Architecture field of a binary package

sourcePriority_ :: Maybe PackagePriority

Set the Priority field of the source package

binaryPriorities_ :: Map BinPkgName PackagePriority

Set the Priority field of a binary package

sourceSection_ :: Maybe Section

Set the Section field of the source package

binarySections_ :: Map BinPkgName Section

Set the Section field of a binary package

install_ :: Map BinPkgName (Set (FilePath, FilePath))

Install a build file into the binary package

installTo_ :: Map BinPkgName (Set (FilePath, FilePath))

Install a build file into the binary package at an exact location

installData_ :: Map BinPkgName (Set (FilePath, FilePath))

DHInstallTo somewhere relative to DataDir (see above)

file_ :: Map BinPkgName (Set (FilePath, Text))

Create a file with the given text at the given path

installCabalExec_ :: Map BinPkgName (Set (String, FilePath))

Install a cabal executable into the binary package

installCabalExecTo_ :: Map BinPkgName (Set (String, FilePath))

Install a cabal executable into the binary package at an exact location

installDir_ :: Map BinPkgName (Set FilePath)

Create a directory in the binary package

installInit_ :: Map BinPkgName Text

Add an init.d file to the binary package

executable_ :: Map BinPkgName InstallFile

Create a binary package to hold a cabal executable

serverInfo_ :: Map BinPkgName Server

Like DHExecutable, but configure the executable as a server process

website_ :: Map BinPkgName Site

Like DHServer, but configure the server as a web server

backups_ :: Map BinPkgName String

Configure the executable to do incremental backups

extraDevDeps_ :: Relations

Limited version of Depends, put a dependency on the dev library package. The only reason to use this is because we don't yet know the name of the dev library package.

packageDescription_ :: Maybe PackageDescription

The result of reading a cabal configuration file.

compiler_ :: Maybe CompilerId

The compiler value from cabal

Instances

data Flags Source

This record supplies information about the task we want done - debianization, validataion, help message, etc.

Constructors

Flags 

Fields

verbosity_ :: Int

Run with progress messages at the given level of verboseness.

dryRun_ :: Bool

Don't write any files or create any directories, just explain what would have been done.

validate_ :: Bool

Fail if the debianization already present doesn't match the one we are going to generate closely enough that it is safe to debianize during the run of dpkg-buildpackage, when Setup configure is run. Specifically, the version number in the top changelog entry must match, and the sets of package names in the control file must match.

debAction_ :: DebAction

What to do - Usage, Debianize or Substvar

Instances

data DebType Source

A redundant data type, too lazy to expunge.

Constructors

Dev 
Prof 
Doc 

data Site Source

Information about the web site we are packaging.

Constructors

Site 

Fields

domain :: String

The domain name assigned to the server. An apache configuration will be generated to redirect requests from this domain to hostname:port

serverAdmin :: String

Apache ServerAdmin parameter

server :: Server

The hint to install the server job

Instances

data Server Source

Information about the server we are packaging.

Constructors

Server 

Fields

hostname :: String

Host on which the server will run

port :: Int

Port on which the server will run. Obviously, this must assign each and every server package to a different port.

headerMessage :: String

A comment that will be inserted to explain how the file was generated

retry :: String

start-stop-daemon --retry argument

serverFlags :: [String]

Extra flags to pass to the server via the init script

installFile :: InstallFile

The hint to install the server executable

data InstallFile Source

Constructors

InstallFile 

Fields

execName :: String

The name of the executable file

sourceDir :: Maybe FilePath

where to find it, default is distbuildexecName/

destDir :: Maybe FilePath

where to put it, default is usrbinexecName

destName :: String

name to give installed executable

verbosity :: Lens Atoms IntSource

Set how much progress messages get generated.

dryRun :: Lens Atoms BoolSource

Don't write anything, just output a description of what would have happened

validate :: Lens Atoms BoolSource

Make sure the version number and package names of the supplied and generated debianizations match.

debAction :: Lens Atoms DebActionSource

Debianize, SubstVars, or Usage. I'm no longer sure what SubstVars does, but someone may still be using it.

flags :: Lens Atoms FlagsSource

Obsolete record containing verbosity, dryRun, validate, and debAction.

compilerVersion :: Lens Atoms (Maybe Version)Source

Set the compiler version, this is used when loading the cabal file to

buildDir :: Lens Atoms (Set FilePath)Source

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.

extraLibMap :: Lens Atoms (Map String Relations)Source

Map from cabal Extra-Lib names to debian binary package names.

execMap :: Lens Atoms (Map String Relations)Source

Map from cabal Build-Tool names to debian binary package names.

cabalFlagAssignments :: Lens Atoms (Set (FlagName, Bool))Source

Cabal flag assignments to use when loading the cabal file.

packageDescription :: Lens Atoms (Maybe PackageDescription)Source

The result of loading a .cabal file

compiler :: Lens Atoms (Maybe CompilerId)Source

Another result of loading a .cabal file

debianNameMap :: Lens Atoms (Map PackageName VersionSplits)Source

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 package can.

epochMap :: Lens Atoms (Map PackageName Int)Source

Map of Debian epoch numbers assigned to cabal packages.

executable :: Lens Atoms (Map BinPkgName InstallFile)Source

Create a package to hold a cabal executable

serverInfo :: Lens Atoms (Map BinPkgName Server)Source

Create a package for a server

website :: Lens Atoms (Map BinPkgName Site)Source

Create a package for a website

backups :: Lens Atoms (Map BinPkgName String)Source

Create a package for a timed backup script

apacheSite :: Lens Atoms (Map BinPkgName (String, FilePath, Text))Source

Create an apache configuration file with the given (domain, logdir, filetext). This is called when expanding the result of the website lens above.

Lower level hints about the debianization

missingDependencies :: Lens Atoms (Set BinPkgName)Source

List if packages that should be omitted from any dependency list - e.g. a profiling package missing due to use of noProfilingPackage lens elsewhere.

utilsPackageNames :: Lens Atoms (Set BinPkgName)Source

Override the package name used to hold left over data files and executables. Usually only one package is specified, but if more then one are they will each receive the same list of files.

sourcePackageName :: Lens Atoms (Maybe SrcPkgName)Source

Override the debian source package name constructed from the cabal name

revision :: Lens Atoms (Maybe String)Source

Revision string used in constructing the debian verison number from the cabal version

debVersion :: Lens Atoms (Maybe DebianVersion)Source

Exact debian version number, overrides the version generated from the cabal version

packageInfo :: Lens Atoms (Map PackageName PackageInfo)Source

No longer sure what the purpose of this lens is.

omitLTDeps :: Lens Atoms (Set Bool)Source

Set this to filter any less-than dependencies out of the generated debian dependencies. (Not sure if this is implemented.)

noProfilingLibrary :: Lens Atoms (Set Bool)Source

Set this to omit the prof library deb.

noDocumentationLibrary :: Lens Atoms (Set Bool)Source

Set this to omit the doc library deb.

copyright :: Lens Atoms (Maybe Text)Source

The copyright information from the cabal file

license :: Lens Atoms (Maybe License)Source

The license information from the cabal file

licenseFile :: Lens Atoms (Maybe Text)Source

The value in the cabal file's license-file field

sourceArchitectures :: Lens Atoms (Maybe PackageArchitectures)Source

The architectures supported by this source package - Any, All, or some list of specific architectures.

extraDevDeps :: Lens Atoms RelationsSource

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.

rulesHead :: Lens Atoms (Maybe Text)Source

The beginning of the rules file

rulesFragments :: Lens Atoms (Set Text)Source

Additional fragments of the rules file

postInst :: Lens Atoms (Map BinPkgName Text)Source

Map of debian/postinst scripts

postRm :: Lens Atoms (Map BinPkgName Text)Source

Map of debian/postrm scripts

preInst :: Lens Atoms (Map BinPkgName Text)Source

Map of debian/preinst scripts

preRm :: Lens Atoms (Map BinPkgName Text)Source

Map of debian/prerm scripts

compat :: Lens Atoms (Maybe Int)Source

The debian/compat file, contains the minimum compatible version of the debhelper package. If not given the version number of the installed debhelper package is used.

sourceFormat :: Lens Atoms (Maybe SourceFormat)Source

The debian/source/format file.

watch :: Lens Atoms (Maybe Text)Source

the debian/watch file

changelog :: Lens Atoms (Maybe ChangeLog)Source

the debian/changelog file

comments :: Lens Atoms (Maybe [[Text]])Source

Comment entries for the latest changelog entry (DebLogComments [[Text]])

control :: Lens Atoms SourceDebDescriptionSource

The debian/control file. Many of the following lenses access parts of the SourceDebDescription.

logrotateStanza :: Lens Atoms (Map BinPkgName (Set Text))Source

Add a stanza to the binary package's logrotate script.

link :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath)))Source

Add entries to a binary deb's debian/foo.links file.

install :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath)))Source

Install files into directories by adding entries to the binary deb's debian/foo.install file.

installTo :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath)))Source

Rename and install files. This is done by adding rules to debian/rules.

installData :: Lens Atoms (Map BinPkgName (Set (FilePath, FilePath)))Source

Install files into the a binary deb's data directory, usrshare/packagename-version. This expands to either an install or an installTo.

file :: Lens Atoms (Map BinPkgName (Set (FilePath, Text)))Source

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.

installCabalExec :: Lens Atoms (Map BinPkgName (Set (String, FilePath)))Source

Install a cabal executable into a binary deb. FIXME: change signature to BinPkgName -> Lens Atoms (Set (String, FilePath))

installCabalExecTo :: Lens Atoms (Map BinPkgName (Set (String, FilePath)))Source

Rename and install a cabal executable FIXME: change signature to BinPkgName -> Lens Atoms (Set (String, FilePath))

installDir :: Lens Atoms (Map BinPkgName (Set FilePath))Source

Create directories in the package FIXME: change signature to BinPkgName -> Lens Atoms (Set FilePath)

installInit :: Lens Atoms (Map BinPkgName Text)Source

Create an etcinit.d file in the package FIXME: change signature to BinPkgName -> Lens Atoms Text

intermediateFiles :: Lens Atoms (Set (FilePath, Text))Source

Create a file in the debianization. This is used to implement the file lens above. FIXME: change signature to BinPkgName -> Lens Atoms (Set (FilePath, Text))