forked from twisted/twisted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.aap
137 lines (110 loc) · 4.5 KB
/
main.aap
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
SCP=bash admin/aapscp
HERE=`os.getcwd()`
:python
import winreg
from aapwin import getValueFromReg, pathdb
# sys.path.insert(0, os.path.join(os.getcwd(), 'twisted', 'topfiles'))
sys.path.insert(0, os.getcwd())
def geniss(iss_template, dodocs):
"""Return the inno setup file"""
tdct = dict(setupbase=_top.setupbase, version=_top.Version,
pyversion=_top.pyversion)
template = '%(setupbase)s-%(version)s.win32-py%(pyversion)s' % tdct
import setup
docdct = dict(pyversion=_top.pyversion,
pyversion10=_top.pyversion10, twversion=_top.Version,
twhome=_recipe.HERE,
docfile=r'Source: "%s\doc\twisteddoc.zip"; DestDir: "{app}"' % _recipe.HERE,
outputbasefilename=template,
)
nodocdct = docdct.copy()
nodocdct['docfile'] = ''
if dodocs:
dct = docdct
else:
dct = nodocdct
return iss_template % dct
def find(filename, topdir='.'):
"""A crude unix find(1), returns only the first match"""
for dirpath, dirnames, filenames in os.walk(topdir):
if filename in filenames:
return os.path.join(dirpath, filename)
raise ValueError("%s not found under %s" % (filename,topdir))
def getBuildingTwistedVersion():
"""Return the version of Twisted in $HERE, which may be
different from the version of Twisted in sys.path.
"""
globs = globals().copy()
copyright = find('copyright.py')
execfile(copyright, globs)
return globs['version']
# get the version of twisted from the tree being built, not sys.path
Version=`getBuildingTwistedVersion()`
ZIVersion=3.1.0c1
# PyVersion is variant rather than a regular string variable so the script
# will accept only one of these two values
:variant PyVersion
py2.3
pyversion=2.3
pyversion10=23
pyhome=`_no.pathdb["python23"]`
py2.4
pyversion=2.4
pyversion10=24
pyhome=`_no.pathdb["python24"]`
pyexe=$(pyhome)\python.exe
:variant DoDocs
nodocs
setupbase=Twisted_NoDocs
withdocs
setupbase=Twisted
all: dist/$(setupbase)-$(Version).win32-py$(pyversion).exe
:print : Done building $(target)
# publish to sf.net
:attr {publish=scp://shell.sf.net//home/groups/t/tw/twisted/htdocs/$(setupbase)-$(Version).win32-py$(pyversion).exe} dist/$(setupbase)-$(Version).win32-py$(pyversion).exe
# only run setup.py when needed
build/scripts-$(pyversion) build/lib.win32-$(pyversion): \
ZopeInterface-$ZIVersion
:mkdir {f} build/scripts-$(pyversion)
:copy win32/twisted_postinstall.py build/scripts-$(pyversion)/.
:sys $(pyexe) setup.py all build --compiler=mingw32 \
install --root=../win32dist --no-compile
@1
:pushdir ZopeInterface-$(ZIVersion)
@try:
:sys $(pyexe) setup.py build --compiler=mingw32 \
install --root=../win32dist --no-compile
@finally:
:popdir
ZopeInterface-$(ZIVersion).tgz:
err = "Please download the ZopeInterface $ZIVersion tarball"
@assert os.path.exists(target), err
ZopeInterface-$ZIVersion: ZopeInterface-$(ZIVersion).tgz
:sys tar xvfz ZopeInterface-$(ZIVersion).tgz
# build with inno
ExeDeps=py$(pyversion)-$(DoDocs).iss
build/lib.win32-$(pyversion)
build/scripts-$(pyversion)
iscc=`pathdb["iscc"]`
dist/Twisted-$(Version).win32-py$(pyversion).exe: doc/twisteddoc.zip $(ExeDeps)
:sys "$(iscc)" py$(pyversion)-withdocs.iss
# build with inno
dist/Twisted_NoDocs-$(Version).win32-py$(pyversion).exe: $(ExeDeps)
:sys "$(iscc)" py$(pyversion)-nodocs.iss
## we don't do docs any more
## # fetch docs from latest release (this better be there)
## :attr {fetch=http://twisted.sf.net/TwistedDocs-$(Version).tar.bz2} doc/TwistedDocs-$(Version).tar.bz2
# uncompress and rezip doc
doc/twisteddoc.zip: doc/TwistedDocs-$(Version).tar.bz2
:chdir doc
@if not os.path.isdir('TwistedDocs-%s' % _no.Version):
:sys tar xfj TwistedDocs-$(Version).tar.bz2
:chdir TwistedDocs-$(Version)
:sys zip -rq ../twisteddoc.zip *
# generate iss files
py$(pyversion)-$(DoDocs).iss: win32/pyx.x-foo.iss.template
@docs = (_top.DoDocs == 'withdocs')
# file2string is fucked, don't use
@tmpl = file('win32/pyx.x-foo.iss.template').read()
@iss = _top.geniss(tmpl, docs)
@file(target, 'w').write(iss)