summaryrefslogtreecommitdiffstats
path: root/net-p2p/py-kenosis/Makefile
blob: 52e017b6364a853d431f158cb2748b9867e7a4fe (plain)
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
# New ports collection makefile for:	kenosis
# Date created:		Thu Jan 13 01:15:19 UTC 2005
# Whom:                 Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	kenosis
PORTVERSION=	0.96
CATEGORIES=	net-p2p python
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	A fully-distributed p2p RPC system built on top of XMLRPC

RUN_DEPENDS=	${LOCALBASE}/lib/${PYTHON_VERSION}/site-packages/xmlrpclib.py:${PORTSDIR}/net/py-xmlrpclib

USE_PYTHON=	yes
USE_PYDISTUTILS=	yes
PYSETUP=	${PORTNAME}_setup.py

post-extract:
# Avoid name collision and move ds inside kenosis package
# it is only used by kenosis anyway
	@${MV} ${WRKSRC}/ds ${WRKSRC}/${PORTNAME}
# Contributed by Eric Ries <eric.ries@aya.yale.edu> - kenosis developer
# Queue.py changed API from python 2.3 to 2.4
# use Queue.py from python 2.3 while kenosis developers fix this
	@${CP} ${FILESDIR}/python2.3-Queue.py \
		${WRKSRC}/${PORTNAME}/Queue.py

post-patch:
# ds was moved inside kenosis package
# use local copy of Queue
# point at correct python
	@${FIND} ${WRKSRC} -type f -print0 \
		| ${XARGS} -0 -n 5 -x \
		${REINPLACE_CMD} -E \
		-e 's|from[[:space:]]+ds|from ${PORTNAME}.ds|' \
		-e 's|import[[:space:]]+Queue|from ${PORTNAME} import Queue|' \
		-e 's|/usr/bin/python|${PYTHON_CMD}|' \
		-e 's|/usr/bin/env[[:space:]]+python|${PYTHON_CMD}|'
# remove all .bak files
	@${FIND} ${WRKSRC} -name "*.bak" -type f -print0 \
		| ${XARGS} -0 -n 5 -x \
		${RM} -f
# Contributed by Eric Ries <eric.ries@aya.yale.edu> - kenosis developer
# set default time out to 20
	@${REINPLACE_CMD} -E \
		-e 's|(socket.setdefaulttimeout)\([[:digit:]]+\)|\1(20)|' \
		${WRKSRC}/${PORTNAME}/node.py

post-install:
# fix post-install permissions
	@${FIND} ${PYTHON_SITELIBDIR} -type f -print0 \
		| ${XARGS} -0 -n 5 -x \
		${CHMOD} ${SHAREMODE}

.include <bsd.port.mk>
OpenPOWER on IntegriCloud