def set_pkg_license_declared(self, doc, lic):
self.assert_package_exists()<EOL>if not self.package_license_declared_set:<EOL><INDENT>self.package_license_declared_set = True<EOL>if validations.validate_lics_conc(lic):<EOL><INDENT>doc.package.license_declared = lic<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise SPDXValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise CardinalityError('<STR_LIT>')<EOL><DEDENT>
Sets the package's declared license.
        Raises SPDXValueError if data malformed.
        Raises OrderError if no package previously defined.
        Raises CardinalityError if already set.