summaryrefslogtreecommitdiffstats
path: root/freebsd
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-01-26 21:37:48 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-01-26 21:37:48 +0300
commita4caaed0a2699936cc40b4f260a49033ae2ea807 (patch)
tree1b7e78c095ff6beaf519adefd2ecebc0a1b41770 /freebsd
parent61078f0274de4d99c153349dc01a27567c50e489 (diff)
downloadrspamd-a4caaed0a2699936cc40b4f260a49033ae2ea807.tar.gz
rspamd-a4caaed0a2699936cc40b4f260a49033ae2ea807.zip
* Add ability to build FreeBSD package from rspamd sources
Diffstat (limited to 'freebsd')
-rw-r--r--freebsd/cmake/PkgCreate.cmake56
-rw-r--r--freebsd/rspamd.plist29
2 files changed, 85 insertions, 0 deletions
diff --git a/freebsd/cmake/PkgCreate.cmake b/freebsd/cmake/PkgCreate.cmake
new file mode 100644
index 000000000..547e8c967
--- /dev/null
+++ b/freebsd/cmake/PkgCreate.cmake
@@ -0,0 +1,56 @@
+# PkgCreate creates FreeBSD package for cmake
+# USAGE : ADD_FREEBSD_PACKAGE ( PKG_TARGET_NAME [DESCRIPTION] )
+
+FIND_PROGRAM(PKGCREATE
+ NAMES pkg_create
+ PATHS "/usr/sbin")
+
+IF ( PKGCREATE )
+ GET_FILENAME_COMPONENT(PKGCREATE_PATH ${PKGCREATE} ABSOLUTE)
+ MESSAGE(STATUS "Found pkg_create : ${PKGCREATE_PATH}")
+ SET(PKGCREATE_FOUND "YES")
+ELSE ( PKGCREATE )
+ MESSAGE(STATUS "pkg_create NOT found. package generation will not be available")
+ SET(PKGCREATE_FOUND "NO")
+ENDIF ( PKGCREATE )
+
+MACRO(ADD_FREEBSD_PACKAGE PKGNAME PLIST_FILE)
+ # let's create a directory to call 'make install DESTDIR=...' into:
+ SET ( FREEBSD_DIR ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}_${PACKAGE_VERSION}-${PACKAGE_RELEASE} )
+ FILE ( REMOVE ${FREEBSD_DIR} )
+ FILE ( MAKE_DIRECTORY ${FREEBSD_DIR} )
+ FILE ( MAKE_DIRECTORY ${FREEBSD_DIR}/pkg )
+ # Calling "make install DESTDIR=${FREEBSD_DIR}"
+ ADD_CUSTOM_TARGET(pkg_destdir_install
+ COMMAND ${CMAKE_MAKE_PROGRAM} install CMAKE_INSTALL_PREFIX=/ DESTDIR=${FREEBSD_DIR}
+ DEPENDS ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ COMMENT "Installing with DESTDIR = ${FREEBSD_DIR}"
+ )
+ ADD_DEPENDENCIES(pkg_destdir_install pkg_destdir_preinstall)
+ ADD_CUSTOM_TARGET(pkg_destdir_preinstall
+ COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=/ -DDESTDIR=${FREEBSD_DIR} .
+ DEPENDS ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ COMMENT "Configuring with DESTDIR = ${FREEBSD_DIR}"
+ )
+ ADD_DEPENDENCIES(pkg_destdir_preinstall all preinstall)
+
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}_${PACKAGE_VERSION}-${PACKAGE_RELEASE}.tbz
+ COMMAND ${PKGCREATE_PATH} -c -"${PACKAGE_DESCRIPTION_SUMMARY}"
+ -d -"${PACKAGE_DESCRIPTION}"
+ -f ${PLIST_FILE}
+ -p ${FREEBSD_DIR}
+ ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}_${PACKAGE_VERSION}-${PACKAGE_RELEASE}.tbz
+ # removing control, so its (re)generated each time we need to build the package
+ DEPENDS ${PLIST_FILE}
+ COMMENT "Generating freebsd package"
+ )
+
+ # the final target:
+ ADD_CUSTOM_TARGET(${PKGNAME}_pkg
+ DEPENDS ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}_${PACKAGE_VERSION}-${PACKAGE_RELEASE}.tbz
+ )
+
+ ADD_DEPENDENCIES(${PKGNAME}_pkg pkg_destdir_install)
+ENDMACRO(ADD_FREEBSD_PACKAGE PKGNAME) \ No newline at end of file
diff --git a/freebsd/rspamd.plist b/freebsd/rspamd.plist
new file mode 100644
index 000000000..9aa563522
--- /dev/null
+++ b/freebsd/rspamd.plist
@@ -0,0 +1,29 @@
+etc/rspamd/plugins/lua/maillist.lua
+etc/rspamd/plugins/lua/trie.lua
+etc/rspamd/plugins/lua/received_rbl.lua
+etc/rspamd/plugins/lua/multimap.lua
+etc/rspamd/plugins/lua/phishing.lua
+etc/rspamd/plugins/lua/once_received.lua
+etc/rspamd/plugins/lua/whitelist.lua
+etc/rspamd/plugins/lua/forged_recipients.lua
+etc/rspamd/2tld.inc.orig
+etc/rspamd/lua/rspamd.lua
+etc/rspamd/lua/regexp/lotto.lua
+etc/rspamd/lua/regexp/headers.lua
+etc/rspamd/lua/regexp/drugs.lua
+etc/rspamd/lua/regexp/fraud.lua
+@unexec if cmp -s %D/etc/rspamd.xml.sample %D/etc/rspamd.xml; then rm -f %D/etc/rspamd.xml; fi
+etc/rspamd.xml.sample
+bin/rspamc
+bin/rspamd
+lib/librspamd_ipmark.so
+lib/librspamd_regmark.so
+@dirrm etc/rspamd/plugins/lua
+@dirrm etc/rspamd/plugins
+@dirrm etc/rspamd/lua/regexp
+@dirrm etc/rspamd/lua
+@dirrm etc/rspamd
+
+@unexec rmdir %D/etc/rspamd 2>/dev/null || true
+@unexec rmdir /var/run/rspamd 2>/dev/null || true
+@unexec %D/etc/rc.d/rspamd.sh forcestop 2>/dev/null || true