Commit 0fc40318 authored by Ghislain MARY's avatar Ghislain MARY

Improve flexisip-rpm config.

parent b54d58bf
......@@ -26,6 +26,7 @@ lcb_git_tag("master")
lcb_external_source_paths("belr")
lcb_groupable(YES)
lcb_package_source(YES)
lcb_spec_file("belr.spec")
lcb_dependencies("bctoolbox")
lcb_cmake_options("-DENABLE_TOOLS=${ENABLE_TOOLS}")
\ No newline at end of file
lcb_cmake_options("-DENABLE_TOOLS=${ENABLE_TOOLS}")
......@@ -58,7 +58,6 @@ lcb_builder_cmake_options(flexisip
"-DENABLE_PUSHNOTIFICATION=${ENABLE_PUSHNOTIFICATION}"
"-DENABLE_PRESENCE=${ENABLE_PRESENCE}"
"-DENABLE_CONFERENCE=${ENABLE_CONFERENCE}"
"-DXSDCXX_ROOT_PATH=${XSDCXX_ROOT_PATH}"
"-DENABLE_SNMP=${ENABLE_SNMP}"
"-DENABLE_DOC=${ENABLE_DOC}"
"-DENABLE_PROTOBUF=${ENABLE_PROTOBUF}"
......
......@@ -26,6 +26,8 @@ lcb_git_tag("3.10.0")
lcb_external_source_paths("linphone")
lcb_groupable(YES)
lcb_package_source(YES)
lcb_spec_file("liblinphone.spec")
lcb_rpmbuild_name("liblinphone")
lcb_dependencies("bctoolbox" "bellesip" "ortp" "ms2" "belr" "libxsd" "soci")
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES AND NOT APPLE)
......
......@@ -26,6 +26,7 @@ if(LINPHONE_BUILDER_BUILD_DEPENDENCIES AND NOT APPLE)
# Do not build sqlite3 on Apple systems (Mac OS X and iOS), they are provided by the system
lcb_dependencies("sqlite3")
endif()
lcb_may_be_found_on_system(YES)
lcb_cmake_options(
"-DSOCI_TESTS=NO"
......@@ -40,5 +41,4 @@ lcb_cmake_options(
"-DWITH_SQLITE3=YES"
)
lcb_linking_type("-DSOCI_SHARED=YES" "-DSOCI_STATIC=NO")
lcb_use_autotools_for_rpm(YES)
......@@ -34,16 +34,10 @@ if [ @AUTOTOOLS_VERBOSE_MAKEFILE@ -eq 1 ]; then
VERBOSE="--verbose"
fi
# SPEC_PREFIX=""
# if [ @LINPHONE_BUILDER_SPEC_PREFIX@ != "" ]; then
# SPEC_PREFIX="--define \"_prefix @LINPHONE_BUILDER_SPEC_PREFIX@\""
# fi
cd @ep_source@
# TODO rpmbuild -ba @ep_build@/@LINPHONE_BUILDER_SPEC_FILE@ --define "_topdir $RPM_TOPDIR" $SPEC_PREFIX --with bc $VERBOSE @ep_redirect_to_file@
rpmbuild -ba @ep_build@/@LINPHONE_BUILDER_SPEC_FILE@ \
--define "_topdir $RPM_TOPDIR" --define '_PKG_CONFIG_PATH $PKG_CONFIG_PATH'\
--define "_builddir @ep_source@" \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTION@ \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTIONS@ \
@LINPHONE_BUILDER_RPMBUILD_OPTIONS@ \
$VERBOSE @ep_redirect_to_file@
......@@ -733,7 +733,7 @@ macro(linphone_builder_add_external_project PROJNAME)
# some specific RPMBUILD options to pass for this particular project
if(EP_${PROJNAME}_RPMBUILD_OPTIONS)
set(LINPHONE_BUILDER_RPMBUILD_OPTIONS "${EP_${PROJNAME}_RPMBUILD_OPTIONS}")
string(REPLACE ";" " " LINPHONE_BUILDER_RPMBUILD_OPTIONS "${EP_${PROJNAME}_RPMBUILD_OPTIONS}")
else()
set(LINPHONE_BUILDER_RPMBUILD_OPTIONS "")
endif()
......@@ -1380,6 +1380,17 @@ macro(lcb_use_c_compiler_for_assembler BOOL_VALUE)
lcb_builder_use_c_compiler_for_assembler("${LINPHONE_BUILDER_CURRENT_BUILDER}" ${BOOL_VALUE})
endmacro()
macro(lcb_builder_rpmbuild_options BUILDER)
set(_args "${ARGN}")
foreach(_arg IN LISTS _args)
list(APPEND EP_${BUILDER}_RPMBUILD_OPTIONS "${_arg}")
endforeach()
endmacro()
macro(lcb_rpmbuild_options)
lcb_builder_rmpbuild_options("${LINPHONE_BUILDER_CURRENT_BUILDER}" ${ARGN})
endmacro()
macro(lcb_blacklist_dependencies)
set(_args "${ARGN}")
foreach(_dependency IN LISTS _args)
......
......@@ -12,7 +12,7 @@ export RPM_TOPDIR="@LINPHONE_BUILDER_WORK_DIR@/rpmbuild"
rpmbuild -ta --clean --rmsource --define "_topdir $RPM_TOPDIR" \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTION@ \
@LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTIONS@ \
@LINPHONE_BUILDER_RPMBUILD_OPTIONS@ \
--rmspec @ep_build@/*.tar.gz \
$VERBOSE @ep_redirect_to_file@
......
......@@ -90,106 +90,99 @@ endif()
# we can override the bctoolbox build method before including builders because it doesn't define it.
set(EP_bctoolbox_BUILD_METHOD "rpm")
lcb_builder_build_method(bctoolbox "rpm")
lcb_builder_cmake_options(bctoolbox "-DENABLE_TESTS=NO")
lcb_builder_cmake_options(bctoolbox "-DENABLE_TESTS_COMPONENT=NO")
lcb_builder_cmake_options(ms2 "-DENABLE_SRTP=NO") #mainly to avoid issue with old libsrtp (sha1_update conflict with polarssl)
set(EP_ms2_BUILD_METHOD "rpm")
set(EP_ortp_BUILD_METHOD "rpm")
# Include builders
include(builders/CMakeLists.txt)
set(EP_bellesip_BUILD_METHOD "rpm")
set(EP_sofiasip_BUILD_METHOD "rpm")
set(EP_flexisip_BUILD_METHOD "rpm")
set(EP_odb_BUILD_METHOD "custom")
set(EP_ms2_SPEC_PREFIX "${RPM_INSTALL_PREFIX}")
set(EP_ortp_SPEC_PREFIX "${RPM_INSTALL_PREFIX}")
set(EP_bellesip_SPEC_PREFIX "${RPM_INSTALL_PREFIX}")
set(EP_sofiasip_SPEC_PREFIX "${RPM_INSTALL_PREFIX}")
set(EP_flexisip_SPEC_PREFIX "${RPM_INSTALL_PREFIX}")
set(EP_ortp_RPMBUILD_OPTIONS "--with bc")
set(EP_ms2_RPMBUILD_OPTIONS "--with bc --without video --without srtp")
set(EP_unixodbc_RPMBUILD_OPTIONS "--with bc")
set(EP_myodbc_RPMBUILD_OPTIONS "--with bc")
set(EP_sofiasip_RPMBUILD_OPTIONS "--with bc --without glib")
set(EP_hiredis_RPMBUILD_OPTIONS "--with bc" )
if (ENABLE_TRANSCODER)
set(EP_flexisip_RPMBUILD_OPTIONS "--with bc --with push")
else()
set(EP_flexisip_RPMBUILD_OPTIONS "--with bc --without transcoder --with push")
endif()
lcb_builder_build_method(ortp "rpm")
lcb_builder_rpmbuild_options(ortp "--with bc")
set(EP_bellesip_RPMBUILD_OPTIONS "--with bc ")
lcb_builder_build_method(ms2 "rpm")
lcb_builder_cmake_options(ms2 "-DENABLE_SRTP=NO") #mainly to avoid issue with old libsrtp (sha1_update conflict with polarssl)
lcb_builder_rpmbuild_options(ms2
"--with bc"
"--without video"
"--without srtp"
)
if (ENABLE_PRESENCE)
lcb_builder_rpmbuild_name("flexisip" "flexisip-presence")
set(EP_flexisip_RPMBUILD_OPTIONS "${EP_flexisip_RPMBUILD_OPTIONS} --with presence")
endif()
lcb_builder_build_method(belr "rpm")
lcb_builder_rpmbuild_options(belr "--with bc")
if (ENABLE_SOCI)
set(soci_filename "soci-3.2.3.tar.gz")
set(EP_soci_URL "${CMAKE_CURRENT_SOURCE_DIR}/builders/soci/${soci_filename}")
set(EP_soci_URL_HASH "SHA1=5e527cf5c1740198fa706fc8821af45b34867ee1")
lcb_builder_build_method(bellesip "rpm")
lcb_builder_rpmbuild_options(bellesip "--with bc")
set(EP_soci_BUILD_METHOD "rpm")
set(EP_soci_SPEC_FILE "soci.spec" )
set(EP_soci_CONFIG_H_FILE "${CMAKE_CURRENT_SOURCE_DIR}/builders/soci/${EP_soci_SPEC_FILE}" )
set(EP_soci_RPMBUILD_OPTIONS "--without postgresql --without sqlite3 --without odbc --with mysql --without oracle --define 'soci_patch ${CMAKE_CURRENT_SOURCE_DIR}/builders/soci/soci_libdir.patch'")
lcb_builder_build_method(linphone "rpm")
lcb_builder_rpmbuild_options(linphone "--with bc")
#create source dir and copy the tar.gz inside
set(EP_soci_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_soci_PATCH_COMMAND ${EP_soci_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${EP_soci_URL}" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_soci_PATCH_COMMAND ${EP_soci_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/soci/soci_libdir.patch" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_soci_PATCH_COMMAND ${EP_soci_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" ${EP_soci_CONFIG_H_FILE} "<BINARY_DIR>")
lcb_builder_build_method(sofiasip "rpm")
lcb_builder_rpmbuild_options(sofiasip
"--with bc"
"--without glib"
)
# no configure needed for soci
set(EP_soci_CONFIGURE_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/soci/configure.sh.cmake)
lcb_builder_build_method(odb "custom")
set(EP_flexisip_RPMBUILD_OPTIONS "${EP_flexisip_RPMBUILD_OPTIONS} --with soci")
lcb_builder_build_method(flexisip "rpm")
lcb_builder_rpmbuild_options(flexisip
"--with bc"
"--with push"
)
lcb_builder_rpmbuild_options(hiredis "--with bc")
if(NOT ENABLE_TRANSCODER)
lcb_builder_rpmbuild_options(flexisip "--without transcoder")
endif()
if (ENABLE_SNMP)
set(EP_flexisip_RPMBUILD_OPTIONS "${EP_flexisip_RPMBUILD_OPTIONS} --with snmp")
if(ENABLE_PRESENCE)
lcb_builder_rpmbuild_name(flexisip "flexisip-presence")
lcb_builder_rpmbuild_options(flexisip "--with presence")
endif()
if(ENABLE_CONFERENCE)
lcb_builder_rpmbuild_options(flexisip "--with conference")
endif()
if(ENABLE_SNMP)
lcb_builder_rpmbuild_options(flexisip "--with snmp")
endif()
if(ENABLE_BC_ODBC)
set(EP_unixodbc_BUILD_METHOD "rpm")
set(EP_myodbc_BUILD_METHOD "rpm")
set(EP_unixodbc_SPEC_PREFIX "${RPM_INSTALL_PREFIX}")
set(EP_myodbc_SPEC_PREFIX "${RPM_INSTALL_PREFIX}")
set(EP_myodbc_CONFIGURE_OPTIONS "--with-unixODBC=${RPM_INSTALL_PREFIX}")
set(EP_flexisip_RPMBUILD_OPTIONS "${EP_flexisip_RPMBUILD_OPTIONS} --with bcodbc")
list(APPEND EP_flexisip_CONFIGURE_OPTIONS "--with-odbc=${RPM_INSTALL_PREFIX}")
lcb_builder_build_method(unixodbc "rpm")
lcb_builder_rpmbuild_options(unixodbc "--with bc")
lcb_builder_build_method(myodbc "rpm")
lcb_builder_rpmbuild_options(myodbc "--with bc")
lcb_builder_configure_options(myodbc "--with-unixODBC=${RPM_INSTALL_PREFIX}")
lcb_builder_rpmbuild_options(flexisip "--with bcodbc")
lcb_builder_configure_options(flexisip "--with-odbc=${RPM_INSTALL_PREFIX}")
endif()
set(LINPHONE_BUILDER_RPMBUILD_PACKAGE_PREFIX "bc-")
# prepare the RPMBUILD options that we need to pass
set(RPMBUILD_OPTIONS "--define '_mandir %{_prefix}'")
set(GLOBAL_RPMBUILD_OPTIONS "--define '_mandir %{_prefix}'")
if(PLATFORM STREQUAL "Debian")
# dependencies cannot be checked by rpmbuild in debian
set(RPMBUILD_OPTIONS "${RPMBUILD_OPTIONS} --nodeps")
set(GLOBAL_RPMBUILD_OPTIONS "${GLOBAL_RPMBUILD_OPTIONS} --nodeps")
# dist is not defined in debian for rpmbuild..
set(RPMBUILD_OPTIONS "${RPMBUILD_OPTIONS} --define 'dist .deb'")
set(GLOBAL_RPMBUILD_OPTIONS "${GLOBAL_RPMBUILD_OPTIONS} --define 'dist .deb'")
# debian has multi-arch lib dir instead of lib and lib64
set(RPMBUILD_OPTIONS "${RPMBUILD_OPTIONS} --define '_lib lib'")
set(GLOBAL_RPMBUILD_OPTIONS "${GLOBAL_RPMBUILD_OPTIONS} --define '_lib lib'")
# debian has multi-arch lib dir instead of lib and lib64
set(RPMBUILD_OPTIONS "${RPMBUILD_OPTIONS} --define '_libdir %{_prefix}/%{_lib}'")
set(GLOBAL_RPMBUILD_OPTIONS "${GLOBAL_RPMBUILD_OPTIONS} --define '_libdir %{_prefix}/%{_lib}'")
# some debians are using dash as shell, which doesn't support "export -n", so we override and use bash
set(RPMBUILD_OPTIONS "${RPMBUILD_OPTIONS} --define '_buildshell /bin/bash'")
set(GLOBAL_RPMBUILD_OPTIONS "${GLOBAL_RPMBUILD_OPTIONS} --define '_buildshell /bin/bash'")
CHECK_PROGRAM(alien)
CHECK_PROGRAM(fakeroot)
endif()
set(LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTION ${RPMBUILD_OPTIONS})
set(LINPHONE_BUILDER_RPMBUILD_GLOBAL_OPTIONS ${GLOBAL_RPMBUILD_OPTIONS})
......@@ -35,6 +35,7 @@ set(DEFAULT_VALUE_ENABLE_SNMP ON)
set(DEFAULT_VALUE_ENABLE_POLARSSL ON)
set(DEFAULT_VALUE_ENABLE_PROTOBUF OFF)
set(DEFAULT_VALUE_ENABLE_VCARD OFF)
set(DEFAULT_VALUE_ENABLE_VIDEO OFF)
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=NO")
......
......@@ -34,6 +34,3 @@ lcb_add_option("SNMP" "Enable SNMP support." "${DEFAULT_ENABLE_SNMP}")
lcb_add_option("SOCI" "Enable SOCI support." "${DEFAULT_ENABLE_SOCI}")
lcb_add_option("Transcoder" "Enable transcoder support." "${DEFAULT_ENABLE_TRANSCODER}")
lcb_add_option("PROTOBUF" "Enable protobuf for REDIS." "${DEFAULT_ENABLE_PROTOBUF}" "ENABLE_PROTOBUF" OFF)
set(XSDCXX_ROOT_PATH "/usr" CACHE STRING "Path of where the bin/xsdcxx executable will be found. Comes from http://www.codesynthesis.com/products/xsd/download.xhtml")
add_feature_info("XSDCXX_ROOT_PATH" XSDCXX_ROOT_PATH "Path of where the bin/xsdcxx executable will be found. Comes from http://www.codesynthesis.com/products/xsd/download.xhtml")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment