"""
 *
 * This file is part of rasdaman community.
 *
 * Rasdaman community is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Rasdaman community is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU  General Public License for more details.
 *
 * You should have received a copy of the GNU  General Public License
 * along with rasdaman community.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright 2003 - 2016 Peter Baumann / rasdaman GmbH.
 *
 * For more information please see <http://www.rasdaman.org>
 * or contact Peter Baumann via <baumann@rasdaman.com>.
 *
"""
from profile.profile import Profile
from tpinstaller.ubuntu2004 import Ubuntu2004TpInstaller
from tpinstaller.ubuntu2204 import Ubuntu2204TpInstaller
from tpinstaller.ubuntu2404 import Ubuntu2404TpInstaller
from tpinstaller.debian12 import Debian12TpInstaller

if __name__== "__main__":
    """
    Prints all packages installed for the major supported OSs.
    """
    profile = Profile()
    profile.enterprise = True
    for installer in [Ubuntu2004TpInstaller(profile),
                      Ubuntu2204TpInstaller(profile),
                      Ubuntu2404TpInstaller(profile),
                      Debian12TpInstaller(profile)]:
        installer_name = type(installer).__name__.replace("TpInstaller", "").replace("TPInstaller", "")
        pkg_tool = "apt-get"
        if "CentOS" in installer_name:
            pkg_tool = "yum"
        print("------------------------------------------------------------------")
        print(installer_name)
        print("")
        print("- Build core : " + pkg_tool + " install " + " ".join(installer.get_build_core_packages()))
        print("- Build java : " + pkg_tool + " install " + " ".join(installer.get_build_java_packages()))
        if len(installer.get_build_cmake_packages()) > 0:
            print("- Build cmake: " + pkg_tool + " install " + " ".join(installer.get_build_cmake_packages()))
        print("- Build doc  : " + pkg_tool + " install " + " ".join(installer.get_build_doc_packages()))
        print("- Run core   : " + pkg_tool + " install " + " ".join(installer.get_run_core_packages()))
        print("- Run java   : " + pkg_tool + " install " + " ".join(installer.get_run_java_packages()))
        print("- Systemtest : " + pkg_tool + " install " + " ".join(installer.get_run_systemtest_packages()))
        print("- Run python : pip3 install " + " ".join(installer.get_run_pip_packages()))
        print("- Test python: pip3 install " + " ".join(installer.get_run_systemtest_pip_packages()))
        print("- Packaging  : " + pkg_tool + " install " + " ".join(installer.get_packaging_packages()))
