def export_to(self, dh): """Fill in debhelper's substvars.""" prefix = PKG_PREFIX_MAP.get(self.impl, 'misc') for i in sorted(self.depends): dh.addsubstvar(self.package, '{}:Depends'.format(prefix), i) for i in sorted(self.recommends): dh.addsubstvar(self.package, '{}:Recommends'.format(prefix), i) for i in sorted(self.suggests): dh.addsubstvar(self.package, '{}:Suggests'.format(prefix), i) for i in sorted(self.enhances): dh.addsubstvar(self.package, '{}:Enhances'.format(prefix), i) for i in sorted(self.breaks): dh.addsubstvar(self.package, '{}:Breaks'.format(prefix), i) for i in sorted(self.rtscripts): dh.add_rtupdate(self.package, i)
except ImportError: from json import load, dump from dhpython import PKG_PREFIX_MAP from dhpython.pydist import guess_dependency, parse_pydep log = logging.getLogger('pypi2deb') # The location of sphinx-based documentation can be configured via the # environment variable PYPI2DEB_SPHINX_DIRS (colon-separated directories). # Disable sphinx support by assigning an empty string to this environment # variable. try: SPHINX_DIR = set(environ['PYPI2DEB_SPHINX_DIRS'].split(":")) except KeyError: SPHINX_DIR = {'docs', 'doc', 'doc/build'} INTERPRETER_MAP = {value: key for key, value in PKG_PREFIX_MAP.items()} VERSIONED_I_MAP = {'python': 'python2'} DESC_STOP_KEYWORDS = { 'changelog', 'changes', 'license', 'requirements', 'installation' } def _copy_static_files(src_dir, debian_dir): """Copy static templates/overrides from source to destination""" for root, dirs, file_names in walk(src_dir): for fn in file_names: if fn.endswith(('.tpl', '.swp')): continue dst_dir = root.replace(src_dir, debian_dir) if not exists(dst_dir): makedirs(dst_dir)
from pypi2deb.tools import execute from jinja2 import Environment, FileSystemLoader from debian.changelog import Changelog, Version, get_maintainer try: from simplejson import load except ImportError: from json import load from dhpython import PKG_PREFIX_MAP from dhpython.pydist import guess_dependency, parse_pydep log = logging.getLogger('pypi2deb') SPHINX_DIR = {'docs', 'doc', 'doc/build'} INTERPRETER_MAP = {value: key for key, value in PKG_PREFIX_MAP.items()} VERSIONED_I_MAP = {'python': 'python2'} def _copy_static_files(src_dir, debian_dir): """Copy static templates/overrides from source to destination""" for root, dirs, file_names in walk(src_dir): for fn in file_names: if fn.endswith(('.tpl', '.swp')): continue dst_dir = root.replace(src_dir, debian_dir) if not exists(dst_dir): makedirs(dst_dir) if not exists(join(dst_dir, fn)): copy(join(root, fn), join(dst_dir, fn))