Exemple #1
0
# So to avoid any problems, remove anything kaa from the path, since we don't
# need it.
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow', ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
version = VERSION
if os.path.isdir('.git'):
    # Fetch all revisions since last tag.  The first item is the current HEAD object name
    # and the last is the tag object name.
    revs = os.popen('git rev-list --all | grep -B9999  `git rev-list --tags --max-count=1`').read().splitlines()
    if len(revs) > 1:
        # We're at least one commit past the last tag, so this is considered a
        # dev release.
        version = '%sdev-%d-%s' % (VERSION, len(revs)-1, revs[0][:8])
Exemple #2
0
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src

sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow',
                          ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

if sys.hexversion < 0x02060000:
    # Fixed os.listdir for Python 2.5.  This module is optional for Python 2.5
    # (only installed if headers/libs are available) and not compiled for later
    # versions.
    utils_ext = Extension('kaa.base._utils', ['src/extensions/utils.c'])
    if utils_ext.has_python_h():
        extensions.append(utils_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
version = VERSION
Exemple #3
0
# Now append 'src/' to the path so we can import distribution.core.  We don't
# want to insert to the front because then any absolute imports will look in
# src/ first, rather than standard Python modules, which is a problem for any
# modules whose name collides (e.g. io)
#sys.path.append('src')
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

shm_ext = Extension('kaa.base.shmmodule', ['src/extensions/shmmodule.c'])
if not shm_ext.has_python_h():
    print('---------------------------------------------------------------------\n'
          'Python headers not found; please install python development package.\n'
          'kaa.db, shm and inotify support will be unavailable\n'
          '---------------------------------------------------------------------')
    time.sleep(2)

else:
    osname = os.popen('uname -s').read().strip().lower()
    if osname == 'darwin':
        print('- kaa.shm not supported on Darwin, not building')
    elif sys.hexversion < 0x03000000:
        # shm not compatible with Python 3 (yet? maybe we should remove
        # this module)
        extensions.append(shm_ext)
Exemple #4
0
# need it.
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow',
                          ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
version = VERSION
if os.path.isdir('.git'):
    # Fetch all revisions since last tag.  The first item is the current HEAD object name
    # and the last is the tag object name.
    revs = os.popen(
        'git rev-list --all | grep -B9999  `git rev-list --tags --max-count=1`'
    ).read().splitlines()
    if len(revs) > 1:
        # We're at least one commit past the last tag, so this is considered a
Exemple #5
0
try:
    if not ifoparser.check_cc([], '', '-ldvdread'):
        print 'Warning: libdvdread is missing.'
        raise AttributeError()

    if not ifoparser.check_cc(['<dvdread/dvd_reader.h>'], '', '-ldvdread'):
        print 'Warning: libdvdread header file is missing.'
        raise AttributeError()

    ext_modules = [ cdrom, ifoparser ]
except AttributeError:
    print 'The DVD parser will be disabled'
    ext_modules = [ cdrom ]

if not cdrom.has_python_h():
    print "---------------------------------------------------------------------"
    print "Python headers not found; please install python development package."
    print "Rom drive support will be unavailable"
    print "---------------------------------------------------------------------"
    ext_modules = [ ]

exiv2 = Extension('kaa.metadata.image.exiv2', ['src/image/exiv2.cpp'])
if exiv2.check_library('exiv2', '0.18'):
    print 'Building experimental exiv2 parser'
    ext_modules.append(exiv2)
    
setup(
    module = 'metadata',
    version = '0.7.7',
    license = 'GPL',
Exemple #6
0
# So to avoid any problems, remove anything kaa from the path, since we don't
# need it.
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow', ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

if sys.hexversion < 0x02060000:
    # Fixed os.listdir for Python 2.5.  This module is optional for Python 2.5
    # (only installed if headers/libs are available) and not compiled for later
    # versions.
    utils_ext = Extension('kaa.base._utils', ['src/extensions/utils.c'])
    if utils_ext.has_python_h():
        extensions.append(utils_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
version = VERSION