Ticket #8: setup.py

File setup.py, 2.5 KB (added by flip, 10 years ago)
Line 
1# Python modules
2import distutils.core as duc
3import platform
4
5# My modules
6import prober
7
8f = open("VERSION")
9VERSION = f.read().strip()
10f.close()
11
12name = "posix_ipc"
13description = "POSIX IPC primitives (semaphores, shared memory and message queues) for Python"
14f = open("README")
15long_description = f.read().strip()
16f.close()
17author = "Philip Semanchuk",
18author_email = "philip@semanchuk.com",
19maintainer = "Philip Semanchuk",
20url = "http://semanchuk.com/philip/posix_ipc/",
21download_url = "http://semanchuk.com/philip/posix_ipc/posix_ipc-%s.tar.gz" % VERSION,
22source_files = ["posix_ipc_module.c"]
23# http://pypi.python.org/pypi?%3Aaction=list_classifiers
24classifiers = [ "Development Status :: 4 - Beta", 
25                "Intended Audience :: Developers", 
26                "License :: OSI Approved :: BSD License",
27                "Operating System :: MacOS :: MacOS X",
28                "Operating System :: POSIX :: BSD :: FreeBSD",
29                "Operating System :: POSIX :: Linux",
30                "Operating System :: POSIX :: SunOS/Solaris",
31                "Operating System :: POSIX", 
32                "Operating System :: Unix", 
33                "Programming Language :: Python", 
34                "Programming Language :: Python :: 2",
35                "Programming Language :: Python :: 3",
36                "Topic :: Utilities" ]
37license = "http://creativecommons.org/licenses/BSD/"
38keywords = "ipc inter-process communication semaphore shared memory shm message queue"
39
40libraries = [ ]
41
42d = prober.probe()
43
44# Linux & FreeBSD require linking against the realtime libs
45# This causes an error on other platforms
46if "REALTIME_LIB_IS_NEEDED" in d:
47    libraries.append("rt")
48
49ext_modules = [ duc.Extension("posix_ipc", 
50                              source_files,
51                              libraries=libraries,
52                              depends = [ "posix_ipc_module.c", 
53                                          "probe_results.h", 
54                                        ],
55#                            extra_compile_args=['-E']
56                             )
57              ]
58
59                     
60duc.setup(name = name,
61          version = VERSION,
62          description = description,
63          long_description = long_description,
64          author = author,
65          author_email = author_email,
66          maintainer = maintainer,
67          url = url,
68          download_url = download_url,
69          classifiers = classifiers,
70          license = license,
71          keywords = keywords,
72          ext_modules = ext_modules
73         )