SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

21
devel/py-certifi/Makefile Normal file
View file

@ -0,0 +1,21 @@
COMMENT= TLS CA support for Python
MODPY_EGG_VERSION= 2023.5.7
DISTNAME= certifi-${MODPY_EGG_VERSION}
PKGNAME= py-${DISTNAME}
CATEGORIES= devel security
HOMEPAGE= https://certifi.io/
# ISC
PERMIT_PACKAGE= Yes
MODPY_PI= Yes
MODULES= lang/python
MODPY_PYBUILD= setuptools
FLAVORS= python3
FLAVOR= python3
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (certifi-2023.5.7.tar.gz) = Dw1W3Fpq1W/UujZITWzDRFHhxlSMYdqtjDIBafke3cc=
SIZE (certifi-2023.5.7.tar.gz) = 158051

View file

@ -0,0 +1,81 @@
Index: certifi/core.py
--- certifi/core.py.orig
+++ certifi/core.py
@@ -7,74 +7,13 @@ This module returns the installation location of cacer
import sys
-if sys.version_info >= (3, 11):
+if sys.version_info >= (3, 7):
- from importlib.resources import as_file, files
-
- _CACERT_CTX = None
- _CACERT_PATH = None
-
def where() -> str:
- # This is slightly terrible, but we want to delay extracting the file
- # in cases where we're inside of a zipimport situation until someone
- # actually calls where(), but we don't want to re-extract the file
- # on every call of where(), so we'll do it once then store it in a
- # global variable.
- global _CACERT_CTX
- global _CACERT_PATH
- if _CACERT_PATH is None:
- # This is slightly janky, the importlib.resources API wants you to
- # manage the cleanup of this file, so it doesn't actually return a
- # path, it returns a context manager that will give you the path
- # when you enter it and will do any cleanup when you leave it. In
- # the common case of not needing a temporary file, it will just
- # return the file system location and the __exit__() is a no-op.
- #
- # We also have to hold onto the actual context manager, because
- # it will do the cleanup whenever it gets garbage collected, so
- # we will also store that at the global level as well.
- _CACERT_CTX = as_file(files("certifi").joinpath("cacert.pem"))
- _CACERT_PATH = str(_CACERT_CTX.__enter__())
+ return "/etc/ssl/cert.pem"
- return _CACERT_PATH
-
def contents() -> str:
- return files("certifi").joinpath("cacert.pem").read_text(encoding="ascii")
-
-elif sys.version_info >= (3, 7):
-
- from importlib.resources import path as get_path, read_text
-
- _CACERT_CTX = None
- _CACERT_PATH = None
-
- def where() -> str:
- # This is slightly terrible, but we want to delay extracting the
- # file in cases where we're inside of a zipimport situation until
- # someone actually calls where(), but we don't want to re-extract
- # the file on every call of where(), so we'll do it once then store
- # it in a global variable.
- global _CACERT_CTX
- global _CACERT_PATH
- if _CACERT_PATH is None:
- # This is slightly janky, the importlib.resources API wants you
- # to manage the cleanup of this file, so it doesn't actually
- # return a path, it returns a context manager that will give
- # you the path when you enter it and will do any cleanup when
- # you leave it. In the common case of not needing a temporary
- # file, it will just return the file system location and the
- # __exit__() is a no-op.
- #
- # We also have to hold onto the actual context manager, because
- # it will do the cleanup whenever it gets garbage collected, so
- # we will also store that at the global level as well.
- _CACERT_CTX = get_path("certifi", "cacert.pem")
- _CACERT_PATH = str(_CACERT_CTX.__enter__())
-
- return _CACERT_PATH
-
- def contents() -> str:
- return read_text("certifi", "cacert.pem", encoding="ascii")
+ return open('/etc/ssl/cert.pem').read()
else:
import os

View file

@ -0,0 +1,3 @@
The "Certifi" Python module normally contains its own CA Bundle derived from
Mozilla's CA root store. For the OpenBSD package, it has been modified to point
to OpenBSD's standard root store in /etc/ssl/cert.pem instead.

View file

@ -0,0 +1,20 @@
@pkgpath devel/py-certifi
lib/python${MODPY_VERSION}/site-packages/certifi/
lib/python${MODPY_VERSION}/site-packages/certifi-${MODPY_EGG_VERSION}.dist-info/
lib/python${MODPY_VERSION}/site-packages/certifi-${MODPY_EGG_VERSION}.dist-info/LICENSE
lib/python${MODPY_VERSION}/site-packages/certifi-${MODPY_EGG_VERSION}.dist-info/METADATA
lib/python${MODPY_VERSION}/site-packages/certifi-${MODPY_EGG_VERSION}.dist-info/RECORD
lib/python${MODPY_VERSION}/site-packages/certifi-${MODPY_EGG_VERSION}.dist-info/WHEEL
lib/python${MODPY_VERSION}/site-packages/certifi-${MODPY_EGG_VERSION}.dist-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/certifi/__init__.py
lib/python${MODPY_VERSION}/site-packages/certifi/__main__.py
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/certifi/${MODPY_PYCACHE}/
lib/python${MODPY_VERSION}/site-packages/certifi/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
lib/python${MODPY_VERSION}/site-packages/certifi/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/certifi/${MODPY_PYCACHE}__main__.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
lib/python${MODPY_VERSION}/site-packages/certifi/${MODPY_PYCACHE}__main__.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/certifi/${MODPY_PYCACHE}core.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
lib/python${MODPY_VERSION}/site-packages/certifi/${MODPY_PYCACHE}core.${MODPY_PYC_MAGIC_TAG}pyc
@comment lib/python${MODPY_VERSION}/site-packages/certifi/cacert.pem
lib/python${MODPY_VERSION}/site-packages/certifi/core.py
lib/python${MODPY_VERSION}/site-packages/certifi/py.typed