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
14 __author__
= "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
15 __version__
= "20110222"
19 def __init__( self
, outfile
):
22 self
.targetPrefix
= "${libdir}/python%s/" % VERSION
[:3]
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__
) )
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
46 def addPackage( self
, name
, description
, dependencies
, filenames
):
47 """add a package to the Makefile"""
48 if type( filenames
) == type( "" ):
49 filenames
= filenames
.split()
51 for filename
in filenames
:
52 if filename
[0] != "$":
53 fullFilenames
.append( "%s%s" % ( self
.targetPrefix
, filename
) )
55 fullFilenames
.append( filename
)
56 self
.packages
[name
] = description
, dependencies
, fullFilenames
59 """generate body of Makefile"""
64 # generate provides line
67 provideLine
= 'PROVIDES+="'
68 for name
in sorted(self
.packages
):
69 provideLine
+= "%s " % name
72 self
.out( provideLine
)
76 # generate package line
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"'
85 self
.out( packageLine
)
89 # generate package variables
92 for name
, data
in sorted(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.
109 dirset
[os
.path
.dirname( target
)] = True
112 # generate which files to copy for the target (-dfR because whole directories are also allowed)
116 line
+= "%s " % target
122 self
.out( 'DESCRIPTION_${PN}-modules="All Python modules"' )
123 line
= 'RDEPENDS_${PN}-modules="'
125 for name
, data
in sorted(self
.packages
.iteritems()):
126 if name
not in ['${PN}-core-dbg', '${PN}-dev']:
129 self
.out( "%s \"" % line
)
130 self
.out( 'ALLOW_EMPTY_${PN}-modules = "1"' )
132 def doEpilog( self
):
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" )
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( "${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*" )
164 m
.addPackage( "${PN}-core-dbg", "Python core module debug information", "${PN}-core",
165 "config/.debug lib-dynload/.debug ${bindir}/.debug ${libdir}/.debug" )
167 m
.addPackage( "${PN}-dev", "Python Development Package", "${PN}-core",
168 "${includedir} ${libdir}/libpython2.6.so" ) # package
170 m
.addPackage( "${PN}-idle", "Python Integrated Development Environment", "${PN}-core ${PN}-tkinter",
171 "${bindir}/idle idlelib" ) # package
173 m
.addPackage( "${PN}-pydoc", "Python Interactive Help Support", "${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re",
174 "${bindir}/pydoc pydoc.*" )
176 m
.addPackage( "${PN}-smtpd", "Python Simple Mail Transport Daemon", "${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime",
177 "${bindir}/smtpd.*" )
179 m
.addPackage( "${PN}-audio", "Python Audio Handling", "${PN}-core",
180 "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.so lib-dynload/audioop.so" )
182 m
.addPackage( "${PN}-bsddb", "Python Berkeley Database Bindings", "${PN}-core",
183 "bsddb lib-dynload/_bsddb.so" ) # package
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.*" )
188 m
.addPackage( "${PN}-compile", "Python Bytecode Compilation Support", "${PN}-core",
189 "py_compile.* compileall.*" )
191 m
.addPackage( "${PN}-compiler", "Python Compiler Support", "${PN}-core",
192 "compiler" ) # package
194 m
.addPackage( "${PN}-compression", "Python High Level Compression Support", "${PN}-core ${PN}-zlib",
195 "gzip.* zipfile.* tarfile.* lib-dynload/bz2.so" )
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" )
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.*" )
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
206 m
.addPackage( "${PN}-ctypes", "Python C Types Support", "${PN}-core",
207 "ctypes lib-dynload/_ctypes.so" ) # directory + low level module
209 m
.addPackage( "${PN}-datetime", "Python Calendar and Time support", "${PN}-core ${PN}-codecs",
210 "_strptime.* calendar.* lib-dynload/datetime.so" )
212 m
.addPackage( "${PN}-db", "Python File-Based Database Support", "${PN}-core",
213 "anydbm.* dumbdbm.* whichdb.* " )
215 m
.addPackage( "${PN}-debugger", "Python Debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint",
218 m
.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects.", "${PN}-lang ${PN}-re",
221 m
.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core",
222 "config distutils" ) # package
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",
227 # FIXME consider adding to some higher level package
228 m
.addPackage( "${PN}-elementtree", "Python elementree", "${PN}-core",
229 "lib-dynload/_elementtree.so" )
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
234 m
.addPackage( "${PN}-fcntl", "Python's fcntl Interface", "${PN}-core",
235 "lib-dynload/fcntl.so" )
237 m
.addPackage( "${PN}-hotshot", "Python Hotshot Profiler", "${PN}-core",
238 "hotshot lib-dynload/_hotshot.so" )
240 m
.addPackage( "${PN}-html", "Python HTML Processing", "${PN}-core",
241 "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* " )
243 m
.addPackage( "${PN}-gdbm", "Python GNU Database Support", "${PN}-core",
244 "lib-dynload/gdbm.so" )
246 m
.addPackage( "${PN}-image", "Python Graphical Image Handling", "${PN}-core",
247 "colorsys.* imghdr.* lib-dynload/imageop.so lib-dynload/rgbimg.so" )
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.* " )
253 m
.addPackage( "${PN}-json", "Python JSON Support", "${PN}-core ${PN}-math ${PN}-re",
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.*" )
262 m
.addPackage( "${PN}-logging", "Python Logging Support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold",
263 "logging" ) # package
265 m
.addPackage( "${PN}-mailbox", "Python Mailbox Format Support", "${PN}-core ${PN}-mime",
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.*" )
271 m
.addPackage( "${PN}-mime", "Python MIME Handling APIs", "${PN}-core ${PN}-io",
272 "mimetools.* uu.* quopri.* rfc822.*" )
274 m
.addPackage( "${PN}-mmap", "Python Memory-Mapped-File Support", "${PN}-core ${PN}-io",
275 "lib-dynload/mmap.so " )
277 m
.addPackage( "${PN}-multiprocessing", "Python Multiprocessing Support", "${PN}-core ${PN}-io ${PN}-lang",
278 "lib-dynload/_multiprocessing.so multiprocessing" ) # package
280 m
.addPackage( "${PN}-netclient", "Python Internet Protocol Clients", "${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime",
282 "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.* rfc822.* mimetools.*" )
284 m
.addPackage( "${PN}-netserver", "Python Internet Protocol Servers", "${PN}-core ${PN}-netclient",
285 "cgi.* *HTTPServer.* SocketServer.*" )
287 m
.addPackage( "${PN}-numbers", "Python Number APIs", "${PN}-core ${PN}-lang ${PN}-re",
288 "decimal.* numbers.*" )
290 m
.addPackage( "${PN}-pickle", "Python Persistence Support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re",
291 "pickle.* shelve.* lib-dynload/cPickle.so" )
293 m
.addPackage( "${PN}-pkgutil", "Python Package Extension Utility Support", "${PN}-core",
296 m
.addPackage( "${PN}-pprint", "Python Pretty-Print Support", "${PN}-core",
299 m
.addPackage( "${PN}-profile", "Python Basic Profiling Support", "${PN}-core ${PN}-textutils",
300 "profile.* pstats.* cProfile.* lib-dynload/_lsprof.so" )
302 m
.addPackage( "${PN}-re", "Python Regular Expression APIs", "${PN}-core",
303 "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
305 m
.addPackage( "${PN}-readline", "Python Readline Support", "${PN}-core",
306 "lib-dynload/readline.so rlcompleter.*" )
308 m
.addPackage( "${PN}-resource", "Python Resource Control Interface", "${PN}-core",
309 "lib-dynload/resource.so" )
311 m
.addPackage( "${PN}-shell", "Python Shell-Like Functionality", "${PN}-core ${PN}-re",
312 "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
314 m
.addPackage( "${PN}-robotparser", "Python robots.txt parser", "${PN}-core ${PN}-netclient",
317 m
.addPackage( "${PN}-subprocess", "Python Subprocess Support", "${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle",
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.*" )
323 m
.addPackage( "${PN}-sqlite3-tests", "Python Sqlite3 Database Support Tests", "${PN}-core ${PN}-sqlite3",
326 m
.addPackage( "${PN}-stringold", "Python String APIs [deprecated]", "${PN}-core ${PN}-re",
327 "lib-dynload/strop.so string.*" )
329 m
.addPackage( "${PN}-syslog", "Python Syslog Interface", "${PN}-core",
330 "lib-dynload/syslog.so" )
332 m
.addPackage( "${PN}-terminal", "Python Terminal Controlling Support", "${PN}-core ${PN}-io",
335 m
.addPackage( "${PN}-tests", "Python Tests", "${PN}-core",
338 m
.addPackage( "${PN}-threading", "Python Threading & Synchronization Support", "${PN}-core ${PN}-lang",
339 "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" )
341 m
.addPackage( "${PN}-tkinter", "Python Tcl/Tk Bindings", "${PN}-core",
342 "lib-dynload/_tkinter.so lib-tk" ) # package
344 m
.addPackage( "${PN}-unittest", "Python Unit Testing Framework", "${PN}-core ${PN}-stringold ${PN}-lang",
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.*" )
350 m
.addPackage( "${PN}-xml", "Python basic XML support.", "${PN}-core ${PN}-elementtree ${PN}-re",
351 "lib-dynload/pyexpat.so xml xmllib.*" ) # package
353 m
.addPackage( "${PN}-xmlrpc", "Python XMLRPC Support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang",
354 "xmlrpclib.* SimpleXMLRPCServer.*" )
356 m
.addPackage( "${PN}-zlib", "Python zlib Support.", "${PN}-core",
357 "lib-dynload/zlib.so" )
359 m
.addPackage( "${PN}-mailbox", "Python Mailbox Format Support", "${PN}-core ${PN}-mime",