aports/main/dovecot/APKBUILD
mio e92fb1aa04 main/dovecot: fix build on 32-bit arches
Fix build errors on 32-bit arches.

```
In file included from ../../src/lib/lib.h:37,
                 from http-server-settings.c:3:
../../src/lib/macros.h:173:21: error: size of unnamed array is negative
  173 |         (sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
      |                     ^
../../src/lib/macros.h:182:9: note: in expansion of macro 'COMPILE_ERROR_IF_TRUE'
  182 |         COMPILE_ERROR_IF_TRUE( \
      |         ^~~~~~~~~~~~~~~~~~~~~
../../src/lib-settings/settings-parser.h:78:34: note: in expansion of macro 'COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE'
   78 |         { .type = (_enum_type) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/lib-settings/settings-parser.h:125:9: note: in expansion of macro 'SETTING_DEFINE_STRUCT_TYPE'
  125 |         SETTING_DEFINE_STRUCT_TYPE(SET_SIZE, SET_FLAG_HIDDEN, uoff_t, key, name, struct_name)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
http-server-settings.c:13:9: note: in expansion of macro 'SETTING_DEFINE_STRUCT_SIZE_HIDDEN'
   13 |         SETTING_DEFINE_STRUCT_##type("http_server_"#name, name, struct http_server_settings)
      |         ^~~~~~~~~~~~~~~~~~~~~~
http-server-settings.c:34:9: note: in expansion of macro 'DEF'
   34 |         DEF(SIZE_HIDDEN, socket_send_buffer_size),
      |         ^~~
```
2025-03-28 06:13:47 +00:00

371 lines
8.8 KiB
Text

# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Michael Mason <ms13sp@gmail.com>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Martin Uddén <martin.udden@gmail.com>
# Contributor: Niklas Meyer <derlinkman@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dovecot
pkgver=2.4.0
# rebuild community/dovecot-fts-xapian on version changes
case "$pkgver" in
*.*.*.*) _pkgverminor=${pkgver%.*.*};;
*.*.*) _pkgverminor=${pkgver%.*};;
esac
pkgrel=1
_pigeonholever=2.4.0
pkgdesc="IMAP and POP3 server"
url="https://www.dovecot.org/"
arch="all"
license="MIT AND LGPL-2.1-or-later"
depends="openssl>3"
pkgusers="dovecot dovenull"
pkggroups="dovecot dovenull"
makedepends="
autoconf
automake
bzip2-dev
clucene-dev
expat-dev
gettext-dev
heimdal-dev
icu-dev
libcap-dev
libpq-dev
libsodium-dev
libstemmer-dev
libtool
linux-headers
lua5.3-dev
lz4-dev
mariadb-connector-c-dev
openldap-dev
openssl-dev>3
sqlite-dev
zlib-dev
zstd-dev
"
install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
subpackages="
$pkgname-doc
$pkgname-dev
$pkgname-openrc
$pkgname-lmtpd
$pkgname-pop3d
$pkgname-submissiond
$pkgname-pigeonhole-plugin-ldap:_sieve_ldap
$pkgname-pigeonhole-plugin:_sieve
$pkgname-sql
$pkgname-pgsql
$pkgname-mysql
$pkgname-sqlite
$pkgname-gssapi
$pkgname-ldap
$pkgname-lua
$pkgname-fts-solr:_fts_solr
"
source="https://www.dovecot.org/releases/$_pkgverminor/dovecot-$pkgver.tar.gz
$pkgname-pigeonhole-$_pigeonholever.tar.gz::https://pigeonhole.dovecot.org/releases/$_pkgverminor/dovecot-pigeonhole-$_pigeonholever.tar.gz
skip-iconv-check.patch
headers.patch
setting-types.patch
setting-types-pigeonhole
dovecot.logrotate
dovecot.initd
"
_builddir_pigeonhole="$srcdir/$pkgname-pigeonhole-$_pigeonholever"
options="!check" # tests being weird
# secfixes:
# 2.3.21.1-r0:
# - CVE-2024-23184
# - CVE-2024-23185
# 2.3.19.1-r5:
# - CVE-2022-30550
# 2.3.15-r0:
# - CVE-2021-29157
# - CVE-2021-33515
# 2.3.13-r0:
# - CVE-2020-24386
# - CVE-2020-25275
# 2.3.11.3-r0:
# - CVE-2020-12100
# - CVE-2020-12673
# - CVE-2020-12674
# 2.3.10.1-r0:
# - CVE-2020-10957
# - CVE-2020-10958
# - CVE-2020-10967
# 2.3.9.3-r0:
# - CVE-2020-7046
# - CVE-2020-7957
# 2.3.9.2-r0:
# - CVE-2019-19722
# 2.3.7.2-r0:
# - CVE-2019-11500
# 2.3.6-r0:
# - CVE-2019-11499
# - CVE-2019-11494
# - CVE-2019-10691
# 2.3.5.1-r0:
# - CVE-2019-7524
# 2.3.4.1-r0:
# - CVE-2019-3814
# 2.3.1-r0:
# - CVE-2017-15130
# - CVE-2017-14461
# - CVE-2017-15132
prepare() {
default_prepare
update_config_sub
autoreconf -vi
cd "$_builddir_pigeonhole"
update_config_sub
# Apply patch for dovecot-pigeonhole
patch -p1 -i "$srcdir"/setting-types-pigeonhole
}
_configure() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--localstatedir=/var \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-static \
"$@"
}
build() {
_configure \
--with-gssapi=plugin \
--with-ldap=plugin \
--with-sql=plugin \
--with-lua=plugin \
--with-mysql \
--with-sqlite \
--with-pgsql \
--with-solr \
--with-bzlib \
--with-icu \
--with-lz4 \
--with-lzma \
--with-sodium \
--with-stemmer \
--with-zlib \
--with-zstd \
--with-ssl=openssl \
--with-ssldir=/etc/ssl/dovecot \
--with-rundir=/run/dovecot
make
# Build pigeonhole plugin
cd "$_builddir_pigeonhole"
_configure \
--with-dovecot="$builddir" \
--with-ldap=plugin
make
}
check() {
make check
}
package() {
make DESTDIR="$pkgdir" install
cd "$pkgdir"
install -d ./etc/ssl/dovecot
install -D -m 755 "$srcdir"/dovecot.initd ./etc/init.d/dovecot
install -D -m 644 "$srcdir"/dovecot.logrotate ./etc/logrotate.d/dovecot
# default config
rm ./etc/dovecot/*
rm ./usr/share/doc/dovecot/mkcert.sh
mv ./usr/share/doc/dovecot/dovecot-openssl.cnf ./etc/dovecot/
# mv ./usr/share/doc/dovecot/example-config/dovecot* \
# ./usr/share/doc/dovecot/example-config/conf.d \
# ./etc/dovecot/
# rm -fr ./usr/share/doc/dovecot/example-config
# Fix SSL dirs in default config.
# sed -i -e 's,^ssl_cert =.*,ssl_cert = </etc/ssl/dovecot/server.pem,' \
# -e 's,^ssl_key =.*,ssl_key = </etc/ssl/dovecot/server.key,' \
# ./etc/dovecot/conf.d/10-ssl.conf
# Set default passdb to passwd and create appropriate 'users' file.
# install -m 640 -o dovecot -g mail /dev/null ./etc/dovecot/users
# sed -i -e 's,!include auth-system.conf.ext,!include auth-passwdfile.conf.ext,' \
# -e 's,#!include auth-passwdfile.conf.ext,#!include auth-system.conf.ext,' \
# ./etc/dovecot/conf.d/10-auth.conf
# Installing pigeonhole plugin.
cd "$_builddir_pigeonhole"
make install DESTDIR="$pkgdir"
# Moving config in the correct place
# mv "$pkgdir"/usr/share/doc/dovecot/example-config/conf.d/* \
# "$pkgdir"/etc/dovecot/conf.d
# Remove libtool archives.
find "$pkgdir" -name '*.la' -exec rm -f {} +
}
dev() {
default_dev
mkdir -p "$subpkgdir"/usr/lib/dovecot
mv "$pkgdir"/usr/lib/dovecot/dovecot-config \
"$subpkgdir"/usr/lib/dovecot/
}
lmtpd() {
pkgdesc="$pkgdesc (LMTP server)"
_protocol lmtp
}
pop3d() {
pkgdesc="$pkgdesc (POP3 daemon)"
_protocol pop3
}
submissiond() {
pkgdesc="$pkgdesc (mail submission agent)"
_protocol submission
}
_protocol() {
depends="$pkgname=$pkgver-r$pkgrel"
replaces="$pkgname" # for backward compatibility
local name="$1"
local protocolsd="$subpkgdir/usr/share/dovecot/protocols.d"
cd "$pkgdir"
_submv usr/libexec/dovecot/"$name"*
# _submv etc/dovecot/conf.d/*-"$name".conf
mkdir -p "$protocolsd"
echo "protocols = \$protocols $name" \
> "$protocolsd"/${subpkgname#"$pkgname"-}.conf
}
_sieve() {
pkgdesc="Sieve and managesieve plugin for Dovecot"
depends="$pkgname=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot sieve_extprograms
_find usr/lib/dovecot sieve_imapsieve
_find usr/bin sieve
_find usr/lib/dovecot sieve
_find usr/lib/dovecot pigeonhole
_find usr/libexec/dovecot managesieve
_find etc/dovecot/ sieve
}
_sieve_ldap() {
pkgdesc="Sieve and managesieve plugin for Dovecot (LDAP support)"
depends="$pkgname-pigeonhole-plugin=$pkgver-r$pkgrel $pkgname-ldap=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot _sieve_storage_ldap_
}
pgsql() {
pkgdesc="PostgreSQL driver for Dovecot"
depends="$pkgname-sql=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot _pgsql
}
lua() {
pkgdesc="Lua plugins for Dovecot"
depends="$pkgname=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot lua
}
mysql() {
pkgdesc="MySQL driver for Dovecot"
depends="$pkgname-sql=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot _mysql
}
sqlite() {
pkgdesc="SQLite driver for Dovecot"
depends="$pkgname-sql=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot _sqlite
}
gssapi() {
pkgdesc="GSSAPI auth plugin for Dovecot"
depends="$pkgname=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot _gssapi
}
ldap() {
pkgdesc="LDAP auth plugin for Dovecot"
depends="$pkgname=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot ldap.so
_find etc/dovecot -ldap.conf
}
sql() {
pkgdesc="SQL plugin for dovecot"
depends="$pkgname=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot -sql.
_find etc/dovecot -sql.conf
}
_fts_solr() {
pkgdesc="FTS-Solr plugin for dovecot"
depends="$pkgname=$pkgver-r$pkgrel"
cd "$pkgdir"
_find usr/lib/dovecot fts\*solr
}
_find() {
local _f
local _ff="$(find "$1" -name \*"$2"\*)"
for _f in $_ff
do
_submv "$_f"
done
}
_submv() {
local dir="$(dirname $1)"
mkdir -p "$subpkgdir"/"$dir"
mv "$pkgdir/$1" "$subpkgdir/$dir/"
[ "$(ls -A "$pkgdir/$dir")" ] || rmdir "$pkgdir"/"$dir"
}
sha512sums="
25455f368d850c024c92fdcc814f89d2c5f5583ec84ecaf048b15f13b6f90729ca256bb1b6b2cec46eab129fc78f4600716a72a5f56877479df5d18313b0c526 dovecot-2.4.0.tar.gz
489d6c89f74ca66d0c94a4d701ad64cf94e0feadc7da6026a98735bde9d24d2be24c25ab296aee0287745f3a522a12ae071382dcef5143c1333dc843bcfce3aa dovecot-pigeonhole-2.4.0.tar.gz
fe4fbeaedb377d809f105d9dbaf7c1b961aa99f246b77189a73b491dc1ae0aa9c68678dde90420ec53ec877c08f735b42d23edb13117d7268420e001aa30967a skip-iconv-check.patch
043620ea5d89d561f8f4ebb725368eba5133f1a4e2ff6d682a4abef9d15e04d638a56f4322d34645b1a7e6db0fdd7bf73692771012de903401b9ea25353c354c headers.patch
788234404ebeea514b0598885b88d7b8e4a4ec9c358495e76a937a3d0f02d7b30c47cc345ba33cc952fb8d0f06e6b3f2147e6931564eb240835cacd1d3c40532 setting-types.patch
f099b25c5a48ba21bf26046864480d4c021ac46d1c61c146033de6093a5d86dab06902ccf638ac7895bbd1df720d483ed5be23889d7c4ea5309969b1c39f1f42 setting-types-pigeonhole
9f19698ab45969f1f94dc4bddf6de59317daee93c9421c81f2dbf8a7efe6acf89689f1d30f60f536737bb9526c315215d2bce694db27e7b8d7896036a59c31f0 dovecot.logrotate
d91951b81150d7a3ef6a674c0dc7b012f538164dac4b9d27a6801d31da6813b764995a438f69b6a680463e1b60a3b4f2959654f68e565fe116ea60312d5e5e70 dovecot.initd
"