Commit 565666f6 authored by Ghislain MARY's avatar Ghislain MARY

Improve RPM packaging.

parent 61244560
############################################################################
# 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 "belr")
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/belr.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../belr.spec)
bc_generate_rpm_specfile("rpm/belr.spec.cmake" "${PROJECT_SOURCE_DIR}/belr.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-belr}%{!?_with_bc:belr}
%{?_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
......@@ -23,7 +16,7 @@
Name: %{pkg_name}
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %{build_number}%{?dist}
Summary: Belr is language recognition library for ABNF based protocols.
......@@ -61,11 +54,15 @@ Libraries and headers required to develop software with belr
%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}
%build
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix}
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
make %{?_smp_mflags}
%install
......@@ -90,12 +87,18 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
%{_includedir}/belr
%if @ENABLE_STATIC@
%{_libdir}/libbelr.a
%endif
%if @ENABLE_SHARED@
%{_libdir}/libbelr.so
%endif
%{_datadir}/Belr/cmake/BelrConfig.cmake
%{_datadir}/Belr/cmake/BelrTargets-noconfig.cmake
%{_datadir}/Belr/cmake/BelrTargets.cmake
%if @ENABLE_TESTS@ || @ENABLE_TOOLS@
%{_bindir}/*
%endif
%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