1 | # Python remctl extension build rules. |
---|
2 | # |
---|
3 | # Original implementation by Thomas L. Kula <kula@tproa.net> |
---|
4 | # Copyright 2008 Thomas L. Kula <kula@tproa.net> |
---|
5 | # Copyright 2008 Board of Trustees, Leland Stanford Jr. University |
---|
6 | # |
---|
7 | # Permission to use, copy, modify, and distribute this software and its |
---|
8 | # documentation for any purpose and without fee is hereby granted, provided |
---|
9 | # that the above copyright notice appear in all copies and that both that |
---|
10 | # copyright notice and this permission notice appear in supporting |
---|
11 | # documentation, and that the name of Thomas L. Kula not be used in |
---|
12 | # advertising or publicity pertaining to distribution of the software without |
---|
13 | # specific, written prior permission. Thomas L. Kula makes no representations |
---|
14 | # about the suitability of this software for any purpose. It is provided "as |
---|
15 | # is" without express or implied warranty. |
---|
16 | # |
---|
17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
---|
18 | # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
---|
19 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
---|
20 | |
---|
21 | # Keep the wrapping of the description to 65 columns and make sure there is no |
---|
22 | # trailing newline so that PKG-INFO looks right. |
---|
23 | """Python bindings for remctl remote command execution |
---|
24 | |
---|
25 | remctl is a client/server application that supports remote |
---|
26 | execution of specific commands, using Kerberos v5 GSS-API for |
---|
27 | authentication. Authorization is controlled by a configuration |
---|
28 | file and ACL files and can be set separately for each command, |
---|
29 | unlike with rsh. remctl is like a Kerberos-authenticated simple |
---|
30 | CGI server, or a combination of Kerberos rsh and sudo without |
---|
31 | most of the features and complexity of either. |
---|
32 | |
---|
33 | This module provides Python bindings to the remctl client |
---|
34 | library.""" |
---|
35 | |
---|
36 | from distutils.core import setup, Extension |
---|
37 | |
---|
38 | VERSION = '2.14' |
---|
39 | |
---|
40 | doclines = __doc__.split("\n") |
---|
41 | classifiers = """\ |
---|
42 | Development Status :: 4 - Beta |
---|
43 | Intended Audience :: Developers |
---|
44 | License :: OSI Approved :: MIT License |
---|
45 | Operating System :: OS Independent |
---|
46 | Programming Language :: C |
---|
47 | Programming Language :: Python |
---|
48 | Topic :: Security |
---|
49 | Topic :: Software Development :: Libraries :: Python Modules |
---|
50 | """ |
---|
51 | |
---|
52 | # Helper function to parse a string of compiler flags for ones of interest and |
---|
53 | # strip the flag off, returning the string that the distutils Extension |
---|
54 | # interface expects. |
---|
55 | def parse_flags(prefix, flags): |
---|
56 | result = [] |
---|
57 | filtered = [ opt for opt in flags.split() if opt.startswith(prefix) ] |
---|
58 | for opt in filtered: |
---|
59 | result.append(opt[len(prefix):]) |
---|
60 | return result |
---|
61 | |
---|
62 | # Build the list of include directories, libraries to link with, and |
---|
63 | # directories to add to the search paths based on the Autoconf results. |
---|
64 | ldflags = '' + ' ' + '-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err' + ' ' + ' ' |
---|
65 | include = parse_flags('-I', '' + ' ' + ' ') |
---|
66 | libs = parse_flags('-l', '-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err' + ' ' + '') |
---|
67 | dirs = parse_flags('-L', ldflags) |
---|
68 | libs = ['remctl'] + libs |
---|
69 | dirs.append('/afs/sipb.mit.edu/project/sipb-www/sipbmp3web/remctl-2.14/client/.libs') |
---|
70 | include.append('/afs/sipb.mit.edu/project/sipb-www/sipbmp3web/remctl-2.14/client') |
---|
71 | |
---|
72 | extension = Extension('_remctl', |
---|
73 | sources = [ '_remctlmodule.c' ], |
---|
74 | define_macros = [ ('VERSION', '"' + VERSION + '"') ], |
---|
75 | include_dirs = include, |
---|
76 | libraries = libs, |
---|
77 | library_dirs = dirs) |
---|
78 | |
---|
79 | setup(name = 'pyremctl', |
---|
80 | version = VERSION, |
---|
81 | author = 'Thomas L. Kula', |
---|
82 | author_email = 'kula@tproa.net', |
---|
83 | url = 'http://www.eyrie.org/~eagle/software/remctl/', |
---|
84 | description = doclines[0], |
---|
85 | long_description = "\n".join(doclines[2:]), |
---|
86 | license = 'MIT', |
---|
87 | classifiers = filter(None, classifiers.split("\n")), |
---|
88 | platforms = 'any', |
---|
89 | keywords = [ 'remctl', 'kerberos', 'remote', 'command' ], |
---|
90 | |
---|
91 | ext_modules = [ extension ], |
---|
92 | py_modules = ['remctl']) |
---|