Commit 1bfaf0bf authored by Pekka Pessi's avatar Pekka Pessi

sofia-sip.spec.in: using --with glib gobject openssl

Autodetecting decent glib gobject openssl using pkg-config. Force
BuildRequires with --with flags.

Now configure generates a spec file with version number in its name.

Including su-glib in glib package even if gobject interface cannot be built.

darcs-hash:20061006152634-65a35-b7b41cf01cb8b69af636c0ccdca360cfc88cef91.gz
parent 2cea2cfc
......@@ -198,4 +198,7 @@ win32/Makefile
win32/config.h
])
AC_CONFIG_COMMANDS([version],,[PACKAGE_VERSION=${PACKAGE_VERSION}])
AC_CONFIG_FILES([packages/sofia-sip-${PACKAGE_VERSION}.spec:packages/sofia-sip.spec.in])
AC_OUTPUT
......@@ -5,19 +5,17 @@
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
COND_PC_TARGETS =
if HAVE_GOBJECT
COND_PC_TARGETS += sofia-sip-ua-glib.pc
endif
# Install pkg-config file
# Install pkg-config file here
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = sofia-sip-ua.pc $(COND_PC_TARGETS)
pkgconfig_DATA = sofia-sip-ua.pc
EXTRA_DIST = sofia-sip.spec sofia-sip.spec.in sofia-sip-ua.pc.in sofia-sip-ua-glib.pc.in
if HAVE_GLIB
# We should probably have something here telling
# if we have gobject support or not
pkgconfig_DATA += sofia-sip-ua-glib.pc
endif
%.spec: %.spec.in $(top_builddir)/config.status
cd $(top_builddir) && ${SHELL} config.status --file=$(subdir)/$@
EXTRA_DIST = sofia-sip-${PACKAGE_VERSION}.spec sofia-sip.spec.in
EXTRA_DIST += sofia-sip-ua.pc.in sofia-sip-ua-glib.pc.in
mostlyclean-local:
test "$(top_builddir)" = "$(top_srcdir)" || rm -f sofia-sip.spec
DISTCLEANFILES = sofia-sip-*.spec sofia-sip.spec
......@@ -4,10 +4,11 @@ libdir=@libdir@
libexecdir=@libexecdir@
includedir=@includedir@
include_sofiadir=@include_sofiadir@
gobject=@HAVE_GOBJECT@
Name: sofia-sip-ua-glib
Description: Sofia-SIP library bindings for glib/gobject
Version: @VERSION@
Version: @PACKAGE_VERSION@
Requires: sofia-sip-ua, @SOFIA_GLIB_PKG_REQUIRES@
Libs: -L${libdir} -lsofia-sip-ua-glib
Cflags: -I@include_sofiadir@
......@@ -4,8 +4,9 @@
# Options:
# --with doxygen - Generate documents using doxygen and dot
# --with check - Run tests
# --without openssl - No OpenSSL (TLS)
# --without glib - no GLIB
# --with openssl - Always use OpenSSL (TLS)
# --with glib - Always use glib-2.0 (>= 2.2)
# --with gobject - Always use gobject (>= 2.4)
# --with sctp - with SCTP
#
......@@ -20,15 +21,23 @@ Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Packager: Pekka.Pessi@Nokia.com
%{?_with_doxygen:BuildRequires: doxygen >= 1.3.4}
%{?_with_doxygen:BuildRequires: graphviz >= 1.9}
%{?!_without_openssl:BuildRequires: openssl-devel >= 0.9.7}
%define have_doxygen %{?_with_doxygen:1}%{?!_with_doxygen:0}
%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)
%define have_gobject %(%{?!_with_gobject:pkg-config 'gobject >= 2.4'&&}echo 1||echo 0)
%{?!_without_glib:BuildRequires: glib2-devel >= 2.2}
%define have_glib %{?!_without_glib:1}%{?_without_glib:0}
%if %{have_doxygen}
BuildRequires: doxygen >= 1.3
%endif
%if %{have_openssl}
BuildRequires: openssl-devel >= 0.9.7
%endif
%if %{have_gobject}
BuildRequires: glib2-devel >= 2.4
%endif
%if %{have_glib}
BuildRequires: glib2-devel >= 2.2
%endif
%description
Sofia SIP is a RFC-3261-compliant library for SIP user agents and other
......@@ -40,18 +49,24 @@ network elements.
%build
options="--with-aclocal=aclocal --disable-dependency-tracking"
options="$options --with-pic --enable-shared"
%{?_without_glib:options="$options --without-glib"}
%if !%{have_glib}
options="$options --without-glib"
%endif
%{?_with_sctp:options="$options --enable-sctp"}
%configure $options
make %{_smp_mflags}
%{?_with_check:make check}
%{?_with_doxygen:make doxygen}
%if %{have_doxygen}
make doxygen
%endif
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%{?_with_doxygen:cp -p -r libsofia-sip-ua/docs/html manual}
%if %{have_doxygen}
cp -p -r libsofia-sip-ua/docs/html manual
%endif
%clean
rm -rf $RPM_BUILD_ROOT
......@@ -102,7 +117,7 @@ static libraries and include files.
%{_prefix}/%{_lib}/pkgconfig/sofia-sip-ua.pc
%doc TODO README.developers
# note: no soname as files installed to the same place
# note: no soname here as files installed to the same place
%package glib-devel
Summary: GLIB bindings for Sofia SIP development files
Group: Development/Libraries
......@@ -113,11 +128,16 @@ Requires: sofia-sip-devel >= 1.12
Development package for Sofia SIP UA Glib library. This package includes
pstatic libraries and include files for developing glib programs using Sofia
SIP.
%if !%{have_gobject}
Note that this version does not support gobject interface.
%endif
%if %{have_glib}
%files glib-devel
%defattr(-,root,root,-)
%if %{have_gobject}
%{_prefix}/include/sofia-sip*/sofia-sip/nua_glib.h
%endif
%{_prefix}/include/sofia-sip*/sofia-sip/su_source.h
%{_prefix}/%{_lib}/libsofia-sip-ua-glib.la
%{_prefix}/%{_lib}/libsofia-sip-ua-glib.a
......@@ -126,7 +146,7 @@ SIP.
%endif
%package docs
Summary: Sofia-SIP Development Manual Package
Summary: Sofia-SIP Development Manual Package
Group: Development/Libraries
%description docs
HTML reference documentation for Sofia SIP UA library.
......@@ -134,11 +154,11 @@ HTML reference documentation for Sofia SIP UA library.
%if %{have_doxygen}
%files docs
%defattr(-,root,root,-)
%{?_with_doxygen:%doc manual}
%doc manual
%endif
%package utils
Summary: Sofia-SIP Development Package
Summary: Sofia-SIP Command Line Utilities
Group: Development/Libraries
Requires: sofia-sip = %{version}-%{release}
Obsoletes: sofia-utils
......@@ -156,6 +176,10 @@ Command line utilities for Sofia SIP UA library.
%{_mandir}/man?/*
%changelog
* Fri Oct 6 2006 Pekka Pessi
- Autodetecting openssl, glib and gobject support with pkg-config
(use --with openssl --with glib and --with gobject to force them)
* Mon Sep 18 2006 Kai Vehmanen <kai.vehmanen@nokia.com>
- Removed *.m4 files from the distribution package.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment