Commit 8068e401 authored by Thomas Perl's avatar Thomas Perl

[upstream] Sync to version 14.35.0

parent ac1c1e04
...@@ -4,10 +4,33 @@ SET( PACKAGE "libzypp" ) ...@@ -4,10 +4,33 @@ SET( PACKAGE "libzypp" )
SET( CMAKE_MODULE_PATH ${LIBZYPP_SOURCE_DIR}/cmake/modules ) SET( CMAKE_MODULE_PATH ${LIBZYPP_SOURCE_DIR}/cmake/modules )
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
OPTION (ENABLE_BUILD_DOCS "Build documentation by default?" OFF)
OPTION (ENABLE_BUILD_TRANS "Build translation files by default?" OFF)
OPTION (ENABLE_BUILD_TESTS "Build and run test suite by default?" OFF)
OPTION (DISABLE_LIBPROXY "Build without libproxy support even if package is installed?" OFF) OPTION (DISABLE_LIBPROXY "Build without libproxy support even if package is installed?" OFF)
OPTION (DISABLE_AUTODOCS "Do not require doxygen being installed (required to build autodocs)?" OFF) OPTION (DISABLE_AUTODOCS "Do not require doxygen being installed (required to build autodocs)?" OFF)
#--------------------------------------------------------------------------------
SET (have_system x)
IF (DEBIAN)
MESSAGE (STATUS "Building for Debian")
SET (ENABLE_BUILD_DOCS ON)
SET (ENABLE_BUILD_TRANS ON)
SET (ENABLE_BUILD_TESTS ON)
SET (have_system ${have_system}x)
ENDIF (DEBIAN)
IF (${have_system} STREQUAL x)
MESSAGE (STATUS "Building for SUSE")
ENDIF (${have_system} STREQUAL x)
IF (${have_system} STRGREATER xx)
MESSAGE (FATAL_ERROR "Can only build for one system type.")
ENDIF (${have_system} STRGREATER xx)
#--------------------------------------------------------------------------------
# allow name libraries by name mixed with full # allow name libraries by name mixed with full
# paths # paths
if(COMMAND cmake_policy) if(COMMAND cmake_policy)
...@@ -29,8 +52,8 @@ include(CheckCXXCompilerFlag) ...@@ -29,8 +52,8 @@ include(CheckCXXCompilerFlag)
CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY) CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY)
CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY) CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -fno-strict-aliasing -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed -std=c++0x" ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed -std=c++11" )
SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wl,-as-needed" ) SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Wl,-as-needed" )
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" ) set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3" ) set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3" )
...@@ -62,7 +85,7 @@ MACRO(ADD_TESTS) ...@@ -62,7 +85,7 @@ MACRO(ADD_TESTS)
FOREACH( loop_var ${ARGV} ) FOREACH( loop_var ${ARGV} )
SET_SOURCE_FILES_PROPERTIES( ${loop_var}_test.cc COMPILE_FLAGS "-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN -DBOOST_AUTO_TEST_MAIN=\"\" " ) SET_SOURCE_FILES_PROPERTIES( ${loop_var}_test.cc COMPILE_FLAGS "-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN -DBOOST_AUTO_TEST_MAIN=\"\" " )
ADD_EXECUTABLE( ${loop_var}_test ${loop_var}_test.cc ) ADD_EXECUTABLE( ${loop_var}_test ${loop_var}_test.cc )
TARGET_LINK_LIBRARIES( ${loop_var}_test zypp boost_unit_test_framework zypp_test_utils) TARGET_LINK_LIBRARIES( ${loop_var}_test zypp ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} zypp_test_utils)
ADD_TEST( ${loop_var}_test ${CMAKE_CURRENT_BINARY_DIR}/${loop_var}_test --catch_system_errors=no) ADD_TEST( ${loop_var}_test ${CMAKE_CURRENT_BINARY_DIR}/${loop_var}_test --catch_system_errors=no)
ENDFOREACH( loop_var ) ENDFOREACH( loop_var )
ENDMACRO(ADD_TESTS) ENDMACRO(ADD_TESTS)
...@@ -90,7 +113,7 @@ ELSE ( NOT RPM_FOUND) ...@@ -90,7 +113,7 @@ ELSE ( NOT RPM_FOUND)
endif ( RPM_SUSPECT_VERSION STREQUAL "5.x" ) endif ( RPM_SUSPECT_VERSION STREQUAL "5.x" )
ENDIF( NOT RPM_FOUND) ENDIF( NOT RPM_FOUND)
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options unit_test_framework) FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options thread unit_test_framework)
IF (Boost_FOUND) IF (Boost_FOUND)
MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}") MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
...@@ -105,19 +128,19 @@ ELSE (GETTEXT_FOUND) ...@@ -105,19 +128,19 @@ ELSE (GETTEXT_FOUND)
MESSAGE( FATAL_ERROR "Gettext not found" ) MESSAGE( FATAL_ERROR "Gettext not found" )
ENDIF (GETTEXT_FOUND) ENDIF (GETTEXT_FOUND)
FIND_PACKAGE(Curl REQUIRED) FIND_PACKAGE(CURL REQUIRED)
IF ( NOT CURL_FOUND) IF ( NOT CURL_FOUND)
MESSAGE( FATAL_ERROR " curl not found" ) MESSAGE( FATAL_ERROR " curl not found" )
ELSE ( NOT CURL_FOUND) ELSE ( NOT CURL_FOUND)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
ENDIF( NOT CURL_FOUND) ENDIF( NOT CURL_FOUND)
FIND_PACKAGE(Libxml REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED)
IF ( NOT LIBXML_FOUND) IF ( NOT LIBXML2_FOUND)
MESSAGE( FATAL_ERROR " libxml not found" ) MESSAGE( FATAL_ERROR " libxml not found" )
ELSE ( NOT LIBXML_FOUND) ELSE ( NOT LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
ENDIF( NOT LIBXML_FOUND) ENDIF( NOT LIBXML2_FOUND)
FIND_PACKAGE(ZLIB REQUIRED) FIND_PACKAGE(ZLIB REQUIRED)
IF ( NOT ZLIB_FOUND) IF ( NOT ZLIB_FOUND)
...@@ -213,15 +236,23 @@ INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/zypp-history.lr DESTINATION ${SYSCONFDIR}/l ...@@ -213,15 +236,23 @@ INSTALL( FILES ${LIBZYPP_SOURCE_DIR}/zypp-history.lr DESTINATION ${SYSCONFDIR}/l
#################################################################### ####################################################################
ADD_SUBDIRECTORY( zypp ) ADD_SUBDIRECTORY( zypp )
#ADD_SUBDIRECTORY( zypp2 )
# do not build devel by default # do not build devel by default
ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL ) ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
ADD_SUBDIRECTORY( tools ) ADD_SUBDIRECTORY( tools )
ADD_SUBDIRECTORY( examples ) ADD_SUBDIRECTORY( examples )
ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
ADD_SUBDIRECTORY( doc ) ADD_SUBDIRECTORY( doc )
ADD_SUBDIRECTORY( vendor ) ADD_SUBDIRECTORY( vendor )
ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
IF ( ENABLE_BUILD_TRANS )
ADD_SUBDIRECTORY( po )
ELSE ( ENABLE_BUILD_TRANS )
ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
ENDIF ( ENABLE_BUILD_TRANS )
IF ( ENABLE_BUILD_TESTS )
ADD_SUBDIRECTORY( tests )
ELSE ( ENABLE_BUILD_TESTS )
ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
ENDIF ( ENABLE_BUILD_TESTS )
INCLUDE(CTest) INCLUDE(CTest)
ENABLE_TESTING() ENABLE_TESTING()
...@@ -58,11 +58,11 @@ ...@@ -58,11 +58,11 @@
# - Consider calling ./mkChangelog to assist you. # - Consider calling ./mkChangelog to assist you.
# See './mkChangelog -h' for help. # See './mkChangelog -h' for help.
# #
SET(LIBZYPP_MAJOR "12") SET(LIBZYPP_MAJOR "14")
SET(LIBZYPP_COMPATMINOR "0") SET(LIBZYPP_COMPATMINOR "30")
SET(LIBZYPP_MINOR "2") SET(LIBZYPP_MINOR "35")
SET(LIBZYPP_PATCH "0") SET(LIBZYPP_PATCH "0")
# #
# LAST RELEASED: 12.2.0 (0) # LAST RELEASED: 14.35.0 (30)
# (The number in parenthesis is LIBZYPP_COMPATMINOR) # (The number in parenthesis is LIBZYPP_COMPATMINOR)
#======= #=======
if(CURL_INCLUDE_DIR AND CURL_LIBRARY)
# Already in cache, be silent
set(CURL_FIND_QUIETLY TRUE)
endif(CURL_INCLUDE_DIR AND CURL_LIBRARY)
set(CURL_LIBRARY)
set(CURL_INCLUDE_DIR)
FIND_PATH(CURL_INCLUDE_DIR curl/curl.h
/usr/include
/usr/local/include
)
FIND_LIBRARY(CURL_LIBRARY NAMES curl
PATHS
/usr/lib
/usr/local/lib
)
if(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MESSAGE( STATUS "curl found: includes in ${CURL_INCLUDE_DIR}, library in ${CURL_LIBRARY}")
set(CURL_FOUND TRUE)
else(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MESSAGE( STATUS "curl not found")
endif(CURL_INCLUDE_DIR AND CURL_LIBRARY)
MARK_AS_ADVANCED(CURL_INCLUDE_DIR CURL_LIBRARY)
\ No newline at end of file
...@@ -49,6 +49,8 @@ MACRO( GETTEXT_CREATE_TARBALL_TRANSLATIONS _translation_set_basename ) ...@@ -49,6 +49,8 @@ MACRO( GETTEXT_CREATE_TARBALL_TRANSLATIONS _translation_set_basename )
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${TRANSLATION_SET_CONTENT} OUTPUT ${TRANSLATION_SET_CONTENT}
COMMAND tar xfj ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET} COMMAND tar xfj ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET}
COMMAND sed -i '/^msgid/s/do not forbid installation of %s/remove lock to allow installation of %s/' *.po
COMMAND sed -i '/^msgid/s/do not keep %s installed/remove lock to allow removal of %s/' *.po
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${TRANSLATION_SET}
) )
......
if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
# Already in cache, be silent
set(LIBXML_FIND_QUIETLY TRUE)
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
set(LIBXML_LIBRARY)
set(LIBXML_INCLUDE_DIR)
FIND_PATH(LIBXML_INCLUDE_DIR libxml/parser.h
/usr/include
/usr/include/libxml2
/usr/local/include
)
FIND_LIBRARY(LIBXML_LIBRARY NAMES xml2
PATHS
/usr/lib
/usr/local/lib
)
if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MESSAGE( STATUS "libxml found: includes in ${LIBXML_INCLUDE_DIR}, library in ${LIBXML_LIBRARY}")
set(LIBXML_FOUND TRUE)
else(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MESSAGE( STATUS "libxml not found")
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
MARK_AS_ADVANCED(LIBXML_INCLUDE_DIR LIBXML_LIBRARY)
\ No newline at end of file
...@@ -8,6 +8,13 @@ ELSE ( DEFINED LIB ) ...@@ -8,6 +8,13 @@ ELSE ( DEFINED LIB )
SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" ) SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
ENDIF ( DEFINED LIB ) ENDIF ( DEFINED LIB )
MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" ) MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
# Headers
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}")
# system configuration dir (etc) # system configuration dir (etc)
IF( NOT DEFINED SYSCONFDIR ) IF( NOT DEFINED SYSCONFDIR )
...@@ -117,7 +124,7 @@ MACRO(GENERATE_PACKAGING PACKAGE VERSION) ...@@ -117,7 +124,7 @@ MACRO(GENERATE_PACKAGING PACKAGE VERSION)
SPECFILE() SPECFILE()
ADD_CUSTOM_TARGET( svncheck ADD_CUSTOM_TARGET( svncheck
COMMAND cd $(CMAKE_SOURCE_DIR) && LC_ALL=C git status | grep -q "nothing to commit .working directory clean." COMMAND cd ${CMAKE_SOURCE_DIR} && LC_ALL=C git status | grep -q "nothing to commit .working directory clean."
) )
SET( AUTOBUILD_COMMAND SET( AUTOBUILD_COMMAND
......
...@@ -4,4 +4,3 @@ CONFIGURE_FILE(${LIBZYPP_SOURCE_DIR}/devel/genclass.in ${LIBZYPP_BINARY_DIR}/dev ...@@ -4,4 +4,3 @@ CONFIGURE_FILE(${LIBZYPP_SOURCE_DIR}/devel/genclass.in ${LIBZYPP_BINARY_DIR}/dev
ADD_SUBDIRECTORY(devel.dmacvicar) ADD_SUBDIRECTORY(devel.dmacvicar)
ADD_SUBDIRECTORY(devel.ma) ADD_SUBDIRECTORY(devel.ma)
ADD_SUBDIRECTORY(devel.jkupec)
ADD_DEFINITIONS(
-DSRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
-DTESTS_SRC_DIR="${LIBZYPP_SOURCE_DIR}/tests"
)
SET( bridge_SRCS
bridge/bridge.cc
bridge/BaseImpl.cc
bridge/Derived.cc
)
SET( bridge_HEADERS
bridge/Base.h
bridge/BaseImpl.h
bridge/Derived.h
)
#ADD_EXECUTABLE( bridge ${bridge_SRCS} )
#TARGET_LINK_LIBRARIES( bridge zypp )
#ADD_EXECUTABLE( deltarpm deltarpm.cc )
#TARGET_LINK_LIBRARIES( deltarpm zypp )
#ADD_EXECUTABLE( pathinfo pathinfo.cc )
#TARGET_LINK_LIBRARIES( pathinfo zypp )
ADD_EXECUTABLE( poolquery poolquery.cc )
TARGET_LINK_LIBRARIES( poolquery zypp )
ADD_EXECUTABLE( repos repos.cc )
TARGET_LINK_LIBRARIES( repos zypp )
#ADD_EXECUTABLE( yumparsertest YUMParser_test.cc )
#TARGET_LINK_LIBRARIES( yumparsertest zypp )
ADD_EXECUTABLE( play play.cc )
TARGET_LINK_LIBRARIES( play zypp boost_signals )
#include "zypp/ZYpp.h"
#include "zypp/ZYppFactory.h"
#include "zypp/base/Logger.h"
#include "zypp/base/LogControl.h"
#include "zypp/base/Measure.h"
#include "zypp/cache/CacheStore.h"
#include "zypp/parser/yum/RepoParser.h"
#undef ZYPP_BASE_LOGGER_LOGGROUP
#define ZYPP_BASE_LOGGER_LOGGROUP "yumparsertest"
using namespace std;
using namespace zypp;
using namespace zypp::parser::yum;