belle-sip.spec.cmake 2.43 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@
5

jehan's avatar
jehan committed
6 7 8 9 10 11 12 13 14 15
# 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
16
Name:           @CPACK_PACKAGE_NAME@
jehan's avatar
jehan committed
17 18 19 20 21 22 23 24 25
Version:        @PROJECT_VERSION@
Release:        %build_number%{?dist}
Summary:        Linphone's sip stack

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

27
Requires:	%{pkg_prefix}bctoolbox
28

jehan's avatar
jehan committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
%description
Belle-sip is an object oriented SIP stack, written in C, used by Linphone.


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

%description    devel
Libraries and headers required to develop software with belle-sip

%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
49 50 51 52
# 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
53 54 55 56
%prep
%setup -n %{name}-%{version}-%build_number

%build
57
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_INSTALL_LIBDIR=%{_lib} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
jehan's avatar
jehan committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
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
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/belle-sip
Ghislain MARY's avatar
Ghislain MARY committed
82
%if @ENABLE_STATIC@
jehan's avatar
jehan committed
83
%{_libdir}/libbellesip.a
Ghislain MARY's avatar
Ghislain MARY committed
84 85
%endif
%if @ENABLE_SHARED@
jehan's avatar
jehan committed
86
%{_libdir}/libbellesip.so
Ghislain MARY's avatar
Ghislain MARY committed
87
%endif
jehan's avatar
jehan committed
88
%{_libdir}/pkgconfig/belle-sip.pc
Ghislain MARY's avatar
Ghislain MARY committed
89 90
%{_datadir}/BelleSIP/cmake/BelleSIPConfig*.cmake
%{_datadir}/BelleSIP/cmake/BelleSIPTargets*.cmake
jehan's avatar
jehan committed
91 92 93 94

%changelog
* Mon Aug 19 2013 jehan.monnier <jehan.monnier@linphone.org>
- Initial RPM release.