setup.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Ducker - search with DuckDuckGo from the command line
  2. # Copyright (C) 2016-2017 Jorge Maldonado Ventura <jorgesumle@freakspot.net>
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. import os
  14. import warnings
  15. try:
  16. from setuptools import setup
  17. setuptools_available = True
  18. except ImportError:
  19. from distutils.core import setup
  20. setuptools_available = False
  21. if os.name == 'nt':
  22. data_files = []
  23. else:
  24. texinfo_manual_path = 'docs/_build/texinfo/ducker.info'
  25. data_files = [
  26. ('/usr/share/man/man1', ['ducker.1']),
  27. ('/etc/bash_completion.d', ['autocompletion/bash/ducker.bash'])
  28. ]
  29. if os.path.exists('/etc/fish/completions'):
  30. data_files.append(('/etc/fish/completions', ['autocompletion/fish/ducker.fish']))
  31. if os.path.isfile(texinfo_manual_path):
  32. data_files.append(('/usr/share/info', [texinfo_manual_path]))
  33. else:
  34. warnings.warn('''The program should install correctly. But in order to
  35. also install the info page, you should execute make info
  36. in the docs directory and then run the installation
  37. again''')
  38. if setuptools_available:
  39. setuptools_compatibility_options = {
  40. 'entry_points': {'console_scripts': ['ducker=ducker:main', 'duck=ducker:main']}
  41. }
  42. else:
  43. import shutil
  44. if not os.path.exists('build/_scripts'):
  45. os.makedirs('build/_scripts')
  46. shutil.copyfile('run_ducker.py', 'build/_scripts/ducker')
  47. setuptools_compatibility_options = {'scripts': ['build/_scripts/ducker']}
  48. setup(
  49. name='ducker',
  50. version=__import__('ducker').__version__,
  51. author='Jorge Maldonado Ventura',
  52. author_email='jorgesumle@freakspot.net',
  53. description='''Program that lets you search with DuckDuckGo from the
  54. command line.''',
  55. license='GNU General Public License v3 (GPLv3)',
  56. keywords='CLI DuckDuckGo search terminal',
  57. url='https://www.freakspot.net/programas/ducker/',
  58. packages=['ducker'],
  59. classifiers=[
  60. 'Environment :: Console',
  61. 'Intended Audience :: Developers',
  62. 'Intended Audience :: End Users/Desktop',
  63. 'Intended Audience :: System Administrators',
  64. 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
  65. 'Programming Language :: Python',
  66. 'Programming Language :: Python :: 3',
  67. 'Programming Language :: Python :: 3.3',
  68. 'Programming Language :: Python :: 3.4',
  69. 'Programming Language :: Python :: 3.5',
  70. 'Programming Language :: Python :: 3.6',
  71. 'Topic :: Internet',
  72. 'Topic :: Internet :: WWW/HTTP',
  73. 'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
  74. ],
  75. data_files=data_files,
  76. **setuptools_compatibility_options
  77. )