76.1. perl-net-ssleay-1.96
OpenSSL bindings for perl
| Version | 1.96, release 1 |
| Shelf | perl-cpan — The perl interpreter and every perl-* CPAN module |
| Phase | 40_lang (Languages), 51 of 186 in build order |
| Licence | Artistic-2.0 |
| Homepage | https://metacpan.org/dist/Net-SSLeay |
| Build time | 1.0 SBU |
| Installed size | 1.6 MiB in 83 files |
| Recipe | ports/core/perl-cpan/perl-net-ssleay/kpkgbuild |
About
Net::SSLeay is the Perl binding to OpenSSL’s libssl and libcrypto, an XS module compiled against the openssl port. perl-io-socket-ssl is built on it, and the two are what git send-email loads to send over TLS.
Why it is in KDOS
The comment above the 5 ports from perl-net-ssleay to perl-authen-sasl in script/phases/40_lang/packages.d/perl-cpan.txt:
git send-email's TLS and SMTP authentication are these perl modules, which it loads only when a send needs them: without them every send over TLS or with a login fails, and nothing else notices.
Sources
perl-net-ssleay-1.96.tar.gz(652.8 KiB)
sha256ab213691685fb2a576c669cbc8d9266f8165a31563ad15b7c4030b94adfc0753
upstream: https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.96.tar.gz
archive copy: sources-3/perl-cpan--perl-net-ssleay-1.96.tar.gz
Dependencies
Depends on: perl, openssl, zlib.
Required by (1): perl-io-socket-ssl.
Patches
build.sh applies these; kpkg applies nothing by itself.
openssl-4.patch— Builds Net::SSLeay against OpenSSL 4, inSSLeay.xsand the documentation inlib/Net/SSLeay.pod. It readsASN1_STRINGcontents through the accessor functions (ASN1_STRING_get0_data,ASN1_STRING_length,ASN1_STRING_type) instead of the structure’s fields, inASN1_TIME_timet,X509_get_subjectAltNamesandP_ASN1_TIME_get_isotime, andP_ASN1_TIME_set_isotimesets the time withASN1_TIME_set_stringinstead of filling in anASN1_TIMEon the stack. When OpenSSL is 4 or later it drops the bindings of the single-version methods (SSLv3_method, andTLSv1_method,TLSv1_1_methodandTLSv1_2_methodwith their client and server forms) andCTX_v3_new, and keepsCTX_tlsv1_new,CTX_tlsv1_1_newandCTX_tlsv1_2_newby building each fromTLS_methodwith the minimum and maximum protocol version set to that one version.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/40_lang/phase.env && kpkg install perl-net-ssleay'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/perl-cpan/perl-net-ssleay.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/perl-cpan/perl-net-ssleay
echo 'ab213691685fb2a576c669cbc8d9266f8165a31563ad15b7c4030b94adfc0753 perl-net-ssleay-1.96.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/perl-net-ssleay
SRC=$SRC_ROOT/perl-net-ssleay-1.96
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf perl-net-ssleay-1.96.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/openssl-4.patch"
export OPENSSL_PREFIX=/usr PERL_MM_USE_DEFAULT=1
perl Makefile.PL INSTALLDIRS=vendor
make
make DESTDIR=$PKG install
find "$PKG" -name .packlist -delete
find "$PKG" -name perllocal.pod -delete
find "$PKG" -type d -empty -delete
The switches, and why each is set:
OPENSSL_PREFIX=/usr— WhereMakefile.PLfinds OpenSSL. Unset, it looks for anopensslprogram in a list of places and takes the first it finds, and Homebrew’s, LinuxBrew’s,/usr/localand MacPorts’/opt/localall come before/usr.PERL_MM_USE_DEFAULT=1— Answer everyprompt()inMakefile.PLwith its default. The one question asks whether to run the external tests, which need the network; the default is no.INSTALLDIRS=vendor— Install into perl’s vendor directories, the place for modules that the distribution packages, rather than the site directories kept for modules a user installs later.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/perl-net-ssleay, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf perl-net-ssleay-1.96-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/perl-net-ssleay, and runs the triggers its paths call for.
Contents
Installed directories: /usr/lib/perl5/vendor_perl/Net, /usr/lib/perl5/vendor_perl/auto/Net, /usr/share/licenses/perl-net-ssleay.
Notes
Makefile.PL exits with status 0 and writes no Makefile when it cannot find OpenSSL, so such a failure shows up at the next step, where make finds no makefile.
The find lines after the install remove .packlist and perllocal.pod, MakeMaker’s records of what it installed, which kpkg’s own database replaces, and the empty directories they leave.