name:                zre
version:             0.1.1.0
synopsis:            ZRE protocol implementation
description:         Peer-to-peer local area networking with reliable group messaging
                     and automatic peer discovery.

                     ZRE protocol implementation according to https://rfc.zeromq.org/spec:36/ZRE/

homepage:            https://github.com/sorki/haskell-zre/
license:             BSD3
license-file:        LICENSE
author:              Richard Marko
maintainer:          srk@48.io
copyright:           2020 Richard Marko
category:            Networking
build-type:          Simple
cabal-version:       >=1.10
extra-source-files:
  CHANGELOG.md
  README.rst
  zre.conf

flag examples
  default:
    False
  description:
    Builds example applications

library
  hs-source-dirs:      src
  exposed-modules:       Network.ZRE
                       , Network.ZRE.Beacon
                       , Network.ZRE.Chan
                       , Network.ZRE.Config
                       , Network.ZRE.Lib
                       , Network.ZRE.Options
                       , Network.ZRE.Parse
                       , Network.ZRE.Peer
                       , Network.ZRE.Utils
                       , Network.ZRE.Types
                       , Network.ZRE.ZMQ
                       , Network.ZGossip
                       , Network.ZGossip.ZMQ
                       , Network.ZGossip.Types
                       , Data.ZRE
                       , Data.ZMQParse
                       , Data.ZGossip
                       , System.ZMQ4.Endpoint
  build-depends:       base >= 4.7 && < 5
                     , async
                     , lifted-async
                     , attoparsec
                     , cereal
                     , data-default
                     , network
                     , network-bsd
                     , network-info
                     , network-multicast
                     , binary
                     , bytestring
                     , containers
                     , directory
                     , filepath
                     , mtl
                     , monad-control
                     , optparse-applicative
                     , transformers-base
                     , sockaddr
                     , process
                     , random
                     , text
                     , stm
                     , time
                     , uuid
                     , zeromq4-haskell
  default-language:    Haskell2010
  ghc-options:         -Wall

executable zre
  hs-source-dirs:      app
  main-is:             Main.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , bytestring
                     , async
                     , lifted-async
                     , repline
                     , stm
                     , zre
  default-language:    Haskell2010

executable mzre
  if !flag(examples)
    buildable: False
  hs-source-dirs:      app
  main-is:             Monadic.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , bytestring
                     , mtl
                     , stm
                     , lifted-async
                     , zre
  default-language:    Haskell2010

executable zreworker
  if !flag(examples)
    buildable: False
  hs-source-dirs:      app
  main-is:             Worker.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , async
                     , bytestring
                     , mtl
                     , monad-control
                     , lifted-async
                     , zre
  default-language:    Haskell2010

executable zgossip-server
  hs-source-dirs:      app
  main-is:             ZGossipSrv.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , async
                     , bytestring
                     , mtl
                     , monad-control
                     , lifted-async
                     , zre
  default-language:    Haskell2010

executable zrematch
  if !flag(examples)
    buildable: False
  hs-source-dirs:      app
  main-is:             Match.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , async
                     , bytestring
                     , mtl
                     , monad-control
                     , lifted-async
                     , zre
  default-language:    Haskell2010

executable zretime
  hs-source-dirs:      app
  main-is:             Time.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , bytestring
                     , time
                     , lifted-async
                     , zre
  default-language:    Haskell2010

executable zrecat
  hs-source-dirs:      app
  main-is:             Cat.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , bytestring
                     , optparse-applicative
                     , time
                     , lifted-async
                     , zre
  default-language:    Haskell2010

test-suite zre-test
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs
  other-modules:       Arbitrary
                     , Binary
                     , Endpoint
                     , ZGossip
                     , ZRE
  build-depends:       base
                     , bytestring
                     , zre
                     , QuickCheck
                     , quickcheck-instances
                     , uuid
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  default-language:    Haskell2010

source-repository head
  type:     git
  location: https://github.com/sorki/haskell-zre