blob: 8649e20532aec3c2f08f6245c5e5c36f9b6abef2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# Created by: Martin Matuska <mm@FreeBSD.org>
# $FreeBSD$
PORTNAME= zfs
PORTVERSION= 1.1
CATEGORIES= sysutils python
MASTER_SITES= # none
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DISTFILES= # none
MAINTAINER= ports@FreeBSD.org
COMMENT= Python ZFS library
LICENSE= CDDL
LICENSE_FILE= ${WRKSRC}/OPENSOLARIS.LICENSE
USES= python:2
MAKEFILE= ${FILESDIR}/Makefile.lib
MAKE_ARGS+= PYTHON_INCLUDEDIR="${PYTHON_INCLUDEDIR}" \
PYTHON_LDFLAGS="-L${LOCALBASE}/lib -l${PYTHON_VERSION}"
NO_WRKSUBDIR= yes
SUB_LIST+= PYTHON_CMD=${PYTHON_CMD}
PYFILES= __init__.py \
allow.py \
dataset.py \
groupspace.py\
unallow.py \
userspace.py \
util.py
.include <bsd.port.pre.mk>
.if !exists(${SRC_BASE}/cddl/contrib/opensolaris/lib/pyzfs) || \
!exists(${SRC_BASE}/cddl/contrib/opensolaris/cmd/pyzfs)
IGNORE= requires ZFS v15 or higher sources with pyzfs (in ${SRC_BASE})
.endif
.if !exists(${SRC_BASE}/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h)
MAKEFILE= ${FILESDIR}/Makefile.lib.v28
.endif
.if exists(${SRC_BASE}/cddl/contrib/opensolaris/lib/pyzfs/common/holds.py) && \
exists(${SRC_BASE}/cddl/contrib/opensolaris/lib/pyzfs/common/table.py)
PYFILES+= holds.py \
table.py
PLIST_SUB+= V28=""
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-util.py \
${FILESDIR}/extra-patch-userspace.py
.else
PLIST_SUB+= V28="@comment "
.endif
do-extract:
@${MKDIR} ${WRKSRC}
@${CP} ${SRC_BASE}/cddl/contrib/opensolaris/OPENSOLARIS.LICENSE \
${WRKSRC}/OPENSOLARIS.LICENSE
@${CP} ${SRC_BASE}/cddl/contrib/opensolaris/cmd/pyzfs/pyzfs.py \
${WRKSRC}/pyzfs.py
.for PYFILE in ${PYFILES}
@${CP} ${SRC_BASE}/cddl/contrib/opensolaris/lib/pyzfs/common/${PYFILE} \
${WRKSRC}/${PYFILE}
.endfor
post-patch:
.for PYFILE in pyzfs.py ${PYFILES}
@${REINPLACE_CMD} -e "s|#! /usr/bin/python.*|#! ${PYTHON_CMD}|g" \
${WRKSRC}/${PYFILE}
.endfor
do-install:
${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zfs
.for PYFILE in ${PYFILES}
${INSTALL_DATA} ${WRKSRC}/${PYFILE} \
${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zfs
.endfor
${INSTALL_LIB} ${WRKSRC}/ioctl.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zfs
(cd ${STAGEDIR}${PREFIX} && \
${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py -d ${PYTHONPREFIX_SITELIBDIR} -f ${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;} && \
${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py -d ${PYTHONPREFIX_SITELIBDIR} -f ${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;})
${MKDIR} ${STAGEDIR}/usr/lib/zfs
${INSTALL_SCRIPT} ${WRKSRC}/pyzfs.py ${STAGEDIR}/usr/lib/zfs
(cd ${STAGEDIR}/usr/lib/zfs && \
${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py -d /usr/lib/zfs -f ${STAGEDIR}/usr/lib/zfs && \
${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py -d /usr/lib/zfs -f ${STAGEDIR}/usr/lib/zfs)
.include <bsd.port.post.mk>
|