aboutsummaryrefslogtreecommitdiffstats
path: root/www/mod_python3
diff options
context:
space:
mode:
authorjeh <jeh@FreeBSD.org>2001-03-23 08:27:40 +0800
committerjeh <jeh@FreeBSD.org>2001-03-23 08:27:40 +0800
commita56e393be4849ec179975b83b8d4b942b754323b (patch)
tree50fcffb18b9f6c30cee71d8c8e0e4357ff0ed91b /www/mod_python3
parent968c1ce92f86ed579956904f28ccd94b4e461990 (diff)
downloadfreebsd-ports-gnome-a56e393be4849ec179975b83b8d4b942b754323b.tar.gz
freebsd-ports-gnome-a56e393be4849ec179975b83b8d4b942b754323b.tar.zst
freebsd-ports-gnome-a56e393be4849ec179975b83b8d4b942b754323b.zip
more flexible build options:
.enables apache module to embeded more python features. (crypt, cmath, strop.. and so many;same to lang/python port) but useless features (openpty, gnu readline) are disabled by default. .strip object at post-build phase by default. Assorted cleanup for portlint PR: 25839 Submitted by: Chang, Hye-Shik <perky@python.or.kr> MAINTAINER
Diffstat (limited to 'www/mod_python3')
-rw-r--r--www/mod_python3/Makefile65
1 files changed, 61 insertions, 4 deletions
diff --git a/www/mod_python3/Makefile b/www/mod_python3/Makefile
index 9d2e1093e7df..1b3d91336e2e 100644
--- a/www/mod_python3/Makefile
+++ b/www/mod_python3/Makefile
@@ -7,6 +7,7 @@
PORTNAME= mod_python
PORTVERSION= 2.7.2
+PORTREVISION= 1
CATEGORIES= www python
MASTER_SITES= http://www.modpython.org/dist/ \
http://www.python.org/ftp/python/2.0/ \
@@ -19,23 +20,79 @@ MAINTAINER= perky@python.or.kr
BUILD_DEPENDS= ${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13
RUN_DEPENDS= ${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13
+USE_PYTHON= yes
+INSTALLS_SHLIB= yes
+
+.include <bsd.port.pre.mk>
+
PYTHON_WRKSRC= ${WRKSRC}/../Python-${PYTHON_VERSION:S/python//g}
APXS= ${PREFIX}/sbin/apxs
GNU_CONFIGURE= yes
-USE_PYTHON= yes
-CONFIGURE_ARGS= --with-apxs=${LOCALBASE}/sbin/apxs \
+CONFIGURE_ARGS+= --with-apxs=${LOCALBASE}/sbin/apxs \
--with-python=${PYTHON_WRKSRC}
CONFIGURE_ENV= PYTHON_BIN=${LOCALBASE}/bin/python
PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S/^${LOCALBASE}\///g}
+.if defined(WITH_OPENPTY)
+OPTIONAL_LIBS+= -lutil
+.endif
+
+.if defined(WITH_GNUREADLINE)
+OPTIONAL_LIBS+= -lreadline
+.endif
+
+PYTHON_CONFIGURE_ARGS+= --without-threads
+PYTHON_SETUP_FILE?= ${PORTSDIR}/lang/python/files/Setup
+STRIP_BIN?= /usr/bin/strip
+
+pre-fetch:
+ @${ECHO} ""
+ @${ECHO} "You may use the following build option:"
+ @${ECHO} ""
+ @${ECHO} " PYTHON_SETUP_FILE=path specify python modules setup file"
+ @${ECHO} " WITH_OPENPTY=yes enables openpty function in posixmodule"
+ @${ECHO} " WITH_GNUREADLINE=yes enables gnu readline library"
+ @${ECHO} " DONT_STRIP=yes don't strip shared object"
+ @${ECHO} ""
+
+pre-patch:
+.if !defined(${WITH_OPENPTY})
+ ${PATCH} -s <files/optpatch-Python::configure
+.endif
+
pre-configure:
- cd ${PYTHON_WRKSRC} && ./configure --without-threads && cd Modules && ${MAKE} -f Makefile.pre Makefile
+ cd ${PYTHON_WRKSRC} && ./configure ${PYTHON_CONFIGURE_ARGS}
+.if !exists(${PYTHON_SETUP_FILE})
+ @${ECHO} ""
+ @${ECHO} "### COULD NOT FIND PYTHON SETUP FILE"
+ @${ECHO} "### SPECIFY FILE PATH OR INSTALL PORT 'lang/python'"
+ @${ECHO} ""
+.endif
+
+.if !defined(WITH_GNUREADLINE)
+ ${SED} 's/^readline/#without_readline/g' ${PYTHON_SETUP_FILE} \
+ > ${PYTHON_WRKSRC}/Modules/Setup
+.else
+ ${CP} ${PYTHON_SETUP_FILE} ${PYTHON_WRKSRC}/Modules/Setup
+.endif
+
+post-configure:
+.if defined(OPTIONAL_LIBS)
+ ${SED} 's/^\(LIBS=.*\)/\1 ${OPTIONAL_LIBS}/' ${WRKSRC}/src/Makefile \
+ > ${WRKSRC}/src/Makefile.tmp && \
+ ${MV} -f ${WRKSRC}/src/Makefile.tmp ${WRKSRC}/src/Makefile
+.endif
pre-build:
cd ${PYTHON_WRKSRC} && ${MAKE}
+post-build:
+.if !defined(DONT_STRIP) && exists(${STRIP_BIN})
+ ${STRIP_BIN} ${WRKSRC}/src/mod_python.so
+.endif
+
post-install:
@${CAT} ${PKGMESSAGE}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>