aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-01-19 16:11:34 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-01-19 16:11:34 +0000
commit44b9ea9f740e5ba5a4af45874e9a96becf7f8325 (patch)
tree142589ecf1045181f44526d1058b16c1838c9af0 /src
parent7e4a21dc554d42d31afc611fd92aaddd7da1bb6c (diff)
downloadrspamd-44b9ea9f740e5ba5a4af45874e9a96becf7f8325.tar.gz
rspamd-44b9ea9f740e5ba5a4af45874e9a96becf7f8325.zip
Remove legacy client and rework build system.
--HG-- rename : lib/CMakeLists.txt => src/CMakeLists.txt
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt146
-rw-r--r--src/client/CMakeLists.txt23
-rw-r--r--src/client/rspamdclient.c23
-rw-r--r--src/client/rspamdclient.h32
4 files changed, 224 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 000000000..4e24448c3
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,146 @@
+# Librspamd-util
+SET(LIBRSPAMDUTILSRC aio_event.c
+ bloom.c
+ diff.c
+ fstring.c
+ fuzzy.c
+ hash.c
+ http.c
+ logger.c
+ map.c
+ memcached.c
+ mem_pool.c
+ printf.c
+ radix.c
+ rrd.c
+ trie.c
+ upstream.c
+ util.c)
+
+# Librspamdserver
+SET(LIBRSPAMDSERVERSRC
+ binlog.c
+ buffer.c
+ cfg_utils.c
+ cfg_rcl.c
+ cfg_xml.c
+ dkim.c
+ dns.c
+ dynamic_cfg.c
+ events.c
+ html.c
+ proxy.c
+ roll_history.c
+ settings.c
+ spf.c
+ statfile.c
+ statfile_sync.c
+ symbols_cache.c
+ url.c
+ view.c)
+
+# Librspamd mime
+SET(LIBRSPAMDMIMESRC
+ expressions.c
+ filter.c
+ images.c
+ message.c
+ protocol.c
+ smtp_utils.c
+ smtp_proto.c
+ worker_util.c)
+
+SET(TOKENIZERSSRC tokenizers/tokenizers.c
+ tokenizers/osb.c)
+
+SET(CLASSIFIERSSRC classifiers/classifiers.c
+ classifiers/bayes.c
+ classifiers/winnow.c)
+# Add targets
+
+# Rspamdutil
+ADD_LIBRARY(rspamd-util ${LINK_TYPE} ${LIBRSPAMDUTILSRC})
+IF(CMAKE_COMPILER_IS_GNUCC)
+SET_TARGET_PROPERTIES(rspamd-util PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+TARGET_LINK_LIBRARIES(rspamd-util ${RSPAMD_REQUIRED_LIBRARIES})
+TARGET_LINK_LIBRARIES(rspamd-util pcre)
+TARGET_LINK_LIBRARIES(rspamd-util rspamd-ucl)
+TARGET_LINK_LIBRARIES(rspamd-util rspamd-http-parser)
+TARGET_LINK_LIBRARIES(rspamd-util event)
+
+IF(NOT DEBIAN_BUILD)
+SET_TARGET_PROPERTIES(rspamd-util PROPERTIES VERSION ${RSPAMD_VERSION})
+ENDIF(NOT DEBIAN_BUILD)
+
+IF(GLIB_COMPAT)
+ INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/contrib/lgpl")
+ TARGET_LINK_LIBRARIES(rspamd-util glibadditions)
+ENDIF(GLIB_COMPAT)
+
+IF(NO_SHARED MATCHES "OFF")
+ INSTALL(TARGETS rspamd-util
+ LIBRARY DESTINATION ${LIBDIR}
+ PUBLIC_HEADER DESTINATION include)
+ENDIF(NO_SHARED MATCHES "OFF")
+
+# Librspamd-server
+
+#IF(WITH_DB)
+# LIST(APPEND LIBRSPAMDSERVERSRC kvstorage_bdb.c)
+#ENDIF(WITH_DB)
+#IF(WITH_SQLITE)
+# LIST(APPEND LIBRSPAMDSERVERSRC kvstorage_sqlite.c)
+#ENDIF(WITH_SQLITE)
+
+ADD_LIBRARY(rspamd-server ${LINK_TYPE} ${LIBRSPAMDSERVERSRC} ${TOKENIZERSSRC} ${CLASSIFIERSSRC})
+IF(NOT DEBIAN_BUILD)
+SET_TARGET_PROPERTIES(rspamd-server PROPERTIES VERSION ${RSPAMD_VERSION})
+ENDIF(NOT DEBIAN_BUILD)
+SET_TARGET_PROPERTIES(rspamd-server PROPERTIES LINKER_LANGUAGE C COMPILE_FLAGS "-DRSPAMD_LIB")
+TARGET_LINK_LIBRARIES(rspamd-server rspamd-lua)
+TARGET_LINK_LIBRARIES(rspamd-server rspamd-json)
+TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb)
+TARGET_LINK_LIBRARIES(rspamd-server rspamd-util)
+IF(LIBJUDY_LIBRARY)
+ TARGET_LINK_LIBRARIES(rspamd-server Judy)
+ENDIF(LIBJUDY_LIBRARY)
+IF(CMAKE_COMPILER_IS_GNUCC)
+SET_TARGET_PROPERTIES(rspamd-server PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB -fno-strict-aliasing")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+IF(WITH_DB)
+ TARGET_LINK_LIBRARIES(rspamd-server db)
+ENDIF(WITH_DB)
+
+IF(OPENSSL_FOUND)
+ TARGET_LINK_LIBRARIES(rspamd-server ${OPENSSL_LIBRARIES})
+ENDIF(OPENSSL_FOUND)
+
+IF(NO_SHARED MATCHES "OFF")
+ INSTALL(TARGETS rspamd-server
+ LIBRARY DESTINATION ${LIBDIR}
+ PUBLIC_HEADER DESTINATION ${INCLUDEDIR})
+ENDIF(NO_SHARED MATCHES "OFF")
+
+# Librspamdmime
+ADD_LIBRARY(rspamd-mime ${LINK_TYPE} ${LIBRSPAMDMIMESRC})
+IF(NOT DEBIAN_BUILD)
+SET_TARGET_PROPERTIES(rspamd-mime PROPERTIES VERSION ${RSPAMD_VERSION})
+ENDIF(NOT DEBIAN_BUILD)
+SET_TARGET_PROPERTIES(rspamd-mime PROPERTIES LINKER_LANGUAGE C)
+SET_TARGET_PROPERTIES(rspamd-mime PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB")
+TARGET_LINK_LIBRARIES(rspamd-mime rspamd-server)
+TARGET_LINK_LIBRARIES(rspamd-mime rspamd-util)
+IF(CMAKE_COMPILER_IS_GNUCC)
+SET_TARGET_PROPERTIES(rspamd-mime PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB -fno-strict-aliasing")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+IF(NO_SHARED MATCHES "OFF")
+ INSTALL(TARGETS rspamd-mime
+ LIBRARY DESTINATION ${LIBDIR}
+ PUBLIC_HEADER DESTINATION ${INCLUDEDIR})
+ENDIF(NO_SHARED MATCHES "OFF")
+
+INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src") \ No newline at end of file
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 1d48a202f..90936f037 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -1,3 +1,26 @@
+# Librspamdclient
+SET(LIBRSPAMDCLIENTSRC rspamdclient.c)
+
+ADD_LIBRARY(rspamdclient SHARED ${LIBRSPAMDCLIENTSRC})
+IF(CMAKE_COMPILER_IS_GNUCC)
+ SET_TARGET_PROPERTIES(rspamdclient PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+TARGET_LINK_LIBRARIES(rspamdclient rspamd-util)
+TARGET_LINK_LIBRARIES(rspamdclient ${RSPAMD_REQUIRED_LIBRARIES})
+
+IF(GLIB_COMPAT)
+ INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/contrib/lgpl")
+ TARGET_LINK_LIBRARIES(rspamdclient glibadditions)
+ENDIF(GLIB_COMPAT)
+
+IF(NO_SHARED MATCHES "OFF")
+ INSTALL(TARGETS rspamdclient LIBRARY PUBLIC_HEADER
+ LIBRARY DESTINATION ${LIBDIR}
+ PUBLIC_HEADER DESTINATION ${INCLUDEDIR}
+ ARCHIVE DESTINATION ${LIBDIR})
+ENDIF(NO_SHARED MATCHES "OFF")
+
# rspamc
SET(RSPAMCSRC rspamc.c)
diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c
new file mode 100644
index 000000000..126ddcd1b
--- /dev/null
+++ b/src/client/rspamdclient.c
@@ -0,0 +1,23 @@
+/* Copyright (c) 2014, Vsevolod Stakhov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
diff --git a/src/client/rspamdclient.h b/src/client/rspamdclient.h
new file mode 100644
index 000000000..90a4c1c27
--- /dev/null
+++ b/src/client/rspamdclient.h
@@ -0,0 +1,32 @@
+/* Copyright (c) 2014, Vsevolod Stakhov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RSPAMDCLIENT_H_
+#define RSPAMDCLIENT_H_
+
+#include "config.h"
+#include "ucl.h"
+
+
+
+#endif /* RSPAMDCLIENT_H_ */