diff options
author | scheidell <scheidell@FreeBSD.org> | 2012-01-07 00:36:03 +0800 |
---|---|---|
committer | scheidell <scheidell@FreeBSD.org> | 2012-01-07 00:36:03 +0800 |
commit | 4afbc9296ecee9e8f1bf1ac2f271341cbf223a69 (patch) | |
tree | e3a28d4c4a4a470ca88c83f262363d2b6ac8e295 | |
parent | 5eaba434724d6bade14e712519092b5d2a23e032 (diff) | |
download | freebsd-ports-gnome-4afbc9296ecee9e8f1bf1ac2f271341cbf223a69.tar.gz freebsd-ports-gnome-4afbc9296ecee9e8f1bf1ac2f271341cbf223a69.tar.zst freebsd-ports-gnome-4afbc9296ecee9e8f1bf1ac2f271341cbf223a69.zip |
- Fixes: easy-install.pth contents lost on upgrade clobbering ports using it
PR: ports/118301
Submitted by: Douglas William Thrift <douglas@douglasthrift.net>
Approved by: lars.eggert@nokia.com (maintainer, timeout 3 years), gabor (mentor)
-rw-r--r-- | devel/py-setuptools/Makefile | 12 | ||||
-rw-r--r-- | devel/py-setuptools/files/pkg-install.in | 24 | ||||
-rw-r--r-- | devel/py-setuptools/pkg-plist | 4 |
3 files changed, 38 insertions, 2 deletions
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 |