From 3c7099b027dbadc2e8ca63cdea0a04fd72e44d83 Mon Sep 17 00:00:00 2001 From: Michael Scheidell Date: Fri, 6 Jan 2012 16:36:03 +0000 Subject: [PATCH] - Fixes: easy-install.pth contents lost on upgrade clobbering ports using it PR: ports/118301 Submitted by: Douglas William Thrift Approved by: lars.eggert@nokia.com (maintainer, timeout 3 years), gabor (mentor) --- devel/py-setuptools/Makefile | 12 +++++++++++- devel/py-setuptools/files/pkg-install.in | 24 ++++++++++++++++++++++++ devel/py-setuptools/pkg-plist | 4 +++- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 devel/py-setuptools/files/pkg-install.in diff --git a/devel/py-setuptools/Makefile b/devel/py-setuptools/Makefile index f6af36938d9b..1921f22c9659 100644 --- a/devel/py-setuptools/Makefile +++ b/devel/py-setuptools/Makefile @@ -7,7 +7,7 @@ PORTNAME= setuptools PORTVERSION= 0.6c11 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -31,12 +31,22 @@ PLIST_SUB+= PYTHON_CURRENT="" PLIST_SUB+= PYTHON_OLD="@comment " .endif +SUB_FILES= pkg-install +SUB_LIST= EASYINSTALL_PTH=${EASYINSTALL_PTH} + +EASYINSTALL_PTH= ${PYTHON_SITELIBDIR}/easy-install.pth + +pre-install: + PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + post-install: ${INSTALL_DATA} ${WRKSRC}/site.py ${PYTHON_SITELIBDIR} .for opt in -Qold -O ${PYTHON_CMD} ${opt} -m compileall -l -x \ '^[^s][^i]?[^t]?[^e]?[^.][^p][^y]$$' ${PYTHON_SITELIBDIR} .endfor + ${CP} ${EASYINSTALL_PTH} ${EASYINSTALL_PTH}.dist + PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} diff --git a/devel/py-setuptools/files/pkg-install.in b/devel/py-setuptools/files/pkg-install.in new file mode 100644 index 000000000000..4c6fd4c865b3 --- /dev/null +++ b/devel/py-setuptools/files/pkg-install.in @@ -0,0 +1,24 @@ +#!/bin/sh + +EASYINSTALL_PTH=%%EASYINSTALL_PTH%% + +if [ $# -ne 2 ]; then + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 +fi + +case $2 in + PRE-INSTALL) + if [ -f ${EASYINSTALL_PTH} ]; then + mv ${EASYINSTALL_PTH} ${EASYINSTALL_PTH}.tmp + fi + ;; + POST-INSTALL) + if [ -f ${EASYINSTALL_PTH}.tmp ]; then + mv ${EASYINSTALL_PTH}.tmp ${EASYINSTALL_PTH} + fi + ;; +esac + +exit 0 + diff --git a/devel/py-setuptools/pkg-plist b/devel/py-setuptools/pkg-plist index 6771812b9c1b..3495298d80b0 100644 --- a/devel/py-setuptools/pkg-plist +++ b/devel/py-setuptools/pkg-plist @@ -1,8 +1,10 @@ @comment $FreeBSD$ bin/easy_install bin/easy_install-%%PYVER%% -%%PYTHON_SITELIBDIR%%/easy-install.pth %%PYTHON_SITELIBDIR%%/setuptools.pth +@unexec if cmp -s %B/easy-install.pth %B/easy-install.pth.dist; then rm %B/easy-install.pth; fi +%%PYTHON_SITELIBDIR%%/easy-install.pth.dist +@exec [ ! -f %B/easy-install.pth ]; then cp %B/%f %B/easy-install.pth; fi %%PYTHON_SITELIBDIR%%/site.py %%PYTHON_SITELIBDIR%%/site.pyc %%PYTHON_SITELIBDIR%%/site.pyo