import os
import sys
import subprocess
from setuptools import setup, find_packages

srcdir = os.path.dirname(__file__)
homedir = os.path.abspath(os.path.join(srcdir, "../../.."))

# Utility function to read the pegasus Version.in file
def readversion():
    return subprocess.Popen("%s/release-tools/getversion" % homedir,
                stdout=subprocess.PIPE, shell=True).communicate()[0].strip()

# Utility function to read the README file.
def read(fname):
    return open(os.path.join(srcdir, fname)).read()

setup(
    name = "pegasus-wms",
    version = readversion(),
    author = "Pegasus Team",
    author_email = "pegasus@isi.edu",
    description = "Pegasus Workflow Management System Python API",
    long_description = read("README"),
    license = "Apache2",
    url = "http://pegasus.isi.edu",
    keywords = ["scientific workflows"],
    classifiers = [
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "Operating System :: Unix",
        "Programming Language :: Python",
        "Topic :: Scientific/Engineering",
        "Topic :: Utilities",
        "License :: OSI Approved :: Apache Software License",
    ],
    packages = find_packages(exclude=["Pegasus.test"]),
    test_suite = "Pegasus.test"
)


@@ -508,16 +508,488 @@
 read()%0A%0A
+def find_package_data(dirname):%0A    def find_paths(dirname):%0A        items = %5B%5D%0A        for fname in os.listdir(dirname):%0A            path = os.path.join(dirname, fname)%0A            if os.path.isdir(path):%0A                items += find_paths(path)%0A            elif not path.endswith(%22.py%22) and not path.endswith(%22.pyc%22):%0A                items.append(path)%0A        return items%0A    items = find_paths(dirname)%0A    return %5Bos.path.relpath(path, dirname) for path in items%5D%0A%0A
 setup(%0A 
@@ -1760,10 +1760,168 @@
 est%22
-%5D)
+,%22Pegasus.service.test%22%5D),%0A    package_data = %7B%22Pegasus.service%22 : find_package_data(%22Pegasus/service%22) %7D,%0A    include_package_data = True,%0A    zip_safe = False
 ,%0A  

Add package data from pegasus service to setup.py