bzrtp.spec.cmake 2.95 KB
Newer Older
jehan's avatar
jehan committed
1 2
# -*- rpm-spec -*-

Ghislain MARY's avatar
Ghislain MARY committed
3 4
%define _prefix    @CMAKE_INSTALL_PREFIX@
%define pkg_prefix @BC_PACKAGE_NAME_PREFIX@
jehan's avatar
jehan committed
5 6 7 8 9 10 11 12

# 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
%define _datarootdir       %{_prefix}/share
%define _datadir           %{_datarootdir}
%define _docdir            %{_datadir}/doc

%define build_number @PROJECT_VERSION_BUILD@
Ghislain MARY's avatar
Ghislain MARY committed
13 14 15
%if %{build_number}
%define build_number_ext -%{build_number}
%endif
jehan's avatar
jehan committed
16 17 18



Ghislain MARY's avatar
Ghislain MARY committed
19
Name:           @CPACK_PACKAGE_NAME@
jehan's avatar
jehan committed
20 21 22 23 24 25 26 27 28 29
Version:        @PROJECT_VERSION@
Release:        %{build_number}%{?dist}
Summary:        BZRTP is an opensource implementation of ZRTP keys exchange protocol.

Group:          Applications/Communications
License:        GPL
URL:            http://www.linphone.org
Source0:        %{name}-%{version}-%{build_number}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot

Ghislain MARY's avatar
Ghislain MARY committed
30 31
Requires:	%{pkg_prefix}bctoolbox

jehan's avatar
jehan committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
%description

BZRTP is an opensource implementation of ZRTP keys exchange protocol.
The library written in C 89 is fully portable and can be executed  on many platforms including both ARM  processor and x86.

Licensing: The source code is licensed under GPLv2.

%package devel
Summary:       Development libraries for bzrtp
Group:         Development/Libraries
Requires:      %{name} = %{version}-%{release}

%description    devel
Libraries and headers required to develop software with bzrtp

%if 0%{?rhel} && 0%{?rhel} <= 7
%global cmake_name cmake3
%define ctest_name ctest3
%else
%global cmake_name cmake
%define ctest_name ctest
%endif

Ghislain MARY's avatar
Ghislain MARY committed
55 56 57 58
# 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

jehan's avatar
jehan committed
59
%prep
Ghislain MARY's avatar
Ghislain MARY committed
60
%setup -n %{name}-%{version}%{?build_number_ext}
jehan's avatar
jehan committed
61 62

%build
63
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
jehan's avatar
jehan committed
64 65 66 67 68
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}

69 70 71 72 73
# Dirty workaround to give exec rights for all shared libraries. Debian packaging needs this
# TODO : set CMAKE_INSTALL_SO_NO_EXE for a cleaner workaround
chmod +x `find %{buildroot} *.so.*`


jehan's avatar
jehan committed
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
%check
%{ctest_name} -V %{?_smp_mflags}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README.md
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/bzrtp
Ghislain MARY's avatar
Ghislain MARY committed
93
%if @ENABLE_STATIC@
jehan's avatar
jehan committed
94
%{_libdir}/libbzrtp.a
Ghislain MARY's avatar
Ghislain MARY committed
95 96
%endif
%if @ENABLE_SHARED@
jehan's avatar
jehan committed
97
%{_libdir}/libbzrtp.so
Ghislain MARY's avatar
Ghislain MARY committed
98 99 100
%endif
%{_datadir}/bzrtp/cmake/BZRTPConfig*.cmake
%{_datadir}/bzrtp/cmake/BZRTPTargets*.cmake
jehan's avatar
jehan committed
101 102

%changelog
103 104 105 106

* Tue Nov 27 2018 ronan.abhamon <ronan.abhamon@belledonne-communications.com>
- Do not set CMAKE_INSTALL_LIBDIR and never with _libdir!

jehan's avatar
jehan committed
107 108
* Wed Jul 19 2017 jehan.monnier <jehan.monnier@linphone.org>
- Initial RPM release.