Commit 89b0f032 authored by Ghislain MARY's avatar Ghislain MARY

Handle RPM packaging.

parent 19814348
......@@ -17,3 +17,4 @@ msisac.iss
m4/
config.h.in
*.DS_Store
mswebrtc.spec
......@@ -439,44 +439,5 @@ if(ENABLE_SHARED)
)
endif()
add_subdirectory(build)
# CPack settings
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES
"^${CMAKE_BINARY_DIR}"
"/\\\\..+"
"webrtc/build"
"webrtc/build_overrides"
"webrtc/chromium"
"webrtc/data"
"webrtc/infra"
"webrtc/resources"
"webrtc/talk"
"webrtc/third_party"
"webrtc/tools"
"webrtc/webrtc/audio"
"webrtc/webrtc/build"
"webrtc/webrtc/call"
"webrtc/webrtc/common_video"
"webrtc/webrtc/examples"
"webrtc/webrtc/libjingle"
"webrtc/webrtc/modules/audio_conference_mixer"
"webrtc/webrtc/modules/audio_device"
"webrtc/webrtc/modules/bitrate_controller"
"webrtc/webrtc/modules/desktop_capture"
"webrtc/webrtc/modules/media_file"
"webrtc/webrtc/modules/pacing"
"webrtc/webrtc/modules/remote_bitrate_estimator"
"webrtc/webrtc/modules/rtp_rtcp"
"webrtc/webrtc/modules/utility"
"webrtc/webrtc/modules/video*"
"webrtc/webrtc/p2p"
"webrtc/webrtc/sound"
"webrtc/webrtc/test"
"webrtc/webrtc/tools"
"webrtc/webrtc/video*"
"webrtc/webrtc/voice_engine"
)
include(CPack)
############################################################################
# CMakeLists.txt
# Copyright (C) 2016-2018 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
if(NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
endif()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION})
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
"^${CMAKE_BINARY_DIR}"
"^${PROJECT_SOURCE_DIR}/.git.*"
"^${PROJECT_SOURCE_DIR}/webrtc/build"
"^${PROJECT_SOURCE_DIR}/webrtc/build_overrides"
"^${PROJECT_SOURCE_DIR}/webrtc/chromium"
"^${PROJECT_SOURCE_DIR}/webrtc/data"
"^${PROJECT_SOURCE_DIR}/webrtc/infra"
"^${PROJECT_SOURCE_DIR}/webrtc/resources"
"^${PROJECT_SOURCE_DIR}/webrtc/talk"
"^${PROJECT_SOURCE_DIR}/webrtc/third_party"
"^${PROJECT_SOURCE_DIR}/webrtc/tools"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/audio"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/build"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/call"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/common_video"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/examples"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/libjingle"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/audio_conference_mixer"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/audio_device"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/bitrate_controller"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/desktop_capture"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/media_file"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/pacing"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/remote_bitrate_estimator"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/rtp_rtcp"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/utility"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/modules/video*"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/p2p"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/sound"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/test"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/tools"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/video*"
"^${PROJECT_SOURCE_DIR}/webrtc/webrtc/voice_engine"
)
bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD)
if(PROJECT_VERSION_BUILD)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}")
endif()
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
bc_generate_rpm_specfile("rpm/mswebrtc.spec.cmake" "${PROJECT_SOURCE_DIR}/mswebrtc.spec")
include(CPack)
# -*- rpm-spec -*-
%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
%define _datarootdir %{_prefix}/share
%define _datadir %{_datarootdir}
%define _docdir %{_datadir}/doc
%define build_number @PROJECT_VERSION_BUILD@
%if %{build_number}
%define build_number_ext -%{build_number}
%endif
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %{build_number}%{?dist}
Summary: mediastreamer2 plugin to include features from WebRTC (iSAC codec, AECM...).
Group: Applications/Communications
License: GPL
URL: http://www.linphone.org
Source0: %{name}-%{version}%{?build_number_ext}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: %{pkg_prefix}bctoolbox
%description
mediastreamer2 (linphone) plugin to include features from WebRTC (iSAC codec, AECM...)
%if 0%{?rhel} && 0%{?rhel} <= 7
%global cmake_name cmake3
%define ctest_name ctest3
%else
%global cmake_name cmake
%define ctest_name ctest
%endif
# This is for debian builds where debug_package has to be manually specified, whereas in centos it does not
%define custom_debug_package %{!?_enable_debug_packages:%debug_package}%{?_enable_debug_package:%{nil}}
%custom_debug_package
%prep
%setup -n %{name}-%{version}%{?build_number_ext}
%build
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
%check
%{ctest_name} -V %{?_smp_mflags}
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_libdir}/mediastreamer/plugins/*.so
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