Sat May 21 05:22:40 2016 UTC ()
Back to the basic problem... check-perms.mk issues warnings/errors on text
files installed group and/or world writeable so only search and fix in DESTDIR.
This avoids touching any files used during build at the same time.


(richard)
diff -r1.44 -r1.45 pkgsrc/lang/python/extension.mk

cvs diff -r1.44 -r1.45 pkgsrc/lang/python/extension.mk (switch to unified diff)

--- pkgsrc/lang/python/extension.mk 2016/05/20 16:37:27 1.44
+++ pkgsrc/lang/python/extension.mk 2016/05/21 05:22:40 1.45
@@ -1,79 +1,80 @@ @@ -1,79 +1,80 @@
1# $NetBSD: extension.mk,v 1.44 2016/05/20 16:37:27 wiz Exp $ 1# $NetBSD: extension.mk,v 1.45 2016/05/21 05:22:40 richard Exp $
2 2
3.include "../../lang/python/pyversion.mk" 3.include "../../lang/python/pyversion.mk"
4 4
5# Packages that are a non-egg distutils extension should set 5# Packages that are a non-egg distutils extension should set
6# PYDISTUTILSPKG=YES and include this mk file. 6# PYDISTUTILSPKG=YES and include this mk file.
7 7
8# This mk fragment is included to handle packages that create 8# This mk fragment is included to handle packages that create
9# extensions to python, which by definition are those that place files 9# extensions to python, which by definition are those that place files
10# in ${PYSITELIB}. Extensions can be implemented via setuptools as 10# in ${PYSITELIB}. Extensions can be implemented via setuptools as
11# eggs (see egg.mk), via distutils (confusing, with an egg-info file, 11# eggs (see egg.mk), via distutils (confusing, with an egg-info file,
12# even though they are not eggs), or via more ad hocs methods. 12# even though they are not eggs), or via more ad hocs methods.
13 13
14.if defined(PYDISTUTILSPKG) 14.if defined(PYDISTUTILSPKG)
15.include "../../mk/bsd.prefs.mk" 15.include "../../mk/bsd.prefs.mk"
16 16
17PYSETUP?= setup.py 17PYSETUP?= setup.py
18PYSETUPBUILDTARGET?= build 18PYSETUPBUILDTARGET?= build
19PYSETUPBUILDARGS?= #empty 19PYSETUPBUILDARGS?= #empty
20PYSETUPARGS?= #empty 20PYSETUPARGS?= #empty
21PYSETUPINSTALLARGS?= #empty 21PYSETUPINSTALLARGS?= #empty
22PYSETUPOPTARGS?= -c -O1 22PYSETUPOPTARGS?= -c -O1
23_PYSETUPINSTALLARGS= ${PYSETUPINSTALLARGS} ${PYSETUPOPTARGS} ${_PYSETUPTOOLSINSTALLARGS} 23_PYSETUPINSTALLARGS= ${PYSETUPINSTALLARGS} ${PYSETUPOPTARGS} ${_PYSETUPTOOLSINSTALLARGS}
24_PYSETUPINSTALLARGS+= --root=${DESTDIR:Q} 24_PYSETUPINSTALLARGS+= --root=${DESTDIR:Q}
25PY_PATCHPLIST?= yes 25PY_PATCHPLIST?= yes
26PYSETUPINSTALLARGS?= #empty 26PYSETUPINSTALLARGS?= #empty
27PYSETUPTESTTARGET?= test 27PYSETUPTESTTARGET?= test
28PYSETUPTESTARGS?= #empty 28PYSETUPTESTARGS?= #empty
29PYSETUPSUBDIR?= #empty 29PYSETUPSUBDIR?= #empty
30 30
31pre-patch: fixup-python-writeable-source 31post-install: fixup-python-writeable-source
32.PHONY: fixup-python-writeable-source 32.PHONY: fixup-python-writeable-source
33fixup-python-writeable-source: 33fixup-python-writeable-source:
34 ${FIND} ${WRKSRC} -type f -exec ${CHMOD} go-w {} \; 34 ${FIND} ${DESTDIR} -type f \( -perm -g+w -o -perm -o+w \) \
 35 -exec ${CHMOD} go-w '{}' +
35 36
36do-build: 37do-build:
37 (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \ 38 (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \
38 ${PYSETUP} ${PYSETUPARGS} ${PYSETUPBUILDTARGET} ${PYSETUPBUILDARGS}) 39 ${PYSETUP} ${PYSETUPARGS} ${PYSETUPBUILDTARGET} ${PYSETUPBUILDARGS})
39 40
40do-install: 41do-install:
41 (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ 42 (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
42 ${PYTHONBIN} ${PYSETUP} ${PYSETUPARGS} "install" ${_PYSETUPINSTALLARGS}) 43 ${PYTHONBIN} ${PYSETUP} ${PYSETUPARGS} "install" ${_PYSETUPINSTALLARGS})
43.if !target(do-test) && !(defined(TEST_TARGET) && !empty(TEST_TARGET)) 44.if !target(do-test) && !(defined(TEST_TARGET) && !empty(TEST_TARGET))
44do-test: 45do-test:
45 (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \ 46 (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \
46 ${PYSETUP} ${PYSETUPARGS} ${PYSETUPTESTTARGET} ${PYSETUPTESTARGS}) 47 ${PYSETUP} ${PYSETUPARGS} ${PYSETUPTESTTARGET} ${PYSETUPTESTARGS})
47.endif 48.endif
48 49
49.endif 50.endif
50 51
51# PY_NO_EGG suppress the installation of the egg info file (and 52# PY_NO_EGG suppress the installation of the egg info file (and
52# therefore its inclusion in the package). Python practice is be to 53# therefore its inclusion in the package). Python practice is be to
53# use these files to let 'require' verify that python distributions 54# use these files to let 'require' verify that python distributions
54# are present, and therefore the default value of PY_NO_EGG=yes causes 55# are present, and therefore the default value of PY_NO_EGG=yes causes
55# pkgsrc not to conform to python norms. The reason for this behavior 56# pkgsrc not to conform to python norms. The reason for this behavior
56# appears to be that creating egg info files was new in Python 2.5. 57# appears to be that creating egg info files was new in Python 2.5.
57PY_NO_EGG?= yes 58PY_NO_EGG?= yes
58.if !empty(PY_NO_EGG:M[yY][eE][sS]) 59.if !empty(PY_NO_EGG:M[yY][eE][sS])
59# see python*/patches/patch-av 60# see python*/patches/patch-av
60INSTALL_ENV+= PKGSRC_PYTHON_NO_EGG=defined 61INSTALL_ENV+= PKGSRC_PYTHON_NO_EGG=defined
61.endif 62.endif
62 63
63.if defined(PY_PATCHPLIST) 64.if defined(PY_PATCHPLIST)
64PLIST_SUBST+= PYINC=${PYINC} PYLIB=${PYLIB} PYSITELIB=${PYSITELIB} 65PLIST_SUBST+= PYINC=${PYINC} PYLIB=${PYLIB} PYSITELIB=${PYSITELIB}
65.endif 66.endif
66 67
67# prepare Python>=3.2 bytecode file location change 68# prepare Python>=3.2 bytecode file location change
68# http://www.python.org/dev/peps/pep-3147/ 69# http://www.python.org/dev/peps/pep-3147/
69.if empty(_PYTHON_VERSION:M2?) 70.if empty(_PYTHON_VERSION:M2?)
70PY_PEP3147?= yes 71PY_PEP3147?= yes
71.endif 72.endif
72.if defined(PY_PEP3147) && !empty(PY_PEP3147:M[yY][eE][sS]) 73.if defined(PY_PEP3147) && !empty(PY_PEP3147:M[yY][eE][sS])
73PLIST_AWK+= -f ${PKGSRCDIR}/lang/python/plist-python.awk 74PLIST_AWK+= -f ${PKGSRCDIR}/lang/python/plist-python.awk
74PLIST_AWK_ENV+= PYVERS="${PYVERSSUFFIX:S/.//}" 75PLIST_AWK_ENV+= PYVERS="${PYVERSSUFFIX:S/.//}"
75PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.py[co]$$/ { 76PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.py[co]$$/ {
76PRINT_PLIST_AWK+= gsub(/__pycache__\//, "") 77PRINT_PLIST_AWK+= gsub(/__pycache__\//, "")
77PRINT_PLIST_AWK+= gsub(/opt-1\.pyc$$/, "pyo") 78PRINT_PLIST_AWK+= gsub(/opt-1\.pyc$$/, "pyo")
78PRINT_PLIST_AWK+= gsub(/\.cpython-${_PYTHON_VERSION}/, "")} 79PRINT_PLIST_AWK+= gsub(/\.cpython-${_PYTHON_VERSION}/, "")}
79.endif 80.endif