2023-09-18 13:43:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
trait ldap
|
|
|
|
|
{
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2023-10-01 01:06:11 +08:00
|
|
|
$alt = '';
|
|
|
|
|
// openssl support
|
|
|
|
|
$alt .= $this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? '--with-tls=openssl ' : '';
|
|
|
|
|
// gmp support
|
|
|
|
|
$alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : '';
|
|
|
|
|
// libsodium support
|
|
|
|
|
$alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '';
|
2023-09-18 13:43:58 +02:00
|
|
|
shell()->cd($this->source_dir)
|
|
|
|
|
->exec(
|
2023-09-23 14:10:35 +08:00
|
|
|
$this->builder->makeAutoconfFlags(AUTOCONF_LDFLAGS | AUTOCONF_CPPFLAGS) .
|
2023-09-18 13:43:58 +02:00
|
|
|
' ./configure ' .
|
|
|
|
|
'--enable-static ' .
|
|
|
|
|
'--disable-shared ' .
|
|
|
|
|
'--disable-slapd ' .
|
2023-09-21 12:56:52 +02:00
|
|
|
'--disable-slurpd ' .
|
2023-09-18 13:43:58 +02:00
|
|
|
'--without-systemd ' .
|
2023-09-23 14:10:35 +08:00
|
|
|
'--without-cyrus-sasl ' .
|
2023-10-01 01:06:11 +08:00
|
|
|
$alt .
|
2023-09-18 13:43:58 +02:00
|
|
|
'--prefix='
|
|
|
|
|
)
|
|
|
|
|
->exec('make clean')
|
2023-09-23 14:10:35 +08:00
|
|
|
// remove tests and doc to prevent compile failed with error: soelim not found
|
|
|
|
|
->exec('sed -i -e "s/SUBDIRS= include libraries clients servers tests doc/SUBDIRS= include libraries clients servers/g" Makefile')
|
2023-09-18 13:43:58 +02:00
|
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
|
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
|
|
|
$this->patchPkgconfPrefix(['ldap.pc', 'lber.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|