#!/usr/bin/env python

from distutils.core import setup
from willie import __version__
import tempfile
import os
import shutil


def do_setup():
    setup(name='willie',
          version=__version__,
          description='Simple and extendible IRC bot',
          author='Edward Powell',
          author_email='powell.518@gmail.com',
          url='http://willie.dftba.net/',
          long_description="""Willie is a simple, lightweight, open source, easy-to-use IRC Utility bot, written in Python. It's designed to be easy to use, easy to run, and easy to make new features for. """,
          packages=['willie', 'willie.modules'],
          scripts=['willie.py'],
          license='Eiffel Forum License, version 2',
          platforms='Linux x86, x86-64',
          requires=['MySQLdb', 'feedparser', 'pytz', 'lxml', 'praw', 'enchant', 'pygeoip']
         )

if __name__ == "__main__":
    do_setup()

@@ -138,16 +138,175 @@
 etup():%0A
+    try:%0A        tmp_dir = tempfile.mkdtemp()%0A        tmp_main_script = os.path.join(tmp_dir, 'willie')%0A        shutil.copy('willie.py', tmp_main_script)%0A%0A    
     setu
@@ -322,16 +322,20 @@
 illie',%0A
+    
         
@@ -367,16 +367,20 @@
         
+    
 descript
@@ -422,24 +422,28 @@
 ,%0A          
+  
+  
 author='Edwa
@@ -454,16 +454,20 @@
 owell',%0A
+    
         
@@ -515,16 +515,20 @@
         
+ 
+   
 url='htt
@@ -561,16 +561,20 @@
         
+   
+ 
 long_des
@@ -775,16 +775,20 @@
         
+    
 packages
@@ -828,16 +828,20 @@
         
+    
 scripts=
@@ -845,22 +845,30 @@
 ts=%5B
-'willie.py'%5D,%0A
+tmp_main_script%5D,%0A    
     
@@ -926,16 +926,20 @@
         
+    
 platform
@@ -971,16 +971,20 @@
         
+ 
+   
 requires
@@ -1065,17 +1065,208 @@
         
-)
+    )%0A    finally:%0A        try:%0A            shutil.rmtree(tmp_dir)%0A        except OSError, e:%0A            if e.errno != 2:  # The directory is already gone, so ignore it%0A                raise%0A
 %0A%0Aif __n

Revert "[setup] Fix install problems"