[PATCH] devel/py27-dateutil: fix non-root build, other updates
John Hein
jhein at symmetricom.com
Fri Jan 24 21:50:47 UTC 2014
>Submitter-Id: current-users
>Originator: John Hein
>Organization:
>Confidential: no
>Synopsis: [PATCH] devel/py27-dateutil: fix non-root build, other updates
>Severity: non-critical
>Priority: low
>Category: ports
>Class: sw-bug
>Release:
>Environment:
System:
>Description:
The main motivation for this patch is to fix the build for the
non-root user. The chmod in post-patch was removing write permission
from files that the build is trying to write to. Okay if you're root
on a local filesystem, but it fails if you are a regular user (try
just 'make' as a regular user) because setup.py tries to write to
files in the python_dateutil.egg-info (which are now read-only thanks
to the chmod 444 in post-patch).
The fix is to change ${SHAREMODE} (0444) to a+r for the chmod.
While I was here, I:
- added support for staging
- moved away from the deprecated easy_install (changes plist,
thus bumped PORTREVISION as well)
- replaced the deprecated BSD license with BSD3CLAUSE
I chose to still use the static pkg-plist rather than
use PYDISTUTILS_AUTOPLIST.
p.s. bsd.python.mk could probably add PYDISTUTILS_EGGINFO to PLIST_SUB.
Port maintainer (nivit at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.99_8 (mode: change, diff: SVN)
>How-To-Repeat:
As a regular user:
cd /usr/ports/devel/py-dateutil
make
Observe:
.
.
running egg_info
writing requirements to python_dateutil.egg-info/requires.txt
error: python_dateutil.egg-info/requires.txt: Permission denied
>Fix:
--- py27-dateutil-2.1_3.patch begins here ---
Index: Makefile
===================================================================
--- Makefile (revision 340890)
+++ Makefile (working copy)
@@ -3,7 +3,7 @@
PORTNAME= dateutil
PORTVERSION= 2.1
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -12,19 +12,19 @@
MAINTAINER= nivit at FreeBSD.org
COMMENT= Provides powerful extensions to the standard datetime module
-LICENSE= BSD
+LICENSE= BSD3CLAUSE
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:${PORTSDIR}/devel/py-six
RUN_DEPENDS+= ${BUILD_DEPENDS}
USE_PYTHON= yes
-USE_PYDISTUTILS= easy_install
+USE_PYDISTUTILS= yes
PYDISTUTILS_PKGNAME= python-dateutil
+PLIST_SUB+= PYDISTUTILS_EGGINFO=${PYDISTUTILS_EGGINFO}
# Fix incorrect permissions
-NO_STAGE= yes
post-patch:
- @${FIND} ${WRKSRC} -type f -exec ${CHMOD} ${SHAREMODE} {} ";"
+ @${FIND} ${WRKSRC} -type f -exec ${CHMOD} a+r {} ";"
@${REINPLACE_CMD} -e 's|import winreg|from six.moves import winreg|' ${WRKSRC}/dateutil/tzwin.py
regression-test: build
Index: pkg-plist
===================================================================
--- pkg-plist (revision 340890)
+++ pkg-plist (working copy)
@@ -1,35 +1,34 @@
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/PKG-INFO
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/SOURCES.txt
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/dependency_links.txt
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/not-zip-safe
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/requires.txt
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/top_level.txt
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/__init__.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/__init__.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/__init__.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/easter.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/easter.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/easter.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/parser.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/parser.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/parser.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/relativedelta.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/relativedelta.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/relativedelta.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/rrule.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/rrule.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/rrule.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/tz.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/tz.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/tz.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/tzwin.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/tzwin.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/tzwin.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/zoneinfo/__init__.py
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/zoneinfo/__init__.pyc
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/zoneinfo/__init__.pyo
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/zoneinfo/zoneinfo--latest.tar.gz
- at dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil/zoneinfo
- at dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/dateutil
- at dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO
- at dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%
+%%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%%/PKG-INFO
+%%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%%/SOURCES.txt
+%%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%%/dependency_links.txt
+%%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%%/not-zip-safe
+%%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%%/requires.txt
+%%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%%/top_level.txt
+%%PYTHON_SITELIBDIR%%/dateutil/__init__.py
+%%PYTHON_SITELIBDIR%%/dateutil/__init__.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/__init__.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/easter.py
+%%PYTHON_SITELIBDIR%%/dateutil/easter.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/easter.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/parser.py
+%%PYTHON_SITELIBDIR%%/dateutil/parser.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/parser.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/relativedelta.py
+%%PYTHON_SITELIBDIR%%/dateutil/relativedelta.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/relativedelta.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/rrule.py
+%%PYTHON_SITELIBDIR%%/dateutil/rrule.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/rrule.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/tz.py
+%%PYTHON_SITELIBDIR%%/dateutil/tz.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/tz.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/tzwin.py
+%%PYTHON_SITELIBDIR%%/dateutil/tzwin.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/tzwin.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/zoneinfo/__init__.py
+%%PYTHON_SITELIBDIR%%/dateutil/zoneinfo/__init__.pyc
+%%PYTHON_SITELIBDIR%%/dateutil/zoneinfo/__init__.pyo
+%%PYTHON_SITELIBDIR%%/dateutil/zoneinfo/zoneinfo--latest.tar.gz
+ at dirrm %%PYTHON_SITELIBDIR%%/dateutil/zoneinfo
+ at dirrm %%PYTHON_SITELIBDIR%%/dateutil
+ at dirrm %%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%%
--- py27-dateutil-2.1_3.patch ends here ---
More information about the freebsd-python
mailing list