Commit 25e5919a authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Improve RPM packaging.

parent 10049e07
...@@ -106,3 +106,4 @@ tools/lp-test-ecc ...@@ -106,3 +106,4 @@ tools/lp-test-ecc
tools/lp-sendmsg tools/lp-sendmsg
*.pyc *.pyc
liblinphone.spec
############################################################################ ############################################################################
# CMakeLists.txt # CMakeLists.txt
# Copyright (C) 2017 Belledonne Communications, Grenoble France # Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
# #
############################################################################ ############################################################################
# #
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
# #
############################################################################ ############################################################################
if (NOT CPACK_PACKAGE_NAME) if(NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "liblinphone") set(CPACK_PACKAGE_NAME "liblinphone")
ENDIF() ENDIF()
...@@ -40,13 +40,14 @@ set(CPACK_SOURCE_IGNORE_FILES ...@@ -40,13 +40,14 @@ set(CPACK_SOURCE_IGNORE_FILES
bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD) bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD)
if(PROJECT_VERSION_BUILD) if(PROJECT_VERSION_BUILD)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}")
endif() endif()
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" ) message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rpm/liblinphone.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/../liblinphone.spec)
bc_generate_rpm_specfile("rpm/liblinphone.spec.cmake" "${PROJECT_SOURCE_DIR}/liblinphone.spec")
include(CPack) include(CPack)
# -*- rpm-spec -*- # -*- rpm-spec -*-
## rpmbuild options %define _prefix @CMAKE_INSTALL_PREFIX@
# These 2 lines are here because we can build the RPM for flexisip, in which %define pkg_prefix @BC_PACKAGE_NAME_PREFIX@
# 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}
# re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir # 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 # taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
...@@ -15,18 +10,20 @@ ...@@ -15,18 +10,20 @@
%define _docdir %{_datadir}/doc %define _docdir %{_datadir}/doc
%define build_number @PROJECT_VERSION_BUILD@ %define build_number @PROJECT_VERSION_BUILD@
%if %{build_number}
%define build_number_ext -%{build_number}
%endif
Name: @CPACK_PACKAGE_NAME@
Name: %{pkg_name}
Version: @PROJECT_VERSION@ Version: @PROJECT_VERSION@
Release: %build_number%{?dist} Release: %{build_number}%{?dist}
Summary: Phone anywhere in the whole world by using the Internet Summary: Phone anywhere in the whole world by using the Internet
Group: Applications/Communications Group: Applications/Communications
License: GPL License: GPL
URL: http://www.linphone.org URL: http://www.linphone.org
Source0: %{name}-%{version}-%{build_number}.tar.gz Source0: %{name}-%{version}%{?build_number_ext}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: %{pkg_prefix}bctoolbox Requires: %{pkg_prefix}bctoolbox
...@@ -34,15 +31,13 @@ Requires: %{pkg_prefix}ortp ...@@ -34,15 +31,13 @@ Requires: %{pkg_prefix}ortp
Requires: %{pkg_prefix}mediastreamer Requires: %{pkg_prefix}mediastreamer
Requires: %{pkg_prefix}belle-sip Requires: %{pkg_prefix}belle-sip
Requires: %{pkg_prefix}belr Requires: %{pkg_prefix}belr
%if %{?_with_soci:1}%{!?_with_soci:0} %if @ENABLE_SOCI_STORAGE@
Requires: %{pkg_prefix}soci Requires: %{pkg_prefix}soci
%endif %endif
%description %description
liblinphone is the voip sdk used by Linphone liblinphone is the voip sdk used by Linphone
%define video %{?_without_video:0}%{!?_without_video:1}
%package devel %package devel
Summary: Development libraries for liblinphone Summary: Development libraries for liblinphone
...@@ -61,11 +56,15 @@ develop programs using the liblinphone library. ...@@ -61,11 +56,15 @@ develop programs using the liblinphone library.
%define ctest_name ctest %define ctest_name ctest
%endif %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 %prep
%setup -n %{name}-%{version}-%build_number %setup -n %{name}-%{version}%{?build_number_ext}
%build %build
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} -DENABLE_VIDEO=%{video} %{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} make %{?_smp_mflags}
%install %install
...@@ -84,25 +83,32 @@ rm -rf $RPM_BUILD_ROOT ...@@ -84,25 +83,32 @@ rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README.md TODO %doc AUTHORS ChangeLog COPYING NEWS README.md TODO
%{_bindir}/linphonec %if @ENABLE_DAEMON@ || @ENABLE_CONSOLE_UI@
%{_bindir}/linphonecsh %{_bindir}/*
%{_bindir}/lp-auto-answer %endif
%{_bindir}/lp-test-ecc
%{_libdir}/*.so.* %{_libdir}/*.so.*
#%{_mandir}/* #%{_mandir}/*
%{_datadir}/linphone %{_datadir}/linphone
%{_datadir}/sounds/linphone %{_datadir}/sounds/linphone
%{_datadir}/Linphone/rootca.pem
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/*
%{_includedir}/linphone %{_includedir}/linphone
%if @ENABLE_CXX_WRAPPER@
%{_includedir}/linphone++
%endif
%if @ENABLE_STATIC@
%{_libdir}/*.a %{_libdir}/*.a
%endif
%if @ENABLE_SHARED@
%{_libdir}/*.so %{_libdir}/*.so
#%{_docdir} %endif
%if @ENABLE_DOC@
%{_docdir}/linphone*/html
%{_docdir}/linphone*/xml
%endif
%{_datadir}/Linphone/cmake/*.cmake %{_datadir}/Linphone/cmake/*.cmake
%{_datadir}/liblinphone_tester %{_datadir}/LinphoneCxx/cmake/*.cmake
%{_datadir}/belr/grammars/cpim_grammar %{_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