summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 46bb08eb553df74c8006fddb6964ac5f0f217c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Maintainer: Oleksandr Natalenko <oleksandr@natalenko.name>
# Contributor: Andrew Lewis <nerf@judo.za.org>
# Contributor: mezcal

pkgname=rspamd
pkgver=1.9.2
pkgrel=1
epoch=
pkgdesc="Fast, free and open-source spam filtering system."
arch=(x86_64 i686 armv7h)
url="https://rspamd.com"
license=(BSD)
depends=(file glib2 icu libevent luajit sqlite)
makedepends=(cmake ragel ninja)

backup=('etc/logrotate.d/rspamd'
		'etc/rspamd/2tld.inc'
		'etc/rspamd/actions.conf'
		'etc/rspamd/cgp.inc'
		'etc/rspamd/common.conf'
		'etc/rspamd/composites.conf'
		'etc/rspamd/dmarc_whitelist.inc'
		'etc/rspamd/groups.conf'
		'etc/rspamd/logging.inc'
		'etc/rspamd/maillist.inc'
		'etc/rspamd/metrics.conf'
		'etc/rspamd/mid.inc'
		'etc/rspamd/mime_types.inc'
		'etc/rspamd/modules.conf'
		'etc/rspamd/modules.d/antivirus.conf'
		'etc/rspamd/modules.d/arc.conf'
		'etc/rspamd/modules.d/asn.conf'
		'etc/rspamd/modules.d/chartable.conf'
		'etc/rspamd/modules.d/clickhouse.conf'
		'etc/rspamd/modules.d/dcc.conf'
		'etc/rspamd/modules.d/dkim.conf'
		'etc/rspamd/modules.d/dkim_signing.conf'
		'etc/rspamd/modules.d/dmarc.conf'
		'etc/rspamd/modules.d/elastic.conf'
		'etc/rspamd/modules.d/emails.conf'
		'etc/rspamd/modules.d/external_services.conf'
		'etc/rspamd/modules.d/force_actions.conf'
		'etc/rspamd/modules.d/forged_recipients.conf'
		'etc/rspamd/modules.d/fuzzy_check.conf'
		'etc/rspamd/modules.d/greylist.conf'
		'etc/rspamd/modules.d/hfilter.conf'
		'etc/rspamd/modules.d/history_redis.conf'
		'etc/rspamd/modules.d/ip_score.conf'
		'etc/rspamd/modules.d/maillist.conf'
		'etc/rspamd/modules.d/metadata_exporter.conf'
		'etc/rspamd/modules.d/metric_exporter.conf'
		'etc/rspamd/modules.d/mid.conf'
		'etc/rspamd/modules.d/milter_headers.conf'
		'etc/rspamd/modules.d/mime_types.conf'
		'etc/rspamd/modules.d/multimap.conf'
		'etc/rspamd/modules.d/mx_check.conf'
		'etc/rspamd/modules.d/neural.conf'
		'etc/rspamd/modules.d/once_received.conf'
		'etc/rspamd/modules.d/phishing.conf'
		'etc/rspamd/modules.d/ratelimit.conf'
		'etc/rspamd/modules.d/rbl.conf'
		'etc/rspamd/modules.d/redis.conf'
		'etc/rspamd/modules.d/regexp.conf'
		'etc/rspamd/modules.d/replies.conf'
		'etc/rspamd/modules.d/reputation.conf'
		'etc/rspamd/modules.d/rspamd_update.conf'
		'etc/rspamd/modules.d/spamassassin.conf'
		'etc/rspamd/modules.d/spamtrap.conf'
		'etc/rspamd/modules.d/spf.conf'
		'etc/rspamd/modules.d/surbl.conf'
		'etc/rspamd/modules.d/trie.conf'
		'etc/rspamd/modules.d/url_redirector.conf'
		'etc/rspamd/modules.d/url_reputation.conf'
		'etc/rspamd/modules.d/url_tags.conf'
		'etc/rspamd/modules.d/whitelist.conf'
		'etc/rspamd/options.inc'
		'etc/rspamd/redirectors.inc'
		'etc/rspamd/rspamd.conf'
		'etc/rspamd/scores.d/fuzzy_group.conf'
		'etc/rspamd/scores.d/headers_group.conf'
		'etc/rspamd/scores.d/hfilter_group.conf'
		'etc/rspamd/scores.d/mime_types_group.conf'
		'etc/rspamd/scores.d/mua_group.conf'
		'etc/rspamd/scores.d/phishing_group.conf'
		'etc/rspamd/scores.d/policies_group.conf'
		'etc/rspamd/scores.d/rbl_group.conf'
		'etc/rspamd/scores.d/statistics_group.conf'
		'etc/rspamd/scores.d/subject_group.conf'
		'etc/rspamd/scores.d/surbl_group.conf'
		'etc/rspamd/scores.d/whitelist_group.conf'
		'etc/rspamd/settings.conf'
		'etc/rspamd/spf_dkim_whitelist.inc'
		'etc/rspamd/statistic.conf'
		'etc/rspamd/surbl-whitelist.inc'
		'etc/rspamd/worker-controller.inc'
		'etc/rspamd/worker-fuzzy.inc'
		'etc/rspamd/worker-normal.inc'
		'etc/rspamd/worker-proxy.inc')

install=rspamd.install

source=("${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/${pkgver}.tar.gz"
		"${pkgname}.tmpfile"
		"${pkgname}.sysuser"
		"${pkgname}.logrotate"
		"fixes-${pkgver}.diff"
		)

sha256sums=('69a39cb83a4d28da2fc2fc2dc7c8e07435557e50e19cfdf73bd1ebd964da80f9'
            'f89edae5436a3c14e58210fb5c1d5bdd2f8a6f98c03dbc150ea9ff1a3fcfe441'
            '59646874a5036f3f26cac2898a2f60713fe6147b3c60ee964494f07b6acc313f'
            'e705cc908a8e081e4a830cfec5acfc38f00125c5281bb074c939ba3b4a7a8c8b'
            'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')

prepare() {
	cd "${pkgname}-${pkgver}"

	patch -Np1 <../fixes-${pkgver}.diff
}

build() {
	cd "${pkgname}-${pkgver}"

	cmake \
		-G Ninja \
		-DNO_SHARED=ON \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCONFDIR=/etc/rspamd \
		-DRUNDIR=/run/rspamd \
		-DLOGDIR=/var/log/rspamd \
		-DRSPAMD_USER='_rspamd' \
		-DDBDIR=/var/lib/rspamd \
		-DWANT_SYSTEMD_UNITS=ON \
		.

	cmake --build .
}

package() {
	cd "${pkgname}-${pkgver}"

	DESTDIR="${pkgdir}/" cmake --build . --target install

	install -Dm0644 "LICENSE.md" -t "${pkgdir}/usr/share/${pkgname}"
	install -Dm0644 "../${pkgname}.tmpfile" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
	install -Dm0644 "../${pkgname}.sysuser" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
	install -Dm0644 "../${pkgname}.logrotate" "${pkgdir}/etc/logrotate.d/${pkgname}"
}

# vim: set tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab