1# -*- rpm-spec -*-
2#
3# mediastreamer2 -- A media streaming library for telephony applications
4#
5# These 2 lines are here because we can build the RPM for flexisip, in which
6# case we prefix the entire installation so that we don't break compatibility
7# with the user's libs.
8# To compile with bc prefix, use rpmbuild -ba --with bc [SPEC]
9%define                 pkg_name        %{?_with_bc:bc-mediastreamer}%{!?_with_bc:mediastreamer}
10%{?_with_bc: %define    _prefix         /opt/belledonne-communications}
11
12# re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir
13# taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
14%define _datarootdir       %{_prefix}/share
15%define _datadir           %{_datarootdir}
16%define _docdir            %{_datadir}/doc
17
18%ifarch %ix86
19%define		mediastreamer2_cpu	pentium4
20%endif
21
22Summary:	Audio/Video real-time streaming
23Name:		%pkg_name
24Version:	@MEDIASTREAMER_VERSION@
25Release:	%(git describe --tags --abbrev=40 | sed -rn 's/^.*-([0-9]+)-g[a-z0-9]{40}$/\1/p' || echo '1')%{?dist}
26License:	GPL
27Group:		Applications/Communications
28URL:		http://www.mediastreamer2.com
29Source0:        %{name}-%{version}.tar.gz
30BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
31%ifarch %ix86
32BuildArch:	i686
33%endif
34
35%description
36Mediastreamer2 is a GPL licensed library to make audio and video
37real-time streaming and processing. Written in pure C, it is based
38upon the oRTP library.
39
40%package        devel
41Summary:        Headers, libraries and docs for the mediastreamer2 library
42Group:          Development/Libraries
43Requires:       %{name} = %{version}-%{release}
44
45%description    devel
46Mediastreamer2 is a GPL licensed library to make audio and video
47real-time streaming and processing. Written in pure C, it is based
48upon the ortp library.
49
50This package contains header files and development libraries needed to
51develop programs using the mediastreamer2 library.
52
53%define		video		%{?_without_video:0}%{!?_without_video:1}
54
55%prep
56%setup -q
57
58%build
59options="--enable-shared --enable-static --disable-glx --docdir=%{_docdir} "
60%if !%{video}
61options="$options --disable-video"
62%endif
63
64%configure $options
65
66make -j$RPM_BUILD_NCPUS
67
68%install
69rm -rf $RPM_BUILD_ROOT
70make install DESTDIR=$RPM_BUILD_ROOT
71
72%clean
73rm -rf $RPM_BUILD_ROOT
74
75%files
76%defattr(-,root,root,-)
77%{_bindir}/*
78%{_libdir}/*.so.*
79%{_datadir}/images/nowebcamCIF.jpg
80%{_datadir}/locale/??/LC_MESSAGES/mediastreamer.mo
81%{_datadir}/locale/??_??/LC_MESSAGES/mediastreamer.mo
82
83%files devel
84%defattr(-,root,root,-)
85%{_libdir}/*.la
86%{_libdir}/*.a
87%{_libdir}/*.so
88%{_libdir}/pkgconfig/*.pc
89%{_includedir}
90%{_docdir}
91
92%changelog
93* Tue Oct 25 2005 Francois-Xavier Kowalski <fix@hp.com>
94- Add to mediastreamer2 distribution with "make rpm" target
95