Beispiel #1
0
    def write_buildpattern(self):
        """
        Write build pattern to spec file.

        Currently depends on buildpattern.py due to pattern-matched methods
        """
        buildpattern.write_buildpattern(self.specfile)
Beispiel #2
0
def write_spec(filename):
    file = open(filename, "w", encoding="utf-8")
    file.write_strip = types.MethodType(_file_write, file)
    file.write("#\n")
    file.write("# This file is auto-generated. DO NOT EDIT\n")
    file.write("# Generated by: autospec.py\n")
    file.write("#\n")

    if config.keepstatic == 1:
        file.write("%define keepstatic 1\n")

    # first, write the general package header
    tarball.write_nvr(file)
    write_sources(file)
    specdescription.write_summary(file)
    license.write_license(file)

    files.write_main_subpackage_requires(file)
    buildreq.write_buildreq(file)
    patches.write_patch_header(file)

    # then write the main package extra content
    specdescription.write_description(file)
    files.write_files_header(file)

    # then write the build instructions
    buildpattern.write_buildpattern(file)

    # then write the scriplets
    files.write_scriplets(file)

    # then write the %files
    files.write_files(file)
    lang.write_lang_files(file)

    file.close()