git: be7d044437f6 - main - devel/p5-Test-OpenLDAP: update to 0.72

From: Rodrigo Osorio <rodrigo_at_FreeBSD.org>
Date: Fri, 23 Feb 2024 22:52:28 UTC
The branch main has been updated by rodrigo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=be7d044437f61c0740f3e3baf27f13397c29a53b

commit be7d044437f61c0740f3e3baf27f13397c29a53b
Author:     Rodrigo Osorio <rodrigo@FreeBSD.org>
AuthorDate: 2024-02-23 08:22:36 +0000
Commit:     Rodrigo Osorio <rodrigo@FreeBSD.org>
CommitDate: 2024-02-23 22:51:41 +0000

    devel/p5-Test-OpenLDAP: update to 0.72
    
    Changelog: https://metacpan.org/release/DDICK/Test-OpenLDAP-0.72/source/Changes
---
 devel/p5-Test-OpenLDAP/Makefile                    | 16 ++----
 devel/p5-Test-OpenLDAP/distinfo                    |  5 +-
 devel/p5-Test-OpenLDAP/files/patch-OpenLDAP.pm     | 65 ----------------------
 .../files/patch-lib_Test_OpenLDAP.pm               | 30 ++++++++++
 4 files changed, 37 insertions(+), 79 deletions(-)

diff --git a/devel/p5-Test-OpenLDAP/Makefile b/devel/p5-Test-OpenLDAP/Makefile
index 9df623458b27..278d087c517d 100644
--- a/devel/p5-Test-OpenLDAP/Makefile
+++ b/devel/p5-Test-OpenLDAP/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	Test-OpenLDAP
-PORTVERSION=	0.05
-PORTREVISION=	6
+PORTVERSION=	0.72
 CATEGORIES=	devel perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
@@ -12,22 +11,15 @@ WWW=		https://metacpan.org/release/Test-OpenLDAP
 LICENSE=	ART10 GPLv1+
 LICENSE_COMB=	dual
 
-RUN_DEPENDS=	\
-	p5-Data-UUID>0:devel/p5-Data-UUID \
-	p5-perl-ldap>0:net/p5-perl-ldap
 BUILD_DEPENDS=	${RUN_DEPENDS}
+RUN_DEPENDS=	p5-Data-UUID>0:devel/p5-Data-UUID \
+		p5-perl-ldap>0:net/p5-perl-ldap
 
-NO_ARCH=	yes
 USES=		ldap:server perl5
 USE_PERL5=	configure
 
 CONFIGURE_ENV=	PATH=${PATH}:${PREFIX}/libexec
 
-post-patch:
-	${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
-		-e 's|/usr/lib/openldap|${LOCALBASE}/libexec|' \
-		${WRKSRC}/lib/Test/OpenLDAP.pm
-	${RM} ${WRKSRC}/lib/Test/OpenLDAP.pm.bak \
-		${WRKSRC}/lib/Test/OpenLDAP.pm.orig
+NO_ARCH=	yes
 
 .include <bsd.port.mk>
diff --git a/devel/p5-Test-OpenLDAP/distinfo b/devel/p5-Test-OpenLDAP/distinfo
index e05b84d057a5..3966e8abce7b 100644
--- a/devel/p5-Test-OpenLDAP/distinfo
+++ b/devel/p5-Test-OpenLDAP/distinfo
@@ -1,2 +1,3 @@
-SHA256 (Test-OpenLDAP-0.05.tar.gz) = 9af0cfa9eb6d851422ceee6f6208d7ccfcf2680de49c5ed36320f5e721782761
-SIZE (Test-OpenLDAP-0.05.tar.gz) = 20747
+TIMESTAMP = 1708636855
+SHA256 (Test-OpenLDAP-0.72.tar.gz) = ee8ce6cf33c6bca17da71f72a3ec82af2af040a6dc195b4c5e12e5718d91f90e
+SIZE (Test-OpenLDAP-0.72.tar.gz) = 22942
diff --git a/devel/p5-Test-OpenLDAP/files/patch-OpenLDAP.pm b/devel/p5-Test-OpenLDAP/files/patch-OpenLDAP.pm
deleted file mode 100644
index 3a83f2fb73da..000000000000
--- a/devel/p5-Test-OpenLDAP/files/patch-OpenLDAP.pm
+++ /dev/null
@@ -1,65 +0,0 @@
---- lib/Test/OpenLDAP.pm.orig	2013-03-13 10:05:02 UTC
-+++ lib/Test/OpenLDAP.pm
-@@ -95,6 +95,8 @@ sub new {
-       File::Spec->catdir( $self->{slapd_d_directory}, 'cn=config' );
-     $self->{cn_schema_directory} =
-       File::Spec->catdir( $self->{cn_config_directory}, 'cn=schema' );
-+    $self->{cn_module_ldif_path} =
-+      File::Spec->catfile( $self->{cn_config_directory}, 'cn=module{0}.ldif' );
-     $self->{cn_schema_ldif_path} =
-       File::Spec->catfile( $self->{cn_config_directory}, 'cn=schema.ldif' );
-     $self->{cn_schema_core_ldif_path} =
-@@ -123,6 +125,7 @@ sub new {
-     mkdir $self->{db_directory}, oct USER_READ_WRITE_EXECUTE_PERMISSIONS()
-       or Carp::croak("Failed to mkdir $self->{db_directory}:$OS_ERROR");
-     $self->_create_config_ldif();
-+    $self->_create_module_ldif();
-     $self->_create_schema_ldif();
-     $self->_create_schema_core_ldif();
-     $self->{olc_database_for_config} = '{0}config';
-@@ -372,6 +375,34 @@ __CONFIG_LDIF__
-     return;
- }
- 
-+sub _create_module_ldif {
-+    my ($self)      = @_;
-+    my $write_flags = Fcntl::O_WRONLY() | Fcntl::O_CREAT() | Fcntl::O_EXCL();
-+    my $uuid        = lc $self->_uuid();
-+    my $entry_csn   = $self->_entry_csn();
-+    my $create_timestamp = POSIX::strftime( '%Y%m%d%H%M%SZ', gmtime time );
-+    my $handle = FileHandle->new( $self->{cn_module_ldif_path},
-+        $write_flags, oct USER_READ_WRITE_PERMISSIONS() )
-+      or Carp::croak(
-+        "Failed to open '$self->{cn_module_ldif_path}' for writing:$OS_ERROR");
-+    $handle->print(
-+        <<"__MODULE_LDIF__") or Carp::croak("Failed to write to '$self->{cn_module_ldif_path}':$OS_ERROR");
-+dn: cn=module{0}
-+objectClass: olcModuleList
-+cn: module{0}
-+olcModulePath: %%LOCALBASE%%/libexec/openldap
-+olcModuleLoad: {0}back_bdb
-+olcModuleLoad: {1}back_hdb
-+structuralObjectClass: olcModuleList
-+entryUUID: $uuid
-+creatorsName: cn=config
-+createTimestamp: $create_timestamp
-+entryCSN: $entry_csn
-+modifiersName: cn=config
-+modifyTimestamp: $create_timestamp
-+__MODULE_LDIF__
-+}
-+
- sub _create_schema_ldif {
-     my ($self)      = @_;
-     my $write_flags = Fcntl::O_WRONLY() | Fcntl::O_CREAT() | Fcntl::O_EXCL();
-@@ -1697,6 +1728,10 @@ sub DESTROY {
-       or Carp::croak(
-         "Failed to unlink '$self->{olc_database_config_path}':$OS_ERROR");
-     $self->_remove_cn_schema_directory();
-+    unlink $self->{cn_module_ldif_path}
-+      or ( $OS_ERROR == POSIX::ENOENT() )
-+      or Carp::croak(
-+        "Failed to unlink '$self->{cn_module_ldif_path}':$OS_ERROR");
-     rmdir $self->{cn_config_directory}
-       or ( $OS_ERROR == POSIX::ENOENT() )
-       or
diff --git a/devel/p5-Test-OpenLDAP/files/patch-lib_Test_OpenLDAP.pm b/devel/p5-Test-OpenLDAP/files/patch-lib_Test_OpenLDAP.pm
new file mode 100644
index 000000000000..0b40a9173a88
--- /dev/null
+++ b/devel/p5-Test-OpenLDAP/files/patch-lib_Test_OpenLDAP.pm
@@ -0,0 +1,30 @@
+--- lib/Test/OpenLDAP.pm.orig	2024-02-22 23:31:46 UTC
++++ lib/Test/OpenLDAP.pm
+@@ -120,6 +120,7 @@
+ sub _version {
+     my ($self) = @_;
+     my $key = '_slapd_version';
++    local $ENV{PATH} = "$ENV{PATH}$Config{path_sep}/usr/local/libexec";
+     if ( defined $self->{$key} ) {
+     }
+     else {
+@@ -197,7 +198,7 @@
+     {
+         my $path_sep          = $Config{path_sep};
+         my @slapd_directories = split /$path_sep/smx,
+-          "$ENV{PATH}$path_sep/usr/lib/openldap";
++          "$ENV{PATH}$path_sep/usr/local/libexec";
+         my $slapd_path;
+         foreach my $directory (@slapd_directories) {
+             my $possible =
+@@ -250,8 +251,8 @@
+     }
+     elsif ( defined $pid ) {
+         eval {
+-            local $ENV{PATH} = "$ENV{PATH}$Config{path_sep}/usr/lib/openldap"
+-              ;    # adding /usr/lib/openldap for OpenSUSE deployments
++            local $ENV{PATH} = "$ENV{PATH}$Config{path_sep}/usr/local/libexec"
++              ;    # adding /usr/local/libexec for OpenSUSE deployments
+             sysopen STDERR, $dev_null, Fcntl::O_WRONLY()
+               or
+               Carp::croak("Failed to redirect STDERR to $dev_null:$OS_ERROR");