Index: setup.py
===================================================================
--- setup.py	(revision 79d5b6c6866fe47aa0030d1fa7a21cc644a4be7b)
+++ setup.py	(revision 5980b1a5a71267ef67af9f49f11bc52097c0f681)
@@ -5,7 +5,5 @@
 import sys
 import os
-import platform
-import shutil
-from setuptools import setup, Extension, find_packages
+from setuptools import setup, Extension
 from distutils.command.build_ext import build_ext
 
@@ -56,7 +54,7 @@
     f_path = os.path.join(sans_dir, 'plugin_models')
     if os.path.isdir(f_path):
-        for file in os.listdir(f_path): 
-            if file in plugin_model_list:
-                file_path =  os.path.join(f_path, file)
+        for f in os.listdir(f_path): 
+            if f in plugin_model_list:
+                file_path =  os.path.join(f_path, f)
                 os.remove(file_path)
                     
@@ -93,6 +91,6 @@
         if enable_openmp:
             if copt.has_key(c):
-               for e in self.extensions:
-                   e.extra_compile_args = copt[ c ]
+                for e in self.extensions:
+                    e.extra_compile_args = copt[ c ]
             if lopt.has_key(c):
                 for e in self.extensions:
@@ -106,4 +104,7 @@
         build_ext.build_extensions(self)
 
+# sans module
+package_dir["sans"] = os.path.join("src", "sans")
+packages.append("sans")
 
 # sans.invariant
@@ -118,9 +119,9 @@
 packages.extend(["sans.guiframe", "sans.guiframe.local_perspectives"])
 # build local plugin
-for dir in os.listdir(os.path.join(guiframe_path, "local_perspectives")):
-    if dir not in ['.svn','__init__.py', '__init__.pyc']:
-        package_name = "sans.guiframe.local_perspectives." + dir
+for d in os.listdir(os.path.join(guiframe_path, "local_perspectives")):
+    if d not in ['.svn','__init__.py', '__init__.pyc']:
+        package_name = "sans.guiframe.local_perspectives." + d
         packages.append(package_name)
-        package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", dir)
+        package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", d)
 
 # sans.dataloader
@@ -216,5 +217,4 @@
 if not os.name=='nt':
     IGNORED_FILES.extend(["gamma_win.c","winFuncs.c"])
-
 
 EXTENSIONS = [".c", ".cpp"]
@@ -247,4 +247,50 @@
 append_file(file_list=smear_sources, dir_path=smear_dir)
         
+package_dir["sans.models"] = model_dir
+package_dir["sans.models.sans_extension"] = os.path.join("src", "sans", "models", "sans_extension")
+package_data['sans.models'] = [os.path.join('media', "*.*")]
+package_data['sans.models'] += [os.path.join('media','img', "*.*")]
+packages.extend(["sans.models","sans.models.sans_extension"])
+    
+smearer_sources = [os.path.join(smear_dir, "smearer.cpp"),
+                  os.path.join(smear_dir, "smearer_module.cpp")]
+geni_sources = [os.path.join(gen_dir, "sld2i_module.cpp")]
+if os.name=='nt':
+    smearer_sources.append(os.path.join(igordir, "winFuncs.c"))
+    geni_sources.append(os.path.join(igordir, "winFuncs.c"))
+ext_modules.extend( [ Extension("sans.models.sans_extension.c_models",
+                                sources=model_sources,                 
+                                include_dirs=[igordir, includedir, 
+                                              c_model_dir, numpy_incl_path, cephes_dir],
+                                ),       
+                    # Smearer extension
+                    Extension("sans.models.sans_extension.smearer",
+                              sources = smearer_sources,
+                              include_dirs=[igordir, 
+                                            smear_dir, numpy_incl_path],
+                              ),
+                    
+                    Extension("sans.models.sans_extension.smearer2d_helper",
+                              sources = [os.path.join(smear_dir, 
+                                                "smearer2d_helper_module.cpp"),
+                                         os.path.join(smear_dir, 
+                                                "smearer2d_helper.cpp"),],
+                              include_dirs=[smear_dir, numpy_incl_path],
+                              ),
+                    
+                    Extension("sans.models.sans_extension.sld2i",
+                              sources = [os.path.join(gen_dir, 
+                                                "sld2i_module.cpp"),
+                                         os.path.join(gen_dir, 
+                                                "sld2i.cpp"),
+                                         os.path.join(c_model_dir, 
+                                                "libfunc.c"),
+                                         os.path.join(c_model_dir, 
+                                                "librefl.c"),],
+                              include_dirs=[gen_dir, includedir, 
+                                            c_model_dir, numpy_incl_path],
+                              )
+                    ] )
+        
 # SasView
 
@@ -264,5 +310,5 @@
     required.extend(['pil'])
    
- # Set up SasView    
+# Set up SasView    
 setup(
     name="sasview",
@@ -271,5 +317,5 @@
     author = "University of Tennessee",
     author_email = "sansdanse@gmail.com",
-    url = "http://danse.chem.utk.edu",
+    url = "http://sasview.org",
     license = "PSF",
     keywords = "small-angle x-ray and neutron scattering analysis",
