sofia-sip.spec.in 8.15 KB
Newer Older
1
# Sofia SIP UA Library
Pekka Pessi's avatar
Pekka Pessi committed
2

3 4 5 6 7
# 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-sofia-sip}%{!?_with_bc:sofia-sip}
8
%define					pkg_prefix		%{?_with_bc:bc-}%{!?_with_bc:}
9
#%{?_with_bc: %define    _prefix         /opt/belledonne-communications}
10
%define					bcpkg			%{?_with_bc:1}{!?_with_bc:0}
11 12


13
Summary: Sofia SIP User-Agent library
14
Name: %pkg_name
Pekka Pessi's avatar
Pekka Pessi committed
15
Version: @VERSION@
16
Release: 2%{?dist}
17
License: LGPL
Pekka Pessi's avatar
Pekka Pessi committed
18 19
Group: System Environment/Libraries
URL: http://sf.net/projects/sofia-sip
20
Source0: %{name}-%{version}.tar.gz
Pekka Pessi's avatar
Pekka Pessi committed
21 22
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

23 24
BuildRequires: pkgconfig

25 26
%define opt_with() %{expand:%%global with_%{1} %%{?_with_%{1}:1}%%{?!_with_%{1}:0}}
%define opt_without() %{expand:%%global with_%{1} %%{!?_without_%{1}:1}%%{?_without_%{1}:0}}
27

28
# Options:
29 30 31 32 33
%opt_with doxygen	- Generate documents using doxygen and dot
%opt_with check		- Run tests
%opt_with openssl	- Always use OpenSSL (TLS)
%opt_with glib		- Always use glib-2.0 (>= 2.2)
%opt_with sctp		- Include SCTP transport
34

35 36 37
# need to manipulate prefix here instead of above because "%{expand:...}" seems to mess it up
%{?_with_bc: %define    _prefix         /opt/belledonne-communications}

38 39 40 41 42
# sometimes it is not defined
%define _datadir           %{_datarootdir}
%define _docdir            %{_datadir}/doc


43
%define have_doxygen %{?_with_doxygen:1}%{!?_with_doxygen:0}
44 45
%define have_openssl %(%{?!_with_openssl:pkg-config 'openssl >= 0.9.7'&&}echo 1||echo 0)
%define have_glib %(%{?!_with_glib:pkg-config 'glib-2.0 >= 2.2'&&}echo 1||echo 0)
Pekka Pessi's avatar
Pekka Pessi committed
46

47 48
# allow to disable glib by passing --without glib
%define have_glib %{?_without_glib:0}%{?!_without_glib:1}
49

50 51
%if %{have_doxygen}
BuildRequires: doxygen >= 1.3, graphviz
52 53 54 55 56 57 58
%endif
%if %{have_openssl}
BuildRequires: openssl-devel >= 0.9.7
%endif
%if %{have_glib}
BuildRequires: glib2-devel >= 2.2
%endif
59

Pekka Pessi's avatar
Pekka Pessi committed
60 61 62 63 64
%description
Sofia SIP is a RFC-3261-compliant library for SIP user agents and other
network elements.

%prep
65
%setup
Pekka Pessi's avatar
Pekka Pessi committed
66 67

%build
68
options="--disable-dependency-tracking --datadir=%{_datadir}"
69
options="$options --with-pic --enable-shared --disable-static"
70 71 72
%if !%{have_glib}
options="$options --without-glib"
%endif
73
%if %{with_sctp}
74 75 76 77
options="$options --enable-sctp"
%endif

%configure $options
78

79
make %{_smp_mflags}
80
%if %{have_doxygen}
81 82
make doxygen
%endif
Pekka Pessi's avatar
Pekka Pessi committed
83

84 85
# XXX comment next line to build with non-check aware rpmbuild.
%check
86
%if %{with_check}
87 88 89
make check
%endif

Pekka Pessi's avatar
Pekka Pessi committed
90 91 92
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
93

94 95
# Remove extra files
find $RPM_BUILD_ROOT -type f -name *.la -print0 | xargs -0 rm
96

97
%if %{have_doxygen}
98
# Manually install development docs into manual
99 100
cp -p -r libsofia-sip-ua/docs/html manual
%endif
Pekka Pessi's avatar
Pekka Pessi committed
101

102 103 104 105
# this prevents RPM from complaining that we use rpath libs in
# a non-standard directory
%{?_with_bc: export QA_RPATHS=0x0003}

Pekka Pessi's avatar
Pekka Pessi committed
106 107 108
%clean
rm -rf $RPM_BUILD_ROOT

109 110 111 112
%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

Pekka Pessi's avatar
Pekka Pessi committed
113 114
%files
%defattr(-,root,root,-)
115
%{_libdir}/libsofia-sip-ua.so.*
Pekka Pessi's avatar
Pekka Pessi committed
116
%doc AUTHORS COPYING COPYRIGHTS README
Pekka Pessi's avatar
Pekka Pessi committed
117

118
%if %{have_glib}
119
# note: soname in pkgname allows install of multiple library versions
120
# The glib interface is still a bit unstable
121
%package	glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
122
Summary:	GLIB bindings for Sofia-SIP
123
Group:		System Environment/Libraries
124 125 126
Requires:	%{pkg_prefix}sofia-sip
Obsoletes:	%{pkg_prefix}sofia-sip-glib < %{version}-%{release}
Provides:	%{pkg_prefix}sofia-sip-glib = %{version}-%{release}
Pekka Pessi's avatar
Pekka Pessi committed
127

128
%description	glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
Pekka Pessi's avatar
Pekka Pessi committed
129 130
GLib interface to Sofia SIP User Agent library.

131
%files 		glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
Pekka Pessi's avatar
Pekka Pessi committed
132
%defattr(-,root,root,-)
133
%{_libdir}/libsofia-sip-ua-glib.so.*
134 135 136 137
%doc AUTHORS COPYING COPYRIGHTS README libsofia-sip-ua-glib/ChangeLog

%post glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@ -p /sbin/ldconfig
%postun glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@ -p /sbin/ldconfig
Pekka Pessi's avatar
Pekka Pessi committed
138 139 140

%endif

Pekka Pessi's avatar
Pekka Pessi committed
141
%package	devel
142 143
Summary:	Sofia-SIP Development Package
Group:		Development/Libraries
144 145 146
Requires:	%{pkg_prefix}sofia-sip = %{version}-%{release}
Obsoletes:	%{pkg_prefix}sofia-devel < %{version}-%{release}
Provides:	%{pkg_prefix}sofia-devel = %{version}-%{release}
147

148
Requires:	pkgconfig
149

Pekka Pessi's avatar
Pekka Pessi committed
150
%description	devel
151
Development package for Sofia SIP UA library. This package includes
152
static libraries and include files.
Pekka Pessi's avatar
Pekka Pessi committed
153

154
%if !%{with_doxygen}
155
The reference documentation for Sofia SIP UA library is available at
156 157
<http://sofia-sip.sourceforge.net/development.html>
%endif
158

Pekka Pessi's avatar
Pekka Pessi committed
159
%files 		devel
160
%defattr(-,root,root,-)
161 162 163 164 165 166 167 168 169 170 171
%dir %{_includedir}/sofia-sip*
%dir %{_includedir}/sofia-sip*/sofia-sip
%{_includedir}/sofia-sip*/sofia-sip/*.h
%{_includedir}/sofia-sip*/sofia-sip/*.h.in
%dir %{_includedir}/sofia-sip*/sofia-resolv
%{_includedir}/sofia-sip*/sofia-resolv/*.h
%dir %{_datadir}/sofia-sip
%{_datadir}/sofia-sip/tag_dll.awk
%{_datadir}/sofia-sip/msg_parser.awk
%{_libdir}/libsofia-sip-ua.so
%{_libdir}/pkgconfig/sofia-sip-ua.pc
Pekka Pessi's avatar
Pekka Pessi committed
172
%doc TODO README.developers
173

174 175
%if %{have_glib}
# note: no soname here as no multiple glib-devel packages can co-exist in peace
Pekka Pessi's avatar
Pekka Pessi committed
176
%package	glib-devel
177 178
Summary:	GLIB bindings for Sofia SIP development files
Group:			Development/Libraries
179 180
Requires:	%{pkg_prefix}sofia-sip-glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@ = %{version}-%{release}
Requires:	%{pkg_prefix}sofia-sip-devel >= 1.12
181
BuildRequires:	glib2-devel >= 2.2
182

Pekka Pessi's avatar
Pekka Pessi committed
183 184
%description	glib-devel
Development package for Sofia SIP UA Glib library. This package includes
185
static libraries and include files for developing glib programs using Sofia
Pekka Pessi's avatar
Pekka Pessi committed
186 187 188 189
SIP.

%files 		glib-devel
%defattr(-,root,root,-)
190 191 192
%{_includedir}/sofia-sip*/sofia-sip/su_source.h
%{_libdir}/libsofia-sip-ua-glib.so
%{_libdir}/pkgconfig/sofia-sip-ua-glib.pc
Pekka Pessi's avatar
Pekka Pessi committed
193 194 195
%endif

%package	docs
196 197
Summary:	Sofia-SIP Development Manual Package
Group:		Documentation
Pekka Pessi's avatar
Pekka Pessi committed
198 199 200
%description	docs
HTML reference documentation for Sofia SIP UA library.

201
%if %{have_doxygen}
Pekka Pessi's avatar
Pekka Pessi committed
202 203
%files docs
%defattr(-,root,root,-)
204
%doc manual
Pekka Pessi's avatar
Pekka Pessi committed
205
%endif
Pekka Pessi's avatar
Pekka Pessi committed
206 207

%package	utils
208 209
Summary:	Sofia-SIP Command Line Utilities
Group:		Applications/Internet
210 211 212
Requires:	%{pkg_prefix}sofia-sip = %{version}-%{release}
Obsoletes:	%{pkg_prefix}sofia-utils < %{version}-%{release}
Provides:	%{pkg_prefix}sofia-utils = %{version}-%{release}
Pekka Pessi's avatar
Pekka Pessi committed
213 214 215
%description	utils
Command line utilities for Sofia SIP UA library.

Pekka Pessi's avatar
Pekka Pessi committed
216
%files utils
Pekka Pessi's avatar
Pekka Pessi committed
217
%defattr(-,root,root,-)
218 219 220 221 222 223
%{_bindir}/localinfo
%{_bindir}/addrinfo
%{_bindir}/sip-options
%{_bindir}/sip-date
%{_bindir}/sip-dig
%{_bindir}/stunc
Pekka Pessi's avatar
Pekka Pessi committed
224
%{_mandir}/man?/*
Pekka Pessi's avatar
Pekka Pessi committed
225 226

%changelog
227 228 229 230 231 232 233
* Thu Dec  7 2006 Pekka Pessi <ppessi at gmail.com> - 1.12.4-1
- Silenced all rpmlint warnings on FC6.

* Wed Dec  6 2006 Pekka Pessi <ppessi at gmail.com> - 1.12.4-0
- Fixing optional values on Fedora. rpmlinted. No doxygen docs.

* Tue Dec  5 2006 Pekka Pessi <ppessi at gmail.com> - 1.12.4
234 235
- Bumped version. rpmlinted.

236
* Tue Dec  5 2006 Kai Vehmanen <first.lastname at nokia.com>
237
- The 'nua-glib' module, and the related dependency to gobject, has been
238 239 240
  removed from the sofia-sip package

* Fri Oct  6 2006 Pekka Pessi <ppessi at gmail.com> - 1.12.3
241 242 243
- Autodetecting openssl, glib and gobject support with pkg-config
  (use --with openssl --with glib and --with gobject to force them)

244
* Mon Sep 18 2006 Kai Vehmanen <first.lastname at nokia.com>
245 246
- Removed *.m4 files from the distribution package.

247
* Fri Aug 11 2006 Kai Vehmanen <first.lastname at nokia.com>
248 249
- Modified the install location of the awk scripts.

250
* Thu Jun 15 2006 Kai Vehmanen <first.lastname at nokia.com>
251
- Added library soname to sofia-sip-glib package name.
252 253
- Modified dependencies - the glib subpackages do not depend
  on a specific version of sofia-sip anymore.
254

255
* Wed Mar 08 2006 Kai Vehmanen <first.lastname at nokia.com>
256 257
- Added libsofia-sip-ua-glib to the package.

258
* Tue Nov 15 2005 Kai Vehmanen <first.lastname at nokia.com>
259 260 261
- Removed the --includedir parameter. The public headers are
  now installed under includedir/sofia-sip-MAJOR.MINOR/

262
* Thu Oct 20 2005 Pekka Pessi <first.lastname at nokia.com>
263
- Using %%{_lib} instead of lib
Pekka Pessi's avatar
Pekka Pessi committed
264

265
* Thu Oct  6 2005 Pekka Pessi <first.lastname at nokia.com>
Pekka Pessi's avatar
Pekka Pessi committed
266 267
- Added sub-package utils

268
* Thu Oct  6 2005 Pekka Pessi <first.lastname at nokia.com> - 1.11.0
Pekka Pessi's avatar
Pekka Pessi committed
269 270
- Added %%{?dist} to release

271
* Sat Jul 23 2005 Pekka Pessi <first.lastname at nokia.com> - 1.10.1
Pekka Pessi's avatar
Pekka Pessi committed
272
- Initial build.