angstrom-uboot-scripts: add scripts for using pico DLP + DSP and gumstix palo43 ...
[openembedded.git] / contrib / python / generate-manifest-2.6.py
blobfe0e38596bfb7207ce5c3e3dcf7b1cbc585302a8
1 #!/usr/bin/env python
3 # generate Python Manifest for the OpenEmbedded build system
4 # (C) 2002-2009 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
5 # (C) 2007 Jeremy Laine
6 # licensed under MIT, see COPYING.MIT
8 import os
9 import sys
10 import time
12 VERSION = "2.6.2"
14 __author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
15 __version__ = "20091004"
17 class MakefileMaker:
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-2009 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__ ) )
31 # helper functions
34 def out( self, data ):
35 """print a line to the output file"""
36 self.output.write( "%s\n" % data )
38 def setPrefix( self, targetPrefix ):
39 """set a file prefix for addPackage files"""
40 self.targetPrefix = targetPrefix
42 def doProlog( self ):
43 self.out( """ """ )
44 self.out( "" )
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
58 def doBody( self ):
59 """generate body of Makefile"""
61 global VERSION
64 # generate provides line
67 provideLine = 'PROVIDES+="'
68 for name in self.packages:
69 provideLine += "%s " % name
70 provideLine += '"'
72 self.out( provideLine )
73 self.out( "" )
76 # generate package line
79 packageLine = 'PACKAGES="python-core-dbg '
80 for name in self.packages:
81 if name != 'python-core-dbg':
82 packageLine += "%s " % name
83 packageLine += 'python-modules"'
85 self.out( packageLine )
86 self.out( "" )
89 # generate package variables
92 for name, data in self.packages.iteritems():
93 desc, deps, files = data
96 # write out the description, revision and dependencies
98 self.out( 'DESCRIPTION_%s="%s"' % ( name, desc ) )
99 self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) )
101 line = 'FILES_%s="' % name
104 # check which directories to make in the temporary directory
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
112 # generate which files to copy for the target (-dfR because whole directories are also allowed)
115 for target in files:
116 line += "%s " % target
118 line += '"'
119 self.out( line )
120 self.out( "" )
122 self.out( 'DESCRIPTION_python-modules="All Python modules"' )
123 line = 'RDEPENDS_python-modules="'
125 for name, data in self.packages.iteritems():
126 if name != 'python-core-dbg':
127 line += "%s " % name
129 self.out( "%s \"" % line )
130 self.out( 'ALLOW_EMPTY_python-modules = "1"' )
132 def doEpilog( self ):
133 self.out( """""" )
134 self.out( "" )
136 def make( self ):
137 self.doProlog()
138 self.doBody()
139 self.doEpilog()
141 if __name__ == "__main__":
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
149 m = MakefileMaker( outfile )
151 # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
152 # Parameters: revision, name, description, dependencies, filenames
155 m.addPackage( "python-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.* ${bindir}/python*" )
164 m.addPackage( "python-core-dbg", "Python core module debug information", "python-core",
165 "config/.debug lib-dynload/.debug ${bindir}/.debug ${libdir}/.debug" )
167 m.addPackage( "python-devel", "Python Development Package", "python-core",
168 "${includedir} ${libdir}/libpython2.6.so config" ) # package
170 m.addPackage( "python-idle", "Python Integrated Development Environment", "python-core python-tkinter",
171 "${bindir}/idle idlelib" ) # package
173 m.addPackage( "python-pydoc", "Python Interactive Help Support", "python-core python-lang python-stringold python-re",
174 "${bindir}/pydoc pydoc.*" )
176 m.addPackage( "python-smtpd", "Python Simple Mail Transport Daemon", "python-core python-netserver python-email python-mime",
177 "${bindir}/smtpd.*" )
179 m.addPackage( "python-audio", "Python Audio Handling", "python-core",
180 "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.so lib-dynload/audioop.so" )
182 m.addPackage( "python-bsddb", "Python Berkeley Database Bindings", "python-core",
183 "bsddb lib-dynload/_bsddb.so" ) # package
185 m.addPackage( "python-codecs", "Python Codecs, Encodings & i18n Support", "python-core python-lang",
186 "codecs.* encodings gettext.* locale.* lib-dynload/_locale.so lib-dynload/unicodedata.so stringprep.* xdrlib.*" )
188 m.addPackage( "python-compile", "Python Bytecode Compilation Support", "python-core",
189 "py_compile.* compileall.*" )
191 m.addPackage( "python-compiler", "Python Compiler Support", "python-core",
192 "compiler" ) # package
194 m.addPackage( "python-compression", "Python High Level Compression Support", "python-core python-zlib",
195 "gzip.* zipfile.* tarfile.* lib-dynload/bz2.so" )
197 m.addPackage( "python-crypt", "Python Basic Cryptographic and Hashing Support", "python-core",
198 "hashlib.* md5.* sha.* lib-dynload/crypt.so lib-dynload/_hashlib.so lib-dynload/_sha256.so lib-dynload/_sha512.so" )
200 m.addPackage( "python-textutils", "Python Option Parsing, Text Wrapping and Comma-Separated-Value Support", "python-core python-io python-re python-stringold",
201 "lib-dynload/_csv.so csv.* optparse.* textwrap.*" )
203 m.addPackage( "python-curses", "Python Curses Support", "python-core",
204 "curses lib-dynload/_curses.so lib-dynload/_curses_panel.so" ) # directory + low level module
206 m.addPackage( "python-ctypes", "Python C Types Support", "python-core",
207 "ctypes lib-dynload/_ctypes.so" ) # directory + low level module
209 m.addPackage( "python-datetime", "Python Calendar and Time support", "python-core python-codecs",
210 "_strptime.* calendar.* lib-dynload/datetime.so" )
212 m.addPackage( "python-db", "Python File-Based Database Support", "python-core",
213 "anydbm.* dumbdbm.* whichdb.* " )
215 m.addPackage( "python-debugger", "Python Debugger", "python-core python-io python-lang python-re python-stringold python-shell python-pprint",
216 "bdb.* pdb.*" )
218 m.addPackage( "python-difflib", "Python helpers for computing deltas between objects.", "python-lang python-re",
219 "difflib.*" )
221 m.addPackage( "python-distutils", "Python Distribution Utilities", "python-core",
222 "config distutils" ) # package
224 m.addPackage( "python-doctest", "Python framework for running examples in docstrings.", "python-core python-lang python-io python-re python-unittest python-debugger python-difflib",
225 "doctest.*" )
227 # FIXME consider adding to some higher level package
228 m.addPackage( "python-elementtree", "Python elementree", "python-core",
229 "lib-dynload/_elementtree.so" )
231 m.addPackage( "python-email", "Python Email Support", "python-core python-io python-re python-mime python-audio python-image python-netclient",
232 "imaplib.* email" ) # package
234 m.addPackage( "python-fcntl", "Python's fcntl Interface", "python-core",
235 "lib-dynload/fcntl.so" )
237 m.addPackage( "python-hotshot", "Python Hotshot Profiler", "python-core",
238 "hotshot lib-dynload/_hotshot.so" )
240 m.addPackage( "python-html", "Python HTML Processing", "python-core",
241 "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* " )
243 m.addPackage( "python-gdbm", "Python GNU Database Support", "python-core",
244 "lib-dynload/gdbm.so" )
246 m.addPackage( "python-image", "Python Graphical Image Handling", "python-core",
247 "colorsys.* imghdr.* lib-dynload/imageop.so lib-dynload/rgbimg.so" )
249 m.addPackage( "python-io", "Python Low-Level I/O", "python-core python-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.* tempfile.* StringIO.* " )
253 m.addPackage( "python-json", "Python JSON Support", "python-core python-math python-re",
254 "json" ) # package
256 m.addPackage( "python-lang", "Python Low-Level Language Support", "python-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.* linecache.* weakref.*" )
262 m.addPackage( "python-logging", "Python Logging Support", "python-core python-io python-lang python-pickle python-stringold",
263 "logging" ) # package
265 m.addPackage( "python-mailbox", "Python Mailbox Format Support", "python-core python-mime",
266 "mailbox.*" )
268 m.addPackage( "python-math", "Python Math Support", "python-core",
269 "lib-dynload/cmath.so lib-dynload/math.so lib-dynload/_random.so random.* sets.*" )
271 m.addPackage( "python-mime", "Python MIME Handling APIs", "python-core python-io",
272 "mimetools.* uu.* quopri.* rfc822.*" )
274 m.addPackage( "python-mmap", "Python Memory-Mapped-File Support", "python-core python-io",
275 "lib-dynload/mmap.so " )
277 m.addPackage( "python-multiprocessing", "Python Multiprocessing Support", "python-core python-io python-lang",
278 "lib-dynload/_multiprocessing.so multiprocessing" ) # package
280 m.addPackage( "python-netclient", "Python Internet Protocol Clients", "python-core python-crypt python-datetime python-io python-lang python-logging python-mime",
281 "*Cookie*.* " +
282 "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.* rfc822.* mimetools.*" )
284 m.addPackage( "python-netserver", "Python Internet Protocol Servers", "python-core python-netclient",
285 "cgi.* *HTTPServer.* SocketServer.*" )
287 m.addPackage( "python-pickle", "Python Persistence Support", "python-core python-codecs python-io python-re",
288 "pickle.* shelve.* lib-dynload/cPickle.so" )
290 m.addPackage( "python-pkgutil", "Python Package Extension Utility Support", "python-core",
291 "pkgutil.*")
293 m.addPackage( "python-pprint", "Python Pretty-Print Support", "python-core",
294 "pprint.*" )
296 m.addPackage( "python-profile", "Python Basic Profiling Support", "python-core python-textutils",
297 "profile.* pstats.* cProfile.* lib-dynload/_lsprof.so" )
299 m.addPackage( "python-re", "Python Regular Expression APIs", "python-core",
300 "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
302 m.addPackage( "python-readline", "Python Readline Support", "python-core",
303 "lib-dynload/readline.so rlcompleter.*" )
305 m.addPackage( "python-resource", "Python Resource Control Interface", "python-core",
306 "lib-dynload/resource.so" )
308 m.addPackage( "python-shell", "Python Shell-Like Functionality", "python-core python-re",
309 "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
311 m.addPackage( "python-robotparser", "Python robots.txt parser", "python-core python-netclient",
312 "robotparser.*")
314 m.addPackage( "python-subprocess", "Python Subprocess Support", "python-core python-io python-re python-fcntl python-pickle",
315 "subprocess.*" )
317 m.addPackage( "python-sqlite3", "Python Sqlite3 Database Support", "python-core python-datetime python-lang python-crypt python-io python-threading python-zlib",
318 "lib-dynload/_sqlite3.so sqlite3/dbapi2.* sqlite3/__init__.* sqlite3/dump.*" )
320 m.addPackage( "python-sqlite3-tests", "Python Sqlite3 Database Support Tests", "python-core python-sqlite3",
321 "sqlite3/test" )
323 m.addPackage( "python-stringold", "Python String APIs [deprecated]", "python-core python-re",
324 "lib-dynload/strop.so string.*" )
326 m.addPackage( "python-syslog", "Python Syslog Interface", "python-core",
327 "lib-dynload/syslog.so" )
329 m.addPackage( "python-terminal", "Python Terminal Controlling Support", "python-core python-io",
330 "pty.* tty.*" )
332 m.addPackage( "python-tests", "Python Tests", "python-core",
333 "test" ) # package
335 m.addPackage( "python-threading", "Python Threading & Synchronization Support", "python-core python-lang",
336 "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" )
338 m.addPackage( "python-tkinter", "Python Tcl/Tk Bindings", "python-core",
339 "lib-dynload/_tkinter.so lib-tk" ) # package
341 m.addPackage( "python-unittest", "Python Unit Testing Framework", "python-core python-stringold python-lang",
342 "unittest.*" )
344 m.addPackage( "python-unixadmin", "Python Unix Administration Support", "python-core",
345 "lib-dynload/nis.so lib-dynload/grp.so lib-dynload/pwd.so getpass.*" )
347 m.addPackage( "python-xml", "Python basic XML support.", "python-core python-re",
348 "lib-dynload/pyexpat.so xml xmllib.*" ) # package
350 m.addPackage( "python-xmlrpc", "Python XMLRPC Support", "python-core python-xml python-netserver python-lang",
351 "xmlrpclib.* SimpleXMLRPCServer.*" )
353 m.addPackage( "python-zlib", "Python zlib Support.", "python-core",
354 "lib-dynload/zlib.so" )
356 m.addPackage( "python-mailbox", "Python Mailbox Format Support", "python-core python-mime",
357 "mailbox.*" )
359 m.make()