#!/usr/bin/env python """The Crawler package setup""" # Copyright 2008-2010 eGovMon # This program is distributed under the terms of the GNU General # Public License. # # This file is part of the eGovernment Monitoring # (eGovMon) # # eGovMon 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. # # eGovMon 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 eGovMon; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301 USA __author__ = "Terje Gjosater" __version__ = "$Revision$" __updated__ = "$LastChangedDate$" import sys import os from distutils.core import setup return #This is outdated modules=['configparser','logger','urlparser','config', 'eGovMonStaticConfig','eGovMonHarvestManError','options','urlproc','connector', 'pageparser','urlqueue','crawlererror','harvestmanklass', 'urlthread','crawler','harvestman','robotparser','urltypes', 'hooks','rules','utils','datamgr','writestats','install', 'urlcollections'] 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="eGovernment Monitor", author_email="maintainer@egovmon.no", url="http://www.egovmon.no", py_modules=modules, packages=['common','plugins'], scripts=['crawlerwrapper','debugcrawler'] ) for dir in ["storedfiles","config","../HarvestMan/EIAOHarvestMan2/js"]: p="/var/local/cache/egovmon/harvestman/" os.system("test -d %s%s || mkdir -p %s%s" % (p,dir,p,dir)) os.chown("/var/log/egovmon",os.getuid(),99) os.chmod("/var/log/egovmon",00775) os.system("cp config.template /etc/egovmon")