rmilter: de-vendor most of dependencies

While we're at it, set the group to _rmilter.
This commit is contained in:
Đoàn Trần Công Danh 2021-03-27 15:13:24 +07:00
parent 025079a7e8
commit 0b75183b5e
3 changed files with 92 additions and 4 deletions

View File

@ -0,0 +1,58 @@
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -240,10 +240,7 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}
"${CMAKE_BINARY_DIR}/src"
"${CMAKE_BINARY_DIR}/"
"${CMAKE_SOURCE_DIR}/compat"
- "${CMAKE_SOURCE_DIR}/uthash"
- "${CMAKE_SOURCE_DIR}/contrib/libucl"
- "${CMAKE_SOURCE_DIR}/contrib/http-parser"
- "${CMAKE_SOURCE_DIR}/contrib/xxhash")
+ )
BISON_TARGET(CfgParser src/cfg_file.y ${CMAKE_CURRENT_BINARY_DIR}/cfg_yacc.c)
FLEX_TARGET(CfgScanner src/cfg_file.l ${CMAKE_CURRENT_BINARY_DIR}/cfg_lex.c)
@@ -376,16 +373,17 @@ IF(ENABLE_MEMCACHED MATCHES "ON")
MODULES libmemcached)
ENDIF()
+pkg_check_modules(hiredis REQUIRED hiredis)
+pkg_check_modules(libucl REQUIRED libucl)
+pkg_check_modules(libzstd REQUIRED libzstd)
+
################################ SOURCES SECTION ###########################
-ADD_SUBDIRECTORY(hiredis)
-INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/hiredis")
+INCLUDE_DIRECTORIES(${hiredis_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${libucl_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${libzstd_INCLUDE_DIRS})
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/lc-btrie")
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/")
-ADD_SUBDIRECTORY(contrib/libucl)
-ADD_SUBDIRECTORY(contrib/http-parser)
-ADD_SUBDIRECTORY(contrib/xxhash)
ADD_SUBDIRECTORY(contrib/lc-btrie)
-ADD_SUBDIRECTORY(contrib/zstd)
SET(RMILTERSRC
compat/blake2b-ref.c
@@ -410,12 +408,12 @@ CONFIGURE_FILE(config.h.in config.h)
ADD_EXECUTABLE(rmilter ${RMILTERSRC})
SET_TARGET_PROPERTIES(rmilter PROPERTIES LINKER_LANGUAGE C)
TARGET_LINK_LIBRARIES(rmilter ${RMILTER_REQUIRED_LIBRARIES})
-TARGET_LINK_LIBRARIES(rmilter rmilter-hiredis)
-TARGET_LINK_LIBRARIES(rmilter ucl)
-TARGET_LINK_LIBRARIES(rmilter xxhash)
-TARGET_LINK_LIBRARIES(rmilter rmilter-http-parser)
+TARGET_LINK_LIBRARIES(rmilter ${hiredis_LINK_LIBRARIES})
+TARGET_LINK_LIBRARIES(rmilter ${libucl_LINK_LIBRARIES})
+TARGET_LINK_LIBRARIES(rmilter -lxxhash)
+TARGET_LINK_LIBRARIES(rmilter -lhttp_parser)
TARGET_LINK_LIBRARIES(rmilter lcbtrie)
-TARGET_LINK_LIBRARIES(rmilter rmilter-zstd)
+TARGET_LINK_LIBRARIES(rmilter ${libzstd_LINK_LIBRARIES})
##################### INSTALLATION ##########################################

View File

@ -0,0 +1,24 @@
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -296,18 +296,7 @@ IF(SUPPORT_STD_FLAG)
ENDIF(SUPPORT_STD_FLAG)
# Optimization flags
-IF(NOT CMAKE_C_OPT_FLAGS)
- IF(ENABLE_OPTIMIZATION MATCHES "ON")
- SET(CMAKE_C_OPT_FLAGS "-O3 -fstrict-aliasing")
- ELSE(ENABLE_OPTIMIZATION MATCHES "ON")
- SET(CMAKE_C_OPT_FLAGS "-g -O2 -fstrict-aliasing")
- ENDIF(ENABLE_OPTIMIZATION MATCHES "ON")
-ENDIF(NOT CMAKE_C_OPT_FLAGS)
-
-IF(ENABLE_DEBUG MATCHES "ON")
- SET(CMAKE_BUILD_TYPE "Debug")
- SET(WITH_DEBUG 1)
-ENDIF(ENABLE_DEBUG MATCHES "ON")
+SET(CMAKE_C_OPT_FLAGS "-fstrict-aliasing")
SET(CMAKE_C_FLAGS "${CMAKE_C_OPT_FLAGS} ${CMAKE_C_FLAGS} ${CMAKE_C_WARN_FLAGS}")

View File

@ -3,21 +3,27 @@ pkgname=rmilter
version=1.10.0
revision=1
build_style=cmake
configure_args="-DMILTER_USER=rmilter -DSBINDIR=/usr/bin"
configure_args="-DMILTER_USER=rmilter -DMILTER_GROUP=_rmilter -DSBINDIR=/usr/bin"
hostmakedepends="pkg-config bison flex"
makedepends="openssl-devel pcre-devel libmilter-devel opendkim-devel libsasl-devel libmemcached-devel glib-devel"
makedepends="openssl-devel pcre-devel libmilter-devel opendkim-devel
libsasl-devel libmemcached-devel glib-devel xxHash-devel libzstd-devel
http-parser-devel hiredis-devel libucl-devel uthash"
short_desc="Postfix/sendmail integration for rspamd"
maintainer="John Regan <john@jrjrtech.com>"
license="BSD"
license="BSD-2-Clause, BSD-3-Clause"
homepage="https://github.com/vstakhov/rmilter"
distfiles="$homepage/archive/${version}.tar.gz"
checksum=ea80563fa7636afed0b5fd9a29aa2300f15793ed85788e4ce69c187d341a7d54
system_accounts="rmilter"
rmilter_pgroup="_rmilter"
rmilter_homedir="/var/lib/rmilter"
post_install() {
vdoc rmilter.conf.sample
vdoc rmilter-grey.conf
vsv rmilter
vlicense src/rmilter.c
head -26 src/rmilter.c >rmilter.LICENSE
head -38 contrib/lc-btrie/btrie.h >btrie.LICENSE
vlicense rmilter.LICENSE
vlicense btrie.LICENSE
}