Commit ca1467f2 authored by Ghislain MARY's avatar Ghislain MARY

Improve RPM specfile generation.

parent 996a3d65
......@@ -66,8 +66,6 @@ else()
find_package(BcToolbox 0.2.0 REQUIRED)
endif()
add_subdirectory(build)
check_include_file(sys/uio.h HAVE_SYS_UIO_H)
check_include_file(sys/audio.h HAVE_SYS_AUDIO_H)
if(NOT ANDROID)
......@@ -192,6 +190,10 @@ set(ORTPDEPS_LIBS )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
add_subdirectory(build)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake"
......
############################################################################
# CMakeLists.txt
# Copyright (C) 2017 Belledonne Communications, Grenoble France
# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -46,7 +46,8 @@ endif()
message("Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rpm/ortp.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../ortp.spec)
bc_generate_rpm_specfile("rpm/ortp.spec.cmake" "${PROJECT_SOURCE_DIR}/ortp.spec")
include(CPack)
......@@ -5,15 +5,8 @@
# Default is optimized for Pentium IV but will execute on Pentium II &
# later (i686).
# These 2 lines are here because we can build the RPM for flexisip, in which
# case we prefix the entire installation so that we don't break compatibility
# with the user's libs.
# To compile with bc prefix, use rpmbuild -ba --with bc [SPEC]
%define pkg_name %{?_with_bc:bc-ortp}%{!?_with_bc:ortp}
%{?_with_bc: %define _prefix /opt/belledonne-communications}
%define srtp %{?_without_srtp:0}%{?!_without_srtp:1}
%define pkg_prefix %{?_with_bc:bc-}%{!?_with_bc:}
%define _prefix @CMAKE_INSTALL_PREFIX@
%define pkg_prefix @BC_PACKAGE_NAME_PREFIX@
# re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir
# taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
......@@ -26,7 +19,7 @@
%endif
%define build_number @PROJECT_VERSION_BUILD@
Summary: Real-time Transport Protocol Stack
Name: %pkg_name
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %build_number%{?dist}
#to be alined with redhat which changed epoc to 1 for an unknown reason
......@@ -40,6 +33,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch: i686
%endif
Requires: %{pkg_prefix}bctoolbox
%if 0%{?rhel} && 0%{?rhel} <= 7
%global cmake_name cmake3
%define ctest_name ctest3
......@@ -48,8 +43,6 @@ BuildArch: i686
%define ctest_name ctest
%endif
Requires: %{pkg_prefix}bctoolbox
%description
oRTP is a GPL licensed C library implementing the RTP protocol
(rfc3550). It is available for most unix clones (primilarly Linux and
......@@ -83,7 +76,7 @@ develop programs using the oRTP library.
%setup -n %{name}-%{version}-%build_number
%build
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR=%{_lib} -DCMAKE_PREFIX_PATH:PATH=%{_prefix}
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR=%{_lib} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
make %{?_smp_mflags}
%install
......
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