<s> '''<STR_LIT>''' <EOL> from . . import build <EOL> from . . import compilers <EOL> import datetime <EOL> from . . import mlog <EOL> from . . modules import gnome <EOL> import os <EOL> class RPMModule : <EOL> def generate_spec_template ( self , state , args , kwargs ) : <EOL> compiler_deps = set ( ) <EOL> for compiler in state . compilers : <EOL> if isinstance ( compiler , compilers . GnuCCompiler ) : <EOL> compiler_deps . add ( '<STR_LIT>' ) <EOL> elif isinstance ( compiler , compilers . GnuCPPCompiler ) : <EOL> compiler_deps . add ( '<STR_LIT>' ) <EOL> elif isinstance ( compiler , compilers . ValaCompiler ) : <EOL> compiler_deps . add ( '<STR_LIT>' ) <EOL> elif isinstance ( compiler , compilers . GnuFortranCompiler ) : <EOL> compiler_deps . add ( '<STR_LIT>' ) <EOL> elif isinstance ( compiler , compilers . GnuObjCCompiler ) : <EOL> compiler_deps . add ( '<STR_LIT>' ) <EOL> elif compiler == compilers . GnuObjCPPCompiler : <EOL> compiler_deps . add ( '<STR_LIT>' ) <EOL> else : <EOL> mlog . log ( '<STR_LIT>' , <EOL> mlog . bold ( compiler . get_id ( ) ) ) <EOL> return <EOL> proj = state . project_name . replace ( '<STR_LIT:U+0020>' , '<STR_LIT:_>' ) . replace ( '<STR_LIT:\t>' , '<STR_LIT:_>' ) <EOL> so_installed = False <EOL> devel_subpkg = False <EOL> files = set ( ) <EOL> files_devel = set ( ) <EOL> to_delete = set ( ) <EOL> for target in state . targets . values ( ) : <EOL> if isinstance ( target , build . Executable ) and target . need_install : <EOL> files . add ( '<STR_LIT>' % target . get_filename ( ) ) <EOL> elif isinstance ( target , build . SharedLibrary ) and target . need_install : <EOL> files . add ( '<STR_LIT>' % target . get_filename ( ) ) <EOL> for alias in target . get_aliaslist ( ) : <EOL> if alias . endswith ( '<STR_LIT>' ) : <EOL> files_devel . add ( '<STR_LIT>' % alias ) <EOL> else : <EOL> files . add ( '<STR_LIT>' % alias ) <EOL> so_installed = True <EOL> elif isinstance ( target , build . StaticLibrary ) and target . need_install : <EOL> to_delete . add ( '<STR_LIT>' % target . get_filename ( ) ) <EOL> mlog . log ( '<STR_LIT>' , mlog . bold ( target . get_filename ( ) ) , <EOL> '<STR_LIT>' ) <EOL> elif isinstance ( target , gnome . GirTarget ) and target . should_install ( ) : <EOL> files_devel . add ( '<STR_LIT>' % target . get_filename ( ) [ <NUM_LIT:0> ] ) <EOL> elif isinstance ( target , gnome . TypelibTarget ) and target . should_install ( ) : <EOL> files . add ( '<STR_LIT>' % target . get_filename ( ) [ <NUM_LIT:0> ] ) <EOL> for header in state . headers : <EOL> if len ( header . get_install_subdir ( ) ) > <NUM_LIT:0> : <EOL> files_devel . add ( '<STR_LIT>' % header . get_install_subdir ( ) ) <EOL> else : <EOL> for hdr_src in header . get_sources ( ) : <EOL> files_devel . add ( '<STR_LIT>' % hdr_src ) <EOL> for man in state . man : <EOL> for man_file in man . get_sources ( ) : <EOL> files . add ( '<STR_LIT>' % ( int ( man_file . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] ) , man_file ) ) <EOL> if len ( files_devel ) > <NUM_LIT:0> : <EOL> devel_subpkg = True <EOL> fn = open ( '<STR_LIT>' % os . path . join ( state . environment . get_build_dir ( ) , proj ) , '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' % proj ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> for compiler in compiler_deps : <EOL> fn . write ( '<STR_LIT>' % compiler ) <EOL> for dep in state . environment . coredata . deps : <EOL> fn . write ( '<STR_LIT>' % dep ) <EOL> for lib in state . environment . coredata . ext_libs . values ( ) : <EOL> fn . write ( '<STR_LIT>' % lib . fullpath ) <EOL> mlog . log ( '<STR_LIT>' , mlog . bold ( lib . fullpath ) , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> mlog . bold ( '<STR_LIT>' % lib . fullpath ) ) <EOL> for prog in state . environment . coredata . ext_progs . values ( ) : <EOL> if not prog . found ( ) : <EOL> fn . write ( '<STR_LIT>' % prog . get_name ( ) ) <EOL> else : <EOL> fn . write ( '<STR_LIT>' % '<STR_LIT:U+0020>' . join ( prog . fullpath ) ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> if devel_subpkg : <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> if len ( to_delete ) > <NUM_LIT:0> : <EOL> fn . write ( '<STR_LIT>' % '<STR_LIT:U+0020>' . join ( to_delete ) ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> for f in files : <EOL> fn . write ( '<STR_LIT>' % f ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> if devel_subpkg : <EOL> fn . write ( '<STR_LIT>' ) <EOL> for f in files_devel : <EOL> fn . write ( '<STR_LIT>' % f ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> if so_installed : <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT>' % datetime . date . today ( ) . strftime ( '<STR_LIT>' ) ) <EOL> fn . write ( '<STR_LIT>' ) <EOL> fn . write ( '<STR_LIT:\n>' ) <EOL> fn . close ( ) <EOL> mlog . log ( '<STR_LIT>' % proj ) <EOL> def initialize ( ) : <EOL> return RPMModule ( ) </s>
