summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/python
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2011-03-05 17:01:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-10 18:14:19 -0800
commita54f4b69190a5001f9a06365118a6915a751138c (patch)
tree39f0d42bfc6dfd8ab7b95416f4a64997a7be4a11 /scripts/contrib/python
parentcbbfbfc54f3661f49a4b314eb187a09d7955226a (diff)
downloadpoky-a54f4b69190a5001f9a06365118a6915a751138c.tar.gz
python: add generate-manifest-2.6.py script and regen python-2.6-manifest.inc
* imported from OE with sorted entries etc (From OE-Core rev: 94b36524550ff2c94a5f8d82a9bc2073c06d418a) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Acked-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/python')
-rwxr-xr-xscripts/contrib/python/generate-manifest-2.6.py362
1 files changed, 362 insertions, 0 deletions
diff --git a/scripts/contrib/python/generate-manifest-2.6.py b/scripts/contrib/python/generate-manifest-2.6.py
new file mode 100755
index 0000000000..1b11266edf
--- /dev/null
+++ b/scripts/contrib/python/generate-manifest-2.6.py
@@ -0,0 +1,362 @@
1#!/usr/bin/env python
2
3# generate Python Manifest for the OpenEmbedded build system
4# (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
5# (C) 2007 Jeremy Laine
6# licensed under MIT, see COPYING.MIT
7
8import os
9import sys
10import time
11
12VERSION = "2.6.6"
13
14__author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
15__version__ = "20110222"
16
17class MakefileMaker:
18
19 def __init__( self, outfile ):
20 """initialize"""
21 self.packages = {}
22 self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
23 self.output = outfile
24 self.out( """
25# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
26# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
27# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
28""" % ( sys.argv[0], __version__ ) )
29
30 #
31 # helper functions
32 #
33
34 def out( self, data ):
35 """print a line to the output file"""
36 self.output.write( "%s\n" % data )
37
38 def setPrefix( self, targetPrefix ):
39 """set a file prefix for addPackage files"""
40 self.targetPrefix = targetPrefix
41
42 def doProlog( self ):
43 self.out( """ """ )
44 self.out( "" )
45
46 def addPackage( self, name, description, dependencies, filenames ):
47 """add a package to the Makefile"""
48 if type( filenames ) == type( "" ):
49 filenames = filenames.split()
50 fullFilenames = []
51 for filename in filenames:
52 if filename[0] != "$":
53 fullFilenames.append( "%s%s" % ( self.targetPrefix, filename ) )
54 else:
55 fullFilenames.append( filename )
56 self.packages[name] = description, dependencies, fullFilenames
57
58 def doBody( self ):
59 """generate body of Makefile"""
60
61 global VERSION
62
63 #
64 # generate provides line
65 #
66
67 provideLine = 'PROVIDES+="'
68 for name in sorted(self.packages):
69 provideLine += "%s " % name
70 provideLine += '"'
71
72 self.out( provideLine )
73 self.out( "" )
74
75 #
76 # generate package line
77 #
78
79 packageLine = 'PACKAGES="${PN}-core-dbg '
80 for name in sorted(self.packages):
81 if name != '${PN}-core-dbg':
82 packageLine += "%s " % name
83 packageLine += '${PN}-modules"'
84
85 self.out( packageLine )
86 self.out( "" )
87
88 #
89 # generate package variables
90 #
91
92 for name, data in sorted(self.packages.iteritems()):
93 desc, deps, files = data
94
95 #
96 # write out the description, revision and dependencies
97 #
98 self.out( 'DESCRIPTION_%s="%s"' % ( name, desc ) )
99 self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) )
100
101 line = 'FILES_%s="' % name
102
103 #
104 # check which directories to make in the temporary directory
105 #
106
107 dirset = {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead.
108 for target in files:
109 dirset[os.path.dirname( target )] = True
110
111 #
112 # generate which files to copy for the target (-dfR because whole directories are also allowed)
113 #
114
115 for target in files:
116 line += "%s " % target
117
118 line += '"'
119 self.out( line )
120 self.out( "" )
121
122 self.out( 'DESCRIPTION_${PN}-modules="All Python modules"' )
123 line = 'RDEPENDS_${PN}-modules="'
124
125 for name, data in sorted(self.packages.iteritems()):
126 if name not in ['${PN}-core-dbg', '${PN}-dev']:
127 line += "%s " % name
128
129 self.out( "%s \"" % line )
130 self.out( 'ALLOW_EMPTY_${PN}-modules = "1"' )
131
132 def doEpilog( self ):
133 self.out( """""" )
134 self.out( "" )
135
136 def make( self ):
137 self.doProlog()
138 self.doBody()
139 self.doEpilog()
140
141if __name__ == "__main__":
142
143 if len( sys.argv ) > 1:
144 os.popen( "rm -f ./%s" % sys.argv[1] )
145 outfile = file( sys.argv[1], "w" )
146 else:
147 outfile = sys.stdout
148
149 m = MakefileMaker( outfile )
150
151 # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
152 # Parameters: revision, name, description, dependencies, filenames
153 #
154
155 m.addPackage( "${PN}-core", "Python Interpreter and core modules (needed!)", "",
156 "__future__.* _abcoll.* abc.* copy.* copy_reg.* ConfigParser.* " +
157 "genericpath.* getopt.* linecache.* new.* " +
158 "os.* posixpath.* struct.* " +
159 "warnings.* site.* stat.* " +
160 "UserDict.* UserList.* UserString.* " +
161 "lib-dynload/binascii.so lib-dynload/_struct.so lib-dynload/time.so " +
162 "lib-dynload/xreadlines.so types.* platform.* ${bindir}/python*" )
163
164 m.addPackage( "${PN}-core-dbg", "Python core module debug information", "${PN}-core",
165 "config/.debug lib-dynload/.debug ${bindir}/.debug ${libdir}/.debug" )
166
167 m.addPackage( "${PN}-dev", "Python Development Package", "${PN}-core",
168 "${includedir} ${libdir}/libpython2.6.so" ) # package
169
170 m.addPackage( "${PN}-idle", "Python Integrated Development Environment", "${PN}-core ${PN}-tkinter",
171 "${bindir}/idle idlelib" ) # package
172
173 m.addPackage( "${PN}-pydoc", "Python Interactive Help Support", "${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re",
174 "${bindir}/pydoc pydoc.*" )
175
176 m.addPackage( "${PN}-smtpd", "Python Simple Mail Transport Daemon", "${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime",
177 "${bindir}/smtpd.*" )
178
179 m.addPackage( "${PN}-audio", "Python Audio Handling", "${PN}-core",
180 "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.so lib-dynload/audioop.so" )
181
182 m.addPackage( "${PN}-bsddb", "Python Berkeley Database Bindings", "${PN}-core",
183 "bsddb lib-dynload/_bsddb.so" ) # package
184
185 m.addPackage( "${PN}-codecs", "Python Codecs, Encodings & i18n Support", "${PN}-core ${PN}-lang",
186 "codecs.* encodings gettext.* locale.* lib-dynload/_locale.so lib-dynload/unicodedata.so stringprep.* xdrlib.*" )
187
188 m.addPackage( "${PN}-compile", "Python Bytecode Compilation Support", "${PN}-core",
189 "py_compile.* compileall.*" )
190
191 m.addPackage( "${PN}-compiler", "Python Compiler Support", "${PN}-core",
192 "compiler" ) # package
193
194 m.addPackage( "${PN}-compression", "Python High Level Compression Support", "${PN}-core ${PN}-zlib",
195 "gzip.* zipfile.* tarfile.* lib-dynload/bz2.so" )
196
197 m.addPackage( "${PN}-crypt", "Python Basic Cryptographic and Hashing Support", "${PN}-core",
198 "hashlib.* md5.* sha.* lib-dynload/crypt.so lib-dynload/_hashlib.so lib-dynload/_sha256.so lib-dynload/_sha512.so" )
199
200 m.addPackage( "${PN}-textutils", "Python Option Parsing, Text Wrapping and Comma-Separated-Value Support", "${PN}-core ${PN}-io ${PN}-re ${PN}-stringold",
201 "lib-dynload/_csv.so csv.* optparse.* textwrap.*" )
202
203 m.addPackage( "${PN}-curses", "Python Curses Support", "${PN}-core",
204 "curses lib-dynload/_curses.so lib-dynload/_curses_panel.so" ) # directory + low level module
205
206 m.addPackage( "${PN}-ctypes", "Python C Types Support", "${PN}-core",
207 "ctypes lib-dynload/_ctypes.so" ) # directory + low level module
208
209 m.addPackage( "${PN}-datetime", "Python Calendar and Time support", "${PN}-core ${PN}-codecs",
210 "_strptime.* calendar.* lib-dynload/datetime.so" )
211
212 m.addPackage( "${PN}-db", "Python File-Based Database Support", "${PN}-core",
213 "anydbm.* dumbdbm.* whichdb.* " )
214
215 m.addPackage( "${PN}-debugger", "Python Debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint",
216 "bdb.* pdb.*" )
217
218 m.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects.", "${PN}-lang ${PN}-re",
219 "difflib.*" )
220
221 m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core",
222 "config distutils" ) # package
223
224 m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings.", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib",
225 "doctest.*" )
226
227 # FIXME consider adding to some higher level package
228 m.addPackage( "${PN}-elementtree", "Python elementree", "${PN}-core",
229 "lib-dynload/_elementtree.so" )
230
231 m.addPackage( "${PN}-email", "Python Email Support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient",
232 "imaplib.* email" ) # package
233
234 m.addPackage( "${PN}-fcntl", "Python's fcntl Interface", "${PN}-core",
235 "lib-dynload/fcntl.so" )
236
237 m.addPackage( "${PN}-hotshot", "Python Hotshot Profiler", "${PN}-core",
238 "hotshot lib-dynload/_hotshot.so" )
239
240 m.addPackage( "${PN}-html", "Python HTML Processing", "${PN}-core",
241 "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* " )
242
243 m.addPackage( "${PN}-gdbm", "Python GNU Database Support", "${PN}-core",
244 "lib-dynload/gdbm.so" )
245
246 m.addPackage( "${PN}-image", "Python Graphical Image Handling", "${PN}-core",
247 "colorsys.* imghdr.* lib-dynload/imageop.so lib-dynload/rgbimg.so" )
248
249 m.addPackage( "${PN}-io", "Python Low-Level I/O", "${PN}-core ${PN}-math",
250 "lib-dynload/_socket.so lib-dynload/_ssl.so lib-dynload/select.so lib-dynload/termios.so lib-dynload/cStringIO.so " +
251 "pipes.* socket.* ssl.* tempfile.* StringIO.* " )
252
253 m.addPackage( "${PN}-json", "Python JSON Support", "${PN}-core ${PN}-math ${PN}-re",
254 "json" ) # package
255
256 m.addPackage( "${PN}-lang", "Python Low-Level Language Support", "${PN}-core",
257 "lib-dynload/_bisect.so lib-dynload/_collections.so lib-dynload/_heapq.so lib-dynload/_weakref.so lib-dynload/_functools.so " +
258 "lib-dynload/array.so lib-dynload/itertools.so lib-dynload/operator.so lib-dynload/parser.so " +
259 "atexit.* bisect.* code.* codeop.* collections.* dis.* functools.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " +
260 "tokenize.* traceback.* weakref.*" )
261
262 m.addPackage( "${PN}-logging", "Python Logging Support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold",
263 "logging" ) # package
264
265 m.addPackage( "${PN}-mailbox", "Python Mailbox Format Support", "${PN}-core ${PN}-mime",
266 "mailbox.*" )
267
268 m.addPackage( "${PN}-math", "Python Math Support", "${PN}-core",
269 "lib-dynload/cmath.so lib-dynload/math.so lib-dynload/_random.so random.* sets.*" )
270
271 m.addPackage( "${PN}-mime", "Python MIME Handling APIs", "${PN}-core ${PN}-io",
272 "mimetools.* uu.* quopri.* rfc822.*" )
273
274 m.addPackage( "${PN}-mmap", "Python Memory-Mapped-File Support", "${PN}-core ${PN}-io",
275 "lib-dynload/mmap.so " )
276
277 m.addPackage( "${PN}-multiprocessing", "Python Multiprocessing Support", "${PN}-core ${PN}-io ${PN}-lang",
278 "lib-dynload/_multiprocessing.so multiprocessing" ) # package
279
280 m.addPackage( "${PN}-netclient", "Python Internet Protocol Clients", "${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime",
281 "*Cookie*.* " +
282 "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.* rfc822.* mimetools.*" )
283
284 m.addPackage( "${PN}-netserver", "Python Internet Protocol Servers", "${PN}-core ${PN}-netclient",
285 "cgi.* *HTTPServer.* SocketServer.*" )
286
287 m.addPackage( "${PN}-numbers", "Python Number APIs", "${PN}-core ${PN}-lang ${PN}-re",
288 "decimal.* numbers.*" )
289
290 m.addPackage( "${PN}-pickle", "Python Persistence Support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re",
291 "pickle.* shelve.* lib-dynload/cPickle.so" )
292
293 m.addPackage( "${PN}-pkgutil", "Python Package Extension Utility Support", "${PN}-core",
294 "pkgutil.*")
295
296 m.addPackage( "${PN}-pprint", "Python Pretty-Print Support", "${PN}-core",
297 "pprint.*" )
298
299 m.addPackage( "${PN}-profile", "Python Basic Profiling Support", "${PN}-core ${PN}-textutils",
300 "profile.* pstats.* cProfile.* lib-dynload/_lsprof.so" )
301
302 m.addPackage( "${PN}-re", "Python Regular Expression APIs", "${PN}-core",
303 "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
304
305 m.addPackage( "${PN}-readline", "Python Readline Support", "${PN}-core",
306 "lib-dynload/readline.so rlcompleter.*" )
307
308 m.addPackage( "${PN}-resource", "Python Resource Control Interface", "${PN}-core",
309 "lib-dynload/resource.so" )
310
311 m.addPackage( "${PN}-shell", "Python Shell-Like Functionality", "${PN}-core ${PN}-re",
312 "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
313
314 m.addPackage( "${PN}-robotparser", "Python robots.txt parser", "${PN}-core ${PN}-netclient",
315 "robotparser.*")
316
317 m.addPackage( "${PN}-subprocess", "Python Subprocess Support", "${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle",
318 "subprocess.*" )
319
320 m.addPackage( "${PN}-sqlite3", "Python Sqlite3 Database Support", "${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib",
321 "lib-dynload/_sqlite3.so sqlite3/dbapi2.* sqlite3/__init__.* sqlite3/dump.*" )
322
323 m.addPackage( "${PN}-sqlite3-tests", "Python Sqlite3 Database Support Tests", "${PN}-core ${PN}-sqlite3",
324 "sqlite3/test" )
325
326 m.addPackage( "${PN}-stringold", "Python String APIs [deprecated]", "${PN}-core ${PN}-re",
327 "lib-dynload/strop.so string.*" )
328
329 m.addPackage( "${PN}-syslog", "Python Syslog Interface", "${PN}-core",
330 "lib-dynload/syslog.so" )
331
332 m.addPackage( "${PN}-terminal", "Python Terminal Controlling Support", "${PN}-core ${PN}-io",
333 "pty.* tty.*" )
334
335 m.addPackage( "${PN}-tests", "Python Tests", "${PN}-core",
336 "test" ) # package
337
338 m.addPackage( "${PN}-threading", "Python Threading & Synchronization Support", "${PN}-core ${PN}-lang",
339 "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" )
340
341 m.addPackage( "${PN}-tkinter", "Python Tcl/Tk Bindings", "${PN}-core",
342 "lib-dynload/_tkinter.so lib-tk" ) # package
343
344 m.addPackage( "${PN}-unittest", "Python Unit Testing Framework", "${PN}-core ${PN}-stringold ${PN}-lang",
345 "unittest.*" )
346
347 m.addPackage( "${PN}-unixadmin", "Python Unix Administration Support", "${PN}-core",
348 "lib-dynload/nis.so lib-dynload/grp.so lib-dynload/pwd.so getpass.*" )
349
350 m.addPackage( "${PN}-xml", "Python basic XML support.", "${PN}-core ${PN}-elementtree ${PN}-re",
351 "lib-dynload/pyexpat.so xml xmllib.*" ) # package
352
353 m.addPackage( "${PN}-xmlrpc", "Python XMLRPC Support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang",
354 "xmlrpclib.* SimpleXMLRPCServer.*" )
355
356 m.addPackage( "${PN}-zlib", "Python zlib Support.", "${PN}-core",
357 "lib-dynload/zlib.so" )
358
359 m.addPackage( "${PN}-mailbox", "Python Mailbox Format Support", "${PN}-core ${PN}-mime",
360 "mailbox.*" )
361
362 m.make()