aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rspamd/APKBUILD
blob: ee2b2e3463fab6dfed61dd4f759dcf851f5d6d93 (plain) (blame)
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
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Nathan Angelacos <nangel@alpinelinux.org>
pkgname=rspamd
pkgver=1.3.4
pkgrel=1
pkgdesc="Rapid spam filtering system"
url="https://rspamd.com"
arch="x86_64 x86 armhf"
license="BSD"
pkgusers="rspamd"
pkggroups="rspamd"
depends=""
depends_dev=""
makedepends="$depends_dev cmake libressl-dev libevent-dev glib-dev gmime-dev
	lua5.1-dev lua5.1 sqlite-dev hiredis-dev file-dev pcre-dev ragel"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-web $pkgname-client"
source="https://rspamd.com/downloads/$pkgname-$pkgver.tar.xz
	$pkgname.logrotated
	$pkgname.initd
	$pkgname.confd
	$pkgname.conf
	$pkgname.worker_normal
	$pkgname.worker_controller
"

_builddir="$srcdir"/$pkgname-$pkgver
build() {
	cd "$_builddir"
	cmake CMakeLists.txt \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCONFDIR=/etc/$pkgname \
		-DRUNDIR=/run/$pkgname \
		-DRSPAMD_USER=$pkgusers \
		-DRSPAMD_GROUP=$pkggroups \
		-DENABLE_HIREDIS=ON \
		-DINSTALL_EXAMPLES=ON \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	find "$pkgdir"/usr/bin -type l -delete
	rm -fr "$pkgdir"/etc/$pkgname/rspamd* "$pkgdir"/etc/$pkgname/worker*

	sed -i -E 's~DBDIR(/rspamd.sock)~RUNDIR\1~' "$pkgdir"/etc/$pkgname/options.inc
	install -Dm644 "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname/$pkgname.conf
	install -Dm644 "$srcdir"/$pkgname.worker_normal "$pkgdir"/etc/$pkgname/worker.d/normal.conf
	mkdir -p "$pkgdir"/etc/$pkgname/local.d "$pkgdir"/etc/$pkgname/override.d

	install -Dm644 "$srcdir"/$pkgname.logrotated "$pkgdir"/etc/logrotate.d/$pkgname
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname

	install -dm750 -o $pkgusers -g $pkggroups "$pkgdir"/var/lib/$pkgname/rspamd_dynamic
	install -dm750 -g $pkggroups "$pkgdir"/var/log/$pkgname

	mkdir "$pkgdir"/usr/sbin
	mv "$pkgdir"/usr/bin/rspamd-$pkgver "$pkgdir"/usr/sbin/rspamd
	mv "$pkgdir"/usr/bin/rspamadm-$pkgver "$pkgdir"/usr/bin/rspamadm

	mv "$pkgdir"/usr/share/examples "$pkgdir"/usr/share/doc
	mv "$pkgdir"/usr/share/$pkgname/www/README.md \
		"$pkgdir"/usr/share/$pkgname/www/plugins.txt \
		"$pkgdir"/usr/share/doc/$pkgname
}

web() {
	arch="noarch"
	license="MIT"
	depends="$pkgname"
	pkgdesc="$pkgdesc (web control interface)"
	mkdir -p "$subpkgdir"/usr/share/$pkgname "$subpkgdir"/etc/$pkgname/worker.d
	mv "$pkgdir"/usr/share/$pkgname/www "$subpkgdir"/usr/share/$pkgname/
	install -Dm644 "$srcdir"/$pkgname.worker_controller "$subpkgdir"/etc/$pkgname/worker.d/controller.conf
}

client() {
	pkgdesc="$pkgdesc (console client)"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/rspamc-$pkgver "$subpkgdir"/usr/bin/rspamc
}

md5sums="ab81d063861d68b1e2260d1c599bf29c  rspamd-1.3.4.tar.xz
c152c6a90f6ae9e5a7a1d137dfbc0305  rspamd.logrotated
3f32a16e76e1461ffba9231cfb1e3d17  rspamd.initd
ecfea2a25b95727ae91c04001fbd3e46  rspamd.confd
0ba1c9aea1820de74d831fd531cce51a  rspamd.conf
560b2d4746510fe9a7a2fb1c09181c38  rspamd.worker_normal
15a9f5dde0076eaab4565549b05b991c  rspamd.worker_controller"
sha256sums="64fcabb3dc6767b5dc22c89f968414d1028f34ab8a21e1b22482aace069d527c  rspamd-1.3.4.tar.xz
6c5e79e9052d957f3d0d634b2ae7a56bbc0901a5d6946dc991c92f19a72fce97  rspamd.logrotated
6b531f95724b2a3990524ab09b7304ce4e811b6e082dfdbe633f201a6bc7eee3  rspamd.initd
82be6a663af2e2333b0dfbbbfd05a9ff3d02e05c7e506235b1b0dbd9d0b72972  rspamd.confd
8b51fbd06a46adceb8cc4b0dc06e7b98d263336acbff913c34ff8e451173aa23  rspamd.conf
ccb271cc6b1ff69add9d6e00edcb14e1c1ae664ee6ecf28304647f6cb32240c9  rspamd.worker_normal
91848312e707032bb159f042da04b4a15efd43f69a17225481962cb07751e90a  rspamd.worker_controller"
sha512sums="41a3aa9b699ca1e40d229ebc9c3fd41ef07ad99b0badda44481fe4ff3003000069352f58379fa47013f96d98b08430a3c7bea0d97cab4a7e6db17a9084b082d6  rspamd-1.3.4.tar.xz
2efe28575c40d1fba84b189bb872860e744400db80dce2f6330be6c6287fb3f46e6511284729b957488bf40bcb9b0952e26df9934f5f138334bd2766075c45cb  rspamd.logrotated
30b45812ef68f2b82d0d7f370b44bec52691296c7349c96c8273342eb4f9b5708c13ad97b13f63d81bee588b4e459c0da3092a62adff9e5b8938f44546df3dcd  rspamd.initd
0b73b159cec9a4a1d337fbb429814f78da23b55f72c9fb8a777ab5f06634206a4f9b25e587f8dbfa7c3242ac5501ebcc90b9a0e926adfd37e14a12ac4607fa62  rspamd.confd
856000ab9b76dd7acff95ab9a55a0eddfc66486a439fcba7fbb36ecdeaa9740f29301cf7248c982e2d5b745b1bad521abb0f4d5e240d442440a36103d3ee634d  rspamd.conf
e669882c35891eee37c4121ea065e72545c618ac5e16044ccd19db4cdb14bed271fa87dc261e43e587a08ea6149e13952626c8cea8a797a59b649203c2ac4731  rspamd.worker_normal
e830ccd5d7999e8cf8d0a82baba1ca80c8b8eb3a7f710c8c067af937258fff49f010cead46619adebc1d481d1131c9e0146fa654a4f4c28749437e5b2c49e755  rspamd.worker_controller"