source: TI05-delivery/trunk/setup.py @ 1064

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/trunk/setup.py@1064
Revision 1064, 1.5 KB checked in by spascoe, 13 years ago (diff)

A python module which provides a function to start the daemon can be
built using the setup.py script. This method of invoking the server
has been briefly tested but no test cases yet.

I've taken out the initialisation/finalisation hooks from the auth API because
we shouldn't need them now. They were written assuming the python interpretter
was going to be embedded within bbftpd, but I've inverted the embedding by
wrapping bbftpd.c:main in a python extension function.

Line 
1"""Built bbftp embedded in python.
2"""
3
4from distutils.core import setup, Extension
5
6bbftpd_home = './src/bbftp-server-3.2.0'
7
8# Not all *.c files are compiled into *.o files in bbftpd
9bbftpd_src = [
10    'bbftpd.c',
11    'bbftpd_cd.c',
12    'bbftpd_check.c',
13    'bbftpd_crypt.c',
14    'bbftpd_daemon.c',
15    'bbftpd_list.c',
16    'bbftpd_login.c',
17    'bbftpd_message.c',
18    'bbftpd_mkdir.c',
19    'bbftpd_rm.c',
20    'bbftpd_stat.c',
21    'bbftpd_statfs.c',
22    'bbftpd_readcontrol.c',
23    'bbftpd_retr.c',
24    'bbftpd_signals.c',
25    'bbftpd_socket.c',
26    'bbftpd_store.c',
27    'bbftpd_utils.c',
28    'changetodir.c',
29    'createadir.c',
30    'createreceivesock.c',
31    'readcontrol.c',
32    'sendafile.c',
33    'sendlist.c',
34    'signals_routines.c',
35    'storeafile.c',
36    'bbftpd_private.c',
37    'bbftpd_private_user.c',
38    ]
39
40bbftpd = Extension('bbftpd',
41                   define_macros = [('NDG_AUTH', 1), ('LOCAL_SYSLOG_FACILITY', 1),
42                                    ('_LARGEFILE64_SOURCE', 1),
43                                    ('NDG_PYTHON_EMBED', 1)],
44                   include_dirs = [bbftpd_home+'/includes', bbftpd_home+'/bbftpd'],
45                   libraries = ['crypt', 'crypto'],
46                   sources = ['%s/bbftpd/%s' % (bbftpd_home, x) for x in bbftpd_src])
47
48setup(name = 'bbftp-python',
49      version = '0.1',
50      description = 'Embedded bbftp server',
51      author = 'Stephen Pascoe',
52      author_email = 'S.Pascoe@rl.ac.uk',
53      ext_modules = [bbftpd])
54     
Note: See TracBrowser for help on using the repository browser.