#!/usr/bin/env python """The Crawler package setup""" # Copyright 2005, 2006 EIAO Consoritum # This program is distributed under the terms of the GNU General # Public License. # # This file is part of the European Internet Accessibility Observatory # (EIAO) # # EIAO is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # EIAO is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with EIAO; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301 USA __author__ = "Terje Gjosater" __maintainer__ = "Terje Gjosater, Morten Goodwin Olsen" __version__ = 0.1 import sys import os from distutils.core import setup fail = False def run_tests(): global fail try: import test for res in test.result: if res[0] > 0: fail = True except: print 'Could not run tests. Check test.py' if fail: print 'One of more tests failed. Installation will stop.' else: print 'Test ran successful.' try: run_tests() except ImportError, e: print e print 'Required modules not found for test, assuming you are doing a fresh installation' if not fail and 'install' in sys.argv: setup(name = "Crawler wrapper", version="0.1", description="Crawler wrapper.", author="European Internet Accessibility Observatory", author_email="developer@eiao.net", url="http://www.eiao.net", py_modules=[], packages=[], scripts=['crawlers'] ) os.system("cp init.d/crawlers /etc/init.d") try: os.stat("/etc/rc3.d/S93crawlers") except OSError: os.symlink("/etc/init.d/crawlers","/etc/rc3.d/S93crawlers")