From 4c876bf9fc2573be36d6ebd504df3cc3535dc7d2 Mon Sep 17 00:00:00 2001 From: Petr Vaněk Date: Thu, 12 Nov 2020 14:12:58 +0100 Subject: mail-filter/rspamd: use bundled lua-lpeg, bug #753830 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/753830 Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Petr Vaněk Signed-off-by: Joonas Niilola --- .../rspamd/files/rspamd-2.5-unbundle-lua.patch | 60 ++--------- .../rspamd/files/rspamd-2.6-unbundle-lua.patch | 62 ++--------- mail-filter/rspamd/rspamd-2.5-r1.ebuild | 113 ++++++++++++++++++++ mail-filter/rspamd/rspamd-2.5.ebuild | 115 -------------------- mail-filter/rspamd/rspamd-2.6-r1.ebuild | 117 --------------------- mail-filter/rspamd/rspamd-2.6-r2.ebuild | 115 ++++++++++++++++++++ 6 files changed, 242 insertions(+), 340 deletions(-) create mode 100644 mail-filter/rspamd/rspamd-2.5-r1.ebuild delete mode 100644 mail-filter/rspamd/rspamd-2.5.ebuild delete mode 100644 mail-filter/rspamd/rspamd-2.6-r1.ebuild create mode 100644 mail-filter/rspamd/rspamd-2.6-r2.ebuild (limited to 'mail-filter/rspamd') diff --git a/mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch b/mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch index b8deb2d6903b..4a20c8f19d3f 100644 --- a/mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch +++ b/mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch @@ -1,22 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index bbc141170..8e3665c18 100644 +index bbc141170..7fbb1b485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -112,7 +112,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" - "${CMAKE_SOURCE_DIR}/contrib/librdns" - "${CMAKE_SOURCE_DIR}/contrib/aho-corasick" - "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" -- "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" - "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir - "${CMAKE_BINARY_DIR}/src/libcryptobox") - -@@ -592,16 +591,11 @@ ENDIF() - ADD_SUBDIRECTORY(contrib/libucl) - ADD_SUBDIRECTORY(contrib/librdns) - ADD_SUBDIRECTORY(contrib/aho-corasick) --ADD_SUBDIRECTORY(contrib/lua-lpeg) - ADD_SUBDIRECTORY(contrib/t1ha) - ADD_SUBDIRECTORY(contrib/libev) +@@ -598,10 +598,6 @@ ADD_SUBDIRECTORY(contrib/libev) ADD_SUBDIRECTORY(contrib/kann) ADD_SUBDIRECTORY(contrib/fastutf8) @@ -27,27 +13,11 @@ index bbc141170..8e3665c18 100644 IF (ENABLE_LUA_REPL MATCHES "ON") ADD_SUBDIRECTORY(contrib/replxx) SET(WITH_LUA_REPL 1) -@@ -700,7 +694,6 @@ INSTALL(FILES "contrib/lua-fun/fun.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-argparse/argparse.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-tableshape/tableshape.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-lupa/lupa.lua" DESTINATION ${LUALIBDIR}) --INSTALL(FILES "contrib/lua-lpeg/lpegre.lua" DESTINATION ${LUALIBDIR}) - - # systemd unit - IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 9a34d2ac4..54b2e4083 100644 +index 9a34d2ac4..59bab5c15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -180,7 +180,6 @@ ENDIF() - TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb) --TARGET_LINK_LIBRARIES(rspamd-server rspamd-lpeg) - TARGET_LINK_LIBRARIES(rspamd-server lcbtrie) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8) -@@ -189,10 +188,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON") +@@ -189,10 +189,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON") ADD_DEPENDENCIES(rspamd-server rspamd-clang) ENDIF() @@ -59,18 +29,10 @@ index 9a34d2ac4..54b2e4083 100644 TARGET_LINK_LIBRARIES(rspamd-server stemmer) ENDIF() diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c -index ce5fff6c5..509ceeb44 100644 +index ce5fff6c5..bea6dc389 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c -@@ -14,7 +14,6 @@ - * limitations under the License. - */ - #include "lua_common.h" --#include "lptree.h" - #include "utlist.h" - #include "unix-std.h" - #include "ottery.h" -@@ -903,10 +902,6 @@ rspamd_lua_wipe_realloc (void *ud, +@@ -903,10 +903,6 @@ rspamd_lua_wipe_realloc (void *ud, return NULL; } @@ -81,7 +43,7 @@ index ce5fff6c5..509ceeb44 100644 lua_State * rspamd_lua_init (bool wipe_mem) { -@@ -961,7 +956,6 @@ rspamd_lua_init (bool wipe_mem) +@@ -961,7 +957,6 @@ rspamd_lua_init (bool wipe_mem) luaopen_kann (L); luaopen_spf (L); #ifndef WITH_LUAJIT @@ -89,11 +51,3 @@ index ce5fff6c5..509ceeb44 100644 lua_settop (L, 0); #endif -@@ -971,7 +965,6 @@ rspamd_lua_init (bool wipe_mem) - rspamd_lua_new_class (L, "rspamd{session}", NULL); - lua_pop (L, 1); - -- rspamd_lua_add_preload (L, "lpeg", luaopen_lpeg); - luaopen_ucl (L); - rspamd_lua_add_preload (L, "ucl", luaopen_ucl); - diff --git a/mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch b/mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch index c6f6324befc7..9278fa8608d7 100644 --- a/mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch +++ b/mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch @@ -1,24 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index b794b9dbd..90caf4048 100644 +index b794b9dbd..1ba5c085e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -111,7 +111,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" - "${CMAKE_SOURCE_DIR}/contrib/librdns" - "${CMAKE_SOURCE_DIR}/contrib/aho-corasick" - "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" -- "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" - "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir - "${CMAKE_BINARY_DIR}/src/libcryptobox") - -@@ -624,7 +623,6 @@ ENDIF() - ADD_SUBDIRECTORY(contrib/libucl) - ADD_SUBDIRECTORY(contrib/librdns) - ADD_SUBDIRECTORY(contrib/aho-corasick) --ADD_SUBDIRECTORY(contrib/lua-lpeg) - ADD_SUBDIRECTORY(contrib/t1ha) - ADD_SUBDIRECTORY(contrib/libev) - ADD_SUBDIRECTORY(contrib/kann) -@@ -632,10 +630,6 @@ ADD_SUBDIRECTORY(contrib/fastutf8) +@@ -632,10 +632,6 @@ ADD_SUBDIRECTORY(contrib/fastutf8) ADD_SUBDIRECTORY(contrib/google-ced) @@ -29,27 +13,11 @@ index b794b9dbd..90caf4048 100644 IF (ENABLE_LUA_REPL MATCHES "ON") ADD_SUBDIRECTORY(contrib/replxx) SET(WITH_LUA_REPL 1) -@@ -735,7 +729,6 @@ INSTALL(FILES "contrib/lua-fun/fun.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-argparse/argparse.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-tableshape/tableshape.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-lupa/lupa.lua" DESTINATION ${LUALIBDIR}) --INSTALL(FILES "contrib/lua-lpeg/lpegre.lua" DESTINATION ${LUALIBDIR}) - - # systemd unit - IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 9a34d2ac4..54b2e4083 100644 +index 9a34d2ac4..59bab5c15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -180,7 +180,6 @@ ENDIF() - TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb) --TARGET_LINK_LIBRARIES(rspamd-server rspamd-lpeg) - TARGET_LINK_LIBRARIES(rspamd-server lcbtrie) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8) -@@ -189,10 +188,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON") +@@ -189,10 +189,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON") ADD_DEPENDENCIES(rspamd-server rspamd-clang) ENDIF() @@ -61,18 +29,10 @@ index 9a34d2ac4..54b2e4083 100644 TARGET_LINK_LIBRARIES(rspamd-server stemmer) ENDIF() diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c -index b7fcc2034..b8120af97 100644 +index b7fcc2034..1d86464da 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c -@@ -14,7 +14,6 @@ - * limitations under the License. - */ - #include "lua_common.h" --#include "lptree.h" - #include "utlist.h" - #include "unix-std.h" - #include "ottery.h" -@@ -922,10 +921,6 @@ rspamd_lua_wipe_realloc (void *ud, +@@ -922,10 +922,6 @@ rspamd_lua_wipe_realloc (void *ud, return NULL; } @@ -83,7 +43,7 @@ index b7fcc2034..b8120af97 100644 lua_State * rspamd_lua_init (bool wipe_mem) { -@@ -981,7 +976,6 @@ rspamd_lua_init (bool wipe_mem) +@@ -981,7 +977,6 @@ rspamd_lua_init (bool wipe_mem) luaopen_spf (L); luaopen_tensor (L); #ifndef WITH_LUAJIT @@ -91,11 +51,3 @@ index b7fcc2034..b8120af97 100644 lua_settop (L, 0); #endif -@@ -991,7 +985,6 @@ rspamd_lua_init (bool wipe_mem) - rspamd_lua_new_class (L, "rspamd{session}", NULL); - lua_pop (L, 1); - -- rspamd_lua_add_preload (L, "lpeg", luaopen_lpeg); - luaopen_ucl (L); - rspamd_lua_add_preload (L, "ucl", luaopen_ucl); - diff --git a/mail-filter/rspamd/rspamd-2.5-r1.ebuild b/mail-filter/rspamd/rspamd-2.5-r1.ebuild new file mode 100644 index 000000000000..eb97eb1d040b --- /dev/null +++ b/mail-filter/rspamd/rspamd-2.5-r1.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake pax-utils systemd tmpfiles + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/rspamd/rspamd.git" + inherit git-r3 +else + SRC_URI="https://github.com/rspamd/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="Rapid spam filtering system" +HOMEPAGE="https://rspamd.com https://github.com/rspamd/rspamd" +LICENSE="Apache-2.0 Boost-1.0 BSD BSD-1 BSD-2 CC0-1.0 LGPL-3 MIT public-domain unicode ZLIB" +SLOT="0" +IUSE="blas cpu_flags_x86_ssse3 jemalloc +jit libressl pcre2" + +RDEPEND=" + acct-group/rspamd + acct-user/rspamd + app-arch/zstd + dev-db/sqlite:3 + dev-libs/glib:2 + dev-libs/icu:= + dev-libs/libev + dev-libs/libsodium + dev-libs/snowball-stemmer + net-libs/libnsl + sys-apps/file + blas? ( sci-libs/openblas ) + cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) + jemalloc? ( dev-libs/jemalloc ) + jit? ( + dev-lang/luajit:2 + ) + !jit? ( + dev-lang/lua:* + dev-lua/LuaBitOp + ) + !libressl? ( dev-libs/openssl:0=[-bindist] ) + libressl? ( dev-libs/libressl:0= ) + pcre2? ( dev-libs/libpcre2[jit=] ) + !pcre2? ( dev-libs/libpcre[jit=] )" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-util/ragel + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}/rspamd-2.5-replxx-gcc10.patch" + "${FILESDIR}/rspamd-2.5-unbundle-lua.patch" + "${FILESDIR}/rspamd-2.5-unbundle-zstd.patch" + "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" +) + +src_prepare() { + cmake_src_prepare + + rm -vrf contrib/{lua-bit,snowball,zstd} || die + + sed -i -e 's/User=_rspamd/User=rspamd/g' \ + rspamd.service \ + || die +} + +src_configure() { + local mycmakeargs=( + -DCONFDIR=/etc/rspamd + -DRUNDIR=/var/run/rspamd + -DDBDIR=/var/lib/rspamd + -DLOGDIR=/var/log/rspamd + -DENABLE_BLAS=$(usex blas ON OFF) + -DENABLE_HYPERSCAN=$(usex cpu_flags_x86_ssse3 ON OFF) + -DENABLE_JEMALLOC=$(usex jemalloc ON OFF) + -DENABLE_LUAJIT=$(usex jit ON OFF) + -DENABLE_PCRE2=$(usex pcre2 ON OFF) + ) + cmake_src_configure +} + +src_test() { + cmake_src_test +} + +src_install() { + cmake_src_install + + newconfd "${FILESDIR}"/rspamd.conf rspamd + newinitd "${FILESDIR}/rspamd-r7.init" rspamd + systemd_newunit rspamd.service rspamd.service + + newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf + + # Remove mprotect for JIT support + if use jit; then + pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-* + fi + + insinto /etc/logrotate.d + newins "${FILESDIR}"/rspamd-r1.logrotate rspamd + + diropts -o rspamd -g rspamd + keepdir /var/{lib,log}/rspamd +} + +pkg_postinst() { + tmpfiles_process "${PN}.conf" +} diff --git a/mail-filter/rspamd/rspamd-2.5.ebuild b/mail-filter/rspamd/rspamd-2.5.ebuild deleted file mode 100644 index a533869c5122..000000000000 --- a/mail-filter/rspamd/rspamd-2.5.ebuild +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake pax-utils systemd tmpfiles - -if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/rspamd/rspamd.git" - inherit git-r3 -else - SRC_URI="https://github.com/rspamd/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~x86" -fi - -DESCRIPTION="Rapid spam filtering system" -HOMEPAGE="https://rspamd.com https://github.com/rspamd/rspamd" -LICENSE="Apache-2.0 Boost-1.0 BSD BSD-1 BSD-2 CC0-1.0 LGPL-3 MIT public-domain unicode ZLIB" -SLOT="0" -IUSE="blas cpu_flags_x86_ssse3 jemalloc +jit libressl pcre2" - -RDEPEND=" - acct-group/rspamd - acct-user/rspamd - app-arch/zstd - dev-db/sqlite:3 - dev-libs/glib:2 - dev-libs/icu:= - dev-libs/libev - dev-libs/libsodium - dev-libs/snowball-stemmer - net-libs/libnsl - sys-apps/file - blas? ( sci-libs/openblas ) - cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) - jemalloc? ( dev-libs/jemalloc ) - jit? ( - dev-lang/luajit:2 - dev-lua/lpeg[luajit] - ) - !jit? ( - dev-lang/lua:* - dev-lua/lpeg[-luajit] - dev-lua/LuaBitOp - ) - !libressl? ( dev-libs/openssl:0=[-bindist] ) - libressl? ( dev-libs/libressl:0= ) - pcre2? ( dev-libs/libpcre2[jit=] ) - !pcre2? ( dev-libs/libpcre[jit=] )" -DEPEND="${RDEPEND}" -BDEPEND=" - dev-util/ragel - virtual/pkgconfig -" - -PATCHES=( - "${FILESDIR}/rspamd-2.5-replxx-gcc10.patch" - "${FILESDIR}/rspamd-2.5-unbundle-lua.patch" - "${FILESDIR}/rspamd-2.5-unbundle-zstd.patch" - "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" -) - -src_prepare() { - cmake_src_prepare - - rm -vrf contrib/{lua-{bit,lpeg},snowball,zstd} || die - - sed -i -e 's/User=_rspamd/User=rspamd/g' \ - rspamd.service \ - || die -} - -src_configure() { - local mycmakeargs=( - -DCONFDIR=/etc/rspamd - -DRUNDIR=/var/run/rspamd - -DDBDIR=/var/lib/rspamd - -DLOGDIR=/var/log/rspamd - -DENABLE_BLAS=$(usex blas ON OFF) - -DENABLE_HYPERSCAN=$(usex cpu_flags_x86_ssse3 ON OFF) - -DENABLE_JEMALLOC=$(usex jemalloc ON OFF) - -DENABLE_LUAJIT=$(usex jit ON OFF) - -DENABLE_PCRE2=$(usex pcre2 ON OFF) - ) - cmake_src_configure -} - -src_test() { - cmake_src_test -} - -src_install() { - cmake_src_install - - newconfd "${FILESDIR}"/rspamd.conf rspamd - newinitd "${FILESDIR}/rspamd-r7.init" rspamd - systemd_newunit rspamd.service rspamd.service - - newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf - - # Remove mprotect for JIT support - if use jit; then - pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-* - fi - - insinto /etc/logrotate.d - newins "${FILESDIR}"/rspamd-r1.logrotate rspamd - - diropts -o rspamd -g rspamd - keepdir /var/{lib,log}/rspamd -} - -pkg_postinst() { - tmpfiles_process "${PN}.conf" -} diff --git a/mail-filter/rspamd/rspamd-2.6-r1.ebuild b/mail-filter/rspamd/rspamd-2.6-r1.ebuild deleted file mode 100644 index 1488b0696d24..000000000000 --- a/mail-filter/rspamd/rspamd-2.6-r1.ebuild +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake pax-utils systemd tmpfiles - -if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/rspamd/rspamd.git" - inherit git-r3 -else - SRC_URI="https://github.com/rspamd/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~x86" -fi - -DESCRIPTION="Rapid spam filtering system" -HOMEPAGE="https://rspamd.com https://github.com/rspamd/rspamd" -LICENSE="Apache-2.0 Boost-1.0 BSD BSD-1 BSD-2 CC0-1.0 LGPL-3 MIT public-domain unicode ZLIB" -SLOT="0" -IUSE="blas cpu_flags_x86_ssse3 jemalloc +jit libressl pcre2" - -RDEPEND=" - acct-group/rspamd - acct-user/rspamd - app-arch/zstd - dev-db/sqlite:3 - dev-libs/glib:2 - dev-libs/icu:= - dev-libs/libev - dev-libs/libsodium - dev-libs/snowball-stemmer - net-libs/libnsl - sys-apps/file - blas? ( - virtual/blas - virtual/lapack - ) - cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) - jemalloc? ( dev-libs/jemalloc ) - jit? ( - dev-lang/luajit:2 - dev-lua/lpeg[luajit] - ) - !jit? ( - dev-lang/lua:* - dev-lua/lpeg[-luajit] - dev-lua/LuaBitOp - ) - !libressl? ( dev-libs/openssl:0=[-bindist] ) - libressl? ( dev-libs/libressl:0= ) - pcre2? ( dev-libs/libpcre2[jit=] ) - !pcre2? ( dev-libs/libpcre[jit=] )" -DEPEND="${RDEPEND}" -BDEPEND=" - dev-util/ragel - virtual/pkgconfig -" - -PATCHES=( - "${FILESDIR}/rspamd-2.6-unbundle-lua.patch" - "${FILESDIR}/rspamd-2.6-unbundle-zstd.patch" - "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" -) - -src_prepare() { - cmake_src_prepare - - rm -vrf contrib/{lua-{bit,lpeg},snowball,zstd} || die - - sed -i -e 's/User=_rspamd/User=rspamd/g' \ - rspamd.service \ - || die -} - -src_configure() { - local mycmakeargs=( - -DCONFDIR=/etc/rspamd - -DRUNDIR=/var/run/rspamd - -DDBDIR=/var/lib/rspamd - -DLOGDIR=/var/log/rspamd - -DENABLE_BLAS=$(usex blas ON OFF) - -DENABLE_HYPERSCAN=$(usex cpu_flags_x86_ssse3 ON OFF) - -DENABLE_JEMALLOC=$(usex jemalloc ON OFF) - -DENABLE_LUAJIT=$(usex jit ON OFF) - -DENABLE_PCRE2=$(usex pcre2 ON OFF) - ) - cmake_src_configure -} - -src_test() { - cmake_src_test -} - -src_install() { - cmake_src_install - - newconfd "${FILESDIR}"/rspamd.conf rspamd - newinitd "${FILESDIR}/rspamd-r7.init" rspamd - systemd_newunit rspamd.service rspamd.service - - newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf - - # Remove mprotect for JIT support - if use jit; then - pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-* - fi - - insinto /etc/logrotate.d - newins "${FILESDIR}"/rspamd-r1.logrotate rspamd - - diropts -o rspamd -g rspamd - keepdir /var/{lib,log}/rspamd -} - -pkg_postinst() { - tmpfiles_process "${PN}.conf" -} diff --git a/mail-filter/rspamd/rspamd-2.6-r2.ebuild b/mail-filter/rspamd/rspamd-2.6-r2.ebuild new file mode 100644 index 000000000000..380080e13fba --- /dev/null +++ b/mail-filter/rspamd/rspamd-2.6-r2.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake pax-utils systemd tmpfiles + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/rspamd/rspamd.git" + inherit git-r3 +else + SRC_URI="https://github.com/rspamd/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="Rapid spam filtering system" +HOMEPAGE="https://rspamd.com https://github.com/rspamd/rspamd" +LICENSE="Apache-2.0 Boost-1.0 BSD BSD-1 BSD-2 CC0-1.0 LGPL-3 MIT public-domain unicode ZLIB" +SLOT="0" +IUSE="blas cpu_flags_x86_ssse3 jemalloc +jit libressl pcre2" + +RDEPEND=" + acct-group/rspamd + acct-user/rspamd + app-arch/zstd + dev-db/sqlite:3 + dev-libs/glib:2 + dev-libs/icu:= + dev-libs/libev + dev-libs/libsodium + dev-libs/snowball-stemmer + net-libs/libnsl + sys-apps/file + blas? ( + virtual/blas + virtual/lapack + ) + cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) + jemalloc? ( dev-libs/jemalloc ) + jit? ( + dev-lang/luajit:2 + ) + !jit? ( + dev-lang/lua:* + dev-lua/LuaBitOp + ) + !libressl? ( dev-libs/openssl:0=[-bindist] ) + libressl? ( dev-libs/libressl:0= ) + pcre2? ( dev-libs/libpcre2[jit=] ) + !pcre2? ( dev-libs/libpcre[jit=] )" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-util/ragel + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}/rspamd-2.6-unbundle-lua.patch" + "${FILESDIR}/rspamd-2.6-unbundle-zstd.patch" + "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" +) + +src_prepare() { + cmake_src_prepare + + rm -vrf contrib/{lua-bit,snowball,zstd} || die + + sed -i -e 's/User=_rspamd/User=rspamd/g' \ + rspamd.service \ + || die +} + +src_configure() { + local mycmakeargs=( + -DCONFDIR=/etc/rspamd + -DRUNDIR=/var/run/rspamd + -DDBDIR=/var/lib/rspamd + -DLOGDIR=/var/log/rspamd + -DENABLE_BLAS=$(usex blas ON OFF) + -DENABLE_HYPERSCAN=$(usex cpu_flags_x86_ssse3 ON OFF) + -DENABLE_JEMALLOC=$(usex jemalloc ON OFF) + -DENABLE_LUAJIT=$(usex jit ON OFF) + -DENABLE_PCRE2=$(usex pcre2 ON OFF) + ) + cmake_src_configure +} + +src_test() { + cmake_src_test +} + +src_install() { + cmake_src_install + + newconfd "${FILESDIR}"/rspamd.conf rspamd + newinitd "${FILESDIR}/rspamd-r7.init" rspamd + systemd_newunit rspamd.service rspamd.service + + newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf + + # Remove mprotect for JIT support + if use jit; then + pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-* + fi + + insinto /etc/logrotate.d + newins "${FILESDIR}"/rspamd-r1.logrotate rspamd + + diropts -o rspamd -g rspamd + keepdir /var/{lib,log}/rspamd +} + +pkg_postinst() { + tmpfiles_process "${PN}.conf" +} -- cgit v1.2.3-65-gdbad