Build the list of data_files more correctly in setup.py.

Build individual file lists for each subdirectory in etc/
This commit is contained in:
David Cantrell 2008-10-04 20:05:53 -10:00
parent c01846d9ae
commit 46052c010d

View File

@ -1,5 +1,22 @@
from distutils.core import setup
import glob
import os
main_etc_files = []
for comp in glob.glob(os.path.join(os.getcwd(), 'etc', '*'):
if os.path.isfile(comp):
main_etc_files.append(comp)
etc_data_files = [(os.path.join('etc', 'lorax'), main_etc_files)]
for comp in glob.glob(os.path.join(os.getcwd(), 'etc', '*'):
if os.path.isdir(comp):
sub_files = glob.glob(comp, '*')
etc_path = os.path.join('etc', 'lorax', os.path.basename(comp))
etc_data_files.append((etc_path, sub_files))
data_files = [(os.path.join('usr', 'share', 'lorax'),
glob.glob('share/*'))] + etc_data_files
setup(name='lorax',
version='0.1',
@ -10,6 +27,5 @@ setup(name='lorax',
package_dir = {'': 'src'},
packages = ['pylorax'],
scripts = ['src/bin/lorax'],
data_files = [('/usr/share/lorax', glob.glob('share/*')),
('/etc/lorax', glob.glob('etc/*'))]
data_files = data_files
)