| 1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4 |
|---|
| 2 | # $Id: Portfile 134312 2015-03-22 03:49:16Z ryandesign@macports.org $ |
|---|
| 3 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | PortGroup cmake 1.0 |
|---|
| 6 | PortGroup github 1.0 |
|---|
| 7 | |
|---|
| 8 | github.setup vstakhov rspamd 0.8.3 |
|---|
| 9 | |
|---|
| 10 | version 0.8.3 |
|---|
| 11 | categories mail |
|---|
| 12 | license BSD |
|---|
| 13 | maintainers pixilla openmaintainer |
|---|
| 14 | platforms darwin |
|---|
| 15 | description Rspamd filtering system is created as a replacement of popular spamassassin \ |
|---|
| 16 | spamd and is designed to be fast, modular and easily extendable system. |
|---|
| 17 | long_description ${description} Rspamd core is written in C language using event driven \ |
|---|
| 18 | paradigma. Plugins for rspamd can be written in lua. Rspamd is designed to \ |
|---|
| 19 | process connections completely asynchronous and do not block anywhere in code. |
|---|
| 20 | homepage http://rspamd.com |
|---|
| 21 | |
|---|
| 22 | if {${github.version} eq ${version}} { |
|---|
| 23 | master_sites http://rspamd.com/downloads |
|---|
| 24 | use_xz yes |
|---|
| 25 | checksums rmd160 dc43a24c9eef555bd390ab31c4aa1deb8c5e7704 \ |
|---|
| 26 | sha256 20f788b08406fdaa8148d726e7ba18940108afff2d48b4f47726e3f2a6a88daf |
|---|
| 27 | } else { |
|---|
| 28 | fetch.type git |
|---|
| 29 | post-fetch { |
|---|
| 30 | system -W ${worksrcpath} "git submodule update --init" |
|---|
| 31 | } |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | depends_build-append port:pkgconfig |
|---|
| 35 | |
|---|
| 36 | depends_lib port:libevent \ |
|---|
| 37 | path:lib/pkgconfig/glib-2.0.pc:glib2 \ |
|---|
| 38 | port:gmime \ |
|---|
| 39 | port:lua \ |
|---|
| 40 | port:pcre \ |
|---|
| 41 | port:perl5 \ |
|---|
| 42 | port:hiredis |
|---|
| 43 | |
|---|
| 44 | set rspamd_user _rspamd |
|---|
| 45 | set rspamd_group ${rspamd_user} |
|---|
| 46 | add_users ${rspamd_user} group=${rspamd_group} realname=Rspamd |
|---|
| 47 | |
|---|
| 48 | configure.args-delete \ |
|---|
| 49 | -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib |
|---|
| 50 | configure.args-append \ |
|---|
| 51 | -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/${name} \ |
|---|
| 52 | -DRSPAMD_USER=${rspamd_user} \ |
|---|
| 53 | -DBUILD_PORT:BOOL=ON \ |
|---|
| 54 | -DENABLE_LUAJIT:BOOL=OFF \ |
|---|
| 55 | -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \ |
|---|
| 56 | -DNO_SHARED=ON |
|---|
| 57 | |
|---|
| 58 | test.run yes |
|---|
| 59 | test.target run-test |
|---|
| 60 | post-destroot { |
|---|
| 61 | |
|---|
| 62 | set docdir ${prefix}/share/doc/${name} |
|---|
| 63 | xinstall -d ${destroot}${docdir} |
|---|
| 64 | xinstall -m 0444 -W ${worksrcpath} ChangeLog LICENSE README.md ${destroot}${docdir} |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | post-activate { |
|---|
| 68 | |
|---|
| 69 | set confdir ${prefix}/etc/${name} |
|---|
| 70 | foreach s [glob ${confdir}/*.sample] { |
|---|
| 71 | |
|---|
| 72 | if {![file exists [string map {.sample {}} "${s}"]]} { |
|---|
| 73 | |
|---|
| 74 | file copy ${s} [string map {.sample {}} "${s}"] |
|---|
| 75 | } |
|---|
| 76 | } |
|---|
| 77 | } |
|---|
| 78 | |
|---|
| 79 | startupitem.create yes |
|---|
| 80 | startupitem.executable \ |
|---|
| 81 | ${prefix}/bin/rspamd \ |
|---|
| 82 | -u ${rspamd_user} \ |
|---|
| 83 | -g ${rspamd_group} \ |
|---|
| 84 | -f \ |
|---|
| 85 | -c ${prefix}/etc/rspamd/rspamd.conf |
|---|