Commit 71e776b7 authored by Ghislain MARY's avatar Ghislain MARY

Improve RPM packaging.

parent c1d092b8
......@@ -106,3 +106,4 @@ tools/lp-test-ecc
tools/lp-sendmsg
*.pyc
liblinphone.spec
############################################################################
# CMakeLists.txt
# Copyright (C) 2017 Belledonne Communications, Grenoble France
# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -20,7 +20,7 @@
#
############################################################################
if (NOT CPACK_PACKAGE_NAME)
if(NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "liblinphone")
ENDIF()
......@@ -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/liblinphone.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../liblinphone.spec)
bc_generate_rpm_specfile("rpm/liblinphone.spec.cmake" "${PROJECT_SOURCE_DIR}/liblinphone.spec")
include(CPack)
# -*- rpm-spec -*-
## rpmbuild options
# 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-liblinphone}%{!?_with_bc:liblinphone}
%{?_with_bc: %define _prefix /opt/belledonne-communications}
%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
......@@ -21,11 +14,8 @@
%define build_number_ext -%{build_number}
%endif
# This is for debian builds where debug_package has to be manually specified,
# whereas in centos it does not
%define lin_debug %{!?_enable_debug_packages:%debug_package}%{?_enable_debug_package:%{nil}}
Name: %{pkg_name}
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %{build_number}%{?dist}
Summary: Phone anywhere in the whole world by using the Internet
......@@ -41,16 +31,13 @@ Requires: %{pkg_prefix}ortp
Requires: %{pkg_prefix}mediastreamer
Requires: %{pkg_prefix}belle-sip
Requires: %{pkg_prefix}belr
%if %{?_with_soci:1}%{!?_with_soci:0}
%if @ENABLE_SOCI_STORAGE@
Requires: %{pkg_prefix}soci
%endif
%description
liblinphone is the voip sdk used by Linphone
%define lime %{?_without_lime:0}%{!?_without_lime:1}
%define video %{?_without_video:0}%{!?_without_video:1}
%package devel
Summary: Development libraries for liblinphone
......@@ -69,13 +56,15 @@ develop programs using the liblinphone library.
%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}
%lin_debug
%build
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} -DENABLE_VIDEO=%{video} -DENABLE_LIME=%{lime} -DENABLE_TOOLS=NO -DENABLE_CONSOLE_UI=NO -DENABLE_DAEMON=NO
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
make %{?_smp_mflags}
%install
......@@ -94,6 +83,9 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README.md TODO
%if @ENABLE_DAEMON@ || @ENABLE_CONSOLE_UI@
%{_bindir}/*
%endif
%{_libdir}/*.so.*
#%{_mandir}/*
%{_datadir}/linphone
......@@ -102,11 +94,19 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
%{_includedir}/linphone
%if @ENABLE_CXX_WRAPPER@
%{_includedir}/linphone++
%endif
%if @ENABLE_STATIC@
%{_libdir}/*.a
%endif
%if @ENABLE_SHARED@
%{_libdir}/*.so
%endif
%if @ENABLE_DOC@
%{_docdir}/linphone*/html
%{_docdir}/linphone*/xml
%endif
%{_datadir}/Linphone/cmake/*.cmake
%{_datadir}/LinphoneCxx/cmake/*.cmake
%{_datadir}/belr/grammars/cpim_grammar
......
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