From 789567bdc05ca99b1c68de742a18d9fd5a1d68b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= <francois.grisez@belledonne-communications.com> Date: Thu, 7 Nov 2019 10:59:44 +0100 Subject: [PATCH] Use BcTooblox macros for source archive generation and change the project version into 4.3.0 --- CMakeLists.txt | 4 ++-- build/CMakeLists.txt | 28 ++++------------------------ build/rpm/liblinphone.spec.cmake | 16 ++++++---------- 3 files changed, 12 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e69d809dc0..3917b2f37f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # CMakeLists.txt -# Copyright (C) 2014 Belledonne Communications, Grenoble France +# Copyright (C) 2010-2019 Belledonne Communications, Grenoble France # ############################################################################ # @@ -20,7 +20,7 @@ # ############################################################################ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.11) # we need CMake 3.11 for defining 'package_source' target as custom target project(linphone VERSION 4.3.0 LANGUAGES C CXX) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 1fd7492c00..50519a0c1c 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # CMakeLists.txt -# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France +# Copyright (C) 2010-2019 Belledonne Communications, Grenoble France # ############################################################################ # @@ -22,33 +22,13 @@ if(NOT CPACK_PACKAGE_NAME) set(CPACK_PACKAGE_NAME "liblinphone") -ENDIF() - -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt") - -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}) +endif() -set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}" "^${PROJECT_SOURCE_DIR}/.git*" ) -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/liblinphone.spec.cmake" "${PROJECT_SOURCE_DIR}/liblinphone.spec") - -include(CPack) - +set(BC_SPECFILE_NAME "liblinphone.spec") +bc_make_package_source_target() diff --git a/build/rpm/liblinphone.spec.cmake b/build/rpm/liblinphone.spec.cmake index 96bb648f1c..03fcc579ea 100755 --- a/build/rpm/liblinphone.spec.cmake +++ b/build/rpm/liblinphone.spec.cmake @@ -2,6 +2,7 @@ %define _prefix @CMAKE_INSTALL_PREFIX@ %define pkg_prefix @BC_PACKAGE_NAME_PREFIX@ +%define package_name @CPACK_PACKAGE_NAME@-${FULL_VERSION} # 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 @@ -9,21 +10,16 @@ %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} +Version: ${RPM_VERSION} +Release: ${RPM_RELEASE}%{?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_ext}.tar.gz +Source0: %{package_name}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Requires: %{pkg_prefix}bctoolbox @@ -61,7 +57,7 @@ develop programs using the liblinphone library. %custom_debug_package %prep -%setup -n %{name}-%{version}%{?build_number_ext} +%setup -n %{package_name} %build %{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@ @@ -93,7 +89,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%doc ChangeLog.md COPYING README.md +%doc ChangeLog.md LICENSE.txt README.md %if @ENABLE_DAEMON@ || @ENABLE_CONSOLE_UI@ || @ENABLE_TOOLS@ %{_bindir}/* %endif -- GitLab