sofia-sip.spec.in 7.88 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 10 11
#%{?_with_bc: %define    _prefix         /opt/belledonne-communications}


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

22 23
BuildRequires: pkgconfig

24 25
%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}}
26

27
# Options:
28 29 30 31 32
%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
33

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

37
%define have_doxygen %{?_with_doxygen:1}%{!?_with_doxygen:0}
38 39
%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
40

41 42
%if %{have_doxygen}
BuildRequires: doxygen >= 1.3, graphviz
43 44 45 46 47 48 49
%endif
%if %{have_openssl}
BuildRequires: openssl-devel >= 0.9.7
%endif
%if %{have_glib}
BuildRequires: glib2-devel >= 2.2
%endif
50

Pekka Pessi's avatar
Pekka Pessi committed
51 52 53 54 55
%description
Sofia SIP is a RFC-3261-compliant library for SIP user agents and other
network elements.

%prep
56
%setup -qn sofia-sip-%{version}
Pekka Pessi's avatar
Pekka Pessi committed
57 58

%build
59
options="--disable-dependency-tracking"
60
options="$options --with-pic --enable-shared --disable-static"
61 62 63
%if !%{have_glib}
options="$options --without-glib"
%endif
64
%if %{with_sctp}
65 66 67 68
options="$options --enable-sctp"
%endif

%configure $options
69

70
make %{_smp_mflags}
71
%if %{have_doxygen}
72 73
make doxygen
%endif
Pekka Pessi's avatar
Pekka Pessi committed
74

75 76
# XXX comment next line to build with non-check aware rpmbuild.
%check
77
%if %{with_check}
78 79 80
make check
%endif

Pekka Pessi's avatar
Pekka Pessi committed
81 82 83
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
84

85 86
# Remove extra files
find $RPM_BUILD_ROOT -type f -name *.la -print0 | xargs -0 rm
87

88
%if %{have_doxygen}
89
# Manually install development docs into manual
90 91
cp -p -r libsofia-sip-ua/docs/html manual
%endif
Pekka Pessi's avatar
Pekka Pessi committed
92

93 94 95 96
# 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
97 98 99
%clean
rm -rf $RPM_BUILD_ROOT

100 101 102 103
%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

Pekka Pessi's avatar
Pekka Pessi committed
104 105
%files
%defattr(-,root,root,-)
106
%{_libdir}/libsofia-sip-ua.so.*
Pekka Pessi's avatar
Pekka Pessi committed
107
%doc AUTHORS COPYING COPYRIGHTS README
Pekka Pessi's avatar
Pekka Pessi committed
108

109
%if %{have_glib}
110
# note: soname in pkgname allows install of multiple library versions
111
# The glib interface is still a bit unstable
112
%package	glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
113
Summary:	GLIB bindings for Sofia-SIP
114
Group:		System Environment/Libraries
115 116 117
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
118

119
%description	glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
Pekka Pessi's avatar
Pekka Pessi committed
120 121
GLib interface to Sofia SIP User Agent library.

122
%files 		glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
Pekka Pessi's avatar
Pekka Pessi committed
123
%defattr(-,root,root,-)
124
%{_libdir}/libsofia-sip-ua-glib.so.*
125 126 127 128
%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
129 130 131

%endif

Pekka Pessi's avatar
Pekka Pessi committed
132
%package	devel
133 134
Summary:	Sofia-SIP Development Package
Group:		Development/Libraries
135 136 137
Requires:	%{pkg_prefix}sofia-sip = %{version}-%{release}
Obsoletes:	%{pkg_prefix}sofia-devel < %{version}-%{release}
Provides:	%{pkg_prefix}sofia-devel = %{version}-%{release}
138

139
Requires:	pkgconfig
140

Pekka Pessi's avatar
Pekka Pessi committed
141
%description	devel
142
Development package for Sofia SIP UA library. This package includes
143
static libraries and include files.
Pekka Pessi's avatar
Pekka Pessi committed
144

145
%if !%{with_doxygen}
146
The reference documentation for Sofia SIP UA library is available at
147 148
<http://sofia-sip.sourceforge.net/development.html>
%endif
149

Pekka Pessi's avatar
Pekka Pessi committed
150
%files 		devel
151
%defattr(-,root,root,-)
152 153 154 155 156 157 158 159 160 161 162
%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
163
%doc TODO README.developers
164

165 166
%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
167
%package	glib-devel
168 169
Summary:	GLIB bindings for Sofia SIP development files
Group:			Development/Libraries
170 171
Requires:	%{pkg_prefix}sofia-sip-glib@LIBVER_SOFIA_SIP_UA_GLIB_SOVER@ = %{version}-%{release}
Requires:	%{pkg_prefix}sofia-sip-devel >= 1.12
172
BuildRequires:	glib2-devel >= 2.2
173

Pekka Pessi's avatar
Pekka Pessi committed
174 175
%description	glib-devel
Development package for Sofia SIP UA Glib library. This package includes
176
static libraries and include files for developing glib programs using Sofia
Pekka Pessi's avatar
Pekka Pessi committed
177 178 179 180
SIP.

%files 		glib-devel
%defattr(-,root,root,-)
181 182 183
%{_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
184 185 186
%endif

%package	docs
187 188
Summary:	Sofia-SIP Development Manual Package
Group:		Documentation
Pekka Pessi's avatar
Pekka Pessi committed
189 190 191
%description	docs
HTML reference documentation for Sofia SIP UA library.

192
%if %{have_doxygen}
Pekka Pessi's avatar
Pekka Pessi committed
193 194
%files docs
%defattr(-,root,root,-)
195
%doc manual
Pekka Pessi's avatar
Pekka Pessi committed
196
%endif
Pekka Pessi's avatar
Pekka Pessi committed
197 198

%package	utils
199 200
Summary:	Sofia-SIP Command Line Utilities
Group:		Applications/Internet
201 202 203
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
204 205 206
%description	utils
Command line utilities for Sofia SIP UA library.

Pekka Pessi's avatar
Pekka Pessi committed
207
%files utils
Pekka Pessi's avatar
Pekka Pessi committed
208
%defattr(-,root,root,-)
209 210 211 212 213 214
%{_bindir}/localinfo
%{_bindir}/addrinfo
%{_bindir}/sip-options
%{_bindir}/sip-date
%{_bindir}/sip-dig
%{_bindir}/stunc
Pekka Pessi's avatar
Pekka Pessi committed
215
%{_mandir}/man?/*
Pekka Pessi's avatar
Pekka Pessi committed
216 217

%changelog
218 219 220 221 222 223 224
* 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
225 226
- Bumped version. rpmlinted.

227
* Tue Dec  5 2006 Kai Vehmanen <first.lastname at nokia.com>
228
- The 'nua-glib' module, and the related dependency to gobject, has been
229 230 231
  removed from the sofia-sip package

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

235
* Mon Sep 18 2006 Kai Vehmanen <first.lastname at nokia.com>
236 237
- Removed *.m4 files from the distribution package.

238
* Fri Aug 11 2006 Kai Vehmanen <first.lastname at nokia.com>
239 240
- Modified the install location of the awk scripts.

241
* Thu Jun 15 2006 Kai Vehmanen <first.lastname at nokia.com>
242
- Added library soname to sofia-sip-glib package name.
243 244
- Modified dependencies - the glib subpackages do not depend
  on a specific version of sofia-sip anymore.
245

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

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

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

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

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

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