15 author_email = '%(author-email)s' |
15 author_email = '%(author-email)s' |
16 |
16 |
17 short_desc = '%(shortdesc)s' |
17 short_desc = '%(shortdesc)s' |
18 long_desc = '''%(longdesc)s''' |
18 long_desc = '''%(longdesc)s''' |
19 |
19 |
20 from os import listdir as _listdir |
|
21 from os.path import join, isdir |
|
22 |
|
23 web = 'http://www.cubicweb.org/project/%%s' %% distname |
20 web = 'http://www.cubicweb.org/project/%%s' %% distname |
24 |
21 |
25 pyversions = ['2.4'] |
22 pyversions = ['2.4'] |
26 |
23 |
27 #from cubicweb.devtools.pkginfo import get_distutils_datafiles |
24 |
28 CUBES_DIR = join('share', 'cubicweb', 'cubes') |
25 from os import listdir as _listdir |
29 THIS_CUBE_DIR = join(CUBES_DIR, '%(cubename)s') |
26 from os.path import join, isdir, exists, dirname |
|
27 from glob import glob |
|
28 |
|
29 THIS_CUBE_DIR = join('share', 'cubicweb', 'cubes', modname) |
30 |
30 |
31 def listdir(dirpath): |
31 def listdir(dirpath): |
32 return [join(dirpath, fname) for fname in _listdir(dirpath) |
32 return [join(dirpath, fname) for fname in _listdir(dirpath) |
33 if fname[0] != '.' and not fname.endswith('.pyc') |
33 if fname[0] != '.' and not fname.endswith('.pyc') |
34 and not fname.endswith('~') |
34 and not fname.endswith('~') |
35 and not isdir(join(dirpath, fname))] |
35 and not isdir(join(dirpath, fname))] |
36 |
36 |
37 from glob import glob |
|
38 try: |
37 try: |
39 data_files = [ |
38 data_files = [ |
40 # common files |
39 # common files |
41 [THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']], |
40 [THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']], |
42 ] |
41 ] |
43 # check for possible extended cube layout |
42 # check for possible extended cube layout |
44 for dirname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'i18n', 'migration'): |
43 for dirname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'i18n', 'migration'): |
45 if isdir(dirname): |
44 if isdir(dirname): |
46 data_files.append([join(THIS_CUBE_DIR, dirname), listdir(dirname)]) |
45 data_files.append([join(THIS_CUBE_DIR, dirname), listdir(dirname)]) |
47 # Note: here, you'll need to add subdirectories if you want |
46 # Note: here, you'll need to add subdirectories if you want |
48 # them to be included in the debian package |
47 # them to be included in the debian package |
49 except OSError: |
48 except OSError: |
|
49 if exists(dirname(__file__)): |
|
50 raise |
50 # we are in an installed directory |
51 # we are in an installed directory |
51 pass |
|
52 |
52 |
53 |
53 |
54 cube_eid = None # <=== FIXME if you need direct bug-subscription |
54 cube_eid = None # <=== FIXME if you need direct bug-subscription |
55 __use__ = (%(dependancies)s) |
55 __use__ = (%(dependancies)s) |
56 __recommend__ = () |
56 __recommend__ = () |