diff --git a/ghc-snap-core.spec b/ghc-snap-core.spec index 4553510..d41a323 100644 --- a/ghc-snap-core.spec +++ b/ghc-snap-core.spec @@ -22,7 +22,8 @@ Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz Source1: https://hackage.haskell.org/package/%{readable}/%{readable}.tar.gz Source2: https://hackage.haskell.org/package/%{pkgver}/%{pkg_name}.cabal#/%{pkgver}.cabal # End cabal-rpm sources -Patch1: snap-core-0.9.2.2-portable-flag.patch +Patch0: snap-core-0.9.2.2-portable-flag.patch +Patch1: snap-core-parseTime.patch # Begin cabal-rpm deps: BuildRequires: dos2unix @@ -128,7 +129,7 @@ This package provides the Haskell %{pkg_name} profiling library. %global main_version %{version} %if %{defined ghclibdir} -%ghc_lib_subpackage %{readable} +%ghc_lib_subpackage -l BSD-3-Clause %{readable} %endif %global version %{main_version} @@ -139,9 +140,15 @@ This package provides the Haskell %{pkg_name} profiling library. %setup -q -n %{pkgver} -a1 dos2unix -k -n %{SOURCE2} %{pkg_name}.cabal # End cabal-rpm setup +%patch0 -p1 -b .orig %patch1 -p1 -b .orig cabal-tweak-drop-dep bytestring-builder +( +cd %{readable} +cabal-tweak-dep-ver bytestring '< 0.11' '< 0.12' +) + %build # Begin cabal-rpm build: diff --git a/snap-core-parseTime.patch b/snap-core-parseTime.patch new file mode 100644 index 0000000..dfa41b6 --- /dev/null +++ b/snap-core-parseTime.patch @@ -0,0 +1,12 @@ +diff -up snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs~ snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs +--- snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs~ 2001-09-09 09:46:40.000000000 +0800 ++++ snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs 2023-01-26 17:11:45.155960424 +0800 +@@ -1282,7 +1282,7 @@ formatLogTime ctime = do + parseHttpTime = return . toCTime . prs . S.unpack + where + prs :: String -> Maybe UTCTime +- prs = parseTime defaultTimeLocale "%a, %d %b %Y %H:%M:%S GMT" ++ prs = parseTimeM True defaultTimeLocale "%a, %d %b %Y %H:%M:%S GMT" + + toCTime :: Maybe UTCTime -> CTime + toCTime (Just t) = fromInteger $ truncate $ utcTimeToPOSIXSeconds t