code: def build_specfile_filesection(spec, files):
      
      str  = '%files\n'
  
      if 'X_RPM_DEFATTR' not in spec:
          spec['X_RPM_DEFATTR'] = '(-,root,root)'
  
      str = str + '%%defattr %s\n' % spec['X_RPM_DEFATTR']
  
      supported_tags = {
          'PACKAGING_CONFIG'           : '%%config %s',
          'PACKAGING_CONFIG_NOREPLACE' : '%%config(noreplace) %s',
          'PACKAGING_DOC'              : '%%doc %s',
          'PACKAGING_UNIX_ATTR'        : '%%attr %s',
          'PACKAGING_LANG_'            : '%%lang(%s) %s',
          'PACKAGING_X_RPM_VERIFY'     : '%%verify %s',
          'PACKAGING_X_RPM_DIR'        : '%%dir %s',
          'PACKAGING_X_RPM_DOCDIR'     : '%%docdir %s',
          'PACKAGING_X_RPM_GHOST'      : '%%ghost %s', }
  
      for file in files:
          # build the tagset
          tags = {}
          for k in list(supported_tags.keys()):
              try:
                  v = file.GetTag(k)
                  if v:
                      tags[k] = v
              except AttributeError:
                  pass
  
          # compile the tagset
          str = str + SimpleTagCompiler(supported_tags, mandatory=0).compile( tags )
  
          str = str + ' '
          str = str + file.GetTag('PACKAGING_INSTALL_LOCATION')
          str = str + '\n\n'
  
      return str
docs: builds the %file section of the specfile