liblinphone.spec.cmake 3.05 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


Ghislain MARY's avatar
Ghislain MARY committed
18
Name:           @CPACK_PACKAGE_NAME@
jehan's avatar
jehan committed
19
Version:        @PROJECT_VERSION@
Ghislain MARY's avatar
Ghislain MARY committed
20
Release:        %{build_number}%{?dist}
jehan's avatar
jehan committed
21 22 23 24 25
Summary:        Phone anywhere in the whole world by using the Internet

Group:          Applications/Communications
License:        GPL
URL:            http://www.linphone.org
Ghislain MARY's avatar
Ghislain MARY committed
26
Source0:        %{name}-%{version}%{?build_number_ext}.tar.gz
jehan's avatar
jehan committed
27
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
28 29 30 31 32 33

Requires:	%{pkg_prefix}bctoolbox
Requires:	%{pkg_prefix}ortp
Requires:	%{pkg_prefix}mediastreamer
Requires:	%{pkg_prefix}belle-sip
Requires:	%{pkg_prefix}belr
Ghislain MARY's avatar
Ghislain MARY committed
34
%if @ENABLE_SOCI_STORAGE@
35 36 37
Requires:	%{pkg_prefix}soci
%endif

jehan's avatar
jehan committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
%description
liblinphone is the voip sdk used by Linphone


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

%description    devel
This package contains header files and development libraries needed to
develop programs using the liblinphone library.

%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
59 60 61 62
# 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
63
%prep
Ghislain MARY's avatar
Ghislain MARY committed
64
%setup -n %{name}-%{version}%{?build_number_ext}
jehan's avatar
jehan committed
65 66

%build
Ghislain MARY's avatar
Ghislain MARY committed
67
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
jehan's avatar
jehan committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}

%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 TODO
Ghislain MARY's avatar
Ghislain MARY committed
86 87 88
%if @ENABLE_DAEMON@ || @ENABLE_CONSOLE_UI@
%{_bindir}/*
%endif
jehan's avatar
jehan committed
89 90 91 92 93 94 95 96
%{_libdir}/*.so.*
#%{_mandir}/*
%{_datadir}/linphone
%{_datadir}/sounds/linphone

%files devel
%defattr(-,root,root)
%{_includedir}/linphone
Ghislain MARY's avatar
Ghislain MARY committed
97 98 99 100
%if @ENABLE_CXX_WRAPPER@
%{_includedir}/linphone++
%endif
%if @ENABLE_STATIC@
jehan's avatar
jehan committed
101
%{_libdir}/*.a
Ghislain MARY's avatar
Ghislain MARY committed
102 103
%endif
%if @ENABLE_SHARED@
jehan's avatar
jehan committed
104
%{_libdir}/*.so
Ghislain MARY's avatar
Ghislain MARY committed
105 106 107 108 109
%endif
%if @ENABLE_DOC@
%{_docdir}/linphone*/html
%{_docdir}/linphone*/xml
%endif
jehan's avatar
jehan committed
110
%{_datadir}/Linphone/cmake/*.cmake
Ghislain MARY's avatar
Ghislain MARY committed
111
%{_datadir}/LinphoneCxx/cmake/*.cmake
Erwan Croze's avatar
Erwan Croze committed
112
%{_datadir}/belr/grammars/cpim_grammar
jehan's avatar
jehan committed
113 114 115 116 117 118 119


%changelog
* Thu Jul 13 2017 jehan.monnier <jehan.monnier@linphone.org>
- cmake port
* Mon Aug 19 2013 jehan.monnier <jehan.monnier@linphone.org>
- Initial RPM release.