- Add files/pkg-install.in, (pre|post)-install target,

and some pkg-add's directives in pkg-plist to preserve
  the easy-install.pth file when the port is upgraded
- Bump PORTREVISION
- Install a copy of site.py[co]? .
This commit is contained in:
Nicola Vitale 2011-03-08 18:37:18 +00:00
parent 6c20977989
commit e1ce3cdb6a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=270518
3 changed files with 48 additions and 2 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= distribute
PORTVERSION= 0.6.14
#PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -23,4 +23,19 @@ PYDISTUTILS_NOEGGINFO= yes
USE_PYTHON= yes
USE_PYDISTUTILS= yes
SUB_FILES= pkg-install
SUB_LIST= EASYINSTALL_PTH=${EASYINSTALL_PTH}
EASYINSTALL_PTH= ${PYTHON_SITELIBDIR}/easy-install.pth
SITE_PY= ${PYTHON_SITELIBDIR}/site.py
pre-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
${INSTALL_DATA} ${WRKSRC}/site.py ${SITE_PY}
${PYTHON_CMD} -m py_compile ${SITE_PY}
${PYTHON_CMD} -OO -m py_compile ${SITE_PY}
${CP} ${EASYINSTALL_PTH} ${EASYINSTALL_PTH}.dist
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View file

@ -0,0 +1,25 @@
#!/bin/sh
# $FreeBSD$
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

View file

@ -1,6 +1,12 @@
@comment $FreeBSD$
bin/easy_install
bin/easy_install-%%PYVER%%
%%PYTHON_SITELIBDIR%%/distribute-%%VERSION%%-py%%PYVER%%.egg
%%PYTHON_SITELIBDIR%%/easy-install.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%%/setuptools-%%SETUPTOOLS_VER%%-py%%PYVER%%.egg-info
%%PYTHON_SITELIBDIR%%/setuptools.pth
%%PYTHON_SITELIBDIR%%/site.py
%%PYTHON_SITELIBDIR%%/site.pyc
%%PYTHON_SITELIBDIR%%/site.pyo