setup.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/env python
  2. """
  3. script to install pwman3
  4. """
  5. from setuptools import setup
  6. import pwman
  7. import sys
  8. from setuptools.command.install import install
  9. import os
  10. import urllib
  11. import shutil
  12. class PyCryptoInstallCommand(install):
  13. """
  14. A Custom command to download and install pycrypto26
  15. binary from voidspace. Not optimal, but it should work ...
  16. """
  17. description = ("A Custom command to download and install pycrypto26"
  18. "binary from voidspace.")
  19. def run(self):
  20. base_path = "http://www.voidspace.org.uk/downloads/pycrypto26"
  21. if 'win32' in sys.platform:
  22. if not 'AMD64' in sys.version:
  23. pycrypto = 'pycrypto-2.6.win32-py2.7.exe'
  24. else: # 'AMD64' in sys.version:
  25. pycrypto = 'pycrypto-2.6.win-amd64-py2.7.exe'
  26. os.system('easy_install '+base_path+'/'+pycrypto)
  27. install.run(self)
  28. else:
  29. print(('Please use pip or your Distro\'s package manager '
  30. 'to install pycrypto ...'))
  31. setup(name=pwman.appname,
  32. version=pwman.version,
  33. description=pwman.description,
  34. author=pwman.author,
  35. author_email=pwman.authoremail,
  36. url=pwman.website,
  37. license="GNU GPL",
  38. packages=['pwman',
  39. 'pwman.data',
  40. 'pwman.data.drivers',
  41. 'pwman.exchange',
  42. 'pwman.ui',
  43. 'pwman.util'],
  44. scripts=['scripts/pwman3'],
  45. zip_safe=False,
  46. install_requires=['pycrypto>=2.6',
  47. 'colorama>=0.2.4'],
  48. classifiers=[
  49. 'Environment :: Console',
  50. 'Intended Audience :: End Users/Desktop',
  51. 'Intended Audience :: Developers',
  52. 'Intended Audience :: System Administrators',
  53. 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
  54. 'Operating System :: MacOS :: MacOS X',
  55. 'Operating System :: Microsoft :: Windows',
  56. 'Operating System :: POSIX',
  57. 'Programming Language :: Python',
  58. 'Programming Language :: Python :: 2.7'
  59. ],
  60. test_suite='pwman.tests',
  61. cmdclass={'install_pycrypto': PyCryptoInstallCommand},
  62. )