summaryrefslogtreecommitdiff
path: root/courier-authlib-devel/PKGBUILD
blob: 2cd17b1d57ccded9c1f18fbdcaa8a4676599b1a9 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Runnytu < runnytu at gmail dot com >
# Old Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Old Maintainer: Jonas Heinrich <onny@project-insanity.org>
# Contributor: tobias <tobias@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>
# Contributor: Neil Romig <neilromig@gmail.com>

pkgname=courier-authlib-devel
_pkgname=${pkgname%-*}
pkgver=0.72.0.20231229
pkgrel=1
pkgdesc="Authentication library for the Courier mailserver(s)"
arch=(i686 pentium4 x86_64)
license=('GPL2')
url="https://courier-mta.org/authlib/"
backup=('etc/authlib/authdaemonrc' 'etc/authlib/authldaprc' \
        'etc/authlib/authmysqlrc' 'etc/authlib/authpgsqlrc')
_pinned_dependencies=(
  'gcc-libs=14.2.1+r134+gab884fffe3fc'
  'gdbm=1.24'
  'glibc>=2.31'
  'libldap=2.6.9'
  'libtool=2.5.4+r1+gbaa1fe41'
  'libxcrypt=4.4.36'
  'mariadb-libs=11.6.2'
  'pam=1.7.0'
  'postgresql-libs=16.3'
  'sqlite=3.47.2'
)
depends=('openssl' 'perl' 'expect' 'courier-unicode>=2.1' "${_pinned_dependencies[@]}")
makedepends=('libldap')
optdepends=('sqlite: With support for the authsqlite authentication module'
	    'libmariadbclient: With support for the authmysql authentication module'
	    'libldap: With support for the authldap authentication module'
	    'postgresql-libs: With support for the authpgsql authentication module'
	    'pam: With support for the authpam authentication module')
provides=("courier-authlib=${pkgver}")
conflicts=('courier-authlib')
options=(!libtool !staticlibs emptydirs)
install=${_pkgname}.install
source=(https://downloads.sourceforge.net/project/courier/authlib-devel/${pkgver##*.}/${_pkgname}-${pkgver}.tar.bz2
	authdaemond.service
	courier-sysusers.conf)
sha512sums=('23200a3b3316f4983e89e9056018c91654d571ea6811f170a9b98dd440e46333af4839416e365421d6f6e1f2effc876c46e53bc1dc7c13660fa21d92af7e42d0'
            '7855fadbef9e6845868d720f9637cc6fe97814b9d994641a351e48536e1985323f095c708f30abe0f3a0c1cb8e25a746da1bb5b2baf9f63d0498d01df39f843b'
            'c8c7dfd245ca7c6bf9174bb170bb45ff548eaa4c0b4049e3def12cf15f83d98347a0d3e0174dd7aae86c412117eee98f51428e8d3c8df61ccdcb5e929ab939a3')

build() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  ./configure --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libdir=/usr/lib \
    --libexecdir=/usr/lib \
    --with-db=gdbm \
    --with-mailuser=courier \
    --with-mailgroup=courier \
    --with-authpam \
    --with-authpwd \
    --with-authshadow \
    --with-authldap \
    --with-authmysql \
    --with-authpgsql \
    --with-authuserdb \
    --with-authcram \
    --with-authdaemon \
    --with-authdaemonvar=/run/authdaemon
    #--with-authsqlite --with-sqlite-libs
  make
}

package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install

  for _distfile in "${pkgdir}/etc/authlib/"*.dist; do
    # change ownership - this is usually done by the Makefile where it is assumed the user & group already exist
    chown 72:72 "${_distfile}"
    # remove the .dist suffix - mimics the install-configure step of a standard Courier installation
    mv "${_distfile}" "${pkgdir}/etc/authlib/"`basename "${_distfile}" .dist`
  done

  # copy the .schema; mostly refered to as courier.schema -> rename it
  install -Dm 444 authldap.schema  "${pkgdir}/etc/openldap/schema/courier.schema"

  chown 72:72 "${pkgdir}/usr/lib/courier-authlib"

  # Install systemd sysuser file
  install -Dm 644 "$srcdir/courier-sysusers.conf" "${pkgdir}/usr/lib/sysusers.d/courier.conf"

  # Install service file
  install -Dm 644 "${srcdir}/authdaemond.service" "${pkgdir}/usr/lib/systemd/system/authdaemond.service"

  mkdir -p "$pkgdir/var/spool/courier"

  echo '/usr/lib/courier-authlib' \
    | install -Dm 644 '/dev/stdin' "${pkgdir}/etc/ld.so.conf.d/courier-authlib.conf"

  rmdir "${pkgdir}/run/authdaemon"

}