liblinphone.spec.cmake 3.55 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
34 35 36
%if @ENABLE_VCARD@
Requires:	%{pkg_prefix}belcard
%endif
37

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
67
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
jehan's avatar
jehan committed
68 69 70 71 72
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}

DanmeiChen's avatar
DanmeiChen committed
73 74 75 76 77 78
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
install -p -m 0644 build/rpm/lp-autoanswer.service $RPM_BUILD_ROOT/lib/systemd/system
install -p -m 0644 build/rpm/lp-autoanswer.conf $RPM_BUILD_ROOT/etc/sysconfig
mv $RPM_BUILD_ROOT/etc/sysconfig/lp-autoanswer.conf $RPM_BUILD_ROOT/etc/sysconfig/lp-autoanswer

jehan's avatar
jehan committed
79 80 81 82 83 84 85 86 87 88
%check
#%{ctest_name} -V %{?_smp_mflags}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

89
%files
jehan's avatar
jehan committed
90
%defattr(-,root,root)
91
%doc ChangeLog.md COPYING README.md
92
%if @ENABLE_DAEMON@ || @ENABLE_CONSOLE_UI@ || @ENABLE_TOOLS@
Ghislain MARY's avatar
Ghislain MARY committed
93 94
%{_bindir}/*
%endif
jehan's avatar
jehan committed
95 96 97 98
%{_libdir}/*.so.*
#%{_mandir}/*
%{_datadir}/linphone
%{_datadir}/sounds/linphone
DanmeiChen's avatar
DanmeiChen committed
99 100
/etc/sysconfig/lp-autoanswer
/lib/systemd/system/lp-autoanswer.service
jehan's avatar
jehan committed
101 102 103 104

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


%changelog
124 125 126 127

* 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
128 129
* Thu Jul 13 2017 jehan.monnier <jehan.monnier@linphone.org>
- cmake port
130

jehan's avatar
jehan committed
131 132
* Mon Aug 19 2013 jehan.monnier <jehan.monnier@linphone.org>
- Initial RPM release.