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
15 __author__
= "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
16 __version__
= "20081209"
20 def __init__( self
, outfile
):
23 self
.targetPrefix
= "${libdir}/python%s/" % VERSION
[:3]
26 # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
27 # Generator: '%s' Version %s (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
28 # Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
29 """ % ( sys
.argv
[0], __version__
) )
35 def out( self
, data
):
36 """print a line to the output file"""
37 self
.output
.write( "%s\n" % data
)
39 def setPrefix( self
, targetPrefix
):
40 """set a file prefix for addPackage files"""
41 self
.targetPrefix
= targetPrefix
47 def addPackage( self
, revision
, name
, description
, dependencies
, filenames
):
48 """add a package to the Makefile"""
49 if type( filenames
) == type( "" ):
50 filenames
= filenames
.split()
52 for filename
in filenames
:
53 if filename
[0] != "$":
54 fullFilenames
.append( "%s%s" % ( self
.targetPrefix
, filename
) )
56 fullFilenames
.append( filename
)
57 self
.packages
[name
] = revision
, description
, dependencies
, fullFilenames
60 """generate body of Makefile"""
65 # generate provides line
68 provideLine
= 'PROVIDES+="'
69 for name
in self
.packages
:
70 provideLine
+= "%s " % name
73 self
.out( provideLine
)
77 # generate package line
80 packageLine
= 'PACKAGES="'
81 for name
in self
.packages
:
82 packageLine
+= "%s " % name
83 packageLine
+= ' python-modules"'
85 self
.out( packageLine
)
89 # generate package variables
92 for name
, data
in self
.packages
.iteritems():
93 rev
, desc
, deps
, files
= data
96 # write out the description, revision and dependencies
98 self
.out( 'DESCRIPTION_%s="%s"' % ( name
, desc
) )
99 self
.out( 'PR_%s="ml%d"' % ( name
, rev
+ BASEREV
) )
100 self
.out( 'RDEPENDS_%s="%s"' % ( name
, deps
) )
102 line
= 'FILES_%s="' % name
105 # check which directories to make in the temporary directory
108 dirset
= {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead.
110 dirset
[os
.path
.dirname( target
)] = True
113 # generate which files to copy for the target (-dfR because whole directories are also allowed)
117 line
+= "%s " % target
123 self
.out( 'DESCRIPTION_python-modules="All Python modules"' )
124 line
= 'RDEPENDS_python-modules="'
126 for name
, data
in self
.packages
.iteritems():
127 if name
!= 'python-core-dbg':
130 self
.out( "%s \"" % line
)
131 self
.out( 'ALLOW_EMPTY_python-modules = "1"' )
133 def doEpilog( self
):
142 if __name__
== "__main__":
144 if len( sys
.argv
) > 1:
145 os
.popen( "rm -f ./%s" % sys
.argv
[1] )
146 outfile
= file( sys
.argv
[1], "w" )
150 m
= MakefileMaker( outfile
)
152 # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
153 # Parameters: revision, name, description, dependencies, filenames
156 m
.addPackage( 0, "python-core", "Python Interpreter and core modules (needed!)", "",
157 "__future__.* copy.* copy_reg.* ConfigParser.* " +
158 "getopt.* linecache.* new.* " +
159 "os.* posixpath.* struct.* " +
160 "warnings.* site.* stat.* " +
161 "UserDict.* UserList.* UserString.* " +
162 "lib-dynload/binascii.so lib-dynload/_struct.so lib-dynload/time.so " +
163 "lib-dynload/xreadlines.so types.* ${bindir}/python*" )
165 m
.addPackage( 0, "python-core-dbg", "Python core module debug information", "python-core",
166 "lib-dynload/.debug ${bindir}/.debug ${libdir}/.debug" )
168 m
.addPackage( 0, "python-devel", "Python Development Package", "python-core",
169 "${includedir} config" ) # package
171 m
.addPackage( 0, "python-idle", "Python Integrated Development Environment", "python-core python-tkinter",
172 "${bindir}/idle idlelib" ) # package
174 m
.addPackage( 0, "python-pydoc", "Python Interactive Help Support", "python-core python-lang python-stringold python-re",
175 "${bindir}/pydoc pydoc.*" )
177 m
.addPackage( 0, "python-smtpd", "Python Simple Mail Transport Daemon", "python-core python-netserver python-email python-mime",
178 "${bindir}/smtpd.*" )
180 m
.addPackage( 0, "python-audio", "Python Audio Handling", "python-core",
181 "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.so lib-dynload/audioop.so" )
183 m
.addPackage( 0, "python-bsddb", "Python Berkeley Database Bindings", "python-core",
184 "bsddb lib-dynload/_bsddb.so" ) # package
186 m
.addPackage( 0, "python-codecs", "Python Codecs, Encodings & i18n Support", "python-core python-lang",
187 "codecs.* encodings gettext.* locale.* lib-dynload/_locale.so lib-dynload/unicodedata.so stringprep.* xdrlib.*" )
189 m
.addPackage( 0, "python-compile", "Python Bytecode Compilation Support", "python-core",
190 "py_compile.* compileall.*" )
192 m
.addPackage( 0, "python-compiler", "Python Compiler Support", "python-core",
193 "compiler" ) # package
195 m
.addPackage( 0, "python-compression", "Python High Level Compression Support", "python-core python-zlib",
196 "gzip.* zipfile.* tarfile.*" )
198 m
.addPackage( 0, "python-crypt", "Python Basic Cryptographic and Hashing Support", "python-core",
199 "hashlib.* md5.* sha.* lib-dynload/crypt.so lib-dynload/_hashlib.so lib-dynload/_sha256.so lib-dynload/_sha512.so" )
201 m
.addPackage( 0, "python-textutils", "Python Option Parsing, Text Wrapping and Comma-Separated-Value Support", "python-core python-io python-re python-stringold",
202 "lib-dynload/_csv.so csv.* optparse.* textwrap.*" )
204 m
.addPackage( 0, "python-curses", "Python Curses Support", "python-core",
205 "curses lib-dynload/_curses.so lib-dynload/_curses_panel.so" ) # directory + low level module
207 m
.addPackage( 0, "python-ctypes", "Python C Types Support", "python-core",
208 "ctypes lib-dynload/_ctypes.so" ) # directory + low level module
210 m
.addPackage( 0, "python-datetime", "Python Calendar and Time support", "python-core python-codecs",
211 "_strptime.* calendar.* lib-dynload/datetime.so" )
213 m
.addPackage( 0, "python-db", "Python File-Based Database Support", "python-core",
214 "anydbm.* dumbdbm.* whichdb.* " )
216 m
.addPackage( 0, "python-debugger", "Python Debugger", "python-core python-io python-lang python-re python-stringold python-shell python-pprint",
219 m
.addPackage( 0, "python-difflib", "Python helpers for computing deltas between objects.", "python-lang python-re",
222 m
.addPackage( 0, "python-distutils", "Python Distribution Utilities", "python-core",
223 "config distutils" ) # package
225 m
.addPackage( 0, "python-doctest", "Python framework for running examples in docstrings.", "python-core python-lang python-io python-re python-unittest python-debugger python-difflib",
228 m
.addPackage( 0, "python-email", "Python Email Support", "python-core python-io python-re python-mime python-audio python-image",
231 m
.addPackage( 0, "python-fcntl", "Python's fcntl Interface", "python-core",
232 "lib-dynload/fcntl.so" )
234 m
.addPackage( 0, "python-hotshot", "Python Hotshot Profiler", "python-core",
235 "hotshot lib-dynload/_hotshot.so" )
237 m
.addPackage( 0, "python-html", "Python HTML Processing", "python-core",
238 "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* " )
240 m
.addPackage( 0, "python-gdbm", "Python GNU Database Support", "python-core",
241 "lib-dynload/gdbm.so" )
243 m
.addPackage( 0, "python-image", "Python Graphical Image Handling", "python-core",
244 "colorsys.* imghdr.* lib-dynload/imageop.so lib-dynload/rgbimg.so" )
246 m
.addPackage( 0, "python-io", "Python Low-Level I/O", "python-core python-math",
247 "lib-dynload/_socket.so lib-dynload/_ssl.so lib-dynload/select.so lib-dynload/termios.so lib-dynload/cStringIO.so "
248 "pipes.* socket.* tempfile.* StringIO.* " )
250 m
.addPackage( 0, "python-lang", "Python Low-Level Language Support", "python-core",
251 "lib-dynload/array.so lib-dynload/parser.so lib-dynload/operator.so lib-dynload/_weakref.so " +
252 "lib-dynload/itertools.so lib-dynload/collections.so lib-dynload/_bisect.so lib-dynload/_heapq.so " +
253 "atexit.* bisect.* code.* codeop.* dis.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " +
254 " tokenize.* traceback.* linecache.* weakref.*" )
256 m
.addPackage( 0, "python-logging", "Python Logging Support", "python-core python-io python-lang python-pickle python-stringold",
257 "logging" ) # package
259 m
.addPackage( 0, "python-tkinter", "Python Tcl/Tk Bindings", "python-core",
260 "lib-dynload/_tkinter.so lib-tk" ) # package
262 m
.addPackage( 0, "python-math", "Python Math Support", "python-core",
263 "lib-dynload/cmath.so lib-dynload/math.so lib-dynload/_random.so random.* sets.*" )
265 m
.addPackage( 0, "python-mime", "Python MIME Handling APIs", "python-core python-io",
266 "mimetools.* uu.* quopri.* rfc822.*" )
268 m
.addPackage( 0, "python-mmap", "Python Memory-Mapped-File Support", "python-core python-io",
269 "lib-dynload/mmap.so " )
271 m
.addPackage( 0, "python-unixadmin", "Python Unix Administration Support", "python-core",
272 "lib-dynload/nis.so lib-dynload/grp.so lib-dynload/pwd.so getpass.*" )
274 m
.addPackage( 0, "python-netclient", "Python Internet Protocol Clients", "python-core python-crypt python-datetime python-io python-lang python-logging python-mime",
276 "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.*" )
278 m
.addPackage( 0, "python-netserver", "Python Internet Protocol Servers", "python-core python-netclient",
279 "cgi.* BaseHTTPServer.* SimpleHTTPServer.* SocketServer.*" )
281 m
.addPackage( 0, "python-pickle", "Python Persistence Support", "python-core python-codecs python-io python-re",
282 "pickle.* shelve.* lib-dynload/cPickle.so" )
284 m
.addPackage( 0, "python-pkgutil", "Python Package Extension Utility Support", "python-core",
287 m
.addPackage( 0, "python-pprint", "Python Pretty-Print Support", "python-core",
290 m
.addPackage( 0, "python-profile", "Python Basic Profiling Support", "python-core python-textutils",
291 "profile.* pstats.* cProfile.* lib-dynload/_lsprof.so" )
293 m
.addPackage( 0, "python-re", "Python Regular Expression APIs", "python-core",
294 "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
296 m
.addPackage( 0, "python-readline", "Python Readline Support", "python-core",
297 "lib-dynload/readline.so rlcompleter.*" )
299 m
.addPackage( 0, "python-resource", "Python Resource Control Interface", "python-core",
300 "lib-dynload/resource.so" )
302 m
.addPackage( 0, "python-shell", "Python Shell-Like Functionality", "python-core python-re",
303 "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
305 m
.addPackage( 0, "python-robotparser", "Python robots.txt parser", "python-core python-netclient",
308 m
.addPackage( 0, "python-subprocess", "Python Subprocess Support", "python-core python-io python-re python-fcntl python-pickle",
311 m
.addPackage( 0, "python-sqlite3", "Python Sqlite3 Database Support", "python-core python-datetime python-lang python-crypt python-io python-threading python-zlib",
312 "lib-dynload/_sqlite3.so sqlite3/dbapi2.* sqlite3/__init__.*" )
314 m
.addPackage( 0, "python-sqlite3-tests", "Python Sqlite3 Database Support Tests", "python-core python-sqlite3",
317 m
.addPackage( 0, "python-stringold", "Python String APIs [deprecated]", "python-core python-re",
318 "lib-dynload/strop.so string.*" )
320 m
.addPackage( 0, "python-syslog", "Python's Syslog Interface", "python-core",
321 "lib-dynload/syslog.so" )
323 m
.addPackage( 0, "python-terminal", "Python Terminal Controlling Support", "python-core python-io",
326 m
.addPackage( 0, "python-tests", "Python Tests", "python-core",
329 m
.addPackage( 0, "python-threading", "Python Threading & Synchronization Support", "python-core python-lang",
330 "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" )
332 m
.addPackage( 0, "python-unittest", "Python Unit Testing Framework", "python-core python-stringold python-lang",
335 m
.addPackage( 0, "python-xml", "Python basic XML support.", "python-core python-re",
336 "lib-dynload/pyexpat.so xml xmllib.*" ) # package
338 m
.addPackage( 0, "python-xmlrpc", "Python XMLRPC Support", "python-core python-xml python-netserver python-lang",
339 "xmlrpclib.* SimpleXMLRPCServer.*" )
341 m
.addPackage( 0, "python-zlib", "Python zlib Support.", "python-core",
342 "lib-dynload/zlib.so" )
344 m
.addPackage( 0, "python-mailbox", "Python Mailbox Format Support", "python-core python-mime",
347 # FIXME consider adding to python-compression
348 m
.addPackage( 0, "python-bzip2", "Python bzip2 support", "python-core",
349 "lib-dynload/bz2.so" )
351 # FIXME consider adding to some higher level package
352 m
.addPackage( 0, "python-elementtree", "Python elementree", "python-core",
353 "lib-dynload/_elementtree.so" )