Include folders with subfolders when creating api tarball

(imported from commit b9d564a6cc4ee6e2afa0108b6d9f18af039fc8cf)
This commit is contained in:
Leo Franchi 2013-03-26 17:55:57 -04:00
parent 79b2572bd4
commit 10a53150a2

View file

@ -7,6 +7,12 @@ import glob
import os
from distutils.core import setup
def recur_expand(target_root, dir):
for root, _, files in os.walk(dir):
paths = [os.path.join(root, f) for f in files]
if len(paths):
yield os.path.join(target_root, root), paths
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
@ -22,9 +28,7 @@ setup(name='humbug',
url='https://humbughq.com/dist/api/',
packages=['humbug'],
data_files=[('share/humbug/examples', ["examples/humbugrc", "examples/send-message"])] + \
[(os.path.join('share/humbug/', relpath),
glob.glob(os.path.join(relpath, '*'))) for relpath in
glob.glob("integrations/*")] + \
list(recur_expand('share/humbug', 'integrations/')) + \
[('share/humbug/demos',
[os.path.join("demos", relpath) for relpath in
os.listdir("demos")])],