Commit 86a007de authored by jehan's avatar jehan

fixes to enable rpm to be installed in /opt/...

parent 7d16956d
#!/bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
THEDIR=`pwd`
cd $srcdir
#AM_VERSION="1.10"
if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then
# automake-1.10 (recommended) is not available on Fedora 8
AUTOMAKE=automake
......@@ -9,24 +16,31 @@ else
AUTOMAKE=automake-${AM_VERSION}
fi
if test -f /opt/local/bin/glibtoolize ; then
# darwin
LIBTOOLIZE=/opt/local/bin/glibtoolize
else
LIBTOOLIZE=libtoolize
fi
if test -d /opt/local/share/aclocal ; then
ACLOCAL_ARGS="-I /opt/local/share/aclocal"
libtoolize="libtoolize"
for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do
if test -x /usr/bin/$lt ; then
libtoolize=$lt ; break
fi
if test -x /usr/local/bin/$lt ; then
libtoolize=$lt ; break
fi
if test -x /opt/local/bin/$lt ; then
libtoolize=$lt ; break
fi
done
if test -d /usr/local/share/aclocal ; then
ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal"
fi
if test -d /share/aclocal ; then
ACLOCAL_ARGS="-I /share/aclocal"
ACLOCAL_ARGS="$ACLOCAL_ARGS -I /share/aclocal"
fi
echo "Generating build scripts in belle-sip..."
set -x
$LIBTOOLIZE --copy --force
$ACLOCAL $ACLOCAL_ARGS
rm -rf config.cache autom4te.cache
$libtoolize --copy --force
$ACLOCAL -I m4 $ACLOCAL_ARGS
autoheader
$AUTOMAKE --force-missing --add-missing --copy
autoconf
......@@ -36,3 +50,5 @@ if [ -d .git/hooks ] && [ ! -f .git/hooks/pre-commit ]; then
cp .git-pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
fi
cd $THEDIR
# -*- rpm-spec -*-
## rpmbuild options
Name: belle-sip
# 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-belle-sip}%{!?_with_bc:belle-sip}
%{?_with_bc: %define _prefix /opt/belledonne-communications}
%define srtp %{?_without_srtp:0}%{?!_without_srtp:1}
# 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
Name: %{pkg_name}
Version: @VERSION@
Release: %(version=`git describe --tags --abbrev=40 | sed -rn 's/^.*-([0-9]+)-g[a-z0-9]{40}$/\1/p'` && if test -z "$version" ; then echo 0 ; else echo $version ; fi)%{?dist}
Summary: Linphone sip stack
......
......@@ -230,28 +230,29 @@ operator<<( std::ostream& __os, const belle_sip_uri_t* uri)
belle_sip_free(uri_as_string);
return __os;
}
template <> struct std::hash<const belle_sip_uri_t*> {
size_t operator()(const belle_sip_uri_t *x ) const {
std::hash<string> H;
size_t h=0;
if (belle_sip_uri_get_user(x))
h = H(belle_sip_uri_get_user(x));
if (belle_sip_uri_get_host(x))
h ^=H(belle_sip_uri_get_host(x));
if (belle_sip_uri_get_port(x)>0) {
std::hash<int> H2;
h ^=H2(belle_sip_uri_get_port(x));
}
if (belle_sip_uri_get_transport_param(x)) {
h ^=H(belle_sip_uri_get_transport_param(x));
namespace std {
template <> struct hash<const belle_sip_uri_t*> {
size_t operator()(const belle_sip_uri_t *x ) const {
hash<string> H;
size_t h=0;
if (belle_sip_uri_get_user(x))
h = H(belle_sip_uri_get_user(x));
if (belle_sip_uri_get_host(x))
h ^=H(belle_sip_uri_get_host(x));
if (belle_sip_uri_get_port(x)>0) {
std::hash<int> H2;
h ^=H2(belle_sip_uri_get_port(x));
}
if (belle_sip_uri_get_transport_param(x)) {
h ^=H(belle_sip_uri_get_transport_param(x));
}
if (belle_sip_uri_is_secure(x))
h+=1;
return h;
}
if (belle_sip_uri_is_secure(x))
h+=1;
return h;
}
};
};
}
#include <functional>
......
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