def set_pkg_summary(self, doc, text):
self.assert_package_exists()<EOL>if not self.package_summary_set:<EOL><INDENT>self.package_summary_set = True<EOL>if validations.validate_pkg_summary(text):<EOL><INDENT>doc.package.summary = str_from_text(text)<EOL><DEDENT>else:<EOL><INDENT>raise SPDXValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise CardinalityError('<STR_LIT>')<EOL><DEDENT>
Set's the package summary.
        Raises SPDXValueError if text is not free form text.
        Raises CardinalityError if summary already set.
        Raises OrderError if no package previously defined.