1
# Copyright © 2010-2013 Piotr Ożarowski <piotr@debian.org>
3
# Permission is hereby granted, free of charge, to any person obtaining a copy
4
# of this software and associated documentation files (the "Software"), to deal
5
# in the Software without restriction, including without limitation the rights
6
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
# copies of the Software, and to permit persons to whom the Software is
8
# furnished to do so, subject to the following conditions:
10
# The above copyright notice and this permission notice shall be included in
11
# all copies or substantial portions of the Software.
13
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
PKG_PREFIX_MAP = {'cpython2': 'python',
24
'cpython3': 'python3',
27
# minimum version required for compile/clean scripts:
28
MINPYCDEP = {'cpython2': 'python (>= 2.6.6-3)',
29
'cpython3': 'python3 (>= 3.2.3-3~)',
33
'cpython2': re.compile(r'.*?/usr/lib/python(2\.\d)(?:/|$)'),
34
'cpython3': re.compile(r'.*?/usr/lib/python(3(?:\.\d+)?)(?:/|$)'),
35
'pypy': re.compile(r'.*?/usr/lib/pypy(?:/|$)')}
37
INTERPRETER_DIR_TPLS = {
38
'cpython2': r'.*/python2\.\d/',
39
'cpython3': r'.*/python3(?:\.\d+)?/',
42
# Interpreter site-directories
45
'/usr/local/lib/python{}/site-packages',
46
'/usr/local/lib/python{}/dist-packages',
47
'/var/lib/python-support/python{}',
48
'/usr/lib/pymodules/python{}',
49
lambda version: '/usr/lib/python{}/site-packages'.format(version)
50
if version >= '2.6' else None],
52
'/usr/local/lib/python{}/site-packages',
53
'/usr/local/lib/python{}/dist-packages',
54
'/usr/lib/python{}/site-packages',
55
'/usr/lib/python{}/dist-packages',
56
'/var/lib/python-support/python{}',
57
'/usr/lib/pymodules/python{}'],
59
'/usr/local/lib/pypy/site-packages',
60
'/usr/local/lib/pypy/dist-packages',
61
'/usr/lib/pypy/site-packages']}
65
'cpython2': '/usr/share/python/dist/',
66
'cpython3': '/usr/share/python3/dist/',
67
'pypy': '/usr/share/pypy/dist/'}
69
PYDIST_OVERRIDES_FNAMES = {
70
'cpython2': 'debian/pydist-overrides',
71
'cpython3': 'debian/py3dist-overrides',
72
'pypy': 'debian/pypydist-overrides'}
74
PYDIST_DPKG_SEARCH_TPLS = {
75
'cpython2': "*/%s-?*\.egg-info | grep '/python2\../\|/pyshared/'",
76
'cpython3': '*python3/*/{}-?*\.egg-info',
77
'pypy': '*pypy/*/{}-?\.egg-info'}
81
'cpython2': ('python-', 'python2.'),
82
'cpython3': ('python3-', 'python3.'),
86
'cpython2': '/usr/share/python/runtime.d/',
87
'cpython3': '/usr/share/python3/runtime.d/',
88
'pypy': '/usr/share/pypy/runtime.d/',
92
if [ "$1" = rtupdate ]; then
93
\tpyclean {pkg_arg} {dname}
94
\tpycompile {pkg_arg} {args} {dname}
97
if [ "$1" = rtupdate ]; then
98
\tpy3clean {pkg_arg} {dname}
99
\tpy3compile {pkg_arg} {args} {dname}