ortp.spec.in 3.24 KB
Newer Older
aymeric's avatar
aymeric committed
1
# -*- rpm-spec -*-
2
#
aymeric's avatar
aymeric committed
3
# ortp -- Real-time Transport Protocol Stack
4
#
aymeric's avatar
aymeric committed
5 6 7
# Default is optimized for Pentium IV but will execute on Pentium II &
# later (i686).

8 9 10 11 12 13
# 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-ortp}%{!?_with_bc:ortp}
%{?_with_bc: %define 	_prefix		/opt/belledonne-communications}
14
%define 		srtp 		%{?_without_srtp:0}%{?!_without_srtp:1}
15

16 17 18 19 20 21
# 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

aymeric's avatar
aymeric committed
22 23 24 25 26
%ifarch %ix86
%define		ortp_cpu	pentium4
%endif

Summary:	Real-time Transport Protocol Stack
27
Name:		%pkg_name
aymeric's avatar
aymeric committed
28
Version:	@ORTP_PKGCONFIG_VERSION@
29
Release:	%(git describe --tags --abbrev=40 | sed -rn 's/^.*-([0-9]+)-g[a-z0-9]{40}$/\1/p' || echo '1')%{?dist}
jehan's avatar
jehan committed
30 31
#to be alined with redhat which changed epoc to 1 for an unknown reason
Epoch:		1
aymeric's avatar
aymeric committed
32 33 34
License:	LGPL
Group:		Applications/Communications
URL:		http://linphone.org/ortp/
35
Source0:	%{name}-%{version}.tar.gz
aymeric's avatar
aymeric committed
36 37 38 39 40 41 42
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
%ifarch %ix86
BuildArch:	i686
%endif

%description
oRTP is a LGPL licensed C library implementing the RTP protocol
43
(rfc3550). It is available for most unix clones (primilarly Linux and
aymeric's avatar
aymeric committed
44 45 46 47 48
HP-UX), and Microsoft Windows.

%package        devel
Summary:        Headers, libraries and docs for the oRTP library
Group:          Development/Libraries
49
BuildRequires:	doxygen
jehan's avatar
jehan committed
50 51
#to be alined with redhat which changed epoc to 1 for an unknown reason
Epoch:		1
Simon Morlat's avatar
Simon Morlat committed
52
Requires:      %{name} = %{epoch}:%{version}-%{release}
aymeric's avatar
aymeric committed
53 54 55 56 57 58 59 60 61 62

%description    devel
oRTP is a LGPL licensed C library implementing the RTP protocol
(rfc1889). It is available for most unix clones (primilarly Linux and
HP-UX), and Microsoft Windows.

This package contains header files and development libraries needed to
develop programs using the oRTP library.

%ifarch %ix86
jehan's avatar
jehan committed
63
%define	ortp_arch_cflags -malign-double -march=i686 -mtune=%{ortp_cpu}
aymeric's avatar
aymeric committed
64 65 66 67
%else
# Must be non-empty
%define ortp_arch_cflags -Wall
%endif
68
%define ortp_cflags %ortp_arch_cflags -Wall -g -pipe -pthread -O3 -fomit-frame-pointer -fno-schedule-insns -fschedule-insns2 -fno-strict-aliasing
aymeric's avatar
aymeric committed
69 70

%prep
71
%setup
aymeric's avatar
aymeric committed
72 73 74 75

%build
%configure \
	--enable-shared \
jehan's avatar
jehan committed
76
	--enable-static \
77 78 79
%if !%{srtp}
	--with-srtp=none \
%endif
jehan's avatar
jehan committed
80
	--docdir=%{_docdir}
81

aymeric's avatar
aymeric committed
82 83 84 85
%{__make} -j$RPM_BUILD_NCPUS CFLAGS="%ortp_cflags" CXXFLAGS="%ortp_cflags"

%install
rm -rf $RPM_BUILD_ROOT
86
make install DESTDIR=$RPM_BUILD_ROOT
aymeric's avatar
aymeric committed
87 88 89 90 91 92

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
93 94 95 96
%doc %{_docdir}/ortp-%{version}/README
%doc %{_docdir}/ortp-%{version}/ChangeLog
%doc %{_docdir}/ortp-%{version}/COPYING
%doc %{_docdir}/ortp-%{version}/AUTHORS
aymeric's avatar
aymeric committed
97 98 99 100
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
101
%doc %{_docdir}/ortp-%{version}/html/*
aymeric's avatar
aymeric committed
102 103 104 105
%{_libdir}/*.la
%{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
106
%{_includedir}/*
aymeric's avatar
aymeric committed
107 108 109 110

%changelog
* Tue Oct 25 2005 Francois-Xavier Kowalski <fix@hp.com>
- Add to oRTP distribution with "make rpm" target