Modernize and fix staged pre-compiled code.

This commit is contained in:
Xin LI 2014-12-16 06:08:29 +00:00
parent 99db4b7aaf
commit e575103ee9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=374786
3 changed files with 13 additions and 26 deletions

View file

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= zfs
PORTVERSION= 1
PORTREVISION= 4
PORTVERSION= 1.1
CATEGORIES= sysutils python
MASTER_SITES= # none
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -21,7 +20,6 @@ MAKE_ARGS+= PYTHON_INCLUDEDIR="${PYTHON_INCLUDEDIR}" \
PYTHON_LDFLAGS="-L${LOCALBASE}/lib -l${PYTHON_VERSION}"
NO_WRKSUBDIR= yes
SUB_FILES+= compile.py
SUB_LIST+= PYTHON_CMD=${PYTHON_CMD}
PYFILES= __init__.py \
@ -78,12 +76,14 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/${PYFILE} \
${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zfs
.endfor
${INSTALL_DATA} ${WRKSRC}/ioctl.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zfs
@${PYTHON_CMD} ${WRKDIR}/compile.py ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zfs
@${PYTHON_CMD} -O ${WRKDIR}/compile.py ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/zfs
${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
@${PYTHON_CMD} ${WRKDIR}/compile.py ${STAGEDIR}/usr/lib/zfs
@${PYTHON_CMD} -O ${WRKDIR}/compile.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>

View file

@ -1,12 +0,0 @@
#!%%PYTHON_CMD%%
import sys
import compileall
import sys
try:
sys.argv[1]
except IndexError:
print "Path missing"
else:
compileall.compile_dir(sys.argv[1], force=True)

View file

@ -26,9 +26,8 @@
%%PYTHON_SITELIBDIR%%/zfs/util.py
%%PYTHON_SITELIBDIR%%/zfs/util.pyc
%%PYTHON_SITELIBDIR%%/zfs/util.pyo
@dirrm %%PYTHON_SITELIBDIR%%/zfs
@cwd /usr/lib
zfs/pyzfs.py
zfs/pyzfs.pyc
zfs/pyzfs.pyo
@dirrm zfs
@dir %%PYTHON_SITELIBDIR%%/zfs
/usr/lib/zfs/pyzfs.py
/usr/lib/zfs/pyzfs.pyc
/usr/lib/zfs/pyzfs.pyo
@dir /usr/lib/zfs