Rebase to LDAP SDK 5.5.0

Resolves: RHEL-34241
This commit is contained in:
Endi S. Dewata 2024-04-25 10:16:09 -05:00
parent bfadd8129d
commit 203b05e199
10 changed files with 181 additions and 91 deletions

4
.gitignore vendored
View File

@ -11,5 +11,9 @@ ldapjdk-4.18.tar.gz
/ldap-sdk-5.2.0-beta1.tar.gz
/ldap-sdk-5.2.0-beta2.tar.gz
/ldap-sdk-5.2.0.tar.gz
/ldap-sdk-5.3.0-beta1.tar.gz
/ldap-sdk-5.3.0.tar.gz
/ldap-sdk-5.4.0.tar.gz
/ldap-sdk-5.4.1.tar.gz
/ldap-sdk-5.5.0-alpha4.tar.gz
/ldap-sdk-5.5.0.tar.gz

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# recipients: rhcs-team
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -2,12 +2,12 @@
Name: ldapjdk
################################################################################
%global product_id dogtag-ldapjdk
%global product_id idm-ldapjdk
# Upstream version number:
%global major_version 5
%global minor_version 4
%global update_version 1
%global minor_version 5
%global update_version 0
# Downstream release number:
# - development/stabilization (unsupported): 0.<n> where n >= 1
@ -26,8 +26,8 @@ Name: ldapjdk
Summary: LDAP SDK
URL: https://github.com/dogtagpki/ldap-sdk
License: MPL-1.1 or GPL-2.0-or-later or LGPL-2.1-or-later
Version: 5.4.1
Release: 4%{?dist}
Version: %{major_version}.%{minor_version}.%{update_version}
Release: %{release_number}%{?phase:.}%{?phase}%{?timestamp:.}%{?timestamp}%{?commit_id:.}%{?commit_id}%{?dist}
# To create a tarball from a version tag:
# $ git archive \
@ -63,10 +63,10 @@ ExclusiveArch: %{java_arches} noarch
BuildRequires: ant
BuildRequires: %{java_devel}
BuildRequires: javapackages-local
BuildRequires: slf4j
BuildRequires: slf4j-jdk14
BuildRequires: jss = 5.4
BuildRequires: maven-local
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-jdk14)
BuildRequires: mvn(org.dogtagpki.jss:jss-base) >= 5.5.0
%description
The Mozilla LDAP SDKs enable you to write applications which access,
@ -79,10 +79,9 @@ manage, and update the information stored in an LDAP directory.
Summary: LDAP SDK
Requires: %{java_headless}
Requires: jpackage-utils >= 0:1.5
Requires: slf4j
Requires: slf4j-jdk14
Requires: jss = 5.4
Requires: mvn(org.slf4j:slf4j-api)
Requires: mvn(org.slf4j:slf4j-jdk14)
Requires: mvn(org.dogtagpki.jss:jss-base) >= 5.5.0
Obsoletes: ldapjdk < %{version}-%{release}
Provides: ldapjdk = %{version}-%{release}
@ -115,38 +114,40 @@ Javadoc for LDAP SDK
%autosetup -n ldap-sdk-%{version}%{?phase:-}%{?phase} -p 1
# flatten-maven-plugin is not available in RPM
%pom_remove_plugin org.codehaus.mojo:flatten-maven-plugin
# specify Maven artifact locations
%mvn_file org.dogtagpki.ldap-sdk:ldapjdk ldapjdk/ldapjdk ldapjdk
%mvn_file org.dogtagpki.ldap-sdk:ldapbeans ldapjdk/ldapbeans ldapbeans
%mvn_file org.dogtagpki.ldap-sdk:ldapfilter ldapjdk/ldapfilter ldapfilt
%mvn_file org.dogtagpki.ldap-sdk:ldapsp ldapjdk/ldapsp ldapsp
%mvn_file org.dogtagpki.ldap-sdk:ldaptools ldapjdk/ldaptools ldaptools
################################################################################
%build
################################################################################
export JAVA_HOME=%{java_home}
./build.sh \
%{?_verbose:-v} \
--work-dir=%{_vpath_builddir} \
dist
%mvn_build
################################################################################
%install
################################################################################
./build.sh \
%{?_verbose:-v} \
--work-dir=%{_vpath_builddir} \
--java-lib-dir=%{_javadir} \
--javadoc-dir=%{_javadocdir} \
--install-dir=%{buildroot} \
install
%mvn_install
ln -sf %{name}/ldapjdk.pom %{buildroot}%{_mavenpomdir}/JPP-ldapjdk.pom
ln -sf %{name}/ldapsp.pom %{buildroot}%{_mavenpomdir}/JPP-ldapsp.pom
ln -sf %{name}/ldapfilter.pom %{buildroot}%{_mavenpomdir}/JPP-ldapfilter.pom
ln -sf %{name}/ldapbeans.pom %{buildroot}%{_mavenpomdir}/JPP-ldapbeans.pom
ln -sf %{name}/ldaptools.pom %{buildroot}%{_mavenpomdir}/JPP-ldaptools.pom
################################################################################
%files -n %{product_id}
%files -n %{product_id} -f .mfiles
################################################################################
%{_javadir}/ldapjdk.jar
%{_javadir}/ldapsp.jar
%{_javadir}/ldapfilt.jar
%{_javadir}/ldapbeans.jar
%{_javadir}/ldaptools.jar
%{_mavenpomdir}/JPP-ldapjdk.pom
%{_mavenpomdir}/JPP-ldapsp.pom
%{_mavenpomdir}/JPP-ldapfilter.pom
@ -154,67 +155,10 @@ export JAVA_HOME=%{java_home}
%{_mavenpomdir}/JPP-ldaptools.pom
################################################################################
%files -n %{product_id}-javadoc
%files -n %{product_id}-javadoc -f .mfiles-javadoc
################################################################################
%dir %{_javadocdir}/ldapjdk
%{_javadocdir}/ldapjdk/*
################################################################################
%changelog
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jun 16 2023 Packit <hello@packit.dev> - 5.4.1-1
- Updating version to v5.4.1 (Chris Kelley)
- Upstream some spec file changes from Fedora to minimise diff (Chris Kelley)
- Introduce Packit configuration for ldapjdk (Chris Kelley)
* Tue Feb 07 2023 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.3.0-1
- Rebase to LDAP SDK 5.3.0
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.0-1.3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.0-1.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jul 08 2022 Jiri Vanek <jvanek@redhat.com> - 5.2.0-1.1
- Rebuilt for Drop i686 JDKs
* Thu Jun 30 2022 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.2.0-1
- Rebase to LDAP SDK 5.2.0
* Fri Apr 29 2022 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.2.0-0.3.beta2
- Rebase to LDAP SDK 5.2.0-beta2
- Rename packages to dogtag-ldapjdk
* Mon Apr 11 2022 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.2.0-0.2.beta1
- Rebase to LDAP SDK 5.2.0-beta1
* Mon Feb 14 2022 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.1.0-1
- Rebase to LDAP SDK 5.1.0
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 5.0.0-3
- Rebuilt for java-17-openjdk as system jdk
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Sep 30 2021 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.0.0-1
- Rebase to LDAP SDK 5.0.0
* Thu Aug 12 2021 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.0.0-0.3.alpha2
- Rebase to LDAP SDK 5.0.0-alpha2
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-0.2.alpha1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jun 22 2021 Dogtag PKI Team <devel@lists.dogtagpki.org> - 5.0.0-0.1.alpha1
- Rebase to LDAP SDK 5.0.0-alpha1
* Thu Apr 25 2024 Red Hat PKI Team <rhcs-maint@redhat.com> - 5.5.0-1
- Rebase to LDAP SDK 5.5.0

3
rpminspect.yaml Normal file
View File

@ -0,0 +1,3 @@
---
inspections:
javabytecode: off

View File

@ -1 +1 @@
SHA512 (ldap-sdk-5.4.1.tar.gz) = f63d2f309284bb27d5e2d5714e310f1f5df97eb77883b741b4c9dd69f044428da9907e278b776b12a6891790631daffa604c3e82c7dfe1e6c81edab3702e9896
SHA512 (ldap-sdk-5.5.0.tar.gz) = 8f3502a731cfd8275664bdef5413db2fadcb80252b847cd5835de4ff6ba75e975c65aa4ea068ae18d35ecfeccf086a113c2763cf3160144e12b4c58c9b698d59

View File

@ -0,0 +1,25 @@
[DEFAULT]
pki_server_database_password=Secret.123
[CA]
pki_admin_email=caadmin@example.com
pki_admin_name=caadmin
pki_admin_nickname=caadmin
pki_admin_password=Secret.123
pki_admin_uid=caadmin
pki_client_database_password=Secret.123
pki_client_database_purge=False
pki_client_pkcs12_password=Secret.123
pki_ds_base_dn=dc=ca,dc=pki,dc=example,dc=com
pki_ds_database=ca
pki_ds_password=Secret.123
pki_security_domain_name=EXAMPLE
pki_ca_signing_nickname=ca_signing
pki_ocsp_signing_nickname=ca_ocsp_signing
pki_audit_signing_nickname=ca_audit_signing
pki_sslserver_nickname=sslserver
pki_subsystem_nickname=subsystem

View File

@ -0,0 +1,24 @@
#!/bin/bash -ex
# This command needs to be executed as it pulls the machine name
# dynamically.
dscreate create-template /tmp/test_dir/ds.inf
sed -i \
-e "s/;instance_name = .*/instance_name = localhost/g" \
-e "s/;root_password = .*/root_password = Secret.123/g" \
-e "s/;suffix = .*/suffix = dc=example,dc=com/g" \
-e "s/;self_sign_cert = .*/self_sign_cert = False/g" \
/tmp/test_dir/ds.inf
dscreate from-file /tmp/test_dir/ds.inf
ldapadd -h $HOSTNAME -x -D "cn=Directory Manager" -w Secret.123 << EOF
dn: dc=example,dc=com
objectClass: domain
dc: example
dn: dc=pki,dc=example,dc=com
objectClass: domain
dc: pki
EOF

View File

@ -0,0 +1,27 @@
[DEFAULT]
pki_server_database_password=Secret.123
[KRA]
pki_admin_email=kraadmin@example.com
pki_admin_name=kraadmin
pki_admin_nickname=kraadmin
pki_admin_password=Secret.123
pki_admin_uid=kraadmin
pki_client_database_password=Secret.123
pki_client_database_purge=False
pki_client_pkcs12_password=Secret.123
pki_ds_base_dn=dc=kra,dc=pki,dc=example,dc=com
pki_ds_database=kra
pki_ds_password=Secret.123
pki_security_domain_name=EXAMPLE
pki_security_domain_user=caadmin
pki_security_domain_password=Secret.123
pki_storage_nickname=kra_storage
pki_transport_nickname=kra_transport
pki_audit_signing_nickname=kra_audit_signing
pki_sslserver_nickname=sslserver
pki_subsystem_nickname=subsystem

View File

@ -0,0 +1,26 @@
---
- name: Install ldapjdk
dnf:
name: >
ldapjdk
- name: Install required packages
dnf:
name: >
389-ds-base, pki-ca, pki-kra
- name: Creates directory
file: path=/tmp/test_files state=directory
- name: Copying templates to /tmp folder
copy : src=. dest=/tmp/test_dir
- name: Setup DS Service
shell: sh /tmp/test_dir/ds-create.sh
- name: Install CA subsystem
shell: pkispawn -f /tmp/test_dir/ca.cfg -s CA -v
- name: Install KRA subsystem
shell: pkispawn -f /tmp/test_dir/kra.cfg -s KRA -v

30
tests/tests.yml Normal file
View File

@ -0,0 +1,30 @@
- hosts: localhost
remote_user: root
tags:
- classic
roles:
- role: Test_Setup
- role: standard-test-basic
tests:
- verify_spawn_ca:
dir: .
run: "curl http://localhost:8080/ca/admin/ca/getStatus | grep '\"running\"'"
- verify_spawn_kra:
dir: .
run: "curl http://localhost:8080/kra/admin/kra/getStatus | grep '\"running\"'"
- destroy_kra:
dir: .
run: "pkidestroy -i pki-tomcat -s KRA && sleep 5"
- verify_destroy_kra:
dir: .
run: "curl http://localhost:8080/kra/admin/kra/getStatus | grep 'HTTP Status 404'"
- destroy_ca:
dir: .
run: "pkidestroy -i pki-tomcat -s CA"
- verify_destroy_ca:
dir: .
run: "curl http://localhost:8080/ca/admin/ca/getStatus &> testfile.log || true && grep 'Connection refused' testfile.log"
required_packages:
- ldapjdk
- pki-ca
- pki-kra