1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

Readd py-zfec 1.5.3

- Fix LICENSE
- Fix RUN_DEPENDS
- Relax USES=python by removing pyutil dependency
- Bump PORTREVISION for dependency change
- Take maintainership

Obtained from:	0441f248ff
		7d159d3b6e
		819ca0443f
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2020-01-29 19:13:34 +00:00
parent 4fdcce3603
commit 1275aa49f8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=524568
7 changed files with 130 additions and 1 deletions

1
MOVED
View File

@ -13778,7 +13778,6 @@ chinese/bg5pdf||2020-01-27|Has expired: Unmaintained, uses EOLed python27
comms/py-libimobiledevice||2020-01-27|Has expired: Unmaintained, uses EOLed python27
converters/py-bcode||2020-01-27|Has expired: Unmaintained, uses EOLed python27
converters/py-iconv||2020-01-27|Has expired: Unmaintained, uses EOLed python27
converters/py-zfec||2020-01-27|Has expired: Unmaintained, uses EOLed python27
databases/gadfly||2020-01-27|Has expired: Unmaintained, uses EOLed python27
databases/metakit||2020-01-27|Has expired: Unmaintained, uses EOLed python27
databases/openark-kit||2020-01-27|Has expired: Unmaintained, uses EOLed python27

View File

@ -156,6 +156,7 @@
SUBDIR += py-text-unidecode
SUBDIR += py-unidecode
SUBDIR += py-webencodings
SUBDIR += py-zfec
SUBDIR += rcctools
SUBDIR += recode
SUBDIR += rubygem-base32

View File

@ -0,0 +1,33 @@
# Created by: Kevin Lo <kevlo@FreeBSD.org>
# $FreeBSD$
PORTNAME= zfec
DISTVERSION= 1.5.3
PORTREVISION= 1
CATEGORIES= converters python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Efficient, portable erasure coding tool
LICENSE= GPLv2+ TGGPL
LICENSE_COMB= dual
LICENSE_NAME_TGGPL= Transitive Grace Period Public Licence 1.0
LICENSE_FILE_GPLv2+ = ${WRKSRC}/COPYING.GPL
LICENSE_FILE_TGGPL= ${WRKSRC}/COPYING.TGPPL.rst
LICENSE_PERMS_TGGPL= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
USES= python
USE_PYTHON= autoplist concurrent distutils
post-install:
${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/zfec/_fec.so
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 3000
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}argparse>=0.8:devel/py-argparse@${PY_FLAVOR}
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1534918559
SHA256 (zfec-1.5.3.tar.gz) = b41bd4b0af9c6b3a78bd6734e1e4511475944164375e6241b53df518a366922b
SIZE (zfec-1.5.3.tar.gz) = 79402

View File

@ -0,0 +1,21 @@
Obtained from: https://github.com/tahoe-lafs/zfec/commit/7d159d3b6ebb28417b333b89b11c0d88cc069568
https://github.com/tahoe-lafs/zfec/commit/819ca0443fc71e33e61226aef9b0b3fd1a93dd41
--- setup.py.orig 2018-04-08 04:36:59 UTC
+++ setup.py
@@ -60,11 +60,14 @@ setup(
long_description=open('README.rst', 'rU').read(),
url="https://github.com/tahoe-lafs/zfec",
install_requires=[
- "pyutil >= 3.0.0",
"argparse >= 0.8 ; python_version <= '2.7'",
# note to self: single-quotes on the '2.7' are ok:
# https://github.com/pypa/packaging/blob/16.8/packaging/markers.py#L121
],
+ extras_require={
+ "bench": ["pyutil >= 3.0.0"],
+ "test": ["twisted", "setuptools_trial", "pyutil >= 3.0.0"],
+ },
ext_modules=extensions,
cmdclass=versioneer.get_cmdclass(),
)

View File

@ -0,0 +1,54 @@
Obtained from: https://github.com/tahoe-lafs/zfec/commit/0441f248ffec150c9c27191b0b7a69a7364a5e7c
--- zfec/filefec.py.orig 2018-02-06 21:53:51 UTC
+++ zfec/filefec.py
@@ -1,14 +1,35 @@
from __future__ import print_function
import array, os, struct
from base64 import b32encode
-from pyutil import fileutil
-from pyutil.mathutil import pad_size, log_ceil
import zfec
from zfec import easyfec
CHUNKSIZE = 4096
+def pad_size(n, k):
+ """
+ The smallest number that has to be added to n to equal a multiple of k.
+ """
+ if n%k:
+ return k - n%k
+ else:
+ return 0
+
+def log_ceil(n, b):
+ """
+ The smallest integer k such that b^k >= n.
+
+ log_ceil(n, 2) is the number of bits needed to store any of n values, e.g.
+ the number of bits needed to store any of 128 possible values is 7.
+ """
+ p = 1
+ k = 0
+ while p < n:
+ p *= b
+ k += 1
+ return k
+
def ab(x): # debuggery
if len(x) >= 3:
return "%s:%s" % (len(x), b32encode(x[-3:]),)
@@ -224,7 +245,10 @@ def encode_to_files(inf, fsize, dirname, prefix, k, m,
for fn in fns:
if verbose:
print("Cleaning up: trying to remove %r..." % (fn,))
- fileutil.remove_if_possible(fn)
+ try:
+ os.remove(fn)
+ except EnvironmentError:
+ pass
return 1
if verbose:
print()

View File

@ -0,0 +1,18 @@
The zfec package implements an "erasure code", or "forward error correction
code".
The most widely known example of an erasure code is the RAID-5 algorithm which
makes it so that in the event of the loss of any one hard drive, the stored data
can be completely recovered. The algorithm in the zfec package has a similar
effect, but instead of recovering from the loss of only a single element, it can
be parameterized to choose in advance the number of elements whose loss it can
tolerate.
This package is largely based on the old "fec" library by Luigi Rizzo et al.,
which is a mature and optimized implementation of erasure coding. The zfec
package makes several changes from the original "fec" package, including
addition of the Python API, refactoring of the C API to support zero-copy
operation, a few clean-ups and optimizations of the core code itself, and the
addition of a command-line tool named "zfec".
WWW: https://github.com/tahoe-lafs/zfec