Commit 77319f12 authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI

First draft for odb support in Flexisip

parent 02317e5e
......@@ -76,6 +76,23 @@ clean-flexisip-rpm:
# needed: ?
# rm -rf WORK/rpmbuild/RPMS/*
build-odb:
export ODBC_PATH=../../OUTPUT
mkdir -p WORK/cmake-odb && \
cd WORK/cmake-odb && \
cmake ../.. -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-flexisip-rpm.cmake \
-DLINPHONE_BUILDER_TARGET=odb \
-DCMAKE_PREFIX_PATH=$(PWD)/OUTPUT\
-DCMAKE_INSTALL_PREFIX=$(PWD)/OUTPUT \
$(filter -D%,$(MAKEFLAGS)) && \
make VERBOSE=1
clean-odb:
rm -rf WORK/tmp-odb && \
rm -rf WORK/Build-odb
build-python:
mkdir -p WORK/cmake-python && \
cd WORK/cmake-python && \
......
......@@ -156,9 +156,19 @@ list(FIND LINPHONE_BUILDER_TARGETS "flexisip" _target_found)
if(_target_found GREATER -1)
add_custom_target(TARGET_flexisip ALL)
add_dependencies(TARGET_linphone_builder TARGET_flexisip)
add_dependencies(TARGET_flexisip TARGET_ortp )
add_dependencies(TARGET_flexisip TARGET_ortp )
linphone_builder_add_builder_to_target(TARGET_flexisip unixodbc )
linphone_builder_add_builder_to_target(TARGET_flexisip myodbc )
linphone_builder_add_builder_to_target(TARGET_flexisip sofiasip )
linphone_builder_add_builder_to_target(TARGET_flexisip flexisip)
endif()
# Build odb and its dependencies if it is in the targets list
list(FIND LINPHONE_BUILDER_TARGETS "odb" _target_found)
if(_target_found GREATER -1)
add_custom_target(TARGET_odb ALL)
add_dependencies(TARGET_linphone_builder TARGET_odb)
linphone_builder_add_builder_to_target(TARGET_odb odb )
linphone_builder_add_builder_to_target(TARGET_odb libodb )
linphone_builder_add_builder_to_target(TARGET_odb libodbmysql )
endif()
############################################################################
# libodb.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(libodb_filename "libodb-2.3.0.tar.bz2")
set(EP_libodb_URL "http://www.codesynthesis.com/download/odb/2.3/${libodb_filename}")
set(EP_libodb_URL_HASH "SHA1=eebc7fa706bc598a80439d1d6a798430fcfde23b")
set(EP_libodb_BUILD_METHOD "rpm")
set(EP_libodb_SPEC_FILE "libodb.spec" )
set(EP_libodb_CONFIG_H_FILE "${CMAKE_CURRENT_SOURCE_DIR}/builders/libodb/${EP_libodb_SPEC_FILE}" )
set(EP_libodb_DEPENDENCIES EP_odb)
#create source dir and copy the tar.gz inside
set(EP_libodb_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_libodb_PATCH_COMMAND ${EP_libodb_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${LINPHONE_BUILDER_WORK_DIR}/Download/EP_libodb/${libodb_filename}" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_libodb_PATCH_COMMAND ${EP_libodb_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" ${EP_libodb_CONFIG_H_FILE} "<BINARY_DIR>")
Name: libodb
Version: 2.3.0
Release: 3%{?dist}
Summary: Common ODB runtime library from Code Synthesis
Group: System Environment/Libraries
License: GPLv2
URL: http://www.codesynthesis.com/products/odb/
Source0: http://www.codesynthesis.com/download/odb/2.3/%{name}-%{version}.tar.bz2
# Set BuildRoot for compatibility with EPEL <= 5
# See: http://fedoraproject.org/wiki/EPEL:Packaging#BuildRoot_tag
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Uses pkgconfig
BuildRequires: pkgconfig
%description
ODB is an object-relational mapping (ORM) system for C++. It provides
tools, APIs, and library support that allow you to persist C++ objects
to a relational database (RDBMS) without having to deal with tables,
columns, or SQL and without manually writing any of the mapping code.
This package contains the common ODB runtime library. Every application
that includes code generated by the ODB compiler will need to link to
this library.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
%build
%configure --disable-static
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc GPLv2
%doc LICENSE
%{_libdir}/libodb-2.3.so
# Exclude the documentation that doesn't need to be packaged
%exclude %{_datadir}/doc/libodb/GPLv2
%exclude %{_datadir}/doc/libodb/LICENSE
%exclude %{_datadir}/doc/libodb/NEWS
%exclude %{_datadir}/doc/libodb/README
%exclude %{_datadir}/doc/libodb/version
%files devel
%doc NEWS
%{_includedir}/odb/
%{_libdir}/libodb.so
%{_libdir}/pkgconfig/libodb.pc
%changelog
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon Nov 4 2013 Dave Johansen <davejohansen@gmail.com> 2.3.0-1
- Updated to 2.3.0
* Tue Jul 23 2013 Dave Johansen <davejohansen@gmail.com> 2.2.3-1
- Initial build
############################################################################
# odb.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(libodbmysql_filename "libodb-mysql-2.3.0.tar.bz2")
set(EP_libodbmysql_URL "http://www.codesynthesis.com/download/odb/2.3/${libodbmysql_filename}")
set(EP_libodbmysql_URL_HASH "SHA1=18adaa5535015e3471a5d205e44df42f0e3a3d37")
set(EP_libodbmysql_BUILD_METHOD "rpm")
set(EP_libodbmysql_SPEC_FILE "libodbmysql.spec" )
set(EP_libodbmysql_CONFIG_H_FILE "${CMAKE_CURRENT_SOURCE_DIR}/builders/libodbmysql/${EP_libodbmysql_SPEC_FILE}" )
set(EP_libodbmysql_DEPENDENCIES EP_libodb)
#create source dir and copy the tar.gz inside
set(EP_libodbmysql_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_libodbmysql_PATCH_COMMAND ${EP_libodbmysql_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${LINPHONE_BUILDER_WORK_DIR}/Download/EP_libodbmysql/${libodbmysql_filename}" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_libodbmysql_PATCH_COMMAND ${EP_libodbmysql_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" ${EP_libodbmysql_CONFIG_H_FILE} "<BINARY_DIR>")
Name: libodb-mysql
Version: 2.3.0
Release: 1%{?dist}
Summary: MySQL ODB runtime library from Code Synthesis
Group: System Environment/Libraries
License: GPLv2
URL: http://www.codesynthesis.com/products/odb/
Source0: http://www.codesynthesis.com/download/odb/2.3/%{name}-%{version}.tar.bz2
# Set BuildRoot for compatibility with EPEL <= 5
# See: http://fedoraproject.org/wiki/EPEL:Packaging#BuildRoot_tag
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Uses libodb from Code Synthesis
BuildRequires: libodb-devel >= 2.3.0
# Uses MySQL
BuildRequires: mysql-devel
# Uses pkgconfig
BuildRequires: pkgconfig
%description
ODB is an object-relational mapping (ORM) system for C++. It provides
tools, APIs, and library support that allow you to persist C++ objects
to a relational database (RDBMS) without having to deal with tables,
columns, or SQL and without manually writing any of the mapping code.
This package contains the MySQL ODB runtime library. Every application
that includes code generated for the MySQL database will need to link
to this library.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
%build
%configure --disable-static
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc GPLv2
%doc LICENSE
%{_libdir}/libodb-mysql-2.3.so
# Exclude the documentation that doesn't need to be packaged
%exclude %{_datadir}/doc/libodb-mysql/GPLv2
%exclude %{_datadir}/doc/libodb-mysql/LICENSE
%exclude %{_datadir}/doc/libodb-mysql/NEWS
%exclude %{_datadir}/doc/libodb-mysql/README
%exclude %{_datadir}/doc/libodb-mysql/version
%files devel
%doc NEWS
# odb folder is created/owned by libodb package
%{_includedir}/odb/*
%{_libdir}/libodb-mysql.so
%{_libdir}/pkgconfig/libodb-mysql.pc
%changelog
* Mon Nov 4 2013 Dave Johansen <davejohansen@gmail.com> 2.3.0-1
- Updated to 2.3.0
* Tue Jul 23 2013 Dave Johansen <davejohansen@gmail.com> 2.2.0-1
- Initial build
############################################################################
# odb.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(odb_filename "odb-2.3.0.tar.bz2")
set(EP_odb_URL "http://www.codesynthesis.com/download/odb/2.3/${odb_filename}")
set(EP_odb_URL_HASH "SHA1=fe18c7154085afec23c18aa940f168de7068f6f3")
set(EP_odb_BUILD_METHOD "rpm")
set(EP_odb_SPEC_FILE "odb.spec" )
set(EP_odb_CONFIG_H_FILE "${CMAKE_CURRENT_SOURCE_DIR}/builders/odb/${EP_odb_SPEC_FILE}" )
#create source dir and copy the tar.gz inside
set(EP_odb_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_odb_PATCH_COMMAND ${EP_odb_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${LINPHONE_BUILDER_WORK_DIR}/Download/EP_odb/${odb_filename}" "${LINPHONE_BUILDER_WORK_DIR}/rpmbuild/SOURCES/")
set(EP_odb_PATCH_COMMAND ${EP_odb_PATCH_COMMAND} "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" ${EP_odb_CONFIG_H_FILE} "<BINARY_DIR>")
Name: odb
Version: 2.3.0
Release: 3%{?dist}
Summary: Object-relational mapping (ORM) system for C++
Group: Development/Tools
License: GPLv3
URL: http://www.codesynthesis.com/products/odb/
Source0: http://www.codesynthesis.com/download/odb/2.3/%{name}-%{version}.tar.bz2
# Set BuildRoot for compatibility with EPEL <= 5
# See: http://fedoraproject.org/wiki/EPEL:Packaging#BuildRoot_tag
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# If building on Fedora or RHEL 7
%if 0%{?rhel}%{?fedora} >= 7
# Then it just needs to be at least gcc 4.5.0 for plugin support
BuildRequires: gcc-c++ >= 4.5.0
BuildRequires: gcc-plugin-devel
%else
# Otherwise, use devtoolset on RHEL 5/6 because it supports plugins
BuildRequires: devtoolset-1.1-binutils
BuildRequires: devtoolset-1.1-gcc-c++
BuildRequires: devtoolset-1.1-gcc-plugin-devel
# Also list gmp-devel since devtoolset-gcc-plugin-devel should list it as a requirement but doesn't
# See: https://bugzilla.redhat.com/show_bug.cgi?id=908577
BuildRequires: gmp-devel
%endif
# Uses libcutl from Code Synthesis
BuildRequires: libcutl-devel >= 1.8.0
# Uses pkgconfig
BuildRequires: pkgconfig
# Uses expat
BuildRequires: expat-devel
# If building on Fedora or RHEL 7
%if 0%{?rhel}%{?fedora} >= 7
#Then odb uses the gcc plugin directory
%define ODB_PLUGIN_DIR %(g++ -print-file-name=plugin)
%else
# Otherwise, it just uses the system directory
%define ODB_PLUGIN_DIR %{_libexecdir}/odb/
%endif
%description
ODB is an object-relational mapping (ORM) system for C++. It provides
tools, APIs, and library support that allow you to persist C++ objects
to a relational database (RDBMS) without having to deal with tables,
columns, or SQL and without manually writing any of the mapping code.
%prep
%setup -q
# Set the path to the default.options file
#define
%define odb_default_options_dir %{_sysconfdir}/%{name}
%define odb_default_options_file %{odb_default_options_dir}/default.options
%build
# If building on Fedora or RHEL 7
%if 0%{?rhel}%{?fedora} >= 7
# Then do standard build
%configure --disable-static --with-options-file=%{odb_default_options_file}
%else
# Otherwise, use devtoolset on RHEL 5/6 to get a version of gcc that supports plugins
source /opt/rh/devtoolset-1.1/enable
# Add the explicit linking of pthread library because of a toolchain issue
# See: http://www.codesynthesis.com/pipermail/odb-users/2013-February/001103.html
%configure --disable-static LIBS="-lpthread" --with-options-file=%{odb_default_options_file}
%endif
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# Add the .conf file
mkdir -p $RPM_BUILD_ROOT/%{odb_default_options_dir}
echo "# Default ODB options file. This file is automatically loaded by the ODB
# compiler and can be used for installation-wide customizations, such as
# adding an include search path for a commonly used library. For example:
# -I %{_includedir}/boost141
#" > $RPM_BUILD_ROOT/%{odb_default_options_file}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%config(noreplace) %{odb_default_options_file}
%doc GPLv3
%doc LICENSE
%doc NEWS
%doc doc/default.css
%doc doc/manual.xhtml
%doc doc/odb-arch.png
%doc doc/odb-flow.png
%doc doc/odb-manual.pdf
%doc doc/odb-manual.ps
%doc doc/odb.xhtml
%{_bindir}/odb
%{ODB_PLUGIN_DIR}
%{_mandir}/man1/odb.1
# Exclude the documentation that doesn't need to be packaged
%exclude %{_datadir}/doc/odb/GPLv3
%exclude %{_datadir}/doc/odb/LICENSE
%exclude %{_datadir}/doc/odb/NEWS
%exclude %{_datadir}/doc/odb/README
%exclude %{_datadir}/doc/odb/default.css
%exclude %{_datadir}/doc/odb/manual.xhtml
%exclude %{_datadir}/doc/odb/odb-arch.png
%exclude %{_datadir}/doc/odb/odb-flow.png
%exclude %{_datadir}/doc/odb/odb-manual.pdf
%exclude %{_datadir}/doc/odb/odb-manual.ps
%exclude %{_datadir}/doc/odb/odb.xhtml
%exclude %{_datadir}/doc/odb/version
%changelog
* Wed Jul 2 2014 Dave Johansen <davejohansen@gmail.com> 2.3.0-3
- Rebuild for gcc 4.8.3
* Wed May 28 2014 Dave Johansen <davejohansen@gmail.com> 2.3.0-2
- Adding expat-devel as BuildRequires
* Mon Nov 4 2013 Dave Johansen <davejohansen@gmail.com> 2.3.0-1
- Updated to 2.3.0
* Tue Jul 23 2013 Dave Johansen <davejohansen@gmail.com> 2.2.2-1
- Initial build
......@@ -321,6 +321,8 @@ macro(linphone_builder_create_targets_list)
list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip" "ortp" "ms2" "ms2-plugins" "linphone")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "flexisip")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "flexisip")
elseif("${LINPHONE_BUILDER_TARGET}" STREQUAL "odb")
list(APPEND LINPHONE_BUILDER_TARGETS "odb" )
else()
message(FATAL_ERROR "Invalid LINPHONE_BUILDER_TARGET '${LINPHONE_BUILDER_TARGET}'")
endif()
......
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