diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-haskell/certificate | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-haskell/certificate')
-rw-r--r-- | dev-haskell/certificate/Manifest | 5 | ||||
-rw-r--r-- | dev-haskell/certificate/certificate-1.3.9.ebuild | 43 | ||||
-rw-r--r-- | dev-haskell/certificate/files/certificate-1.3.6/Tests/Unit.hs | 46 | ||||
-rw-r--r-- | dev-haskell/certificate/files/certificate-1.3.9-ghc-7.10.patch | 16 | ||||
-rw-r--r-- | dev-haskell/certificate/metadata.xml | 20 |
5 files changed, 130 insertions, 0 deletions
diff --git a/dev-haskell/certificate/Manifest b/dev-haskell/certificate/Manifest new file mode 100644 index 000000000000..49b4857da8db --- /dev/null +++ b/dev-haskell/certificate/Manifest @@ -0,0 +1,5 @@ +AUX certificate-1.3.6/Tests/Unit.hs 1401 BLAKE2B da9e592386db1953a1bf2e8026623af5b4497f8b6cb721125eb7dd7e3a3878f022c91a29f646ba486651f377be48082622f90e3a9ab5297c6ce931bdfb880a55 SHA512 a254749781292c2c4a86e9feef03168db5809472581e6f87a0d7e3af97031598f598c696242ecac4dc15b5e526936b3a3bab8a83a544fd97a182bcb4ec6b72be +AUX certificate-1.3.9-ghc-7.10.patch 548 BLAKE2B 406925966374309faabae0772572440db390c337f292a4a8c3e9c827934dfeff2e1ff7d5ab67267a0009e7e51e333ee181b11d4554b22c5bdebf3479b3fbd697 SHA512 2ee1038e6e5b41fc08268e5c0b8d5e0cf810bd6bd4c51b01b8d1077dde5bf21f45ab6074140f8e8175cc70ae118849ddcc5865c42c9d91ca755cc768a99132a7 +DIST certificate-1.3.9.tar.gz 15018 BLAKE2B a89c5cf680a752dbc69f7510eae10bfa1e340090b512f1341db0742d44c13c5171cdeb3b8f0352b53ebe5fb018cb957501b01ff9d297b1a67ddeaf8cce52f265 SHA512 85ad7d1f3def68152824d0be4ccc3fb991903867fac68927eac34db366ce6f8201468a3e73c336fef6feae1ce550f614fc3ab89447b4ec7a67ac279902a815f9 +EBUILD certificate-1.3.9.ebuild 1246 BLAKE2B a92f8a1bb4e28c0511729385e73132018b4ddca52b2374301d96a48d9fb50be55e64eb2a985472423a3a698b099708c540a96109b7019f8e3f255161165746a8 SHA512 eb1b1bd6b290162e431f6d89c730a5eb6c7f362d85d651c4fa6160fea7c73afa0eb4dee667dc62a5985ee20bf08cdc27397cc7af5406c4ff2da57b3a9b0603c6 +MISC metadata.xml 625 BLAKE2B 5347d26e31920b59a5d9f71f083e37559f1d078d81eeb2848d64ff5ab90d269772dabb09746cbe1099d756290ac3390df36adf3d6ce383525387ee560b8eeb9b SHA512 b49ed9a3c937752b192e3d2f9d129732d30104db488b75b85207cbe4257d5aaefa57570f9ca2af744a6b6ef04eb1ff5b86341fa4a6c37bacc988d7ab43c24edd diff --git a/dev-haskell/certificate/certificate-1.3.9.ebuild b/dev-haskell/certificate/certificate-1.3.9.ebuild new file mode 100644 index 000000000000..89e8f4aab7d8 --- /dev/null +++ b/dev-haskell/certificate/certificate-1.3.9.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +# ebuild generated by hackport 0.3.4.9999 + +CABAL_FEATURES="bin lib profile haddock hoogle hscolour" +inherit eutils haskell-cabal + +DESCRIPTION="Certificates and Key Reader/Writer" +HOMEPAGE="https://github.com/vincenthz/hs-certificate" +SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/${PV}" +KEYWORDS="amd64 x86" +IUSE="executable test" +RESTRICT="test" # due missing tests + +RDEPEND=">=dev-haskell/asn1-data-0.7.1:=[profile?] <dev-haskell/asn1-data-0.8.0:=[profile?] + >=dev-haskell/crypto-pubkey-types-0.4:=[profile?] <dev-haskell/crypto-pubkey-types-0.5:=[profile?] + dev-haskell/cryptohash:=[profile?] + dev-haskell/mtl:=[profile?] + >=dev-haskell/pem-0.1:=[profile?] <dev-haskell/pem-0.3:=[profile?] + >=dev-lang/ghc-6.12.1:= + executable? ( dev-haskell/cmdargs:=[profile?] + dev-haskell/crypto-pubkey:=[profile?] + >=dev-haskell/text-0.11:=[profile?] ) +" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-1.8.0.2 +" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-1.3.9-ghc-7.10.patch +} + +src_configure() { + haskell-cabal_src_configure \ + $(cabal_flag executable executable) \ + $(cabal_flag test test) +} diff --git a/dev-haskell/certificate/files/certificate-1.3.6/Tests/Unit.hs b/dev-haskell/certificate/files/certificate-1.3.6/Tests/Unit.hs new file mode 100644 index 000000000000..d97947f2b233 --- /dev/null +++ b/dev-haskell/certificate/files/certificate-1.3.6/Tests/Unit.hs @@ -0,0 +1,46 @@ +module Tests.Unit + ( runTests + ) where + +import System.Directory +import Test.HUnit +import Control.Monad +import Control.Applicative ((<$>)) +import Control.Exception +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as L +import Data.Certificate.X509 +import Data.List (isPrefixOf) + +-- FIXME : make unit tests portable to run on osX and windows +import System.Certificate.X509 +import Data.CertificateStore + +checkCert (X509 c mraw rawCert sigalg sigbits) = do + let errs = + (checkSigAlg $ certSignatureAlg c) ++ + (checkPubKey $ certPubKey c) ++ + (checkExtensions $ certExtensions c) ++ + (checkBodyRaw rawCert mraw) + when (errs /= []) $ do + putStrLn ("error decoding") + mapM_ (putStrLn . (" " ++)) errs + where + checkExtensions ext = [] + + checkSigAlg (SignatureALG_Unknown oid) = ["unknown signature algorithm " ++ show oid] + checkSigAlg _ = [] + + checkPubKey (PubKeyUnknown oid _) = ["unknown public key alg " ++ show (certPubKey c)] + checkPubKey _ = [] + + checkBodyRaw (Just x) (Just y) = if findsubstring y x then [] else ["cannot find body cert in original raw file"] + checkBodyRaw _ _ = [] + + findsubstring a b + | L.null b = False + | a `L.isPrefixOf` b = True + | otherwise = findsubstring a (L.drop 1 b) + +runTests :: IO () +runTests = getSystemCertificateStore >>= mapM_ checkCert . listCertificates diff --git a/dev-haskell/certificate/files/certificate-1.3.9-ghc-7.10.patch b/dev-haskell/certificate/files/certificate-1.3.9-ghc-7.10.patch new file mode 100644 index 000000000000..07a53256ded8 --- /dev/null +++ b/dev-haskell/certificate/files/certificate-1.3.9-ghc-7.10.patch @@ -0,0 +1,16 @@ +diff --git a/Data/Certificate/X509/Cert.hs b/Data/Certificate/X509/Cert.hs +index 4abfadf..15e7bf8 100644 +--- a/Data/Certificate/X509/Cert.hs ++++ b/Data/Certificate/X509/Cert.hs +@@ -1,2 +1,3 @@ ++{-# LANGUAGE FlexibleContexts #-} + module Data.Certificate.X509.Cert + ( +diff --git a/Data/Certificate/X509/Ext.hs b/Data/Certificate/X509/Ext.hs +index 7595f14..8963a55 100644 +--- a/Data/Certificate/X509/Ext.hs ++++ b/Data/Certificate/X509/Ext.hs +@@ -1,2 +1,3 @@ ++{-# LANGUAGE FlexibleContexts #-} + -- | + -- Module : Data.Certificate.X509.Ext diff --git a/dev-haskell/certificate/metadata.xml b/dev-haskell/certificate/metadata.xml new file mode 100644 index 000000000000..3ba11e2cb4c8 --- /dev/null +++ b/dev-haskell/certificate/metadata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>haskell@gentoo.org</email> + <name>Gentoo Haskell</name> + </maintainer> + <longdescription> + Certificates and Key reader/writer + + At the moment only X509 certificate and unencrypted private key are supported, + but will include PGP certificate and pkcs8 private keys + </longdescription> + <use> + <flag name="executable">Build the executable</flag> + </use> + <upstream> + <remote-id type="github">vincenthz/hs-certificate</remote-id> + </upstream> +</pkgmetadata> |