freebsd-ports/devel/py-ice/Makefile
Ruslan Makhmatkhanov 059541aef9 - respect CC, CXX to allow it be built with clang
- convert to optionsng
- make unit tests work correctly, fix running in a jail, make them run by default
- remove unnecessary -g flag when building a debug version
- silence post-patch commands
- compile and install .pyc and .pyo files (using python's compileall.py).
- rename the patches to comply to the naming conventions in the Porter's Handbook
- pass maintainership to submitter

while here:
- trim Makefile header
- remove indefinite article from COMMENT
- add license (GPLv2) and remove mention of it from pkg-descr
- limit python version to 2.x only

PR:		171645
Submitted by:	Michael Gmelin <freebsd at grem dot de>
Approved by:	Tony Maher <tonymaher at optusnet.com dot au> (maintainer)
Feature safe:	yes
2012-10-27 19:57:57 +00:00

90 lines
2.5 KiB
Makefile

# Created by: Boris B. Samorodov <bsam@ipt.ru>
# $FreeBSD$
PORTNAME= Ice
PORTVERSION= 3.4.2
PORTREVISION= 3
CATEGORIES= devel python
MASTER_SITES= http://download.zeroc.com/Ice/3.4/ \
http://www.dirk.sh/dirk/Ice/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= freebsd@grem.de
COMMENT= Ice (Internet Communications Engine) language mapping for Python
LICENSE= GPLv2
BUILD_DEPENDS= mcpp:${PORTSDIR}/devel/mcpp
LIB_DEPENDS= Ice.${LIB_VRS}:${PORTSDIR}/devel/ice
USE_GMAKE= yes
USE_PYTHON= -2.7
BUILD_WRKSRC= ${WRKSRC}/py
INSTALL_WRKSRC= ${WRKSRC}/py
LIB_VRS= ${PORTVERSION:S|.||g:C|2$||}
PLIST_SUB= LIB_VERSION="${PORTVERSION}" LIB_VRS="${LIB_VRS}"
MAKE_ENV= ICE_HOME="${LOCALBASE}/share/Ice"
# bypass infrastructure bug (taken from www/py-django)
OPTIONSFILE= ${PORT_DBDIR}/py-${PORTNAME}/options
OPTIONS_DEFINE= DEBUG DOCS TESTS
OPTIONS_DEFAULT=TESTS
TESTS_DESC= Run tests
.include <bsd.port.options.mk>
CFLAGS+= -ftemplate-depth-128 -fPIC -DPIC -Wall -D_REENTRANT ${PTHREAD_CFLAGS}
.if empty(PORT_OPTIONS:MDEBUG)
CFLAGS+= -DNDEBUG
.endif
.if ${ARCH} == "ia64"
BROKEN= does not compile on ia64
.endif
.if ((${ARCH} != i386) && (${ARCH} != powerpc))
MAKE_ENV= LP64=yes
.endif
.if empty(PORT_OPTIONS:MDOCS)
MAKE_ENV+= NOPORTDOCS=yes
.endif
post-patch:
@${SED} 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g; \
s|%%PREFIX%%|${PREFIX}|g; \
s|%%DATADIR%%|${DATADIR}|g; \
s|%%DOCSDIR%%|${DOCSDIR}|g; \
s|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
s|%%INSTALL_DATA%%|${INSTALL_DATA}|g' \
${FILESDIR}/Make.rules.FreeBSD > ${WRKSRC}/cpp/config/Make.rules.FreeBSD
@${REINPLACE_CMD} 's|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
s|%%INSTALL_DATA%%|${INSTALL_DATA}|g; \
s|%%PYTHON_SITELIBDIR%%|${PYTHON_SITELIBDIR}|g; \
s|%%PREFIX%%|${PREFIX}|g ; \
s|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/py/config/Make.rules
@${REINPLACE_CMD} 's|.(ice_dir).slice|${DATADIR}|g; \
s|.(prefix).slice|${DATADIR}|g; \
s|.(prefix).[ICE_]*LICENSE|${DATADIR}/LICENSE|g;' \
${WRKSRC}/py/config/Make.rules.mak \
${WRKSRC}/config/Make.common.rules.mak \
${WRKSRC}/config/Make.common.rules
post-install:
${ECHO} "Ice" > ${PYTHON_SITELIBDIR}/Ice.pth
.if ${PORT_OPTIONS:MTESTS}
TEST_CMD= @cd ${BUILD_WRKSRC} && ${PYTHON_CMD} ./allTests.py
.endif
post-build:
@${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${WRKSRC}/py/python
@${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py ${WRKSRC}/py/python
.if ${PORT_OPTIONS:MTESTS}
${TEST_CMD}
regression-test test: build
${TEST_CMD}
.endif
.include <bsd.port.mk>