Commit 1b943ed3 authored by Ghislain MARY's avatar Ghislain MARY

Improve RPM packaging.

parent 0dc85788
############################################################################
# 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 "bzrtp")
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/bzrtp.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/../bzrtp.spec)
bc_generate_rpm_specfile("rpm/bzrtp.spec.cmake" "${PROJECT_SOURCE_DIR}/bzrtp.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 bzrtp
%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
......@@ -14,10 +10,13 @@
%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}
Summary: BZRTP is an opensource implementation of ZRTP keys exchange protocol.
......@@ -28,6 +27,8 @@ URL: http://www.linphone.org
Source0: %{name}-%{version}-%{build_number}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: %{pkg_prefix}bctoolbox
%description
BZRTP is an opensource implementation of ZRTP keys exchange protocol.
......@@ -51,11 +52,15 @@ Libraries and headers required to develop software with bzrtp
%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}
%{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
......@@ -80,12 +85,14 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
%{_includedir}/bzrtp
%if @ENABLE_STATIC@
%{_libdir}/libbzrtp.a
%endif
%if @ENABLE_SHARED@
%{_libdir}/libbzrtp.so
%{_datadir}/bzrtp/cmake/BZRTPConfig.cmake
%{_datadir}/bzrtp/cmake/BZRTPTargets-noconfig.cmake
%{_datadir}/bzrtp/cmake/BZRTPTargets.cmake
%{_datadir}/bzrtp/cmake/BZRTPConfigVersion.cmake
%endif
%{_datadir}/bzrtp/cmake/BZRTPConfig*.cmake
%{_datadir}/bzrtp/cmake/BZRTPTargets*.cmake
%changelog
* Wed Jul 19 2017 jehan.monnier <jehan.monnier@linphone.org>
......
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