Beispiel #1
0
    def stage_package(self):
        logger.debugln("class: {} package name {} ".format(
            type(self).__name__, self.name))
        util.clear_directory(self.package_stage_include_dir_path)
        util.rm_file("{}/libcrypto.a".format(self.stage_lib_dir_path))
        util.rm_file("{}/libssl.a".format(self.stage_lib_dir_path))
        sys_desc = platform.platform()
        if re.search('Linux', sys_desc) is not None \
                and re.search('x86_64', sys_desc) is not None:
            arch_arg = "linux-x86_64"
        elif re.search('Darwin', sys_desc) is not None:
            arch_arg = "darwin64-x86_64-cc"
        else:
            raise RuntimeError(
                "could not determine platform type for openssl build options - platform is: {}"
                .format(sys_desc))
        exec.run(
            [
                "./Configure",
                "--prefix={}".format(self.cfg_obj.stage_dir),
                "--openssldir={}".format(self.vendor_ssl_dir),
                "--debug",
                arch_arg,
                # "linux-x86_64"
                # "darwin64-x86_64-cc"
            ],
            self.package_clone_dir_versioned_path)

        exec.run(["make", "all"], self.package_clone_dir_versioned_path)
        exec.run(["make", "install"], self.package_clone_dir_versioned_path)
Beispiel #2
0
    def stage_package(self):
        util.clear_directory(self.package_stage_include_dir_path)
        util.rm_file("{}/libfinal*".format(self.stage_lib_dir_path))
        sys_desc = platform.platform()
        if re.search('Linux', sys_desc) is not None \
                and re.search('x86_64', sys_desc) is not None:
            arch_arg = "linux-x86_64"
        elif re.search('Darwin', sys_desc) is not None:
            arch_arg = "darwin64-x86_64-cc"
        else:
            raise RuntimeError(
                "could not determine platform type for finalcut build options - platform is: {}"
                .format(sys_desc))
        exec.run(["autoreconf", "--install", "--force"])
        exec.run(
            [
                "./configure", "--prefix={}".format(self.cfg_obj.stage_dir),
                "--debug"
                # arch_arg,
                # "linux-x86_64"
                # "darwin64-x86_64-cc"
            ],
            self.package_clone_dir_versioned_path)

        exec.run(["make", "all"], self.package_clone_dir_versioned_path)
        exec.run(["make", "install"], self.package_clone_dir_versioned_path)
Beispiel #3
0
 def stage_headers_only_from_repo(self, repo_name, stage_name, repo_sub_directory=None):
     logger.debugln("class: {} package name {} ".format("PackageBase", self.package_name));
     to_dir = os.path.join(self.stage_include_dir_path, stage_name)
     if repo_sub_directory is None:
         from_dir = os.path.join(self.cfg_obj.clone_dir, repo_name)
     else:
         from_dir = os.path.join(self.cfg_obj.clone_dir, repo_name, repo_sub_directory)
     util.clear_directory(to_dir)
     util.cp_directory_contents(from_dir, to_dir)
     util.list_directory(to_dir)
Beispiel #4
0
 def headers_from_stage_to_vendor(self, stage_name, vendor_name):
     """
     Empties vendor/include/vendor_name and then
     Copies header files from stage/include/stage_name to vendor/include/vendor_name
     """
     logger.debugln("class: {} package name {} ".format("PackageBase", self.package_name));
     from_dir = os.path.join(self.stage_include_dir_path, stage_name)
     to_dir = os.path.join(self.vendor_include_dir_path, vendor_name)
     util.clear_directory(to_dir)
     util.cp_directory_contents(from_dir, to_dir)
Beispiel #5
0
    def stage_source(self, repo_name, stage_name, repo_sub_directory=None, clear_to_dir=True):

        logger.debugln("class: {} package name {} ".format("PackageBase", self.package_name));
        to_dir = os.path.join(self.stage_external_src_dir_path, stage_name)
        if repo_sub_directory is None:
            from_dir = os.path.join(self.cfg_obj.clone_dir, repo_name)
        else:
            from_dir = os.path.join(self.cfg_obj.clone_dir, repo_name, repo_sub_directory)
        print("SourcePackage package build/stage: {} from_dir {} to_dir {} "
              .format(self.package_name, from_dir, to_dir))
        if clear_to_dir:
            util.clear_directory(to_dir)
        util.cp_directory_contents(from_dir, to_dir)
        util.list_directory(to_dir)
Beispiel #6
0
    def install_stage_to_project(self, stage_name, source_name, clear_to_dir=True):
        """
        Empties project_source/external_src/source_name
        and then
        Copies header+source files from stage/external/stage_name to project_sourcer/external_src/source_name
        """
        logger.debugln("class: {} package name {} ".format("PackageBase", self.package_name));
        from_dir = os.path.join(self.stage_external_src_dir_path, stage_name)
        to_dir = os.path.join(self.project_external_src_dir_path, source_name)
        print("SourcePackage package: {} from_dir {} to_dir {} "
              .format(self.package_name, from_dir, to_dir))

        if clear_to_dir:
            util.clear_directory(to_dir)
        util.cp_directory_contents(from_dir, to_dir)
        util.list_directory(to_dir)
Beispiel #7
0
    def stage_package(self):
        logger.debugln("class: {} package name {} ".format(
            type(self).__name__, self.name))
        util.mkdir_p(self.stage_include_dir_path)
        util.mkdir_p(self.stage_lib_dir_path)

        util.clear_directory(self.package_stage_include_dir_path)
        util.rm_directory_contents(self.stage_lib_dir_path, "libcert.*")
        # exec.run(["rm", "-rf",  "{}/libcert*".format(self.stage_lib_dir_path)])

        self.cmake_dir = os.path.join(self.package_clone_dir_path,
                                      "cmake-build-debug")
        util.clear_directory(self.cmake_dir)
        exec.run([
            "cmake", "-DVENDOR_DIR={}".format(self.cfg_obj.stage_dir),
            "-DSTAGE_DIR={}".format(self.cfg_obj.stage_dir), ".."
        ], self.cmake_dir)
        exec.run(["make", "-j30", "cert_library"], self.cmake_dir)
        exec.run(["cmake", "--build", ".", "--target", "install", "-j", "8"],
                 self.cmake_dir)
        # just installed the headers into stage/include/cert
        logger.writeln("CertLib stage_package end")
Beispiel #8
0
def create_clean_install_dirs(defaults: Defaults) -> None:
    util.clear_directory(defaults.clone_dir)
    util.clear_directory(defaults.stage_dir)
    util.clear_directory(os.path.join(defaults.vendor_dir, "include"))
    util.clear_directory(os.path.join(defaults.vendor_dir, "lib"))
    util.clear_directory(os.path.join(defaults.vendor_dir, "ssl"))
Beispiel #9
0
def clean_install_dirs(cfg_obj: cfg.ConfigObject) -> None:
    util.clear_directory(cfg_obj.clone_dir)
    util.clear_directory(cfg_obj.stage_dir)
    util.clear_directory(os.path.join(cfg_obj.vendor_dir, "include"))
    util.clear_directory(os.path.join(cfg_obj.vendor_dir, "lib"))
    util.clear_directory(os.path.join(cfg_obj.vendor_dir, "ssl"))