2023-09-18 13:43:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
trait ldap
|
|
|
|
|
{
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
|
|
|
|
shell()->cd($this->source_dir)
|
|
|
|
|
->exec(
|
|
|
|
|
$this->builder->configure_env . ' ' .
|
2023-09-21 12:56:52 +02:00
|
|
|
'CC="musl-gcc -I' . BUILD_INCLUDE_PATH . '" ' .
|
|
|
|
|
'LDFLAGS="-static -L' . BUILD_LIB_PATH . '" ' .
|
|
|
|
|
($this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? 'LIBS="-lssl -lcrypto -lz" ' : '') .
|
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-21 12:56:52 +02:00
|
|
|
($this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? '--with-tls=openssl ' : '') .
|
|
|
|
|
($this->builder->getLib('gmp') ? '--with-mp=gmp ' : '') .
|
|
|
|
|
($this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '') .
|
2023-09-18 13:43:58 +02:00
|
|
|
'--prefix='
|
|
|
|
|
)
|
|
|
|
|
->exec('make clean')
|
|
|
|
|
->exec('make depend')
|
|
|
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
|
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
|
|
|
$this->patchPkgconfPrefix(['ldap.pc', 'lber.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|