lib/bb/build.py: ignore runfile remove errors
[vuplus_bitbake] / setup.py
1 #!/usr/bin/env python
2 # ex:ts=4:sw=4:sts=4:et
3 # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4 #
5 # Copyright (C) 2003  Chris Larson
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2 as
9 # published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
21 from distutils.core import setup
22 import os, sys
23
24 bbdir = os.path.join(sys.prefix, 'share', 'bitbake')
25 docdir = os.path.join(sys.prefix, 'share', 'doc')
26 # bbdir = os.path.join('bitbake')
27 # docdir = os.path.join('doc')
28
29 def clean_doc(type):
30     origpath = os.path.abspath(os.curdir)
31     os.chdir(os.path.join(origpath, 'doc', 'manual'))
32     make = os.environ.get('MAKE') or 'make'
33     os.system('%s clean-%s' % (make, type))
34
35 def generate_doc(type):
36     origpath = os.path.abspath(os.curdir)
37     os.chdir(os.path.join(origpath, 'doc', 'manual'))
38     make = os.environ.get('MAKE') or 'make'
39     ret = os.system('%s %s' % (make, type))
40     if ret != 0:
41         print "ERROR: Unable to generate html documentation."
42         sys.exit(ret)
43     os.chdir(origpath)
44
45 if 'bdist' in sys.argv[1:]:
46     generate_doc('html')
47
48 sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'lib'))
49 import bb
50 import glob
51 setup(name='bitbake',
52       version=bb.__version__,
53       license='GPLv2',
54       url='http://developer.berlios.de/projects/bitbake/',
55       description='BitBake build tool',
56       long_description='BitBake is a simple tool for the execution of tasks. It is derived from Portage, which is the package management system used by the Gentoo Linux distribution. It is most commonly used to build packages, as it can easily use its rudamentary inheritence to abstract common operations, such as fetching sources, unpacking them, patching them, compiling them, and so on.  It is the basis of the OpenEmbedded project, which is being used for OpenZaurus, Familiar, and a number of other Linux distributions.',
57       author='Chris Larson',
58       author_email='clarson@elinux.org',
59       packages=['bb', 'bb.fetch', 'bb.parse', 'bb.parse.parse_py'],
60       package_dir={'bb': os.path.join('lib', 'bb')},
61       scripts=[os.path.join('bin', 'bitbake'),
62                os.path.join('bin', 'bbimage')],
63       data_files=[(os.path.join(bbdir, 'conf'), [os.path.join('conf', 'bitbake.conf')]),
64                   (os.path.join(bbdir, 'classes'), [os.path.join('classes', 'base.bbclass')]),
65                   (os.path.join(docdir, 'bitbake-%s' % bb.__version__, 'html'), glob.glob(os.path.join('doc', 'manual', 'html', '*.html'))),
66                   (os.path.join(docdir, 'bitbake-%s' % bb.__version__, 'pdf'), glob.glob(os.path.join('doc', 'manual', 'pdf', '*.pdf'))),],
67      )
68
69 if 'bdist' in sys.argv[1:]:
70     clean_doc('html')