Commit 4ca26240 authored by François Grisez's avatar François Grisez

Rework CMake scripts in order to generare RPM packages compliant with the new version semantic

parent 70609e65
Pipeline #9555 passed with stages
in 34 minutes and 36 seconds
......@@ -11,6 +11,7 @@
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
- ccache -s
- git submodule foreach --recursive git fetch --tags
after_script:
- export CCACHE_DIR=${PWD}/ccache
......
......@@ -9,6 +9,9 @@ variables:
DEFAULT_CMAKE_OPTIONS: -DENABLE_CONFERENCE=ON -DENABLE_JWE_AUTH_PLUGIN=ON -DENABLE_EXTERNAL_AUTH_PLUGIN=ON -DENABLE_PRESENCE=ON -DENABLE_PROTOBUF=ON -DENABLE_SNMP=ON -DENABLE_SOCI=ON -DENABLE_TRANSCODER=ON
DEFAULT_MACOS_CMAKE_OPTIONS: -DENABLE_CONFERENCE=ON -DENABLE_JWE_AUTH_PLUGIN=ON -DENABLE_PRESENCE=ON -DENABLE_PROTOBUF=ON -DENABLE_SNMP=OFF -DENABLE_SOCI=ON -DENABLE_TRANSCODER=ON
before_script:
- git submodule foreach --recursive git fetch --tags
#################################################
# Platforms to test
#################################################
......@@ -29,4 +32,4 @@ stages:
- build
- package
- image
- deploy
\ No newline at end of file
- deploy
......@@ -22,13 +22,7 @@
cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR) # 3.2.0 required for target_compile_features support on gcc 4.4+ (centos6)
project(flexisip C CXX)
set(FLEXISIP_MAJOR_VERSION "1")
set(FLEXISIP_MINOR_VERSION "0")
set(FLEXISIP_MICRO_VERSION "13")
set(FLEXISIP_VERSION "${FLEXISIP_MAJOR_VERSION}.${FLEXISIP_MINOR_VERSION}.${FLEXISIP_MICRO_VERSION}")
set(PROJECT_VERSION ${FLEXISIP_VERSION})
project(flexisip LANGUAGES C CXX)
include(CMakePushCheckState)
include(CMakeDependentOption)
......
......@@ -20,41 +20,16 @@
#
############################################################################
if(NOT CPACK_PACKAGE_NAME)
if (ENABLE_PRESENCE)
set(CPACK_PACKAGE_NAME "flexisip-presence")
else()
set(CPACK_PACKAGE_NAME "flexisip")
endif()
ENDIF()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING")
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})
if (NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "flexisip")
endif()
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
"${CMAKE_BINARY_DIR}"
"^${PROJECT_SOURCE_DIR}/linphone-sdk"
"^${PROJECT_SOURCE_DIR}/submodules*"
"^${PROJECT_SOURCE_DIR}/WORK*"
"^${PROJECT_SOURCE_DIR}/.git*"
"./linphone-sdk"
"./submodules*"
"./WORK*"
"./OUTPUT*"
"./.*"
)
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/flexisip.spec.cmake" "${PROJECT_SOURCE_DIR}/flexisip.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
......@@ -11,19 +12,17 @@
%define epoch 1
%define build_number @PROJECT_VERSION_BUILD@
Summary: SIP proxy with media capabilities
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %build_number%{?dist}
Version: ${RPM_VERSION}
Release: ${RPM_RELEASE}%{?dist}
#to be alined with redhat which changed epoc to 1 for an unknown reason
Epoch: %{epoch}
License: AGPLv3
Group: Applications/Communications
URL: http://flexisip.org
Source0: %{name}-%{version}-%build_number.tar.gz
Source0: %{package_name}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: bash >= 2.0
......@@ -112,7 +111,7 @@ Add the ability to delegate authentication process to an external HTTP server.
%custom_debug_package
%prep
%setup -n %{name}-%{version}-%build_number
%setup -n %{package_name}
%build
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} @RPM_ALL_CMAKE_OPTIONS@
......
......@@ -31,12 +31,6 @@
/* oRTP rtp_session_set_reuseaddr availabled */
#define ORTP_HAS_REUSEADDR 1
/* Define to the version of this package. */
#define PACKAGE_VERSION "${FLEXISIP_VERSION}"
/* Version number of package */
#define VERSION "${FLEXISIP_VERSION}"
/* Default log directory */
#define DEFAULT_LOG_DIR "@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/flexisip"
......
......@@ -20,11 +20,6 @@
#if defined(HAVE_CONFIG_H) && !defined(FLEXISIP_INCLUDED)
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#include "flexisip-config.h"
#define FLEXISIP_INCLUDED
......@@ -59,8 +54,6 @@ typedef unsigned long oid;
#endif /* ENABLE_SNMP */
extern oid company_id;
#include <flexisip/sip-boolean-expressions.hh>
#include <flexisip/global.hh>
#include <flexisip/flexisip-exception.hh>
......@@ -69,6 +62,8 @@ typedef struct sip_s sip_t;
namespace flexisip {
const ::oid company_id = SNMP_COMPANY_OID;
struct LpConfig;
enum class ConfigState { Check, Changed, Reset, Commited };
......
......@@ -41,9 +41,6 @@ else()
endif()
if(GIT_DESCRIBE)
if(NOT GIT_TAG STREQUAL FLEXISIP_VERSION)
message(FATAL_ERROR "FLEXISIP_VERSION and git tag differ. Please put them identical.")
endif()
set(GIT_VERSION "${GIT_DESCRIBE}")
configure_file("${WORK_DIR}/gitversion.h.in" "${OUTPUT_DIR}/flexisip-version.h" @ONLY)
elseif(GIT_REVISION)
......
Subproject commit 440e843cc2074bdd42ca90a5f5dc8516876037f2
Subproject commit 77a2b0dd913111afcafbac19468a30cf9b5ac6e5
......@@ -16,34 +16,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <flexisip/agent.hh>
#include <flexisip/module.hh>
#include "domain-registrations.hh"
#include "plugin/plugin-loader.hh"
#include <flexisip/registrardb.hh>
#include <flexisip/logmanager.hh>
#include "etchosts.hh"
#include <algorithm>
#include <sstream>
#include <sofia-sip/tport_tag.h>
#include <sofia-sip/su_tagarg.h>
#include <net/if.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sofia-sip/sip.h>
#include <sofia-sip/su_tagarg.h>
#include <sofia-sip/su_md5.h>
#include <sofia-sip/tport.h>
#include <sofia-sip/tport_tag.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <flexisip/agent.hh>
#include <flexisip/flexisip-version.h>
#include <flexisip/logmanager.hh>
#include <flexisip/module.hh>
#include <flexisip/registrardb.hh>
#include <net/if.h>
#include "etchosts.hh"
#include "domain-registrations.hh"
#include "plugin/plugin-loader.hh"
#define IPADDR_SIZE 64
using namespace std;
using namespace flexisip;
namespace flexisip {
static StatCounter64 *createCounter(GenericStruct *global, string keyprefix, string helpprefix, string value) {
return global->createStat(keyprefix + value, helpprefix + value + ".");
......@@ -624,7 +625,7 @@ Agent::Agent(su_root_t *root) : mBaseConfigListener(NULL), mTerminating(false) {
addPluginModule(this, mModules, pluginDir, pluginName);
}
mServerString = "Flexisip/" VERSION " (sofia-sip-nta/" NTA_VERSION ")";
mServerString = "Flexisip/" FLEXISIP_GIT_VERSION " (sofia-sip-nta/" NTA_VERSION ")";
for (Module *module : mModules)
module->declare(cr);
......@@ -1294,3 +1295,5 @@ void Agent::applyProxyToProxyTransportSettings(tport_t *tp){
}
}
} // namespace flexisip
......@@ -20,17 +20,16 @@
#include <belle-sip/utils.h>
#include "conference-address-generator.hh"
#include "conference-server.hh"
#include <flexisip/configmanager.hh>
#include <flexisip/flexisip-version.h>
#include "conference-address-generator.hh"
#include "conference-server.hh"
#include "utils/uri-utils.hh"
using namespace flexisip;
using namespace std;
namespace flexisip {
SofiaAutoHome ConferenceServer::mHome;
ConferenceServer::Init ConferenceServer::sStaticInit;
......@@ -76,7 +75,7 @@ void ConferenceServer::_init () {
configLinphone->setString("storage", "backend", config->get<ConfigString>("database-backend")->read());
configLinphone->setString("storage", "uri", config->get<ConfigString>("database-connection-string")->read());
mCore = linphone::Factory::get()->createCoreWithConfig(configLinphone, nullptr);
mCore->setUserAgent("Flexisip-conference", VERSION);
mCore->setUserAgent("Flexisip-conference", FLEXISIP_GIT_VERSION);
mCore->addListener(shared_from_this());
mCore->enableConferenceServer(true);
mCore->setTransports(cTransport);
......@@ -310,3 +309,5 @@ ConferenceServer::Init::Init() {
GenericManager::get()->getRoot()->addChild(s);
s->addChildrenValues(items);
}
} // namespace flexisip
......@@ -16,11 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "configdumper.hh"
#include <flexisip/flexisip-version.h>
#include <flexisip/module.hh>
#include "configdumper.hh"
using namespace std;
using namespace flexisip;
namespace flexisip {
ostream &ConfigDumper::dump(ostream &ostr) const {
return dump_recursive(ostr, mRoot, 0);
......@@ -310,7 +313,7 @@ ostream &MibDumper::dump(ostream &ostr) const {
<< " email: contact@belledonne-communications.com\"" << endl
<< " DESCRIPTION \"A Flexisip management tree.\"" << endl
<< " REVISION \"" << mbstr << "\"" << endl
<< " DESCRIPTION \"" PACKAGE_VERSION << "\"" << endl
<< " DESCRIPTION \"" FLEXISIP_GIT_VERSION << "\"" << endl
<< "::={ enterprises " << company_id << " }" << endl
<< endl;
......@@ -346,3 +349,5 @@ ostream &MibDumper::dump2(ostream &ostr, GenericEntry *entry, int level) const {
}
return ostr;
}
} // namespace flexisip
......@@ -16,28 +16,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstring>
#include <algorithm>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <sofia-sip/su_md5.h>
#include "lpconfig.h"
#include <flexisip/configmanager.hh>
#include <flexisip/common.hh>
#include <flexisip/configmanager.hh>
#include <flexisip/flexisip-version.h>
#include <flexisip/logmanager.hh>
#include "flexisip/sip-boolean-expressions.hh"
#include "configdumper.hh"
#include <flexisip/sip-boolean-expressions.hh>
#include <functional>
#include <stdexcept>
#include <ctime>
#include <sstream>
#include <fstream>
#include <sofia-sip/su_md5.h>
#include "configdumper.hh"
#include "lpconfig.h"
using namespace std;
using namespace flexisip;
namespace flexisip {
bool ConfigValueListener::sDirty = false;
ConfigValueListener::~ConfigValueListener() {
......@@ -825,8 +826,6 @@ RootConfigStruct::RootConfigStruct(const string &name, const string &help, vecto
RootConfigStruct::~RootConfigStruct() {
}
oid company_id = SNMP_COMPANY_OID;
#ifndef DEFAULT_LOG_DIR
#define DEFAULT_LOG_DIR "/var/opt/belledonne-communications/log/flexisip"
#endif
......@@ -980,7 +979,7 @@ GenericManager::GenericManager()
global->get<ConfigByteSize>("max-log-size")->setDeprecated(true);
global->setConfigListener(this);
ConfigString *version = new ConfigString("version-number", "Flexisip version.", PACKAGE_VERSION, 999);
ConfigString *version = new ConfigString("version-number", "Flexisip version.", FLEXISIP_GIT_VERSION, 999);
version->setReadOnly(true);
version->setExportable(false);
global->addChild(version);
......@@ -1356,3 +1355,5 @@ int StatCounter64::handleSnmpRequest(netsnmp_mib_handler *handler, netsnmp_handl
return SNMP_ERR_NOERROR;
}
#endif /* enable_snmp */
} // namespace flexisip
......@@ -54,9 +54,6 @@
#ifdef ENABLE_SNMP
#include "snmp-agent.h"
#endif
#ifndef VERSION
#define VERSION "DEVEL"
#endif // VERSION
#include <flexisip/flexisip-version.h>
#ifndef FLEXISIP_GIT_VERSION
......@@ -561,7 +558,7 @@ static void notifyWatchDog(){
static string version() {
ostringstream version;
version << VERSION " (git: " FLEXISIP_GIT_VERSION ")\n";
version << FLEXISIP_GIT_VERSION "\n";
version << "sofia-sip version " SOFIA_SIP_VERSION "\n";
version << "\nCompiled with:\n";
......@@ -893,7 +890,7 @@ int main(int argc, char *argv[]) {
/*
* From now on, we are a flexisip daemon, that is a process that will run proxy, presence, or conference server.
*/
LOGN("Starting flexisip %s-server version %s (git %s)", fName.c_str(), VERSION, FLEXISIP_GIT_VERSION);
LOGN("Starting flexisip %s-server version %s", fName.c_str(), FLEXISIP_GIT_VERSION);
GenericManager::get()->sendTrap("Flexisip "+ fName + "-server starting");
increase_fd_limit();
......
......@@ -73,7 +73,7 @@ PresenceConfigManager::PresenceConfigManager()
global->setConfigListener(this);
ConfigString *version =
new ConfigString("version-number", "Flexisip presence server version.", PACKAGE_VERSION, 999);
new ConfigString("version-number", "Flexisip presence server version.", VERSION, 999);
version->setReadOnly(true);
version->setExportToConfigFile(false);
global->addChild(version);
......
......@@ -69,7 +69,7 @@ ProxyConfigManager::ProxyConfigManager()
global->addChildrenValues(global_conf);
global->setConfigListener(this);
ConfigString *version = new ConfigString("version-number", "Flexisip version.", PACKAGE_VERSION, 999);
ConfigString *version = new ConfigString("version-number", "Flexisip version.", VERSION, 999);
version->setReadOnly(true);
version->setExportToConfigFile(false);
global->addChild(version);
......
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