~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Martin Albisetti
  • Date: 2008-07-29 22:00:33 UTC
  • mto: This revision was merged to the branch mainline in revision 188.
  • Revision ID: argentina@gmail.com-20080729220033-19d1u1rdn38hvo6w
Make sure you have all required dependencies before installing

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 
19
18
"""Loggerhead is a web viewer for projects in bazaar"""
20
19
 
21
 
 
22
 
from distutils.core import setup
 
20
from distutils.core import setup, Command
 
21
from distutils.command.install_data import install_data
 
22
from distutils.dep_util import newer
 
23
from distutils.log import info
 
24
import glob
 
25
import os
 
26
import sys
23
27
import loggerhead
24
 
 
 
28
import bzrlib
 
29
 
 
30
 
 
31
# Make sure you have all required dependencies
 
32
if sys.version_info < (2, 4):
 
33
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.4+\n")
 
34
    sys.exit(1)
 
35
 
 
36
bzrlib_version = bzrlib.version_info[:2]
 
37
try:
 
38
    from bzrlib.trace import warning
 
39
except ImportError:
 
40
    from warnings import warn as warning
 
41
if bzrlib_version < loggerhead.required_bzrlib:
 
42
    from bzrlib.errors import BzrError
 
43
    warning('Installed Bazaar version %s is too old to be used with loggerhead'
 
44
            ' %s.' % (bzrlib.__version__, __version__))
 
45
    raise BzrError('Version mismatch: %r, %r' % (version_info, 
 
46
                                                 bzrlib.version_info) )
 
47
 
 
48
try:
 
49
    import paste
 
50
except ImportError:
 
51
    raise errors.BzrCommandError("python-paste not installed.")
 
52
try:
 
53
    import simpletal
 
54
except ImportError:
 
55
    raise errors.BzrCommandError("python-simpletal not installed.")
 
56
 
 
57
 
 
58
 
 
59
class InstallData(install_data):
 
60
    def run(self):
 
61
        install_data.run(self)
25
62
 
26
63
setup(
27
64
    name = "loggerhead",
31
68
    maintainer = "Michael Hudson",
32
69
    maintainer_email = "michael.hudson@canonical.com",
33
70
    scripts = ["start-loggerhead", "stop-loggerhead", "serve-branches"],
34
 
    packages = ["loggerhead"],
35
 
    package_data = {"loggerhead":["templates/*.pt"]},
36
 
    data_files = [
37
 
        ('share/man/man1',['start-loggerhead.1', 'stop-loggerhead.1']),
38
 
        ('share/doc/loggerhead', ['loggerhead.conf.example']),
39
 
        ],
 
71
    packages = ["loggerhead",
 
72
               ],
 
73
    package_data = {"loggerhead":["templates/*"]},
 
74
    data_files=[
 
75
                ('share/man/man1',['start-loggerhead.1', 'stop-loggerhead.1']),
 
76
                ('share/doc/loggerhead', ['loggerhead.conf.example'])
 
77
               ],
 
78
    cmdclass={'install_data':InstallData}
40
79
    )
 
80