-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py.in
150 lines (136 loc) · 5.87 KB
/
setup.py.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#! /usr/bin/python
# -*- coding: latin-1 -*-
# $Id: setup.py.in 297 2007-06-13 09:51:25Z mtr $
"""
Copyright (C) 2009 by Lingit AS
"""
__author__ = "Martin Thorsen Ranang <[email protected]>"
__revision__ = "$Rev: 297 $"
__version__ = "@PACKAGE_VERSION@"
from distutils.core import setup
import os
LONG_DESCRIPTION = """\
This package contains the implementation of TTPD and TAD. The main
purpose of TTPD is to work as a mediator for requests between external
programs and TUC. In addition, if used with the TAD it will also
handle `alert' requests when used in conjunction with the SMS
interface.
"""
def isPackage(filename):
return (os.path.isdir(filename) and
os.path.isfile(os.path.join(filename, '__init__.py')))
def packagesFor(filename, basePackage=""):
"""Find all packages in filename.
"""
set_of_packages = {}
for item in os.listdir(filename):
directory = os.path.join(filename, item)
if isPackage(directory):
if basePackage:
moduleName = '%s.%s' % (basePackage, item)
else:
moduleName = item
set_of_packages[moduleName] = directory
set_of_packages.update(packagesFor(directory, moduleName))
return set_of_packages
def main():
"""Module mainline (for standalone execution).
"""
packages = packagesFor('lib')
author_name = __author__.split(' <')[0]
author_email = __author__.rsplit(' ')[-1]
if True:
setup(
name='@PACKAGE_NAME@',
version='@PACKAGE_VERSION@',
description='TUC Transfer Protocol Daemon (TTPD) and ' \
'TUC Alert Daemon (TAD)',
long_description=LONG_DESCRIPTION,
author=author_name,
author_email=author_email,
license='GPL',
url='http://www.ranang.org/projects/@PACKAGE_NAME@/',
package_dir=packages,
packages=packages.keys(),
scripts=[
'src/ttpc',
'src/ttpd_analyze',
'src/ttpdctl',
'src/ttpd_log_filter',
],
data_files=[
# Server:
('@sbindir@', ['src/@PACKAGE_TARNAME@']),
# Init script:
('@pkginitdir@', ['etc/init.d/@PACKAGE_TARNAME@']),
# Crontab:
('/etc/cron.d', [
'etc/cron.d/@PACKAGE_TARNAME@-sms',
'etc/cron.d/@PACKAGE_TARNAME@-web',
]),
# Configuration file:
('/etc/default', ['etc/default/@PACKAGE_TARNAME@']),
# Log rotation scripts:
('/etc/logrotate.d', ['etc/logrotate.d/@PACKAGE_TARNAME@']),
# Statistics generation scripts:
('@sms_statistics_dir@', [
'statistics/sms/general_config.sh',
'statistics/sms/last_52_weeks.sh',
'statistics/sms/last_week.sh',
'statistics/sms/this_week.sh',
'statistics/sms/today.sh',
]),
('@web_statistics_dir@', [
'statistics/web/general_config.sh',
'statistics/web/last_52_weeks.sh',
'statistics/web/last_week.sh',
'statistics/web/this_week.sh',
'statistics/web/today.sh',
]),
# Web site:
('/etc/apache2/sites-available', [
'etc/apache2/sites-available/busstuc.lingit.no',
]),
('@www_document_root@', [
'www/busstuc.lingit.no/body_style.inc',
'www/busstuc.lingit.no/bot.php',
'www/busstuc.lingit.no/bust.php',
'www/busstuc.lingit.no/busstuc_json_demo.html',
'www/busstuc.lingit.no/busstuc_json_demo.js',
'www/busstuc.lingit.no/egenskaper.php',
'www/busstuc.lingit.no/index.php',
'www/busstuc.lingit.no/instruksjoner.php',
'www/busstuc.lingit.no/json.php',
'www/busstuc.lingit.no/json_form.php',
'www/busstuc.lingit.no/ombustuc.php',
'www/busstuc.lingit.no/tuc.inc',
'www/busstuc.lingit.no/tucq.inc',
'www/busstuc.lingit.no/tucq_top.inc',
'www/busstuc.lingit.no/tucsms.php',
'www/busstuc.lingit.no/sms_post.php',
'www/busstuc.lingit.no/sms_post_tester.php',
]),
('@www_document_root@/sms_stats', [
'www/busstuc.lingit.no/sms_stats/index.php',
]),
('@www_document_root@/web_stats', [
'www/busstuc.lingit.no/web_stats/index.php',
]),
('@www_document_root@/team_trafikk/', [
'www/busstuc.lingit.no-team-trafikk/README',
'www/busstuc.lingit.no-team-trafikk/body_style.inc',
'www/busstuc.lingit.no-team-trafikk/bot.php',
'www/busstuc.lingit.no-team-trafikk/bust.php',
'www/busstuc.lingit.no-team-trafikk/egenskaper.php',
'www/busstuc.lingit.no-team-trafikk/index.php',
'www/busstuc.lingit.no-team-trafikk/instruksjoner.php',
'www/busstuc.lingit.no-team-trafikk/ombustuc.php',
'www/busstuc.lingit.no-team-trafikk/tuc.inc',
'www/busstuc.lingit.no-team-trafikk/tucq.inc',
'www/busstuc.lingit.no-team-trafikk/tucq_top.inc',
'www/busstuc.lingit.no-team-trafikk/tucsms.php',
]),
],
)
if __name__ == "__main__":
main()