summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-10-26 23:05:13 +0000
committerCoprDistGit <infra@openeuler.org>2023-10-26 23:05:13 +0000
commitae840826aa557b847d9cbf893992e441dc92131c (patch)
tree27a6b4ec2aa131b80637bb1c9a24d19018e0689c
parent3dbec97d51c6627c620073733d92c9d660fc90fd (diff)
automatic import of ghc-http-mediaopeneuler23.09
-rw-r--r--.gitignore1
-rw-r--r--ghc-http-media.spec113
-rw-r--r--sources1
3 files changed, 115 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..7352cbb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/http-media-0.8.1.1.tar.gz
diff --git a/ghc-http-media.spec b/ghc-http-media.spec
new file mode 100644
index 0000000..9d7bb64
--- /dev/null
+++ b/ghc-http-media.spec
@@ -0,0 +1,113 @@
+%global pkg_name http-media
+%global pkgver %{pkg_name}-%{version}
+%bcond_with tests
+
+Name: ghc-%{pkg_name}
+Version: 0.8.1.1
+Release: 1
+Summary: Processing HTTP Content-Type and Accept headers
+License: MIT
+URL: https://hackage.haskell.org/package/%{pkg_name}
+Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-base-devel
+BuildRequires: ghc-base-prof
+BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-bytestring-prof
+BuildRequires: ghc-case-insensitive-devel
+BuildRequires: ghc-case-insensitive-prof
+BuildRequires: ghc-containers-devel
+BuildRequires: ghc-containers-prof
+BuildRequires: ghc-rpm-macros
+BuildRequires: ghc-utf8-string-devel
+BuildRequires: ghc-utf8-string-prof
+ExcludeArch: %{ix86}
+%if %{with tests}
+BuildRequires: ghc-QuickCheck-devel
+BuildRequires: ghc-QuickCheck-prof
+BuildRequires: ghc-tasty-devel
+BuildRequires: ghc-tasty-prof
+BuildRequires: ghc-tasty-quickcheck-devel
+BuildRequires: ghc-tasty-quickcheck-prof
+%endif
+
+%description
+This library is intended to be a comprehensive solution to parsing and
+selecting quality-indexed values in HTTP headers. It is capable of parsing both
+media types and language parameters from the Accept and Content header
+families, and can be extended to match against other accept headers as well.
+Selecting the appropriate header value is achieved by comparing a list of
+server options against the quality-indexed values supplied by the client.
+
+In the following example, the Accept header is parsed and then matched against
+a list of server options to serve the appropriate media using 'mapAcceptMedia':
+
+> getHeader >>= maybe send406Error sendResourceWith . mapAcceptMedia > [
+("text/html", asHtml) > , ("application/json", asJson) > ]
+
+Similarly, the Content-Type header can be used to produce a parser for request
+bodies based on the given content type with 'mapContentMedia':
+
+> getContentType >>= maybe send415Error readRequestBodyWith .
+mapContentMedia > [ ("application/json", parseJson) > , ("text/plain",
+parseText) > ]
+
+The API is agnostic to your choice of server.
+
+%package devel
+Summary: Haskell %{pkg_name} library development files
+Requires: %{name} = %{version}-%{release}
+Requires: ghc-compiler = %{ghc_version}
+Requires(post): ghc-compiler = %{ghc_version}
+Requires(postun): ghc-compiler = %{ghc_version}
+
+%description devel
+This package provides the Haskell %{pkg_name} library development files.
+
+%package -n ghc-%{pkg_name}-help
+Summary: Haskell %{pkg_name} library documentation
+BuildArch: noarch
+
+%description -n ghc-%{pkg_name}-help
+This package provides the Haskell %{pkg_name} library documentation.
+
+%package -n ghc-%{pkg_name}-prof
+Summary: Haskell %{pkg_name} profiling library
+Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
+Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
+
+%description -n ghc-%{pkg_name}-prof
+This package provides the Haskell %{pkg_name} profiling library.
+
+%prep
+%autosetup -n %{pkg_name}-%{version}
+
+%build
+%ghc_lib_build
+
+%install
+%ghc_lib_install
+
+%check
+%cabal_test
+
+%post devel
+%ghc_pkg_recache
+
+%postun devel
+%ghc_pkg_recache
+
+%files -f %{name}.files
+%license LICENSE
+
+%files devel -f %{name}-devel.files
+%doc CHANGES.md
+
+%files -n ghc-%{pkg_name}-help -f ghc-%{pkg_name}-help.files
+%license LICENSE
+
+%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+
+%changelog
+* Thu Sep 28 2023 Lin Runze <lrzlin@163.com> 0.8.1.1-1
+- Initial packaging (Version 0.8.1.1)
diff --git a/sources b/sources
new file mode 100644
index 0000000..e3b05ed
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+b1c818e7331ec6dbafbdeaa1248f9658 http-media-0.8.1.1.tar.gz