Skip to content

Commit

Permalink
put under Network toplevel; got rid of warnings for cabal file
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwills committed Dec 28, 2010
1 parent fc10417 commit 7dc1303
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 63 deletions.
33 changes: 20 additions & 13 deletions HaskellNet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,32 @@ Version: 0.2.4
Author: Jun Mukai
Maintainer: Robert Wills <[email protected]>
License: BSD3
License-file: LICENSE
Category: Network
Homepage: https://patch-tag.com/r/wrwills/HaskellNet/home
Homepage: https://patch-tag.com/r/wrwills/HaskellNet
Description: Originally written for Google SOC, provides network related libraries such as POP3, SMTP, IMAP.
All I have done is get the project to compile using cabal and check that these libraries basically
work.
Build-Depends: base >= 4, haskell98, network, mtl, parsec, time, bytestring, pretty, array, Crypto > 4.2.1, base64-string, containers, old-locale, old-time, mime-mail, text
All I have done is get the project to compile using cabal, check that these libraries basically
work, and add some examples
Synopsis: network related libraries such as POP3, SMTP, IMAP
cabal-version: >=1.2
build-type: Simple
Cabal-version: >=1.6
Build-type: Simple

Extra-Source-Files: README.md, example/*.hs

exposed-modules:
Library
Exposed-modules:
Text.IMAPParsers,
Text.Mime,
Text.URI,
-- Text.Bencode,
HaskellNet.IMAP,
HaskellNet.SMTP,
HaskellNet.POP3,
HaskellNet.BSStream,
HaskellNet.Auth
other-modules: Data.Record, Text.Packrat.Pos, Text.Packrat.Parse
Network.HaskellNet.IMAP,
Network.HaskellNet.SMTP,
Network.HaskellNet.POP3,
Network.HaskellNet.BSStream,
Network.HaskellNet.Auth
Other-modules: Data.Record, Text.Packrat.Pos, Text.Packrat.Parse
Build-Depends: base >= 4 && < 5, haskell98, network, mtl, parsec, time, bytestring, pretty, array, Crypto > 4.2.1, base64-string, containers, old-locale, old-time, mime-mail, text

source-repository head
type: darcs
location: https://patch-tag.com/r/wrwills/HaskellNet
46 changes: 24 additions & 22 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
Copyright (c) 2006, Jun Mukai
Copyright (c)2010, Jun Mukai, Rob Wills

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
* Neither the name of Jun Mukai, Rob Wills nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 2 additions & 2 deletions HaskellNet/Auth.hs → Network/HaskellNet/Auth.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
----------------------------------------------------------------------
-- |
-- Module : HaskellNet.Auth
-- Module : Network.HaskellNet.Auth
-- Copyright : (c) Jun Mukai 2006
-- License : BSD-style (see the file LICENSE)
--
Expand All @@ -11,7 +11,7 @@
-- Authentication related APIs
--

module HaskellNet.Auth
module Network.HaskellNet.Auth
where

import Data.Digest.MD5
Expand Down
4 changes: 2 additions & 2 deletions HaskellNet/BSStream.hs → Network/HaskellNet/BSStream.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-----------------------------------------------------------------------------
-- |
-- Module : HaskellNet.Stream
-- Module : Network.HaskellNet.Stream
-- Copyright : (c) Jun Mukai 2006
-- License : BSD
--
Expand All @@ -13,7 +13,7 @@
--
-----------------------------------------------------------------------------

module HaskellNet.BSStream
module Network.HaskellNet.BSStream
( BSStream(..)
)
where
Expand Down
10 changes: 5 additions & 5 deletions HaskellNet/IMAP.hs → Network/HaskellNet/IMAP.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
----------------------------------------------------------------------
-- |
-- Module : HaskellNet.IMAP
-- Module : Network.HaskellNet.IMAP
-- Copyright : (c) Jun Mukai 2006
-- License : BSD-style (see the file LICENSE)
--
Expand All @@ -11,7 +11,7 @@
-- IMAP client implementation
--

module HaskellNet.IMAP
module Network.HaskellNet.IMAP
( -- * connection type and corresponding actions
IMAPConnection
, mailbox, exists, recent
Expand Down Expand Up @@ -41,9 +41,9 @@ module HaskellNet.IMAP
where

import Network
import HaskellNet.BSStream
import HaskellNet.Auth hiding (auth, login)
import qualified HaskellNet.Auth as A
import Network.HaskellNet.BSStream
import Network.HaskellNet.Auth hiding (auth, login)
import qualified Network.HaskellNet.Auth as A

import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
Expand Down
10 changes: 5 additions & 5 deletions HaskellNet/POP3.hs → Network/HaskellNet/POP3.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
----------------------------------------------------------------------
-- |
-- Module : HaskellNet.POP3
-- Module : Network.HaskellNet.POP3
-- Copyright : (c) Jun Mukai 2006
-- License : BSD-style (see the file LICENSE)
--
Expand All @@ -11,7 +11,7 @@
-- POP3 client implementation
--

module HaskellNet.POP3
module Network.HaskellNet.POP3
( -- * Types
Command(..)
, POP3Connection(..)
Expand Down Expand Up @@ -45,10 +45,10 @@ module HaskellNet.POP3
)
where

import HaskellNet.BSStream
import Network.HaskellNet.BSStream
import Network
import HaskellNet.Auth hiding (auth, login)
import qualified HaskellNet.Auth as A
import Network.HaskellNet.Auth hiding (auth, login)
import qualified Network.HaskellNet.Auth as A

import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
Expand Down
8 changes: 4 additions & 4 deletions HaskellNet/SMTP.hs → Network/HaskellNet/SMTP.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
----------------------------------------------------------------------
-- |
-- Module : HaskellNet.SMTP
-- Module : Network.HaskellNet.SMTP
-- Copyright : (c) Jun Mukai 2006
-- License : BSD-style (see the file LICENSE)
--
Expand All @@ -12,7 +12,7 @@
-- SMTP client implementation
--

module HaskellNet.SMTP
module Network.HaskellNet.SMTP
( -- * Types
Command(..)
, Response(..)
Expand All @@ -33,7 +33,7 @@ module HaskellNet.SMTP
)
where

import HaskellNet.BSStream
import Network.HaskellNet.BSStream
import Data.ByteString (ByteString, append)
import qualified Data.ByteString.Char8 as BS
import Network.BSD (getHostName)
Expand All @@ -45,7 +45,7 @@ import Control.Monad (unless)
import Data.List (intersperse)
import Data.Char (chr, ord, isSpace, isDigit)

import HaskellNet.Auth
import Network.HaskellNet.Auth

import System.IO

Expand Down
4 changes: 2 additions & 2 deletions example/DebugStream.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package HaskellNet #-}
{-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package Network.HaskellNet #-}
-- examples to connect server by hsgnutls

module DebugStream
Expand All @@ -11,7 +11,7 @@ module DebugStream
where

import Network
import HaskellNet.BSStream
import Network.HaskellNet.BSStream

import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
Expand Down
4 changes: 2 additions & 2 deletions example/TLSStream.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- {-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package HaskellNet #-}
-- {-# OPTIONS_GHC -cpp -fglasgow-exts -package hsgnutls -package Network.HaskellNet #-}
-- examples to connect server by hsgnutls

module TLSStream
Expand All @@ -11,7 +11,7 @@ module TLSStream

import Network.GnuTLS
import Network
import HaskellNet.BSStream
import Network.HaskellNet.BSStream

import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
Expand Down
2 changes: 1 addition & 1 deletion example/imap.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import System.IO
import HaskellNet.IMAP
import Network.HaskellNet.IMAP
import Text.Mime
import qualified Data.ByteString.Char8 as BS
import Control.Monad
Expand Down
2 changes: 1 addition & 1 deletion example/pop3.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import System.IO
import HaskellNet.POP3
import Network.HaskellNet.POP3

import qualified Data.ByteString.Char8 as BSC
import qualified Data.ByteString.Char8 as BS
Expand Down
8 changes: 4 additions & 4 deletions example/smtp.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import System.IO
import HaskellNet.SMTP
import Network.HaskellNet.SMTP
import Text.Mime
import qualified Data.ByteString.Char8 as BS
import Codec.Binary.Base64.String
Expand All @@ -16,15 +16,15 @@ main = do
messageHtml <- BS.readFile "example/message.html"
let textP = SinglePart [("Content-Type", "text/plain; charset=utf-8")] message
let htmlP = SinglePart [("Content-Type", "text/html; charset=utf-8")] messageHtml
let msg = MultiPart [("From", "HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")] [htmlP, textP]
let msg = MultiPart [("From", "Network.HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")] [htmlP, textP]
sendMail sendFrom sendTo (BS.pack $ show $ showMime "utf-8" msg) con
closeSMTP con



--let msg = ([("From", "HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], MultiPart [] [textP, htmlP])
--let msg = ([("From", "Network.HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], MultiPart [] [textP, htmlP])
--sendMail sendFrom sendTo (BS.pack $ show $ showMessage "utf-8" msg) con
-- let msg = ([("From", "HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], BS.pack "\r\nhello 算法是指完成一个任from haskellnet")
-- let msg = ([("From", "Network.HaskellNet <" ++ sendFrom ++ ">"),("Subject","Test")], BS.pack "\r\nhello 算法是指完成一个任from haskellnet")

--htmlP = SinglePart [("Content-Type", "text/html; charset=utf-8", "Content-Transfer-Encoding", ""] BS.pack $ encode $

Expand Down

0 comments on commit 7dc1303

Please sign in to comment.