Description: add portserver script
Author: Sascha Steinbiss <satta@debian.org>
--- a/setup.py
+++ b/setup.py
@@ -14,14 +14,15 @@
 #
 """Simple distutils setup for the pure Python portpicker."""
 
-import distutils.core
+from setuptools import setup
 import sys
 import textwrap
 
 
 def main():
     requires = []
-    scripts = []
+    my_entry_points = {}
+    my_modules = ['portpicker']
     py_version = sys.version_info[:2]
     if py_version < (3, 3):
         requires.append('mock(>=1.0)')
@@ -29,9 +30,15 @@
         requires.append('asyncio(>=3.4)')
     if py_version >= (3, 3):
         # The example portserver implementation requires Python 3 and asyncio.
-        scripts.append('src/portserver.py')
+        #scripts.append('src/portserver.py')
+        my_entry_points = {
+            'console_scripts': [
+                'portserver=portserver:main'
+            ]
+        }
+        my_modules.append('portserver')
 
-    distutils.core.setup(
+    setup(
         name='portpicker',
         version='1.1.1',
         description='A library to choose unique available network ports.',
@@ -44,10 +51,10 @@
         maintainer_email='greg@krypto.org',
         url='https://github.com/google/python_portpicker',
         package_dir={'': 'src'},
-        py_modules=['portpicker'],
+        py_modules=my_modules,
         platforms=['POSIX'],
         requires=requires,
-        scripts=scripts,
+        entry_points=my_entry_points,
         classifiers=
         ['Development Status :: 5 - Production/Stable',
          'License :: OSI Approved :: Apache Software License',
