Bug 82445 - Add PYTWISTED dependence line to bsd.python.mk
Summary: Add PYTWISTED dependence line to bsd.python.mk
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hye-Shik Chang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-20 15:30 UTC by Vsevolod Stakhov
Modified: 2005-07-07 09:11 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.35 KB, patch)
2005-06-20 15:30 UTC, Vsevolod Stakhov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Stakhov 2005-06-20 15:30:21 UTC
Twisted is a framework that is used by number of python network applications.
So I think it would be useful to have comfortable way to include it. BTW,
devel/py-twisted is very old and I have an idea to upgrade it to TwistedSumo.
Also this patch contains description for USE_ZOPE option of bsd.python.mk.
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2005-06-20 17:39:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->perky

over to maintainer
Comment 2 Vsevolod Stakhov 2005-06-21 00:19:42 UTC
I have redesigned structure of twisted dependencies due to incompatible
component's lists in twisted 1.3 (that was just a single project) and
twisted 2.0 (that contains different subprojects). So, my suggestion is
to add USE_TWISTED macro that should specify version of twisted framework
needed and can specify specific components for twisted 2.0. Here is modified
patch.


--- bsd.python.mk.orig	Mon Jun 20 17:24:59 2005
+++ bsd.python.mk	Tue Jun 21 03:11:07 2005
@@ -115,6 +115,23 @@
 #
 # PYSETUP:		Name of the setup script used by the distutils package.
 #				default: setup.py
+#
+# USE_TWISTED:	Use twisted framework for port. If there is no version or 
+# 				components specified then 1.3 twisted is used. Version of 
+# 				twisted framework can be 13 or 20. If this option is 20 then
+# 				the dependence to twistedCore is added. Alternatively here
+# 				can be listed specific components of twisted framework, 
+# 				available components are: web, lore, news, words, pair,
+# 				mail, names, xish, runner, flow. Note that core component
+# 				is required for any of this optional components. 
+#
+# USE_ZOPE:		Use Zope - an object-based web application platform, this
+# 				also sets up ZOPEBASEDIR - relative base directory of zope 
+# 				server, SZOPEBASEDIR - absolute base directory of zope that
+# 				is ${LOCALBASE}/${SZOPEBASEDIR} by default, 
+# 				ZOPEPRODUCTDIR - directory, where products for zope can be 
+# 				found. Note that USE_ZOPE require python2.3
+#
 
 _PYTHON_PORTBRANCH=		2.4
 _PYTHON_ALLBRANCHES=	2.4 2.3 2.2 2.1 2.5 # preferred first
@@ -299,6 +316,7 @@
 
 PYDISTUTILS=	${PYTHON_LIBDIR}/distutils/core.py:${PYTHON_PORTSDIR}
 PYNUMERIC=		${PYTHON_SITELIBDIR}/Numeric/Numeric.py:${PORTSDIR}/math/py-numeric
+PYTWISTED=		${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted
 PYXML=			${PYTHON_SITELIBDIR}/_xmlplus/__init__.py:${PORTSDIR}/textproc/py-xml
 
 .if defined(PYTHON_REL) && ${PYTHON_REL} < 232
@@ -342,6 +360,65 @@
 PLIST_SUB+=		ZOPEBASEDIR=${SZOPEBASEDIR} \
 				ZOPEPRODUCTDIR=${SZOPEBASEDIR}/${ZOPEPRODUCTDIR}
 .endif
+
+# Twisted specific routines
+.if defined(USE_TWISTED)
+
+.if exists(${LOCALBASE}/bin/twistd)
+_TWISTED_VER!=	${LOCALBASE}/bin/twistd --version | ${SED} -e 's/.*daemon) \([0-9]\).\([0-9]\).*/\1\2/' -e '2,$$d' -e '$$d'
+.endif
+
+.if ${USE_TWISTED} == "20"
+USE_TWISTED_VER=	${USE_TWISTED}
+.	if defined(_TWISTED_VER) && ${_TWISTED_VER} == "13"
+BROKEN=	Twisted framework versions mismatch: want ${USE_TWISTED_VER} and installed ${_TWISTED_VER}
+.	else
+RUN_DEPENDS+=   ${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twistedCore
+.	endif
+
+.elif ${USE_TWISTED} == "13"
+USE_TWISTED_VER=	${USE_TWISTED}
+.	if defined(_TWISTED_VER) && ${_TWISTED_VER} == "20"
+BROKEN=	Twisted framework versions mismatch: want ${USE_TWISTED_VER} and installed ${_TWISTED_VER}
+.	else
+RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted
+.	endif
+
+.else
+USE_TWISTED_VER=	"20"
+# Components list is allowed only for version 20
+.if defined(_TWISTED_VER) && ${_TWISTED_VER} == "13"
+BROKEN=	Twisted framework versions mismatch: want ${USE_TWISTED_VER} and installed ${_TWISTED_VER}
+.else
+
+# Checking for twisted components 
+_TWISTED_COMPONENTS?=	web lore news words pair mail names xish runner flow
+
+# XXX Should be here other dependencies types?
+web_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/web/__init__.py:${PORTSDIR}/www/py-twistedWeb	
+lore_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/textproc/__init__.py:${PORTSDIR}/textproc/py-twistedLore
+news_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/news/__init__.py:${PORTSDIR}/news/py-twistedNews
+words_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/words/__init__.py:${PORTSDIR}/net/py-twistedWords
+pair_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/pair/__init__.py:${PORTSDIR}/net/py-twistedPair
+mail_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/mail/__init__.py:${PORTSDIR}/mail/py-twistedMail
+names_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/names/__init__.py:${PORTSDIR}/dns/py-twistedNames
+xish_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/xish/__init__.py:${PORTSDIR}/devel/py-twistedXish
+runner_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/runner/__init__.py:${PORTSDIR}/devel/py-twistedRunner
+flow_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/flow/__init__.py:${PORTSDIR}/devel/py-twistedFlow
+
+. for component in ${_TWISTED_COMPONENTS}
+_COMP_TEST= ${USE_TWISTED:M${component}}
+.  if ${_COMP_TEST:S/${component}//}!=${_COMP_TEST:S/  / /g}
+RUN_DEPENDS+=	${${component}_RUN_DEPENDS}
+.	endif
+.endfor
+
+# Implicit dependence from core
+RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twistedCore
+.endif
+.endif
+
+.endif # defined(USE_TWISTED)
 
 # XXX Hm, should I export some of the variables above to *_ENV?
Comment 3 Hye-Shik Chang freebsd_committer freebsd_triage 2005-07-07 09:10:53 UTC
State Changed
From-To: open->closed

Committed in CVS. 
Thank you for that neat work! :)