Commit ed5bdf56 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Merge branch 'release/4.3'

parents 0cd3b7cd 1930099a
############################################################################
# CMakeLists.txt
# Copyright (C) 2015 Belledonne Communications, Grenoble France
# Copyright (C) 2010-2019 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -21,8 +21,8 @@
#
############################################################################
cmake_minimum_required(VERSION 3.1)
project(BELCARD VERSION 1.0.2 LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.11) # we need CMake 3.11 for defining 'package_source' target as custom target
project(BELCARD VERSION 4.3.0 LANGUAGES C CXX)
set(BELCARD_SO_VERSION "1")
......
############################################################################
# CMakeLists.txt
# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
# Copyright (C) 2010-2019 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -22,32 +22,11 @@
if(NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "belcard")
ENDIF()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION})
endif()
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
"${CMAKE_BINARY_DIR}"
"^${PROJECT_SOURCE_DIR}/.git*"
)
bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD)
if(PROJECT_VERSION_BUILD)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}")
endif()
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
bc_generate_rpm_specfile("rpm/belcard.spec.cmake" "${PROJECT_SOURCE_DIR}/belcard.spec")
include(CPack)
bc_make_package_source_target()
......@@ -2,6 +2,7 @@
%define _prefix @CMAKE_INSTALL_PREFIX@
%define pkg_prefix @BC_PACKAGE_NAME_PREFIX@
%define package_name @CPACK_PACKAGE_NAME@-${FULL_VERSION}
# 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
......@@ -9,22 +10,16 @@
%define _datadir %{_datarootdir}
%define _docdir %{_datadir}/doc
%define build_number @PROJECT_VERSION_BUILD@
%if %{build_number}
%define build_number_ext -%{build_number}
%endif
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %{build_number}%{?dist}
Version: ${RPM_VERSION}
Release: ${RPM_RELEASE}%{?dist}
Summary: Belcard is a C++ library to manipulate VCard standard format.
Group: Applications/Communications
License: GPL
URL: http://www.linphone.org
Source0: %{name}-%{version}%{?build_number_ext}.tar.gz
Source0: %{package_name}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: %{pkg_prefix}bctoolbox
......@@ -54,7 +49,7 @@ Libraries and headers required to develop software with belcard
%custom_debug_package
%prep
%setup -n %{name}-%{version}%{?build_number_ext}
%setup -n %{package_name}
%build
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
......
......@@ -46,15 +46,10 @@ namespace belcard {
};
class BelCardImpp : public BelCardProperty {
private:
std::string _escaped_value;
public:
BELCARD_PUBLIC static std::shared_ptr<BelCardImpp> parse(const std::string& input);
BELCARD_PUBLIC static void setHandlerAndCollectors(belr::Parser<std::shared_ptr<BelCardGeneric>> *parser);
BELCARD_PUBLIC void setValue(const std::string &value) override;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
BELCARD_PUBLIC BelCardImpp();
};
......
......@@ -85,36 +85,6 @@ BelCardImpp::BelCardImpp() : BelCardProperty() {
setName("IMPP");
}
void BelCardImpp::setValue(const string &value) {
bctbx_noescape_rules_t uri = {0};
bctbx_noescape_rules_add_alfanums(uri);
bctbx_noescape_rules_add_list(uri, ":@.-_~%!$&'()*+,;=");
// Escape characters if required
char * escaped_value = bctbx_escape(value.c_str(), uri);
_escaped_value = string(escaped_value);
bctbx_free(escaped_value);
// Unescape previously escaped characters
char * unescaped_value = bctbx_unescaped_string(value.c_str());
string new_value = string(unescaped_value);
bctbx_free(unescaped_value);
BelCardProperty::setValue(new_value);
}
void BelCardImpp::serialize(ostream& output) const {
if (getGroup().length() > 0) {
output << getGroup() << ".";
}
output << getName();
for (auto it = getParams().begin(); it != getParams().end(); ++it) {
output << ";" << (**it);
}
output << ":" << _escaped_value << "\r\n";
}
shared_ptr<BelCardLang> BelCardLang::parse(const string& input) {
return BelCardProperty::parseProperty<BelCardLang>("LANG", input);
}
......
No preview for this file type
......@@ -408,7 +408,8 @@ path-rootless = segment-nz *( "/" segment )
path-empty = [pchar]
segment = *pchar
segment-nz = 1*pchar
segment-nz = 1*( pchar / "[" / "]" )
; to be compatible with IPv6 SIP URIs
segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
; non-zero-length segment without any colon ":"
......
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