mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Improve RPM packaging.
This commit is contained in:
parent
3fd706a702
commit
375b821b9f
2 changed files with 43 additions and 27 deletions
|
|
@ -1,6 +1,6 @@
|
|||
############################################################################
|
||||
# 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()
|
||||
|
||||
|
|
@ -40,13 +40,14 @@ set(CPACK_SOURCE_IGNORE_FILES
|
|||
|
||||
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}")
|
||||
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})
|
||||
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
# -*- 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 _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
|
||||
|
|
@ -15,24 +10,33 @@
|
|||
%define _docdir %{_datadir}/doc
|
||||
|
||||
%define build_number @PROJECT_VERSION_BUILD@
|
||||
%if %{build_number}
|
||||
%define build_number_ext -%{build_number}
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
Name: %{pkg_name}
|
||||
Name: @CPACK_PACKAGE_NAME@
|
||||
Version: @PROJECT_VERSION@
|
||||
Release: %build_number%{?dist}
|
||||
Release: %{build_number}%{?dist}
|
||||
Summary: Phone anywhere in the whole world by using the Internet
|
||||
|
||||
Group: Applications/Communications
|
||||
License: GPL
|
||||
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
|
||||
|
||||
Requires: %{pkg_prefix}bctoolbox
|
||||
Requires: %{pkg_prefix}ortp
|
||||
Requires: %{pkg_prefix}mediastreamer
|
||||
Requires: %{pkg_prefix}belle-sip
|
||||
%if @ENABLE_VCARD@
|
||||
Requires: %{pkg_prefix}belcard
|
||||
%endif
|
||||
|
||||
%description
|
||||
liblinphone is the voip sdk used by Linphone
|
||||
|
||||
%define video %{?_without_video:0}%{!?_without_video:1}
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Development libraries for liblinphone
|
||||
|
|
@ -51,11 +55,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
|
||||
%setup -n %{name}-%{version}%{?build_number_ext}
|
||||
|
||||
%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}
|
||||
|
||||
%install
|
||||
|
|
@ -74,25 +82,32 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS ChangeLog COPYING NEWS README.md TODO
|
||||
%{_bindir}/linphonec
|
||||
%{_bindir}/linphonecsh
|
||||
%{_bindir}/lp-auto-answer
|
||||
%{_bindir}/lp-test-ecc
|
||||
%if @ENABLE_DAEMON@ || @ENABLE_CONSOLE_UI@
|
||||
%{_bindir}/*
|
||||
%endif
|
||||
%{_libdir}/*.so.*
|
||||
#%{_mandir}/*
|
||||
%{_datadir}/linphone
|
||||
%{_datadir}/sounds/linphone
|
||||
%{_datadir}/Linphone/rootca.pem
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/*
|
||||
%{_includedir}/linphone
|
||||
%if @ENABLE_CXX_WRAPPER@
|
||||
%{_includedir}/linphone++
|
||||
%endif
|
||||
%if @ENABLE_STATIC@
|
||||
%{_libdir}/*.a
|
||||
%endif
|
||||
%if @ENABLE_SHARED@
|
||||
%{_libdir}/*.so
|
||||
#%{_docdir}
|
||||
%endif
|
||||
%if @ENABLE_DOC@
|
||||
%{_docdir}/linphone*/html
|
||||
%{_docdir}/linphone*/xml
|
||||
%endif
|
||||
%{_datadir}/Linphone/cmake/*.cmake
|
||||
%{_datadir}/liblinphone_tester
|
||||
%{_datadir}/LinphoneCxx/cmake/*.cmake
|
||||
|
||||
|
||||
%changelog
|
||||
Loading…
Add table
Reference in a new issue