git: c8bfb772c274 - main - Add comms/py-libscrc: Python library for calculating various types of CRC

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Tue, 08 Feb 2022 03:20:49 UTC
The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c8bfb772c274a6044c7d5620776921364a46824e

commit c8bfb772c274a6044c7d5620776921364a46824e
Author:     Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
AuthorDate: 2022-02-08 03:19:33 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2022-02-08 03:19:33 +0000

    Add comms/py-libscrc: Python library for calculating various types of CRC
    
    PR:             261571
---
 comms/Makefile             |  1 +
 comms/py-libscrc/Makefile  | 34 ++++++++++++++++++++++++++++++++++
 comms/py-libscrc/distinfo  |  3 +++
 comms/py-libscrc/pkg-descr |  4 ++++
 4 files changed, 42 insertions(+)

diff --git a/comms/Makefile b/comms/Makefile
index 1676e470b3c8..03a3fc2d390f 100644
--- a/comms/Makefile
+++ b/comms/Makefile
@@ -136,6 +136,7 @@
     SUBDIR += py-hid
     SUBDIR += py-hidapi
     SUBDIR += py-libimobiledevice
+    SUBDIR += py-libscrc
     SUBDIR += py-pyserial
     SUBDIR += py-xmodem
     SUBDIR += pyla
diff --git a/comms/py-libscrc/Makefile b/comms/py-libscrc/Makefile
new file mode 100644
index 000000000000..bd14e21f2d35
--- /dev/null
+++ b/comms/py-libscrc/Makefile
@@ -0,0 +1,34 @@
+PORTNAME=	libscrc
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.7
+CATEGORIES=	comms python
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	zarychtam@plan-b.pwste.edu.pl
+COMMENT=	Python library for calculating various types of CRC
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		python
+USE_PYTHON=	autoplist distutils
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	hex-in
+
+TEST_ENV=	${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+do-test:
+	@cd ${TEST_WRKSRC} && for test in \
+	libscrc/test/canx.py \
+	libscrc/test/crc8.py \
+	libscrc/test/crc16.py \
+	libscrc/test/crc24.py \
+	libscrc/test/crc32.py \
+	libscrc/test/crc64.py \
+	libscrc/test/crcx.py \
+	libscrc/test/hacker.py \
+	libscrc/test/modbus.py; \
+	do ${SETENV} ${TEST_ENV} ${PYTHON_CMD} $${test}; done
+
+.include <bsd.port.mk>
diff --git a/comms/py-libscrc/distinfo b/comms/py-libscrc/distinfo
new file mode 100644
index 000000000000..8e31f0d6858a
--- /dev/null
+++ b/comms/py-libscrc/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1643544324
+SHA256 (hex-in-libscrc-v1.7_GH0.tar.gz) = cd4dc6555cb320705218e308b4c4e43b1ae299999084b5ac534c79f94fa2f9d7
+SIZE (hex-in-libscrc-v1.7_GH0.tar.gz) = 52893
diff --git a/comms/py-libscrc/pkg-descr b/comms/py-libscrc/pkg-descr
new file mode 100644
index 000000000000..b370803f8041
--- /dev/null
+++ b/comms/py-libscrc/pkg-descr
@@ -0,0 +1,4 @@
+Python library for calculating:
+CRC3/CRC4/CRC5/CRC6/CRC7/CRC8/CRC16/CRC24/CRC32/CRC64/CRC82.
+
+WWW: https://github.com/hex-in/libscrc