setup.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # This file is part of Radicale Server - Calendar Server
  5. # Copyright © 2009-2010 Guillaume Ayoub
  6. #
  7. # This library is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This library is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
  19. """
  20. Radicale CalDAV server
  21. ======================
  22. The Radicale Project is a CalDAV calendar server. It aims to be a light
  23. solution, easy to use, easy to install, easy to configure. As a consequence,
  24. it requires few software dependances and is pre-configured to work
  25. out-of-the-box.
  26. The Radicale Project runs on most of the UNIX-like platforms (Linux, *BSD,
  27. MacOS X) and Windows. It is known to work with Lightning and Sunbird 0.9+. It
  28. is free and open-source software, released under GPL version 3.
  29. For further information, please visit the `Radicale Website
  30. <http://www.radicale.org/>`_.
  31. """
  32. import os
  33. import shutil
  34. from distutils.core import setup, Command
  35. from distutils.command.build_scripts import build_scripts
  36. class BuildScripts(build_scripts):
  37. """Build the package."""
  38. def run(self):
  39. """Run building."""
  40. self.mkpath(self.build_dir)
  41. for script in self.scripts:
  42. root, _ = os.path.splitext(script)
  43. self.copy_file(script, os.path.join(self.build_dir, root))
  44. class Clean(Command):
  45. """Clean up package temporary files."""
  46. description = "clean up package temporary files"
  47. user_options = []
  48. def initialize_options(self):
  49. """Pre-processing."""
  50. pass
  51. def finalize_options(self):
  52. """Post-processing."""
  53. pass
  54. def run(self):
  55. """Run clean up."""
  56. path = os.path.abspath(os.path.dirname(__file__))
  57. for pathname, _, files in os.walk(path):
  58. for filename in filter(self._should_remove, files):
  59. os.unlink(os.path.join(pathname, filename))
  60. for folder in ("build", "dist"):
  61. if os.path.isdir(os.path.join(path, folder)):
  62. shutil.rmtree(os.path.join(path, folder))
  63. if os.path.isfile(os.path.join(path, "MANIFEST")):
  64. os.unlink(os.path.join(path, "MANIFEST"))
  65. @staticmethod
  66. def _should_remove(filename):
  67. """Return if ``filename`` should be considered as temporary."""
  68. return (os.path.splitext(filename)[1] == ".pyc" or
  69. os.path.splitext(filename)[1] == ".pyo" or
  70. filename.endswith("~") or
  71. (filename.startswith("#") and filename.endswith("#")))
  72. setup(
  73. name="Radicale",
  74. version="0.2",
  75. description="CalDAV Server",
  76. long_description=__doc__,
  77. author="Guillaume Ayoub",
  78. author_email="guillaume.ayoub@kozea.fr",
  79. url="http://www.radicale.org/",
  80. license="GNU GPL v3",
  81. platforms="Any",
  82. packages=["radicale", "radicale.acl"],
  83. provides=["radicale"],
  84. scripts=["radicale.py"],
  85. cmdclass={"clean": Clean,
  86. "build_scripts": BuildScripts},
  87. classifiers=[
  88. "Development Status :: 4 - Beta",
  89. "Environment :: Console",
  90. "Environment :: Web Environment",
  91. "Intended Audience :: End Users/Desktop",
  92. "Intended Audience :: Information Technology",
  93. "License :: OSI Approved :: GNU General Public License (GPL)",
  94. "Operating System :: OS Independent",
  95. "Programming Language :: Python :: 2",
  96. "Programming Language :: Python :: 2.5",
  97. "Programming Language :: Python :: 2.6",
  98. "Programming Language :: Python :: 3",
  99. "Programming Language :: Python :: 3.0",
  100. "Programming Language :: Python :: 3.1",
  101. "Topic :: Office/Business :: Groupware"])