module Debian.Debianize.Types.BinaryDebDescription
( BinaryDebDescription
, newBinaryDebDescription
, package
, description
, packageType
, architecture
, binarySection
, binaryPriority
, essential
, relations
, PackageType(..)
, PackageRelations
, newPackageRelations
, depends
, recommends
, suggests
, preDepends
, breaks
, conflicts
, provides
, replaces
, builtUsing
) where
import Data.Generics (Data, Typeable)
import Data.Lens.Template (makeLenses)
import Data.Monoid (Monoid(..))
import Data.Text (Text)
import Debian.Policy (PackageArchitectures, PackagePriority, Section)
import Debian.Relation (BinPkgName, Relations)
import Prelude hiding ((.))
data BinaryDebDescription
= BinaryDebDescription
{ _package :: BinPkgName
, _packageType :: Maybe PackageType
, _architecture :: Maybe PackageArchitectures
, _binarySection :: Maybe Section
, _binaryPriority :: Maybe PackagePriority
, _essential :: Maybe Bool
, _description :: Maybe Text
, _relations :: PackageRelations
} deriving (Eq, Ord, Read, Show, Data, Typeable)
data PackageType
= Development
| Profiling
| Documentation
| Exec
| Utilities
| Source'
| Cabal
deriving (Eq, Ord, Show, Read, Data, Typeable)
data PackageRelations
= PackageRelations
{ _depends :: Relations
, _recommends :: Relations
, _suggests :: Relations
, _preDepends :: Relations
, _breaks :: Relations
, _conflicts :: Relations
, _provides :: Relations
, _replaces :: Relations
, _builtUsing :: Relations
} deriving (Eq, Ord, Read, Show, Data, Typeable)
newBinaryDebDescription :: BinPkgName -> BinaryDebDescription
newBinaryDebDescription name =
BinaryDebDescription
{ _package = name
, _packageType = Nothing
, _architecture = Nothing
, _binarySection = Nothing
, _binaryPriority = Nothing
, _essential = Nothing
, _description = mempty
, _relations = newPackageRelations }
newPackageRelations :: PackageRelations
newPackageRelations =
PackageRelations
{ _depends = []
, _recommends = []
, _suggests = []
, _preDepends = []
, _breaks = []
, _conflicts = []
, _provides = []
, _replaces = []
, _builtUsing = [] }
$(makeLenses [''BinaryDebDescription, ''PackageRelations])