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