nbd: Recipe for 2.9.11
[openembedded/mini2440.git] / contrib / python / generate-manifest-2.6.py
blobb75486f129725871fbdb412094499c5d5a3ba623
1 #!/usr/bin/env python
3 # generate Python Manifest for the OpenEmbedded build system
4 # (C) 2002-2008 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.1"
14 __author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
15 __version__ = "20081214"
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-2008 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="'
80 for name in self.packages:
81 packageLine += "%s " % name
82 packageLine += ' python-modules"'
84 self.out( packageLine )
85 self.out( "" )
88 # generate package variables
91 for name, data in self.packages.iteritems():
92 desc, deps, files = data
95 # write out the description, revision and dependencies
97 self.out( 'DESCRIPTION_%s="%s"' % ( name, desc ) )
98 self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) )
100 line = 'FILES_%s="' % name
103 # check which directories to make in the temporary directory
106 dirset = {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead.
107 for target in files:
108 dirset[os.path.dirname( target )] = True
111 # generate which files to copy for the target (-dfR because whole directories are also allowed)
114 for target in files:
115 line += "%s " % target
117 line += '"'
118 self.out( line )
119 self.out( "" )
121 self.out( 'DESCRIPTION_python-modules="All Python modules"' )
122 line = 'RDEPENDS_python-modules="'
124 for name, data in self.packages.iteritems():
125 if name != 'python-core-dbg':
126 line += "%s " % name
128 self.out( "%s \"" % line )
129 self.out( 'ALLOW_EMPTY_python-modules = "1"' )
131 def doEpilog( self ):
132 self.out( """""" )
133 self.out( "" )
135 def make( self ):
136 self.doProlog()
137 self.doBody()
138 self.doEpilog()
140 if __name__ == "__main__":
142 if len( sys.argv ) > 1:
143 os.popen( "rm -f ./%s" % sys.argv[1] )
144 outfile = file( sys.argv[1], "w" )
145 else:
146 outfile = sys.stdout
148 m = MakefileMaker( outfile )
150 # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
151 # Parameters: revision, name, description, dependencies, filenames
154 m.addPackage( "python-core", "Python Interpreter and core modules (needed!)", "",
155 "__future__.* _abcoll.* abc.* copy.* copy_reg.* ConfigParser.* " +
156 "genericpath.* getopt.* linecache.* new.* " +
157 "os.* posixpath.* struct.* " +
158 "warnings.* site.* stat.* " +
159 "UserDict.* UserList.* UserString.* " +
160 "lib-dynload/binascii.so lib-dynload/_struct.so lib-dynload/time.so " +
161 "lib-dynload/xreadlines.so types.* ${bindir}/python*" )
163 m.addPackage( "python-core-dbg", "Python core module debug information", "python-core",
164 "lib-dynload/.debug ${bindir}/.debug ${libdir}/.debug" )
166 m.addPackage( "python-devel", "Python Development Package", "python-core",
167 "${includedir} config" ) # package
169 m.addPackage( "python-idle", "Python Integrated Development Environment", "python-core python-tkinter",
170 "${bindir}/idle idlelib" ) # package
172 m.addPackage( "python-pydoc", "Python Interactive Help Support", "python-core python-lang python-stringold python-re",
173 "${bindir}/pydoc pydoc.*" )
175 m.addPackage( "python-smtpd", "Python Simple Mail Transport Daemon", "python-core python-netserver python-email python-mime",
176 "${bindir}/smtpd.*" )
178 m.addPackage( "python-audio", "Python Audio Handling", "python-core",
179 "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.so lib-dynload/audioop.so" )
181 m.addPackage( "python-bsddb", "Python Berkeley Database Bindings", "python-core",
182 "bsddb lib-dynload/_bsddb.so" ) # package
184 m.addPackage( "python-codecs", "Python Codecs, Encodings & i18n Support", "python-core python-lang",
185 "codecs.* encodings gettext.* locale.* lib-dynload/_locale.so lib-dynload/unicodedata.so stringprep.* xdrlib.*" )
187 m.addPackage( "python-compile", "Python Bytecode Compilation Support", "python-core",
188 "py_compile.* compileall.*" )
190 m.addPackage( "python-compiler", "Python Compiler Support", "python-core",
191 "compiler" ) # package
193 m.addPackage( "python-compression", "Python High Level Compression Support", "python-core python-zlib",
194 "gzip.* zipfile.* tarfile.*" )
196 m.addPackage( "python-crypt", "Python Basic Cryptographic and Hashing Support", "python-core",
197 "hashlib.* md5.* sha.* lib-dynload/crypt.so lib-dynload/_hashlib.so lib-dynload/_sha256.so lib-dynload/_sha512.so" )
199 m.addPackage( "python-textutils", "Python Option Parsing, Text Wrapping and Comma-Separated-Value Support", "python-core python-io python-re python-stringold",
200 "lib-dynload/_csv.so csv.* optparse.* textwrap.*" )
202 m.addPackage( "python-curses", "Python Curses Support", "python-core",
203 "curses lib-dynload/_curses.so lib-dynload/_curses_panel.so" ) # directory + low level module
205 m.addPackage( "python-ctypes", "Python C Types Support", "python-core",
206 "ctypes lib-dynload/_ctypes.so" ) # directory + low level module
208 m.addPackage( "python-datetime", "Python Calendar and Time support", "python-core python-codecs",
209 "_strptime.* calendar.* lib-dynload/datetime.so" )
211 m.addPackage( "python-db", "Python File-Based Database Support", "python-core",
212 "anydbm.* dumbdbm.* whichdb.* " )
214 m.addPackage( "python-debugger", "Python Debugger", "python-core python-io python-lang python-re python-stringold python-shell python-pprint",
215 "bdb.* pdb.*" )
217 m.addPackage( "python-difflib", "Python helpers for computing deltas between objects.", "python-lang python-re",
218 "difflib.*" )
220 m.addPackage( "python-distutils", "Python Distribution Utilities", "python-core",
221 "config distutils" ) # package
223 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",
224 "doctest.*" )
226 m.addPackage( "python-email", "Python Email Support", "python-core python-io python-re python-mime python-audio python-image",
227 "email" ) # package
229 m.addPackage( "python-fcntl", "Python's fcntl Interface", "python-core",
230 "lib-dynload/fcntl.so" )
232 m.addPackage( "python-hotshot", "Python Hotshot Profiler", "python-core",
233 "hotshot lib-dynload/_hotshot.so" )
235 m.addPackage( "python-html", "Python HTML Processing", "python-core",
236 "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* " )
238 m.addPackage( "python-gdbm", "Python GNU Database Support", "python-core",
239 "lib-dynload/gdbm.so" )
241 m.addPackage( "python-image", "Python Graphical Image Handling", "python-core",
242 "colorsys.* imghdr.* lib-dynload/imageop.so lib-dynload/rgbimg.so" )
244 m.addPackage( "python-io", "Python Low-Level I/O", "python-core python-math",
245 "lib-dynload/_socket.so lib-dynload/_ssl.so lib-dynload/select.so lib-dynload/termios.so lib-dynload/cStringIO.so " +
246 "pipes.* socket.* tempfile.* StringIO.* " )
248 m.addPackage( "python-lang", "Python Low-Level Language Support", "python-core",
249 "lib-dynload/_bisect.so lib-dynload/_collections.so lib-dynload/_heapq.so lib-dynload/_weakref.so lib-dynload/_functools.so " +
250 "lib-dynload/array.so lib-dynload/itertools.so lib-dynload/operator.so lib-dynload/parser.so " +
251 "atexit.* bisect.* code.* codeop.* collections.* dis.* functools.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " +
252 "tokenize.* traceback.* linecache.* weakref.*" )
254 m.addPackage( "python-logging", "Python Logging Support", "python-core python-io python-lang python-pickle python-stringold",
255 "logging" ) # package
257 m.addPackage( "python-tkinter", "Python Tcl/Tk Bindings", "python-core",
258 "lib-dynload/_tkinter.so lib-tk" ) # package
260 m.addPackage( "python-math", "Python Math Support", "python-core",
261 "lib-dynload/cmath.so lib-dynload/math.so lib-dynload/_random.so random.* sets.*" )
263 m.addPackage( "python-mime", "Python MIME Handling APIs", "python-core python-io",
264 "mimetools.* uu.* quopri.* rfc822.*" )
266 m.addPackage( "python-mmap", "Python Memory-Mapped-File Support", "python-core python-io",
267 "lib-dynload/mmap.so " )
269 m.addPackage( "python-unixadmin", "Python Unix Administration Support", "python-core",
270 "lib-dynload/nis.so lib-dynload/grp.so lib-dynload/pwd.so getpass.*" )
272 m.addPackage( "python-netclient", "Python Internet Protocol Clients", "python-core python-crypt python-datetime python-io python-lang python-logging python-mime",
273 "*Cookie*.* " +
274 "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.*" )
276 m.addPackage( "python-netserver", "Python Internet Protocol Servers", "python-core python-netclient",
277 "cgi.* BaseHTTPServer.* SimpleHTTPServer.* SocketServer.*" )
279 m.addPackage( "python-pickle", "Python Persistence Support", "python-core python-codecs python-io python-re",
280 "pickle.* shelve.* lib-dynload/cPickle.so" )
282 m.addPackage( "python-pkgutil", "Python Package Extension Utility Support", "python-core",
283 "pkgutil.*")
285 m.addPackage( "python-pprint", "Python Pretty-Print Support", "python-core",
286 "pprint.*" )
288 m.addPackage( "python-profile", "Python Basic Profiling Support", "python-core python-textutils",
289 "profile.* pstats.* cProfile.* lib-dynload/_lsprof.so" )
291 m.addPackage( "python-re", "Python Regular Expression APIs", "python-core",
292 "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
294 m.addPackage( "python-readline", "Python Readline Support", "python-core",
295 "lib-dynload/readline.so rlcompleter.*" )
297 m.addPackage( "python-resource", "Python Resource Control Interface", "python-core",
298 "lib-dynload/resource.so" )
300 m.addPackage( "python-shell", "Python Shell-Like Functionality", "python-core python-re",
301 "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
303 m.addPackage( "python-robotparser", "Python robots.txt parser", "python-core python-netclient",
304 "robotparser.*")
306 m.addPackage( "python-subprocess", "Python Subprocess Support", "python-core python-io python-re python-fcntl python-pickle",
307 "subprocess.*" )
309 m.addPackage( "python-sqlite3", "Python Sqlite3 Database Support", "python-core python-datetime python-lang python-crypt python-io python-threading python-zlib",
310 "lib-dynload/_sqlite3.so sqlite3/dbapi2.* sqlite3/__init__.*" )
312 m.addPackage( "python-sqlite3-tests", "Python Sqlite3 Database Support Tests", "python-core python-sqlite3",
313 "sqlite3/test" )
315 m.addPackage( "python-stringold", "Python String APIs [deprecated]", "python-core python-re",
316 "lib-dynload/strop.so string.*" )
318 m.addPackage( "python-syslog", "Python's Syslog Interface", "python-core",
319 "lib-dynload/syslog.so" )
321 m.addPackage( "python-terminal", "Python Terminal Controlling Support", "python-core python-io",
322 "pty.* tty.*" )
324 m.addPackage( "python-tests", "Python Tests", "python-core",
325 "test" ) # package
327 m.addPackage( "python-threading", "Python Threading & Synchronization Support", "python-core python-lang",
328 "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" )
330 m.addPackage( "python-unittest", "Python Unit Testing Framework", "python-core python-stringold python-lang",
331 "unittest.*" )
333 m.addPackage( "python-xml", "Python basic XML support.", "python-core python-re",
334 "lib-dynload/pyexpat.so xml xmllib.*" ) # package
336 m.addPackage( "python-xmlrpc", "Python XMLRPC Support", "python-core python-xml python-netserver python-lang",
337 "xmlrpclib.* SimpleXMLRPCServer.*" )
339 m.addPackage( "python-zlib", "Python zlib Support.", "python-core",
340 "lib-dynload/zlib.so" )
342 m.addPackage( "python-mailbox", "Python Mailbox Format Support", "python-core python-mime",
343 "mailbox.*" )
345 # FIXME consider adding to python-compression
346 m.addPackage( "python-bzip2", "Python bzip2 support", "python-core",
347 "lib-dynload/bz2.so" )
349 # FIXME consider adding to some higher level package
350 m.addPackage( "python-elementtree", "Python elementree", "python-core",
351 "lib-dynload/_elementtree.so" )
353 m.make()