Blame SOURCES/0018-adapt-setup.py-for-both-py2-and-py3.patch

1070a0
From 9d02d75f09b8e6612acb22eb0a9777df63397730 Mon Sep 17 00:00:00 2001
1070a0
From: Jan Dobes <jdobes@redhat.com>
1070a0
Date: Thu, 12 Oct 2017 10:20:54 +0200
1070a0
Subject: [PATCH 18/18] adapt setup.py for both py2 and py3
1070a0
1070a0
(cherry picked from commit 84ef184850f29638f07d2540a9ec35b4fb6c5095)
1070a0
1070a0
Conflicts:
1070a0
  setup.py
1070a0
---
1070a0
 setup.py | 376 ++++++++++++++++++++++++++++++++++-----------------------------
1070a0
 1 file changed, 203 insertions(+), 173 deletions(-)
1070a0
1070a0
diff --git a/setup.py b/setup.py
1070a0
index 045abd7..38ee962 100644
1070a0
--- a/setup.py
1070a0
+++ b/setup.py
1070a0
@@ -4,12 +4,13 @@ import sys
1070a0
 import os.path
1070a0
 from distutils.core import setup, Extension
1070a0
 import string
1070a0
-import yaml # PyYAML
1070a0
+if sys.version_info[0] == 2:
1070a0
+    import yaml # PyYAML
1070a0
+    import Cheetah.Template as Template
1070a0
 try:
1070a0
     import subprocess
1070a0
 except:
1070a0
     import cobbler.sub_process as subprocess
1070a0
-import Cheetah.Template as Template
1070a0
 import time
1070a0
 
1070a0
 VERSION = "2.0.7"
1070a0
@@ -67,63 +68,64 @@ def gen_config():
1070a0
     templatify(MODULES_TEMPLATE, defaults, os.path.join(OUTPUT_DIR, "modules.conf"))
1070a0
     templatify(SETTINGS_TEMPLATE, defaults, os.path.join(OUTPUT_DIR, "settings"))
1070a0
 
1070a0
-if __name__ == "__main__":
1070a0
+
1070a0
+def py2_setup():
1070a0
     gen_build_version()
1070a0
     gen_config()
1070a0
 
1070a0
     # etc configs
1070a0
-    etcpath     = "/etc/cobbler"
1070a0
-    initpath    = "/etc/init.d"
1070a0
-    rotpath       = "/etc/logrotate.d"
1070a0
-    powerpath   = etcpath + "/power"
1070a0
-    pxepath     = etcpath + "/pxe"
1070a0
-    reppath     = etcpath + "/reporting"
1070a0
-    zonepath    = etcpath + "/zone_templates"
1070a0
+    etcpath = "/etc/cobbler"
1070a0
+    initpath = "/etc/init.d"
1070a0
+    rotpath = "/etc/logrotate.d"
1070a0
+    powerpath = etcpath + "/power"
1070a0
+    pxepath = etcpath + "/pxe"
1070a0
+    reppath = etcpath + "/reporting"
1070a0
+    zonepath = etcpath + "/zone_templates"
1070a0
 
1070a0
     # lib paths
1070a0
-    libpath     = "/var/lib/cobbler"
1070a0
-    backpath    = libpath + "/backup"
1070a0
-    trigpath    = libpath + "/triggers"
1070a0
+    libpath = "/var/lib/cobbler"
1070a0
+    backpath = libpath + "/backup"
1070a0
+    trigpath = libpath + "/triggers"
1070a0
     snippetpath = libpath + "/snippets"
1070a0
-    kickpath    = libpath + "/kickstarts"
1070a0
-    dbpath      = libpath + "/config"
1070a0
-    loadpath    = libpath + "/loaders"
1070a0
+    kickpath = libpath + "/kickstarts"
1070a0
+    dbpath = libpath + "/config"
1070a0
+    loadpath = libpath + "/loaders"
1070a0
 
1070a0
     # share paths
1070a0
-    sharepath   = "/usr/share/cobbler"
1070a0
-    itemplates  = sharepath + "/installer_templates"
1070a0
-    wwwtmpl     = sharepath + "/webui_templates"
1070a0
-    manpath     = "share/man/man1"
1070a0
-    spool_koan  = "/var/spool/koan"
1070a0
+    sharepath = "/usr/share/cobbler"
1070a0
+    itemplates = sharepath + "/installer_templates"
1070a0
+    wwwtmpl = sharepath + "/webui_templates"
1070a0
+    manpath = "share/man/man1"
1070a0
+    spool_koan = "/var/spool/koan"
1070a0
 
1070a0
     # www paths
1070a0
-    wwwpath  = "/var/www/cobbler"
1070a0
+    wwwpath = "/var/www/cobbler"
1070a0
     if os.path.exists("/etc/SuSE-release"):
1070a0
-        wwwconf  = "/etc/apache2/conf.d"
1070a0
+        wwwconf = "/etc/apache2/conf.d"
1070a0
     elif os.path.exists("/etc/debian_version"):
1070a0
-        wwwconf  = "/etc/apache2/conf.d"
1070a0
+        wwwconf = "/etc/apache2/conf.d"
1070a0
     else:
1070a0
-        wwwconf  = "/etc/httpd/conf.d"
1070a0
+        wwwconf = "/etc/httpd/conf.d"
1070a0
 
1070a0
-    wwwcon   = "/var/www/cobbler_webui_content"
1070a0
+    wwwcon = "/var/www/cobbler_webui_content"
1070a0
     vw_localmirror = wwwpath + "/localmirror"
1070a0
-    vw_kickstarts  = wwwpath + "/kickstarts"
1070a0
-    vw_kickstarts_sys  = wwwpath + "/kickstarts_sys"
1070a0
+    vw_kickstarts = wwwpath + "/kickstarts"
1070a0
+    vw_kickstarts_sys = wwwpath + "/kickstarts_sys"
1070a0
     vw_repomirror = wwwpath + "/repo_mirror"
1070a0
-    vw_ksmirror   = wwwpath + "/ks_mirror"
1070a0
-    vw_ksmirrorc  = wwwpath + "/ks_mirror/config"
1070a0
-    vw_images     = wwwpath + "/images"
1070a0
-    vw_distros    = wwwpath + "/distros"
1070a0
-    vw_systems    = wwwpath + "/systems"
1070a0
-    vw_profiles   = wwwpath + "/profiles"
1070a0
-    vw_links      = wwwpath + "/links"
1070a0
-    vw_aux        = wwwpath + "/aux"
1070a0
-    modpython     = wwwpath + "/web"
1070a0
-    modwsgisvc    = wwwpath + "/svc"
1070a0
-    modpythonsvc  = modwsgisvc
1070a0
+    vw_ksmirror = wwwpath + "/ks_mirror"
1070a0
+    vw_ksmirrorc = wwwpath + "/ks_mirror/config"
1070a0
+    vw_images = wwwpath + "/images"
1070a0
+    vw_distros = wwwpath + "/distros"
1070a0
+    vw_systems = wwwpath + "/systems"
1070a0
+    vw_profiles = wwwpath + "/profiles"
1070a0
+    vw_links = wwwpath + "/links"
1070a0
+    vw_aux = wwwpath + "/aux"
1070a0
+    modpython = wwwpath + "/web"
1070a0
+    modwsgisvc = wwwpath + "/svc"
1070a0
+    modpythonsvc = modwsgisvc
1070a0
 
1070a0
     # log paths
1070a0
-    logpath  = "/var/log/cobbler"
1070a0
+    logpath = "/var/log/cobbler"
1070a0
     logpath2 = logpath + "/kicklog"
1070a0
     logpath3 = logpath + "/syslog"
1070a0
     logpath4 = "/var/log/httpd/cobbler"
1070a0
@@ -132,123 +134,123 @@ if __name__ == "__main__":
1070a0
     logpath7 = logpath + "/tasks"
1070a0
 
1070a0
     # django content
1070a0
-    dj_config    = "/etc/httpd/conf.d/"
1070a0
+    dj_config = "/etc/httpd/conf.d/"
1070a0
     dj_templates = "/usr/share/cobbler/web/cobbler_web/templates"
1070a0
-    dj_webui     = "/usr/share/cobbler/web/cobbler_web"
1070a0
-    dj_webui2    = "/usr/share/cobbler/web/cobbler_web/templatetags"
1070a0
-    dj_webui_proj= "/usr/share/cobbler/web"
1070a0
-    dj_sessions  = "/var/lib/cobbler/webui_sessions"
1070a0
-    dj_js        = "/var/www/cobbler_webui_content/"
1070a0
+    dj_webui = "/usr/share/cobbler/web/cobbler_web"
1070a0
+    dj_webui2 = "/usr/share/cobbler/web/cobbler_web/templatetags"
1070a0
+    dj_webui_proj = "/usr/share/cobbler/web"
1070a0
+    dj_sessions = "/var/lib/cobbler/webui_sessions"
1070a0
+    dj_js = "/var/www/cobbler_webui_content/"
1070a0
 
1070a0
     setup(
1070a0
         name="cobbler",
1070a0
-        version = VERSION,
1070a0
-        author = "Michael DeHaan",
1070a0
-        author_email = "mdehaan@redhat.com",
1070a0
-        url = "http://fedorahosted.org/cobbler/",
1070a0
-        license = "GPL",
1070a0
-        packages = [
1070a0
+        version=VERSION,
1070a0
+        author="Michael DeHaan",
1070a0
+        author_email="mdehaan@redhat.com",
1070a0
+        url="http://fedorahosted.org/cobbler/",
1070a0
+        license="GPL",
1070a0
+        packages= [
1070a0
             "cobbler",
1070a0
             "cobbler/modules",
1070a0
             "koan"
1070a0
         ],
1070a0
-        scripts = [
1070a0
+        scripts=[
1070a0
             "scripts/cobbler",
1070a0
             "scripts/cobblerd",
1070a0
             "scripts/cobbler-ext-nodes",
1070a0
             "scripts/koan",
1070a0
             "scripts/cobbler-register"
1070a0
         ],
1070a0
-        data_files = [
1070a0
+        data_files=[
1070a0
             (modpythonsvc, ['scripts/services.py']),
1070a0
-            (modwsgisvc,   ['scripts/services.wsgi']),
1070a0
+            (modwsgisvc, ['scripts/services.wsgi']),
1070a0
 
1070a0
             # miscellaneous config files
1070a0
-            (rotpath,  ['config/cobblerd_rotate']),
1070a0
-            (wwwconf,  ['config/cobbler.conf']),
1070a0
-            (wwwconf,  ['config/cobbler_wsgi.conf']),
1070a0
-            (libpath,  ['config/cobbler_hosts']),
1070a0
-            (etcpath,  ['config/modules.conf']),
1070a0
-            (etcpath,  ['config/users.digest']),
1070a0
-            (etcpath,  ['config/rsync.exclude']),
1070a0
-            (etcpath,  ['config/users.conf']),
1070a0
-            (etcpath,  ['config/cheetah_macros']),
1070a0
+            (rotpath, ['config/cobblerd_rotate']),
1070a0
+            (wwwconf, ['config/cobbler.conf']),
1070a0
+            (wwwconf, ['config/cobbler_wsgi.conf']),
1070a0
+            (libpath, ['config/cobbler_hosts']),
1070a0
+            (etcpath, ['config/modules.conf']),
1070a0
+            (etcpath, ['config/users.digest']),
1070a0
+            (etcpath, ['config/rsync.exclude']),
1070a0
+            (etcpath, ['config/users.conf']),
1070a0
+            (etcpath, ['config/cheetah_macros']),
1070a0
             (initpath, ['config/cobblerd']),
1070a0
-            (etcpath,  ['config/settings']),
1070a0
+            (etcpath, ['config/settings']),
1070a0
 
1070a0
             # django webui content
1070a0
-            (dj_config,    [ 'config/cobbler_web.conf' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/blank.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/empty.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/enoaccess.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/error_page.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/header.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/index.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/item.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/ksfile_edit.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/ksfile_list.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/snippet_edit.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/snippet_list.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/master.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/message.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/paginate.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/settings.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/generic_edit.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/generic_list.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/generic_delete.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/generic_rename.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/events.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/eventlog.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/import.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/task_created.tmpl' ]),
1070a0
-            (dj_templates, [ 'web/cobbler_web/templates/check.tmpl' ]),
1070a0
+            (dj_config, ['config/cobbler_web.conf']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/blank.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/empty.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/enoaccess.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/error_page.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/header.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/index.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/item.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/ksfile_edit.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/ksfile_list.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/snippet_edit.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/snippet_list.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/master.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/message.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/paginate.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/settings.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/generic_edit.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/generic_list.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/generic_delete.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/generic_rename.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/events.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/eventlog.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/import.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/task_created.tmpl']),
1070a0
+            (dj_templates, ['web/cobbler_web/templates/check.tmpl']),
1070a0
 
1070a0
             # django code, private to cobbler-web application
1070a0
-            (dj_webui,       [ 'web/cobbler_web/__init__.py' ]),
1070a0
-            (dj_webui_proj,  [ 'web/__init__.py' ]),
1070a0
-            (dj_webui_proj,  [ 'web/urls.py' ]),
1070a0
-            (dj_webui_proj,  [ 'web/manage.py' ]),
1070a0
-            (dj_webui_proj,  [ 'web/settings.py' ]),
1070a0
-            (dj_webui,       [ 'web/cobbler_web/urls.py' ]),
1070a0
-            (dj_webui,       [ 'web/cobbler_web/views.py' ]),
1070a0
-            (dj_webui2,      [ 'web/cobbler_web/templatetags/site.py' ]),
1070a0
-            (dj_webui2,      [ 'web/cobbler_web/templatetags/__init__.py' ]),
1070a0
-            (dj_sessions,  []),
1070a0
+            (dj_webui, ['web/cobbler_web/__init__.py']),
1070a0
+            (dj_webui_proj, ['web/__init__.py']),
1070a0
+            (dj_webui_proj, ['web/urls.py']),
1070a0
+            (dj_webui_proj, ['web/manage.py']),
1070a0
+            (dj_webui_proj, ['web/settings.py']),
1070a0
+            (dj_webui, ['web/cobbler_web/urls.py']),
1070a0
+            (dj_webui, ['web/cobbler_web/views.py']),
1070a0
+            (dj_webui2, ['web/cobbler_web/templatetags/site.py']),
1070a0
+            (dj_webui2, ['web/cobbler_web/templatetags/__init__.py']),
1070a0
+            (dj_sessions, []),
1070a0
 
1070a0
             # backups for upgrades
1070a0
             (backpath, []),
1070a0
 
1070a0
             # for --version support across distros
1070a0
-            (libpath,  ['config/version']),
1070a0
+            (libpath, ['config/version']),
1070a0
 
1070a0
             # bootloaders and syslinux support files
1070a0
             # we only package zpxe.rexx because it's source
1070a0
             # user supplies the others
1070a0
-            (loadpath,  ['scripts/zpxe.rexx']),
1070a0
+            (loadpath, ['scripts/zpxe.rexx']),
1070a0
 
1070a0
             # database/serializer
1070a0
-            (dbpath + "/distros.d",  []),
1070a0
+            (dbpath + "/distros.d", []),
1070a0
             (dbpath + "/profiles.d", []),
1070a0
-            (dbpath + "/systems.d",  []),
1070a0
-            (dbpath + "/repos.d",    []),
1070a0
-            (dbpath + "/images.d",   []),
1070a0
+            (dbpath + "/systems.d", []),
1070a0
+            (dbpath + "/repos.d", []),
1070a0
+            (dbpath + "/images.d", []),
1070a0
 
1070a0
             # sample kickstart files
1070a0
-            (kickpath,  ['kickstarts/legacy.ks']),
1070a0
-            (kickpath,  ['kickstarts/sample.ks']),
1070a0
-            (kickpath,  ['kickstarts/sample_end.ks']),
1070a0
-            (kickpath,  ['kickstarts/default.ks']),
1070a0
-            (kickpath,  ['kickstarts/pxerescue.ks']),
1070a0
+            (kickpath, ['kickstarts/legacy.ks']),
1070a0
+            (kickpath, ['kickstarts/sample.ks']),
1070a0
+            (kickpath, ['kickstarts/sample_end.ks']),
1070a0
+            (kickpath, ['kickstarts/default.ks']),
1070a0
+            (kickpath, ['kickstarts/pxerescue.ks']),
1070a0
 
1070a0
             # seed files for debian
1070a0
-            (kickpath,  ['kickstarts/sample.seed']),
1070a0
+            (kickpath, ['kickstarts/sample.seed']),
1070a0
 
1070a0
             # templates for DHCP, DNS, TFTP, RSYNC
1070a0
-            (etcpath,  ['templates/dhcp.template']),
1070a0
-            (etcpath,  ['templates/dnsmasq.template']),
1070a0
-            (etcpath,  ['templates/named.template']),
1070a0
-            (etcpath,  ['templates/zone.template']),
1070a0
-            (etcpath,  ['templates/rsync.template']),
1070a0
+            (etcpath, ['templates/dhcp.template']),
1070a0
+            (etcpath, ['templates/dnsmasq.template']),
1070a0
+            (etcpath, ['templates/named.template']),
1070a0
+            (etcpath, ['templates/zone.template']),
1070a0
+            (etcpath, ['templates/rsync.template']),
1070a0
 
1070a0
             # templates for netboot configs
1070a0
             (pxepath,  ['templates/pxedefault.template']),
1070a0
@@ -283,7 +285,7 @@ if __name__ == "__main__":
1070a0
             (powerpath, ['templates/power_virsh.template']),
1070a0
 
1070a0
             # templates for reporting
1070a0
-            (reppath,   ['templates/build_report_email.template']),
1070a0
+            (reppath, ['templates/build_report_email.template']),
1070a0
 
1070a0
             # templates for setup
1070a0
             (itemplates, ['installer_templates/modules.conf.template']),
1070a0
@@ -313,12 +315,12 @@ if __name__ == "__main__":
1070a0
             (snippetpath, ['snippets/log_ks_post']),
1070a0
 
1070a0
             # documentation
1070a0
-            (manpath,  ['docs/cobbler.1.gz']),
1070a0
-            (manpath,  ['docs/koan.1.gz']),
1070a0
-            (manpath,  ['docs/cobbler-register.1.gz']),
1070a0
+            (manpath, ['docs/cobbler.1.gz']),
1070a0
+            (manpath, ['docs/koan.1.gz']),
1070a0
+            (manpath, ['docs/cobbler-register.1.gz']),
1070a0
 
1070a0
             # logfiles
1070a0
-            (logpath,  []),
1070a0
+            (logpath, []),
1070a0
             (logpath2, []),
1070a0
             (logpath3, []),
1070a0
             (logpath4, []),
1070a0
@@ -330,72 +332,100 @@ if __name__ == "__main__":
1070a0
             (spool_koan, []),
1070a0
 
1070a0
             # web page directories that we own
1070a0
-            (vw_localmirror,    []),
1070a0
-            (vw_kickstarts,     []),
1070a0
+            (vw_localmirror, []),
1070a0
+            (vw_kickstarts, []),
1070a0
             (vw_kickstarts_sys, []),
1070a0
-            (vw_repomirror,     []),
1070a0
-            (vw_ksmirror,       []),
1070a0
-            (vw_ksmirrorc,      []),
1070a0
-            (vw_distros,        []),
1070a0
-            (vw_images,         []),
1070a0
-            (vw_systems,        []),
1070a0
-            (vw_profiles,       []),
1070a0
-            (vw_links,          []),
1070a0
-            (vw_aux,            []),
1070a0
+            (vw_repomirror, []),
1070a0
+            (vw_ksmirror, []),
1070a0
+            (vw_ksmirrorc, []),
1070a0
+            (vw_distros, []),
1070a0
+            (vw_images, []),
1070a0
+            (vw_systems, []),
1070a0
+            (vw_profiles, []),
1070a0
+            (vw_links, []),
1070a0
+            (vw_aux, []),
1070a0
 
1070a0
             # zone-specific templates directory
1070a0
-            (zonepath,    []),
1070a0
+            (zonepath, []),
1070a0
 
1070a0
             # Web UI templates for object viewing & modification
1070a0
             # FIXME: other templates to add as they are created.
1070a0
             # slurp in whole directory?
1070a0
 
1070a0
             # Web UI support files
1070a0
-            (wwwcon,            ['web/content/style.css']),
1070a0
-            (wwwcon,            ['web/content/logo-cobbler.png']),
1070a0
-            (modpython,         ['web/content/index.html']),
1070a0
-            (wwwpath + "/pub",  []),
1070a0
-            (dj_js,             ['web/content/cobbler.js']),
1070a0
+            (wwwcon, ['web/content/style.css']),
1070a0
+            (wwwcon, ['web/content/logo-cobbler.png']),
1070a0
+            (modpython, ['web/content/index.html']),
1070a0
+            (wwwpath + "/pub", []),
1070a0
+            (dj_js, ['web/content/cobbler.js']),
1070a0
             # FIXME: someday Fedora/EPEL will package these and then we should not embed them then.
1070a0
-            (dj_js,             ['web/content/jquery-1.3.2.js']),
1070a0
-            (dj_js,             ['web/content/jquery-1.3.2.min.js']),
1070a0
-            (dj_js,             ['web/content/jsGrowl_jquery.js']),
1070a0
-            (dj_js,             ['web/content/jsGrowl.js']),
1070a0
-            (dj_js,             ['web/content/jsgrowl_close.png']),
1070a0
-            (dj_js,             ['web/content/jsgrowl_corners.png']),
1070a0
-            (dj_js,             ['web/content/jsgrowl_middle_hover.png']),
1070a0
-            (dj_js,             ['web/content/jsgrowl_corners_hover.png']),
1070a0
-            (dj_js,             ['web/content/jsgrowl_side_hover.png']),
1070a0
-            (dj_js,             ['web/content/jsGrowl.css']),
1070a0
+            (dj_js, ['web/content/jquery-1.3.2.js']),
1070a0
+            (dj_js, ['web/content/jquery-1.3.2.min.js']),
1070a0
+            (dj_js, ['web/content/jsGrowl_jquery.js']),
1070a0
+            (dj_js, ['web/content/jsGrowl.js']),
1070a0
+            (dj_js, ['web/content/jsgrowl_close.png']),
1070a0
+            (dj_js, ['web/content/jsgrowl_corners.png']),
1070a0
+            (dj_js, ['web/content/jsgrowl_middle_hover.png']),
1070a0
+            (dj_js, ['web/content/jsgrowl_corners_hover.png']),
1070a0
+            (dj_js, ['web/content/jsgrowl_side_hover.png']),
1070a0
+            (dj_js, ['web/content/jsGrowl.css']),
1070a0
 
1070a0
             # Anamon script
1070a0
-            (vw_aux,            ['aux/anamon', 'aux/anamon.init']),
1070a0
+            (vw_aux, ['aux/anamon', 'aux/anamon.init']),
1070a0
 
1070a0
             # Directories to hold cobbler triggers
1070a0
-            ("%s/add/distro/pre" % trigpath,      []),
1070a0
-            ("%s/add/distro/post" % trigpath,     []),
1070a0
-            ("%s/add/profile/pre" % trigpath,     []),
1070a0
-            ("%s/add/profile/post" % trigpath,    []),
1070a0
-            ("%s/add/system/pre" % trigpath,      []),
1070a0
-            ("%s/add/system/post" % trigpath,     []),
1070a0
-            ("%s/add/repo/pre" % trigpath,        []),
1070a0
-            ("%s/add/repo/post" % trigpath,       []),
1070a0
-            ("%s/delete/distro/pre" % trigpath,   []),
1070a0
-            ("%s/delete/distro/post" % trigpath,  []),
1070a0
-            ("%s/delete/profile/pre" % trigpath,  []),
1070a0
+            ("%s/add/distro/pre" % trigpath, []),
1070a0
+            ("%s/add/distro/post" % trigpath, []),
1070a0
+            ("%s/add/profile/pre" % trigpath, []),
1070a0
+            ("%s/add/profile/post" % trigpath, []),
1070a0
+            ("%s/add/system/pre" % trigpath, []),
1070a0
+            ("%s/add/system/post" % trigpath, []),
1070a0
+            ("%s/add/repo/pre" % trigpath, []),
1070a0
+            ("%s/add/repo/post" % trigpath, []),
1070a0
+            ("%s/delete/distro/pre" % trigpath, []),
1070a0
+            ("%s/delete/distro/post" % trigpath, []),
1070a0
+            ("%s/delete/profile/pre" % trigpath, []),
1070a0
             ("%s/delete/profile/post" % trigpath, []),
1070a0
-            ("%s/delete/system/pre" % trigpath,   []),
1070a0
-            ("%s/delete/system/post" % trigpath,  []),
1070a0
-            ("%s/delete/repo/pre" % trigpath,     []),
1070a0
-            ("%s/delete/repo/post" % trigpath,    []),
1070a0
-            ("%s/delete/repo/post" % trigpath,    []),
1070a0
-            ("%s/install/pre" % trigpath,         []),
1070a0
-            ("%s/install/post" % trigpath,        []),
1070a0
-            ("%s/sync/pre" % trigpath,            []),
1070a0
-            ("%s/sync/post" % trigpath,           []),
1070a0
-            ("%s/change" % trigpath,              [])
1070a0
+            ("%s/delete/system/pre" % trigpath, []),
1070a0
+            ("%s/delete/system/post" % trigpath, []),
1070a0
+            ("%s/delete/repo/pre" % trigpath, []),
1070a0
+            ("%s/delete/repo/post" % trigpath, []),
1070a0
+            ("%s/delete/repo/post" % trigpath, []),
1070a0
+            ("%s/install/pre" % trigpath, []),
1070a0
+            ("%s/install/post" % trigpath, []),
1070a0
+            ("%s/sync/pre" % trigpath, []),
1070a0
+            ("%s/sync/post" % trigpath, []),
1070a0
+            ("%s/change" % trigpath, [])
1070a0
         ],
1070a0
-        description = SHORT_DESC,
1070a0
-        long_description = LONG_DESC
1070a0
+        description=SHORT_DESC,
1070a0
+        long_description=LONG_DESC
1070a0
     )
1070a0
 
1070a0
+
1070a0
+def py3_setup():
1070a0
+    # Only koan is ready for Python 3
1070a0
+    setup(
1070a0
+        name='koan',
1070a0
+        version=VERSION,
1070a0
+        description=SHORT_DESC,
1070a0
+        long_description=LONG_DESC,
1070a0
+        author='Jan Dobes',
1070a0
+        author_email='jdobes@redhat.com',
1070a0
+        url='http://www.github.com/spacewalkproject',
1070a0
+        packages=['koan'],
1070a0
+        license='GPLv2',
1070a0
+        scripts=[
1070a0
+            "scripts/koan",
1070a0
+            "scripts/cobbler-register"
1070a0
+        ],
1070a0
+    )
1070a0
+
1070a0
+if __name__ == "__main__":
1070a0
+    if sys.version_info[0] == 3:
1070a0
+        py3_setup()
1070a0
+    else:
1070a0
+        py2_setup()
1070a0
+
1070a0
+
1070a0
+
1070a0
+
1070a0
-- 
1070a0
2.5.5
1070a0