SET(RSPAMD_VERSION_MINOR 3)
SET(RSPAMD_VERSION_PATCH 3)
+
SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}")
SET(RSPAMD_MASTER_SITE_URL "http://bitbucket.org/vstakhov/rspamd")
SET(RSPAMD_USER "nobody")
SET(DESTDIR $ENV{DESTDIR})
ENDIF(NOT DESTDIR)
+# Try to detect tip version from hg
+SET(ID "unknown")
+FIND_PROGRAM(HG "hg")
+
+IF(HG)
+ EXECUTE_PROCESS(COMMAND ${HG} "id" OUTPUT_VARIABLE HG_ID)
+ IF(HG_ID)
+ STRING(REGEX MATCH ^[0-9a-z]+ ID "${HG_ID}")
+ ENDIF(HG_ID)
+ELSE(HG)
+# Now check .hg_archival.txt
+ FIND_FILE(HG_ARCH ".hg_archival.txt" "${CMAKE_CURRENT_SOURCE_DIR}")
+ IF(HG_ARCH)
+ FILE(READ ${HG_ARCH} HG_ID)
+ IF(HG_ID)
+ STRING(REGEX MATCH "node: [0-9a-z]+" _tmp "${HG_ID}")
+ STRING(SUBSTRING "${_tmp}" 6 12 ID)
+ ENDIF(HG_ID)
+ ENDIF(HG_ARCH)
+ENDIF(HG)
+
+
################################ SOURCES SECTION ###########################
SET(RSPAMDSRC src/modules.c
#cmakedefine HAVE_CLOCK_GETTIME 1
#define RVERSION "${RSPAMD_VERSION}"
+#define RID "${ID}"
#define RSPAMD_MASTER_SITE_URL "${RSPAMD_MASTER_SITE_URL}"
#define MODULES_NUM ${RSPAMD_MODULES_NUM}
GOptionContext *context;
context = g_option_context_new ("- run rspamd daemon");
- g_option_context_set_summary (context, "Summary:\n Rspamd daemon version " RVERSION);
+ g_option_context_set_summary (context, "Summary:\n Rspamd daemon version " RVERSION "\n Release id: " RID);
g_option_context_add_main_entries (context, entries, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error)) {
fprintf (stderr, "option parsing failed: %s\n", error->message);
config_logger (rspamd, TRUE);
- msg_info ("rspamd " RVERSION " is starting");
+ msg_info ("rspamd " RVERSION " is starting, build id: " RID);
rspamd->cfg->cfg_name = memory_pool_strdup (rspamd->cfg->cfg_pool, rspamd->cfg->cfg_name);
if (!rspamd->cfg->no_fork && daemon (0, 0) == -1) {