<commit_before>PROJECT (libsolv)

CMAKE_MINIMUM_REQUIRED (VERSION 2.4)

OPTION (ENABLE_STATIC "Build a static version of the libraries?" OFF)
OPTION (DISABLE_SHARED "Do not build a shared version of the libraries?" OFF)

OPTION (ENABLE_PERL "Build the perl bindings?" OFF)
OPTION (ENABLE_PYTHON "Build the python bindings?" OFF)
OPTION (ENABLE_RUBY "Build the ruby bindings?" OFF)
OPTION (ENABLE_TCL "Build the Tcl bindings?" OFF)

OPTION (USE_VENDORDIRS "Install the bindings in vendor directories?" OFF)

OPTION (ENABLE_RPMDB "Build with rpm database support?" OFF)
OPTION (ENABLE_PUBKEY "Build with pubkey support?" OFF)
OPTION (ENABLE_RPMDB_BYRPMHEADER "Build with rpmdb Header support?" OFF)
OPTION (ENABLE_RPMMD "Build with rpmmd repository support?" OFF)
OPTION (ENABLE_SUSEREPO "Build with suse repository support?" OFF)
OPTION (ENABLE_COMPS "Build with fedora comps support?" OFF)
OPTION (ENABLE_HELIXREPO "Build with helix repository support?" OFF)
OPTION (ENABLE_DEBIAN "Build with debian database/repository support?" OFF)
OPTION (ENABLE_MDKREPO "Build with mandriva/mageia repository support?" OFF)
OPTION (ENABLE_ARCHREPO "Build with archlinux repository support?" OFF)
OPTION (ENABLE_CUDFREPO "Build with cudf repository support?" OFF)
OPTION (ENABLE_HAIKU "Build with Haiku package support?" OFF)
OPTION (ENABLE_APPDATA "Build with AppStream appdata support?" OFF)

OPTION (MULTI_SEMANTICS "Build with support for multiple distribution types?" OFF)

OPTION (ENABLE_LZMA_COMPRESSION "Build with lzma/xz compression support?" OFF)
OPTION (ENABLE_BZIP2_COMPRESSION "Build with bzip2 compression support?" OFF)

#IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
#ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)

IF (COMMAND cmake_policy)
  # escape preprocessor, see -DVERSION below
  CMAKE_POLICY (SET CMP0005 OLD)
ENDIF (COMMAND cmake_policy)

# Library
IF (DEFINED LIB)
  SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}")
ELSE (DEFINED  LIB)
  IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
    SET (LIB_SUFFIX "64")
  ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
  SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
ENDIF (DEFINED  LIB)
MESSAGE (STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}")
# Library
IF (DEFINED INCLUDE)
  SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE}")
else (DEFINED INCLUDE)
  SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
ENDIF (DEFINED  INCLUDE)
MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}")
SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man")
IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man"  AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
  SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man")
ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man"  AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
MESSAGE(STATUS "Man pages will be installed in ${MAN_INSTALL_DIR}")

####################################################################
# CONFIGURATION                                                    #
####################################################################

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
INSTALL( FILES ${CMAKE_MODULE_PATH}/FindLibSolv.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )

INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake)

SET (have_system x)

IF (FEDORA)
MESSAGE(STATUS "Building for Fedora")
ADD_DEFINITIONS (-DFEDORA)
SET (ENABLE_RPMDB ON)
SET (ENABLE_RPMMD ON)
SET (have_system ${have_system}x)
ENDIF (FEDORA)

IF (DEBIAN)
MESSAGE (STATUS "Building for Debian")
ADD_DEFINITIONS (-DDEBIAN)
SET (ENABLE_DEBIAN ON)
SET (have_system ${have_system}x)
ENDIF (DEBIAN)

IF (SUSE)
MESSAGE (STATUS "Building for SUSE")
ADD_DEFINITIONS (-DSUSE)
SET (ENABLE_RPMDB ON)
SET (ENABLE_PUBKEY ON)
SET (ENABLE_RPMDB_BYRPMHEADER ON)
SET (ENABLE_RPMMD ON)
SET (ENABLE_SUSEREPO ON)
SET (ENABLE_HELIXREPO ON)
SET (ENABLE_LINKED_PKGS ON)
SET (have_system ${have_system}x)
ENDIF (SUSE)

IF (ARCHLINUX)
MESSAGE (STATUS "Building for Archlinux")
ADD_DEFINITIONS (-DARCHLINUX)
SET (ENABLE_ARCHREPO ON)
SET (have_system ${have_system}x)
ENDIF (ARCHLINUX)

IF (MANDRIVA)
MESSAGE (STATUS "Building for Mandriva/Mageia")
ADD_DEFINITIONS (-DMANDRIVA)
SET (ENABLE_MDKREPO ON)
SET (ENABLE_RPMDB ON)
SET (have_system ${have_system}x)
ENDIF (MANDRIVA)

IF (HAIKU)
MESSAGE(STATUS "Building for Haiku")
FIND_LIBRARY(HAIKU_BE_LIBRARY NAMES be)
FIND_LIBRARY(HAIKU_NETWORK_LIBRARY NAMES network)
FIND_LIBRARY(HAIKU_PACKAGE_LIBRARY NAMES package)
SET (HAIKU_SYSTEM_LIBRARIES
    ${HAIKU_BE_LIBRARY} ${HAIKU_NETWORK_LIBRARY} ${HAIKU_PACKAGE_LIBRARY})
ADD_DEFINITIONS (-DHAIKU)
SET (ENABLE_HAIKU ON)
SET (have_system ${have_system}x)
ENDIF (HAIKU)

IF (${have_system} STREQUAL x)
    MESSAGE (STATUS "Building for no system")
ENDIF (${have_system} STREQUAL x)
IF (${have_system} STRGREATER xx)
    MESSAGE (FATAL_ERROR "Can only compile for one system type.")
ENDIF (${have_system} STRGREATER xx)

IF (ENABLE_ARCHREPO)
SET (ENABLE_LZMA_COMPRESSION ON)
ENDIF (ENABLE_ARCHREPO)

FIND_PACKAGE (EXPAT REQUIRED)
FIND_PACKAGE (ZLIB REQUIRED)
IF (ENABLE_LZMA_COMPRESSION)
FIND_PACKAGE (LZMA REQUIRED)
ENDIF (ENABLE_LZMA_COMPRESSION)<commit_msg>support MAGEIA as build target<commit_after>PROJECT (libsolv)

CMAKE_MINIMUM_REQUIRED (VERSION 2.4)

OPTION (ENABLE_STATIC "Build a static version of the libraries?" OFF)
OPTION (DISABLE_SHARED "Do not build a shared version of the libraries?" OFF)

OPTION (ENABLE_PERL "Build the perl bindings?" OFF)
OPTION (ENABLE_PYTHON "Build the python bindings?" OFF)
OPTION (ENABLE_RUBY "Build the ruby bindings?" OFF)
OPTION (ENABLE_TCL "Build the Tcl bindings?" OFF)

OPTION (USE_VENDORDIRS "Install the bindings in vendor directories?" OFF)

OPTION (ENABLE_RPMDB "Build with rpm database support?" OFF)
OPTION (ENABLE_PUBKEY "Build with pubkey support?" OFF)
OPTION (ENABLE_RPMDB_BYRPMHEADER "Build with rpmdb Header support?" OFF)
OPTION (ENABLE_RPMMD "Build with rpmmd repository support?" OFF)
OPTION (ENABLE_SUSEREPO "Build with suse repository support?" OFF)
OPTION (ENABLE_COMPS "Build with fedora comps support?" OFF)
OPTION (ENABLE_HELIXREPO "Build with helix repository support?" OFF)
OPTION (ENABLE_DEBIAN "Build with debian database/repository support?" OFF)
OPTION (ENABLE_MDKREPO "Build with mandriva/mageia repository support?" OFF)
OPTION (ENABLE_ARCHREPO "Build with archlinux repository support?" OFF)
OPTION (ENABLE_CUDFREPO "Build with cudf repository support?" OFF)
OPTION (ENABLE_HAIKU "Build with Haiku package support?" OFF)
OPTION (ENABLE_APPDATA "Build with AppStream appdata support?" OFF)

OPTION (MULTI_SEMANTICS "Build with support for multiple distribution types?" OFF)

OPTION (ENABLE_LZMA_COMPRESSION "Build with lzma/xz compression support?" OFF)
OPTION (ENABLE_BZIP2_COMPRESSION "Build with bzip2 compression support?" OFF)

#IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
#ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)

IF (COMMAND cmake_policy)
  # escape preprocessor, see -DVERSION below
  CMAKE_POLICY (SET CMP0005 OLD)
ENDIF (COMMAND cmake_policy)

# Library
IF (DEFINED LIB)
  SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}")
ELSE (DEFINED  LIB)
  IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
    SET (LIB_SUFFIX "64")
  ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
  SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
ENDIF (DEFINED  LIB)
MESSAGE (STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}")
# Library
IF (DEFINED INCLUDE)
  SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE}")
else (DEFINED INCLUDE)
  SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
ENDIF (DEFINED  INCLUDE)
MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}")
SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man")
IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man"  AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
  SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man")
ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man"  AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
MESSAGE(STATUS "Man pages will be installed in ${MAN_INSTALL_DIR}")

####################################################################
# CONFIGURATION                                                    #
####################################################################

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
INSTALL( FILES ${CMAKE_MODULE_PATH}/FindLibSolv.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )

INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake)

SET (have_system x)

IF (FEDORA)
MESSAGE(STATUS "Building for Fedora")
ADD_DEFINITIONS (-DFEDORA)
SET (ENABLE_RPMDB ON)
SET (ENABLE_RPMMD ON)
SET (have_system ${have_system}x)
ENDIF (FEDORA)

IF (DEBIAN)
MESSAGE (STATUS "Building for Debian")
ADD_DEFINITIONS (-DDEBIAN)
SET (ENABLE_DEBIAN ON)
SET (have_system ${have_system}x)
ENDIF (DEBIAN)

IF (SUSE)
MESSAGE (STATUS "Building for SUSE")
ADD_DEFINITIONS (-DSUSE)
SET (ENABLE_RPMDB ON)
SET (ENABLE_PUBKEY ON)
SET (ENABLE_RPMDB_BYRPMHEADER ON)
SET (ENABLE_RPMMD ON)
SET (ENABLE_SUSEREPO ON)
SET (ENABLE_HELIXREPO ON)
SET (ENABLE_LINKED_PKGS ON)
SET (have_system ${have_system}x)
ENDIF (SUSE)

IF (ARCHLINUX)
MESSAGE (STATUS "Building for Archlinux")
ADD_DEFINITIONS (-DARCHLINUX)
SET (ENABLE_ARCHREPO ON)
SET (have_system ${have_system}x)
ENDIF (ARCHLINUX)

IF (MANDRIVA)
MESSAGE (STATUS "Building for Mandriva")
ADD_DEFINITIONS (-DMANDRIVA)
SET (ENABLE_MDKREPO ON)
SET (ENABLE_RPMDB ON)
SET (have_system ${have_system}x)
ENDIF (MANDRIVA)

IF (MAGEIA)
MESSAGE (STATUS "Building for Mageia")
ADD_DEFINITIONS (-DMAGEIA)
SET (ENABLE_MDKREPO ON)
SET (ENABLE_RPMDB ON)
SET (ENABLE_LZMA_COMPRESSION ON)
SET (have_system ${have_system}x)
ENDIF (MAGEIA)

IF (HAIKU)
MESSAGE(STATUS "Building for Haiku")
FIND_LIBRARY(HAIKU_BE_LIBRARY NAMES be)
FIND_LIBRARY(HAIKU_NETWORK_LIBRARY NAMES network)
FIND_LIBRARY(HAIKU_PACKAGE_LIBRARY NAMES package)
SET (HAIKU_SYSTEM_LIBRARIES
    ${HAIKU_BE_LIBRARY} ${HAIKU_NETWORK_LIBRARY} ${HAIKU_PACKAGE_LIBRARY})
ADD_DEFINITIONS (-DHAIKU)
SET (ENABLE_HAIKU ON)
SET (have_system ${have_system}x)
ENDIF (HAIKU)

IF (${have_system} STREQUAL x)
    MESSAGE (STATUS "Building for no system")
ENDIF (${have_system} STREQUAL x)
IF (${have_system} STRGREATER xx)
    MESSAGE (FATAL_ERROR "Can only compile for one system type.")
ENDIF (${have_system} STRGREATER xx)

IF (ENABLE_ARCHREPO)
SET (ENABLE_LZMA_COMPRESSION ON)
ENDIF (ENABLE_ARCHREPO)

FIND_PACKAGE (EXPAT REQUIRED)
FIND_PACKAGE (ZLIB REQUIRED)
IF (ENABLE_LZMA_COMPRESSION)
FIND_PACKAGE (LZMA REQUIRED)
ENDIF (ENABLE_LZMA_COMPRESSION)
{'fraction_non_alphanumeric': 0.12263720208200164, 'fraction_numerical': 0.002922107570084924, 'mean_word_length': 6.862167982770998, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7608270', 'n_tokens_mistral': 4130, 'n_tokens_neox': 3840, 'n_words': 1064}