summaryrefslogtreecommitdiff
path: root/dev-haskell/certificate
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-haskell/certificate
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-haskell/certificate')
-rw-r--r--dev-haskell/certificate/Manifest7
-rw-r--r--dev-haskell/certificate/certificate-1.3.9.ebuild43
-rw-r--r--dev-haskell/certificate/files/certificate-1.3.6/Tests/Unit.hs46
-rw-r--r--dev-haskell/certificate/files/certificate-1.3.9-ghc-7.10.patch16
-rw-r--r--dev-haskell/certificate/metadata.xml20
5 files changed, 132 insertions, 0 deletions
diff --git a/dev-haskell/certificate/Manifest b/dev-haskell/certificate/Manifest
new file mode 100644
index 000000000000..3eb494e4b9ed
--- /dev/null
+++ b/dev-haskell/certificate/Manifest
@@ -0,0 +1,7 @@
+AUX certificate-1.3.6/Tests/Unit.hs 1401 SHA256 8b3bd7eb99c736d437cc57d10bfbd51f4bf1f4766af2f5ff6f81db10aad95baa SHA512 a254749781292c2c4a86e9feef03168db5809472581e6f87a0d7e3af97031598f598c696242ecac4dc15b5e526936b3a3bab8a83a544fd97a182bcb4ec6b72be WHIRLPOOL 1cf2bc6fe8e1608b1ea6f24fc7c8f6d40d153c8754b000b1cd68f4553ebe9079652586566a51c113c84f2422cda4249756693cb6af582aad331600474e5e1320
+AUX certificate-1.3.9-ghc-7.10.patch 548 SHA256 780ed9d67de550b7752013eaed231123fb5200391eb527dcc933726a9d5ac6ed SHA512 2ee1038e6e5b41fc08268e5c0b8d5e0cf810bd6bd4c51b01b8d1077dde5bf21f45ab6074140f8e8175cc70ae118849ddcc5865c42c9d91ca755cc768a99132a7 WHIRLPOOL b90154ecc36d93a2be8320f1ee4f5ac4203e675ecc06e7f0bef4d4e28d70c1d1326d60fcbf9326fc0f7ad271c523bf2e8feabdc6c70800aed49110e5b4d874c7
+DIST certificate-1.3.9.tar.gz 15018 SHA256 e6257b4b0e884db8a817d265d9a7f9a6c76af8190504f32dadbbf64b0fcee5a1 SHA512 85ad7d1f3def68152824d0be4ccc3fb991903867fac68927eac34db366ce6f8201468a3e73c336fef6feae1ce550f614fc3ab89447b4ec7a67ac279902a815f9 WHIRLPOOL 3094c5fa08e397f3981128c52742f4e0ff90b4169227a5e897cef9b9afc3d4bfd1bb4a26c6b5e1ad3da7e52565ca331b69c048a5fd3c8cf87b45063eb5ac5b8a
+EBUILD certificate-1.3.9.ebuild 1246 SHA256 d63977a8acf41fcf4a54fd80de46739592e8a098be79a0c5bf79719d55364026 SHA512 eb1b1bd6b290162e431f6d89c730a5eb6c7f362d85d651c4fa6160fea7c73afa0eb4dee667dc62a5985ee20bf08cdc27397cc7af5406c4ff2da57b3a9b0603c6 WHIRLPOOL 502c918e048c5f8010abc9ffded403fcd450e1aeb3864623a4239351eb49e302e80f6d6cfe86258c9ea3422a6fc6999762b97118e42db09e90fa083f5ee72b38
+MISC ChangeLog 3136 SHA256 4628fcb04b6c6356b40c248a902cd1d05fb9ad80a3f3f6b5cccc27cc051063f1 SHA512 e21561564333453402b5aff1ae2cb16a3669a9d45eeb8afe66dfa0023bfc16dcfef459b88210604771b3b661b060ced95b1497228dc5accbda8cd484f513676c WHIRLPOOL f3921447bd3e6364848c9711b0044c27cd3466bdf84d1ac5c6568be9d1600708f7263119de657fb83e6a228301916a5a70ec2abc118b54aaf8c34e9de90854ad
+MISC ChangeLog-2015 1676 SHA256 24f77914e3567f6b26d6f56df72c39037fa84df4cb91d251d7d0c5d428447824 SHA512 3b64578ff4bc43ed2b1ef77dd986c88960efeec4c1bd68624870b614677b1f9c39ec75b6eee84892f618d892bfd4e6a6a5c567a1dc172de44958a04dbe16a224 WHIRLPOOL 995970efa348709f434248e68f74fe56d3f635ef189d4782d04300f4192aa1052f626e0e3d8959e29569c11c572193d20b8c24a5e95d672092edbf15f32e4c6f
+MISC metadata.xml 625 SHA256 9f7bfa7c9fcb533ca10e11262f4f8c3d0354317453fad28f86c665bca9b11d79 SHA512 b49ed9a3c937752b192e3d2f9d129732d30104db488b75b85207cbe4257d5aaefa57570f9ca2af744a6b6ef04eb1ff5b86341fa4a6c37bacc988d7ab43c24edd WHIRLPOOL 79c512f85d74b053818038c1cdb340c16b4dde2994a401aec137f5ed89875419decdf277ae4f8937f08da9bc96a4066736184643ed2245a75fc76b74fcabe024
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>