update to 7.1.0
This commit is contained in:
parent
70af9339ac
commit
453595b783
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/happstack-server-7.0.0.tar.gz
|
||||
/happstack-server-7.1.0.tar.gz
|
||||
|
@ -3,23 +3,19 @@
|
||||
%global pkg_name happstack-server
|
||||
|
||||
Name: ghc-%{pkg_name}
|
||||
Version: 7.0.0
|
||||
Release: 10%{?dist}
|
||||
Version: 7.1.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Happstack web server
|
||||
|
||||
License: BSD
|
||||
URL: http://hackage.haskell.org/package/%{pkg_name}
|
||||
Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
|
||||
Patch1: happstack-server-default-to-base4.patch
|
||||
Patch2: happstack-server-7.0.0-blaze-html.patch
|
||||
Patch3: happstack-server-7.0-ghc76-time.patch
|
||||
|
||||
BuildRequires: ghc-Cabal-devel
|
||||
BuildRequires: ghc-rpm-macros
|
||||
# Begin cabal-rpm deps:
|
||||
BuildRequires: ghc-base64-bytestring-devel
|
||||
BuildRequires: ghc-blaze-html-devel
|
||||
BuildRequires: ghc-blaze-markup-devel
|
||||
BuildRequires: ghc-bytestring-devel
|
||||
BuildRequires: ghc-containers-devel
|
||||
BuildRequires: ghc-directory-devel
|
||||
@ -31,16 +27,17 @@ BuildRequires: ghc-monad-control-devel
|
||||
BuildRequires: ghc-mtl-devel
|
||||
BuildRequires: ghc-network-devel
|
||||
BuildRequires: ghc-old-locale-devel
|
||||
BuildRequires: ghc-old-time-devel
|
||||
BuildRequires: ghc-parsec-devel
|
||||
BuildRequires: ghc-process-devel
|
||||
BuildRequires: ghc-sendfile-devel
|
||||
BuildRequires: ghc-syb-devel
|
||||
BuildRequires: ghc-system-filepath-devel
|
||||
BuildRequires: ghc-template-haskell-devel
|
||||
BuildRequires: ghc-text-devel
|
||||
BuildRequires: ghc-threads-devel
|
||||
BuildRequires: ghc-time-devel
|
||||
BuildRequires: ghc-transformers-devel
|
||||
BuildRequires: ghc-transformers-base-devel
|
||||
BuildRequires: ghc-transformers-devel
|
||||
BuildRequires: ghc-unix-devel
|
||||
BuildRequires: ghc-utf8-string-devel
|
||||
BuildRequires: ghc-xhtml-devel
|
||||
@ -61,22 +58,17 @@ Summary: Haskell %{pkg_name} library development files
|
||||
Requires: ghc-compiler = %{ghc_version}
|
||||
Requires(post): ghc-compiler = %{ghc_version}
|
||||
Requires(postun): ghc-compiler = %{ghc_version}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
This package provides the Haskell %{pkg_name} library development files.
|
||||
This package provides the Haskell %{pkg_name} library development
|
||||
files.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{pkg_name}-%{version}
|
||||
%patch1 -p1 -b .1-orig~
|
||||
%patch2 -p1 -b .2-blaze~
|
||||
%patch3 -p1 -b .3-time~
|
||||
|
||||
cabal-tweak-dep-ver base64-bytestring "== 0.1.*" "== 1.*"
|
||||
cabal-tweak-dep-ver blaze-html "< 0.6" "< 0.7"
|
||||
cabal-tweak-dep-ver mtl "< 2.1" "< 2.2"
|
||||
cabal-tweak-dep-ver transformers "< 0.3" "< 0.4"
|
||||
cabal-tweak-dep-ver blaze-html "== 0.5.*" ">= 0.5"
|
||||
|
||||
|
||||
%build
|
||||
@ -103,6 +95,9 @@ cabal-tweak-dep-ver transformers "< 0.3" "< 0.4"
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Sep 04 2013 Jens Petersen <petersen@redhat.com> - 7.1.0-1
|
||||
- update to 7.1.0
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.0.0-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
|
@ -1,159 +0,0 @@
|
||||
diff a/happstack-server.cabal b/happstack-server.cabal
|
||||
--- a/happstack-server.cabal
|
||||
+++ b/happstack-server.cabal
|
||||
@@ -90,7 +90,6 @@
|
||||
monad-control >= 0.3 && < 0.4,
|
||||
mtl >= 2 && < 2.1,
|
||||
old-locale,
|
||||
- old-time,
|
||||
parsec < 4,
|
||||
process,
|
||||
sendfile >= 0.7.1 && < 0.8,
|
||||
--- a/src/Happstack/Server/FileServe/BuildingBlocks.hs
|
||||
+++ b/src/Happstack/Server/FileServe/BuildingBlocks.hs
|
||||
@@ -54,6 +54,7 @@ module Happstack.Server.FileServe.BuildingBlocks
|
||||
isDot
|
||||
) where
|
||||
|
||||
+import Control.Applicative ((<$>))
|
||||
import Control.Exception.Extensible (IOException, bracket, catch)
|
||||
import Control.Monad (MonadPlus(mzero), msum)
|
||||
import Control.Monad.Trans (MonadIO(liftIO))
|
||||
@@ -62,6 +62,7 @@
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Data.Map (Map)
|
||||
import qualified Data.Map as Map
|
||||
+import Data.Time (UTCTime, formatTime)
|
||||
import Happstack.Server.Monads (ServerMonad(askRq), FilterMonad, WebMonad)
|
||||
import Happstack.Server.Response (ToMessage(toResponse), ifModifiedSince, forbidden, ok, seeOther)
|
||||
import Happstack.Server.Types (Length(ContentLength), Request(rqPaths, rqUri), Response(SendFile), RsFlags(rsfLength), nullRsFlags, result, resultBS, setHeader)
|
||||
@@ -71,7 +72,6 @@
|
||||
import System.IO (IOMode(ReadMode), hFileSize, hClose, openBinaryFile, withBinaryFile)
|
||||
import System.Locale (defaultTimeLocale)
|
||||
import System.Log.Logger (Priority(DEBUG), logM)
|
||||
-import System.Time (CalendarTime, formatCalendarTime, toCalendarTime, toUTCTime)
|
||||
import Text.Blaze ((!))
|
||||
import qualified Text.Blaze.Html5 as H
|
||||
import qualified Text.Blaze.Html5.Attributes as A
|
||||
@@ -157,7 +158,7 @@ isDot = isD . reverse
|
||||
-- | Use sendFile to send the contents of a Handle
|
||||
sendFileResponse :: String -- ^ content-type string
|
||||
-> FilePath -- ^ file path for content to send
|
||||
- -> Maybe (CalendarTime, Request) -- ^ mod-time for the handle (MUST NOT be later than server's time of message origination), incoming request (used to check for if-modified-since header)
|
||||
+ -> Maybe (UTCTime, Request) -- ^ mod-time for the handle (MUST NOT be later than server's time of message origination), incoming request (used to check for if-modified-since header)
|
||||
-> Integer -- ^ offset into Handle
|
||||
-> Integer -- ^ number of bytes to send
|
||||
-> Response
|
||||
@@ -173,7 +174,7 @@ sendFileResponse ct filePath mModTime offset count =
|
||||
--
|
||||
lazyByteStringResponse :: String -- ^ content-type string (e.g. @\"text/plain; charset=utf-8\"@)
|
||||
-> L.ByteString -- ^ lazy bytestring content to send
|
||||
- -> Maybe (CalendarTime, Request) -- ^ mod-time for the bytestring, incoming request (used to check for if-modified-since header)
|
||||
+ -> Maybe (UTCTime, Request) -- ^ mod-time for the bytestring, incoming request (used to check for if-modified-since header)
|
||||
-> Integer -- ^ offset into the bytestring
|
||||
-> Integer -- ^ number of bytes to send (offset + count must be less than or equal to the length of the bytestring)
|
||||
-> Response
|
||||
@@ -188,7 +189,7 @@ lazyByteStringResponse ct body mModTime offset count =
|
||||
-- | Send the contents of a Lazy ByteString
|
||||
strictByteStringResponse :: String -- ^ content-type string (e.g. @\"text/plain; charset=utf-8\"@)
|
||||
-> S.ByteString -- ^ lazy bytestring content to send
|
||||
- -> Maybe (CalendarTime, Request) -- ^ mod-time for the bytestring, incoming request (used to check for if-modified-since header)
|
||||
+ -> Maybe (UTCTime, Request) -- ^ mod-time for the bytestring, incoming request (used to check for if-modified-since header)
|
||||
-> Integer -- ^ offset into the bytestring
|
||||
-> Integer -- ^ number of bytes to send (offset + count must be less than or equal to the length of the bytestring)
|
||||
-> Response
|
||||
@@ -213,7 +214,7 @@ filePathSendFile contentType fp =
|
||||
do count <- liftIO $ withBinaryFile fp ReadMode hFileSize -- garbage collection should close this
|
||||
modtime <- liftIO $ getModificationTime fp
|
||||
rq <- askRq
|
||||
- return $ sendFileResponse contentType fp (Just (toUTCTime modtime, rq)) 0 count
|
||||
+ return $ sendFileResponse contentType fp (Just (modtime, rq)) 0 count
|
||||
|
||||
-- | Send the specified file with the specified mime-type using lazy ByteStrings
|
||||
--
|
||||
@@ -230,7 +231,7 @@ filePathLazy contentType fp =
|
||||
modtime <- liftIO $ getModificationTime fp
|
||||
count <- liftIO $ hFileSize handle
|
||||
rq <- askRq
|
||||
- return $ lazyByteStringResponse contentType contents (Just (toUTCTime modtime, rq)) 0 count
|
||||
+ return $ lazyByteStringResponse contentType contents (Just (modtime, rq)) 0 count
|
||||
|
||||
-- | Send the specified file with the specified mime-type using strict ByteStrings
|
||||
--
|
||||
@@ -246,7 +247,7 @@ filePathStrict contentType fp =
|
||||
modtime <- liftIO $ getModificationTime fp
|
||||
count <- liftIO $ withBinaryFile fp ReadMode hFileSize
|
||||
rq <- askRq
|
||||
- return $ strictByteStringResponse contentType contents (Just (toUTCTime modtime, rq)) 0 count
|
||||
+ return $ strictByteStringResponse contentType contents (Just (modtime, rq)) 0 count
|
||||
|
||||
-- * High-level functions for serving files
|
||||
|
||||
@@ -566,7 +567,7 @@ renderDirectoryContents localPath fps =
|
||||
-- a new page template to wrap around this HTML.
|
||||
--
|
||||
-- see also: 'getMetaData', 'renderDirectoryContents'
|
||||
-renderDirectoryContentsTable :: [(FilePath, Maybe CalendarTime, Maybe Integer, EntryKind)] -- ^ list of files+meta data, see 'getMetaData'
|
||||
+renderDirectoryContentsTable :: [(FilePath, Maybe UTCTime, Maybe Integer, EntryKind)] -- ^ list of files+meta data, see 'getMetaData'
|
||||
-> H.Html
|
||||
renderDirectoryContentsTable fps =
|
||||
H.table $ do H.thead $ do H.th $ H.toHtml ""
|
||||
@@ -538,13 +538,13 @@
|
||||
H.th $ H.toHtml "Size"
|
||||
H.tbody $ mapM_ mkRow (zip fps $ cycle [False, True])
|
||||
where
|
||||
- mkRow :: ((FilePath, Maybe CalendarTime, Maybe Integer, EntryKind), Bool) -> H.Html
|
||||
+ mkRow :: ((FilePath, Maybe UTCTime, Maybe Integer, EntryKind), Bool) -> H.Html
|
||||
mkRow ((fp, modTime, count, kind), alt) =
|
||||
(if alt then (! A.class_ (H.toValue "alt")) else id) $
|
||||
H.tr $ do
|
||||
H.td (mkKind kind)
|
||||
H.td (H.a ! A.href (H.toValue fp) $ H.toHtml fp)
|
||||
- H.td ! A.class_ (H.toValue "date") $ (H.toHtml $ maybe "-" (formatCalendarTime defaultTimeLocale "%d-%b-%Y %X %Z") modTime)
|
||||
+ H.td ! A.class_ (H.toValue "date") $ (H.toHtml $ maybe "-" (formatTime defaultTimeLocale "%d-%b-%Y %X %Z") modTime)
|
||||
(maybe id (\c -> (! A.title (H.toValue (show c)))) count) (H.td ! A.class_ (H.toValue "size") $ (H.toHtml $ maybe "-" prettyShow count))
|
||||
mkKind :: EntryKind -> H.Html
|
||||
mkKind File = return ()
|
||||
@@ -568,10 +568,10 @@
|
||||
-- | look up the meta data associated with a file
|
||||
getMetaData :: FilePath -- ^ path to directory on disk containing the entry
|
||||
-> FilePath -- ^ entry in that directory
|
||||
- -> IO (FilePath, Maybe CalendarTime, Maybe Integer, EntryKind)
|
||||
+ -> IO (FilePath, Maybe UTCTime, Maybe Integer, EntryKind)
|
||||
getMetaData localPath fp =
|
||||
do let localFp = localPath </> fp
|
||||
- modTime <- (fmap Just . toCalendarTime =<< getModificationTime localFp) `catch`
|
||||
+ modTime <- (Just <$> getModificationTime localFp) `catch`
|
||||
(\(_ :: IOException) -> return Nothing)
|
||||
count <- do de <- doesDirectoryExist localFp
|
||||
if de
|
||||
--- a/src/Happstack/Server/Response.hs
|
||||
+++ b/src/Happstack/Server/Response.hs
|
||||
@@ -34,11 +34,11 @@
|
||||
import qualified Data.Text.Encoding as T
|
||||
import qualified Data.Text.Lazy as LT
|
||||
import qualified Data.Text.Lazy.Encoding as LT
|
||||
+import Data.Time (UTCTime, formatTime)
|
||||
import Happstack.Server.Internal.Monads (FilterMonad(composeFilter))
|
||||
import Happstack.Server.Types (Response(..), Request(..), nullRsFlags, getHeader, noContentLength, redirect, result, setHeader, setHeaderBS)
|
||||
import Happstack.Server.SURI (ToSURI)
|
||||
import System.Locale (defaultTimeLocale)
|
||||
-import System.Time (CalendarTime, formatCalendarTime)
|
||||
import qualified Text.Blaze.Html as Blaze
|
||||
import qualified Text.Blaze.Renderer.Utf8 as Blaze
|
||||
import Text.Html (Html, renderHtml)
|
||||
@@ -174,12 +174,12 @@ flatten = fmap toResponse
|
||||
-- If the 'Request' includes the @if-modified-since@ header and the
|
||||
-- 'Response' has not been modified, then return 304 (Not Modified),
|
||||
-- otherwise return the 'Response'.
|
||||
-ifModifiedSince :: CalendarTime -- ^ mod-time for the 'Response' (MUST NOT be later than server's time of message origination)
|
||||
+ifModifiedSince :: UTCTime -- ^ mod-time for the 'Response' (MUST NOT be later than server's time of message origination)
|
||||
-> Request -- ^ incoming request (used to check for if-modified-since)
|
||||
-> Response -- ^ Response to send if there are modifications
|
||||
-> Response
|
||||
ifModifiedSince modTime request response =
|
||||
- let repr = formatCalendarTime defaultTimeLocale "%a, %d %b %Y %X GMT" modTime
|
||||
+ let repr = formatTime defaultTimeLocale "%a, %d %b %Y %X GMT" modTime
|
||||
notmodified = getHeader "if-modified-since" request == Just (B.pack $ repr)
|
||||
in if notmodified
|
||||
then noContentLength $ result 304 "" -- Not Modified
|
@ -1,24 +0,0 @@
|
||||
diff -up happstack-server-7.0.0/happstack-server.cabal.2-blaze~ happstack-server-7.0.0/happstack-server.cabal
|
||||
--- happstack-server-7.0.0/happstack-server.cabal.2-blaze~ 2012-11-10 13:04:14.796470433 +0900
|
||||
+++ happstack-server-7.0.0/happstack-server.cabal 2012-11-10 13:10:44.152465822 +0900
|
||||
@@ -78,7 +78,7 @@ Library
|
||||
Paths_happstack_server
|
||||
|
||||
Build-Depends: base,
|
||||
- blaze-html >= 0.3 && < 0.5,
|
||||
+ blaze-html >= 0.3 && < 0.6, blaze-markup,
|
||||
base64-bytestring == 0.1.*,
|
||||
bytestring,
|
||||
containers,
|
||||
diff -up happstack-server-7.0.0/src/Happstack/Server/Response.hs.2-blaze~ happstack-server-7.0.0/src/Happstack/Server/Response.hs
|
||||
--- happstack-server-7.0.0/src/Happstack/Server/Response.hs.2-blaze~ 2012-03-30 01:00:41.000000000 +0900
|
||||
+++ happstack-server-7.0.0/src/Happstack/Server/Response.hs 2012-11-10 13:04:14.798470428 +0900
|
||||
@@ -39,7 +39,7 @@ import Happstack.Server.Types
|
||||
import Happstack.Server.SURI (ToSURI)
|
||||
import System.Locale (defaultTimeLocale)
|
||||
import System.Time (CalendarTime, formatCalendarTime)
|
||||
-import qualified Text.Blaze as Blaze
|
||||
+import qualified Text.Blaze.Html as Blaze
|
||||
import qualified Text.Blaze.Renderer.Utf8 as Blaze
|
||||
import Text.Html (Html, renderHtml)
|
||||
import qualified Text.XHtml as XHtml (Html, renderHtml)
|
@ -1,11 +0,0 @@
|
||||
diff -u happstack-server-7.0.0/happstack-server.cabal\~ happstack-server-7.0.0/happstack-server.cabal
|
||||
--- happstack-server-7.0.0/happstack-server.cabal~ 2012-03-30 01:00:41.000000000 +0900
|
||||
+++ happstack-server-7.0.0/happstack-server.cabal 2012-05-07 11:52:44.798215227 +0900
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
Flag base4
|
||||
Description: Choose the even newer, even smaller, split-up base package.
|
||||
+ Default: True
|
||||
|
||||
Flag network_2_2_3
|
||||
Description: Choose newer network library with merged in network-bytestring.
|
Loading…
Reference in New Issue
Block a user