Permalink
Browse files

Massive overhaul of setup.py . Moved things around a little to clean up

building/packaging/distributing.  The new setup.py is still incomplete.

TODO:
    0.  Put everything in setup.py that should be there.
    1.  Overhaul cobbler.spec so that it fits in accordance.
    2.  Go so far as to possibly split up cobbler.spec into
        a spec file per target (should make it more manageable
        for modifications in the future)...
  • Loading branch information...
Alex Kesling Scott Henson
Alex Kesling authored and Scott Henson committed Jun 7, 2010
1 parent 7c585c9 commit 230ff2e02c1644f81ffdf88397f140439067a0e7
Showing with 199 additions and 82 deletions.
  1. +5 −0 MANIFEST.in
  2. 0 {templates → obsolete}/cobbler.conf
  3. 0 {templates → obsolete}/ris-linuxd.template
  4. 0 {templates → obsolete}/rsync.exclude
  5. +2 −1 setup.cfg
  6. +104 −81 setup.py
  7. 0 templates/{ → etc}/dhcp.template
  8. 0 templates/{ → etc}/dnsmasq.template
  9. 0 templates/{ → etc}/named.template
  10. 0 templates/{ → etc}/rsync.template
  11. 0 templates/{ → etc}/zone.template
  12. 0 templates/{ → power}/power_apc_snmp.template
  13. 0 templates/{ → power}/power_bladecenter.template
  14. 0 templates/{ → power}/power_bullpap.template
  15. 0 templates/{ → power}/power_drac.template
  16. 0 templates/{ → power}/power_ether_wake.template
  17. 0 templates/{ → power}/power_ilo.template
  18. 0 templates/{ → power}/power_integrity.template
  19. 0 templates/{ → power}/power_ipmilan.template
  20. 0 templates/{ → power}/power_ipmitool.template
  21. 0 templates/{ → power}/power_lpar.template
  22. 0 templates/{ → power}/power_rsa.template
  23. 0 templates/{ → power}/power_virsh.template
  24. 0 templates/{ → power}/power_wti.template
  25. 0 templates/{ → pxe}/pxedefault.template
  26. 0 templates/{ → pxe}/pxelocal.template
  27. 0 templates/{ → pxe}/pxelocal_ia64.template
  28. 0 templates/{ → pxe}/pxelocal_s390x.template
  29. 0 templates/{ → pxe}/pxeprofile.template
  30. 0 templates/{ → pxe}/pxeprofile_s390x.template
  31. 0 templates/{ → pxe}/pxesystem.template
  32. 0 templates/{ → pxe}/pxesystem_ia64.template
  33. 0 templates/{ → pxe}/pxesystem_ppc.template
  34. 0 templates/{ → pxe}/pxesystem_s390x.template
  35. 0 templates/{ → pxe}/s390x_conf.template
  36. 0 templates/{ → pxe}/s390x_parm.template
  37. 0 templates/{ → reporting}/build_report_email.template
  38. +88 −0 web_setup.py
View
@@ -2,3 +2,8 @@ include COPYING AUTHORS README CHANGELOG
include config/cobbler_web.conf
recursive-include web *
+recursive-include templates *
+recursive-include config *
+recursive-include kickstarts *
+recursive-include installer_templates *
+
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -15,4 +15,5 @@ requires="cobbler Django mod_python"
build_requires="python-setuptools-devel python-setuptools"
[install]
-install-purelib=/usr/share/cobbler/
+#install-purelib=/usr/share/cobbler/
+install_data=/usr/share/cobbler/
View
185 setup.py
@@ -1,88 +1,111 @@
#!/usr/bin/env python
+import glob, os
from distutils.core import setup
-#Django Configuration
-dj_config = "/etc/httpd/conf.d/"
-#dj_templates = "/usr/share/cobbler/web/cobbler_web/templates"
-#dj_webui = "/usr/share/cobbler/web/cobbler_web"
-#dj_webui2 = "/usr/share/cobbler/web/cobbler_web/templatetags"
-#dj_webui_proj = "/usr/share/cobbler/web"
-dj_sessions = "/var/lib/cobbler/webui_sessions"
-dj_js = "/var/www/cobbler_webui_content/"
-#Web Content
-wwwcon = "/var/www/cobbler_webui_content"
+## Helper Functions #################################################
+def explode_glob_path(path):
+ """Take a glob and hand back the full recursive expansion,
+ ignoring links.
+ """
+ result = []
+ includes = glob.glob(path)
+ for item in includes:
+ if os.path.isdir(item) and not os.path.islink(item):
+ result.extend(explode_glob_path(os.path.join(item, "*")))
+ else:
+ result.append(item)
+ return result
-setup(
- name = "cobbler-web",
- version = "2.0.4",
- description = "Web interface for Cobbler",
- long_description = "Web interface for Cobbler that allows visiting http://server/cobbler_web to configure the install server.",
- author = "Michael DeHaan",
- author_email = "mdehaan@redhat.com",
- url = "http://fedorahosted.org/cobbler/",
- license = "GPLv2+",
- requires = ["mod_python",
- "cobbler",
- ],
- packages = ["web", "web.cobbler_web", "web.cobbler_web.templatetags"],
-# package_dir = {"cobbler_web": "web/cobbler_web"},
- package_data = {"web.cobbler_web": ["templates/*.tmpl"]},
- data_files = [
- (dj_config, ['config/cobbler_web.conf']),
- (dj_sessions, []),
- (wwwcon, ['web/content/style.css']),
- (wwwcon, ['web/content/logo-cobbler.png']),
- (dj_js, ['web/content/cobbler.js']),
- # FIXME: someday Fedora/EPEL will package these and then we should not embed them then.
- (dj_js, ['web/content/jquery-1.3.2.js']),
- (dj_js, ['web/content/jquery-1.3.2.min.js']),
- (dj_js, ['web/content/jsGrowl_jquery.js']),
- (dj_js, ['web/content/jsGrowl.js']),
- (dj_js, ['web/content/jsgrowl_close.png']),
- (dj_js, ['web/content/jsgrowl_corners.png']),
- (dj_js, ['web/content/jsgrowl_middle_hover.png']),
- (dj_js, ['web/content/jsgrowl_corners_hover.png']),
- (dj_js, ['web/content/jsgrowl_side_hover.png']),
- (dj_js, ['web/content/jsGrowl.css']),
+def proc_data_files(data_files):
+ """Because data_files doesn't natively support globs...
+ let's add them.
+ """
+ result = []
+ for dir,files in data_files:
+ includes = []
+ for item in files:
+ includes.extend(explode_glob_path(item))
+ result.append((dir, includes))
+ return result
- # django webui content
- (dj_config, ['config/cobbler_web.conf']),
-# (dj_templates, ['web/cobbler_web/templates/blank.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/empty.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/enoaccess.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/header.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/index.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/item.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/ksfile_edit.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/ksfile_list.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/snippet_edit.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/snippet_list.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/master.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/message.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/paginate.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/settings.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/generic_edit.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/generic_list.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/generic_delete.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/generic_rename.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/events.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/eventlog.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/import.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/task_created.tmpl']),
-# (dj_templates, ['web/cobbler_web/templates/check.tmpl']),
-
- # django code, private to cobbler-web application
-# (dj_webui, ['web/cobbler_web/__init__.py']),
-# (dj_webui_proj, ['web/__init__.py']),
-# (dj_webui_proj, ['web/urls.py']),
-# (dj_webui_proj, ['web/manage.py']),
-# (dj_webui_proj, ['web/settings.py']),
-# (dj_webui, ['web/cobbler_web/urls.py']),
-# (dj_webui, ['web/cobbler_web/views.py']),
-# (dj_webui2, ['web/cobbler_web/templatetags/site.py']),
-# (dj_webui2, ['web/cobbler_web/templatetags/__init__.py']),
- (dj_sessions, []),
- ],
+def make_manpages():
+ """Generate the man pages... this is currently done through POD,
+ possible future version may do this through some Python mechanism
+ (maybe conversion from ReStructured Text (.rst))...
+ """
+ manpages = {
+ "cobbler": 'pod2man --center="cobbler" --release="" ./docs/cobbler.pod | gzip -c > ./docs/cobbler.1.gz',
+ "koan": 'pod2man --center="koan" --release="" ./docs/koan.pod | gzip -c > ./docs/koan.1.gz',
+ "cobbler-register": 'pod2man --center="cobbler-register" --release="" ./docs/cobbler-register.pod | gzip -c > ./docs/cobbler-register.1.gz',
+ }
+
+ #Actually build them
+ for man, cmd in manpages.items():
+ if os.spawn(cmd):
+ print "Creation of %s manpage failed." % man
+ exit(1)
-)
+
+
+## Actual Setup Script ##############################################
+if __name__ == "__main__":
+
+ make_manpages()
+
+# See the comment associated with data_files listings which use these below
+# #Django Configuration
+# dj_config = "/etc/httpd/conf.d/"
+# dj_sessions = "/var/lib/cobbler/webui_sessions"
+
+ setup(
+ name = "cobbler",
+ version = "2.0.4",
+ description = "Boot server configurator",
+ long_description = "Cobbler is a network install server. Cobbler supports PXE, virtualized installs, and reinstalling existing Linux machines. The last two modes use a helper tool, 'koan', that integrates with cobbler. There is also a web interface 'cobbler-web'. Cobbler's advanced features include importing distributions from DVDs and rsync mirrors, kickstart templating, integrated yum mirroring, and built-in DHCP/DNS Management. Cobbler has a XMLRPC API for integration with other applications.",
+ author = "Michael DeHaan",
+ author_email = "mdehaan@redhat.com",
+ url = "http://fedorahosted.org/cobbler/",
+ license = "GPLv2+",
+ requires = [
+ "mod_python",
+ "cobbler",
+ ],
+ packages = [
+ "cobbler",
+ "cobbler/modules",
+ "koan",
+ "web",
+ "web.cobbler_web",
+ "web.cobbler_web.templatetags",
+ ],
+ package_dir = {
+ "cobbler_web": "web/cobbler_web",
+ },
+#If only our target was python >= 2.4
+# package_data = {
+# "web": ["web/content/*"],
+# "web.cobbler_web": ["templates/*.tmpl"],
+# },
+ scripts = [
+ "scripts/cobbler",
+ "scripts/cobblerd",
+ "scripts/cobbler-ext-nodes",
+ "scripts/koan",
+ "scripts/cobbler-register",
+ ],
+ data_files = proc_data_files([
+ ("aux", ["aux/*"]),
+ ("config", ["config/*"]),
+ ("docs", ["docs/*.gz"]),
+ ("installer_templates", ["installer_templates/*"]),
+ ("kickstarts", ["kickstarts/*"]),
+ ("snippets", ["snippets/*"]),
+ ("templates", ["templates/*"]),
+ ("web/content", ["web/content/*"]),
+ ("web/templates", ["web/cobbler_web/templates/*"]),
+#These need to be placed in the RPM or whatever OS specific installer is being used...
+# (dj_config, ['config/cobbler_web.conf']),
+# (dj_sessions, []),
+ ]),
+ )
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,88 @@
+#!/usr/bin/env python
+from distutils.core import setup
+
+#Django Configuration
+dj_config = "/etc/httpd/conf.d/"
+#dj_templates = "/usr/share/cobbler/web/cobbler_web/templates"
+#dj_webui = "/usr/share/cobbler/web/cobbler_web"
+#dj_webui2 = "/usr/share/cobbler/web/cobbler_web/templatetags"
+#dj_webui_proj = "/usr/share/cobbler/web"
+dj_sessions = "/var/lib/cobbler/webui_sessions"
+dj_js = "/var/www/cobbler_webui_content/"
+
+#Web Content
+wwwcon = "/var/www/cobbler_webui_content"
+
+setup(
+ name = "cobbler-web",
+ version = "2.0.4",
+ description = "Web interface for Cobbler",
+ long_description = "Web interface for Cobbler that allows visiting http://server/cobbler_web to configure the install server.",
+ author = "Michael DeHaan",
+ author_email = "mdehaan@redhat.com",
+ url = "http://fedorahosted.org/cobbler/",
+ license = "GPLv2+",
+ requires = ["mod_python",
+ "cobbler",
+ ],
+ packages = ["web", "web.cobbler_web", "web.cobbler_web.templatetags"],
+ package_dir = {"cobbler_web": "web/cobbler_web"},
+ package_data = {"web.cobbler_web": ["templates/*.tmpl"]},
+ data_files = [
+ (dj_config, ['config/cobbler_web.conf']),
+ (dj_sessions, []),
+ (wwwcon, ['web/content/style.css']),
+ (wwwcon, ['web/content/logo-cobbler.png']),
+ (dj_js, ['web/content/cobbler.js']),
+ # FIXME: someday Fedora/EPEL will package these and then we should not embed them then.
+ (dj_js, ['web/content/jquery-1.3.2.js']),
+ (dj_js, ['web/content/jquery-1.3.2.min.js']),
+ (dj_js, ['web/content/jsGrowl_jquery.js']),
+ (dj_js, ['web/content/jsGrowl.js']),
+ (dj_js, ['web/content/jsgrowl_close.png']),
+ (dj_js, ['web/content/jsgrowl_corners.png']),
+ (dj_js, ['web/content/jsgrowl_middle_hover.png']),
+ (dj_js, ['web/content/jsgrowl_corners_hover.png']),
+ (dj_js, ['web/content/jsgrowl_side_hover.png']),
+ (dj_js, ['web/content/jsGrowl.css']),
+#
+# # django webui content
+ (dj_config, ['config/cobbler_web.conf']),
+# (dj_templates, ['web/cobbler_web/templates/blank.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/empty.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/enoaccess.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/header.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/index.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/item.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/ksfile_edit.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/ksfile_list.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/snippet_edit.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/snippet_list.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/master.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/message.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/paginate.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/settings.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/generic_edit.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/generic_list.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/generic_delete.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/generic_rename.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/events.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/eventlog.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/import.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/task_created.tmpl']),
+# (dj_templates, ['web/cobbler_web/templates/check.tmpl']),
+
+# # django code, private to cobbler-web application
+# (dj_webui, ['web/cobbler_web/__init__.py']),
+# (dj_webui_proj, ['web/__init__.py']),
+# (dj_webui_proj, ['web/urls.py']),
+# (dj_webui_proj, ['web/manage.py']),
+# (dj_webui_proj, ['web/settings.py']),
+# (dj_webui, ['web/cobbler_web/urls.py']),
+# (dj_webui, ['web/cobbler_web/views.py']),
+# (dj_webui2, ['web/cobbler_web/templatetags/site.py']),
+# (dj_webui2, ['web/cobbler_web/templatetags/__init__.py']),
+ (dj_sessions, []),
+ ],
+
+)

0 comments on commit 230ff2e

Please sign in to comment.