setup.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. class PyCryptoInstallCommand(install):
  11. """
  12. A Custom command to download and install pycrypto26
  13. binary from voidspace. Not optimal, but it should work ...
  14. """
  15. description = ("A Custom command to download and install pycrypto26"
  16. "binary from voidspace.")
  17. def run(self):
  18. base_path = "http://www.voidspace.org.uk/downloads/pycrypto26"
  19. if 'win32' in sys.platform:
  20. if not 'AMD64' in sys.version:
  21. pycrypto = 'pycrypto-2.6.win32-py2.7.exe'
  22. else: # 'for AMD64'
  23. pycrypto = 'pycrypto-2.6.win-amd64-py2.7.exe'
  24. os.system('easy_install '+base_path+'/'+pycrypto)
  25. install.run(self)
  26. else:
  27. print(('Please use pip or your Distro\'s package manager '
  28. 'to install pycrypto ...'))
  29. setup(name=pwman.appname,
  30. version=pwman.version,
  31. description=pwman.description,
  32. author=pwman.author,
  33. author_email=pwman.authoremail,
  34. url=pwman.website,
  35. license="GNU GPL",
  36. packages=['pwman',
  37. 'pwman.data',
  38. 'pwman.data.drivers',
  39. 'pwman.exchange',
  40. 'pwman.ui',
  41. 'pwman.util'],
  42. package_data={"data": ["documentation"]},
  43. include_package_data=True,
  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 :: OS Independent',
  55. 'Programming Language :: Python',
  56. 'Programming Language :: Python :: 2.7'
  57. ],
  58. test_suite='pwman.tests.suite',
  59. cmdclass={
  60. 'install_pycrypto': PyCryptoInstallCommand},
  61. )