[PATCH] Removal of version numbers from jar file names
The attached patch addresses the following PKI issue: * TRAC Ticket #350 - Dogtag 10: Remove version numbers from PKI jar files . . . This patch was checked against the following PKI services (CA/KRA/OCSP/TKS as a single merged instance): * The Dogtag 10 versions of 'dogtag-pki-theme', 'pki-core', and 'pki-console' were all built, installed, and tested on a 64-bit Fedora 17 machine * None of the java jars under /usr/share/java/pki contain any embedded versions in their names, and there are no more symbolic links * The JNI 'symkey.jar' is a file and contains no embedded version in its name * CA o after reporting the previously encountered 'certutil -a' problem on the admin cert, and manually correcting it, I successfully requested, approved, and issued a certificate using the 'Maual User Dual-Use Certificate Enrollment' profile * KRA o after launching a standalone browser profile (since the KRA admin certificate will not be prompted for since it is running on the same port), the keys were successfully archived using the 'Manual User Signing and Encryption Certificates Enrollment' profile<https://dogtag17-clone.usersys.redhat.com:8443/ca/ee/ca/profileSelect?profileId=caDualCert> * OCSP o after launching another standalone browser profile (since the KRA admin certificate will not be prompted for since it is running on the same port), the command 'OCSPClient server.example.com 8080 /var/lib/pki/pki-tomcat/alias/ "ocspSigningCert cert-pki-tomcat" 23 22.res 1 /ocsp/ee/ocsp' was executed from the command line while performing a 'tail -f /var/log/pki/pki-tomcat/ocsp/debug' which showed communication with the OCSP server * TKS o I successfully launched the URL 'http://server.example.com:8080/tks/services' from a browser * PKI Console o No GUI was presented for the PKI console when invoking 'pkiconsole https://server.example.com:8443/ca', but this appeared to be a display issue, not a problem with the newly named jars If this patch is found to be acceptable in its current incarnation, please feel free to push it to the 'master' branch so that it may be included in the upcoming Beta 2 builds. -- Matt
On 10/26/2012 7:06 PM, Matthew Harmsen wrote:
* The JNI 'symkey.jar' is a file and contains no embedded version in its name
Please take a look at the following code in base/symkey/src/CMakeLists.txt: install( FILES ${CMAKE_BINARY_DIR}/dist/symkey.jar DESTINATION ${LIB_INSTALL_DIR}/symkey -- (A) ) install( FILES ${CMAKE_BINARY_DIR}/dist/symkey.jar DESTINATION ${JAVA_LIB_INSTALL_DIR} -- (B) ) and in pki-core.spec: cd %{buildroot}%{_libdir}/symkey %if 0%{?fedora} >= 16 %{__rm} %{buildroot}%{_jnidir}/symkey.jar -- (C) %{__mv} symkey.jar %{buildroot}%{_jnidir}/symkey.jar -- (D) %else %{__rm} symkey.jar -- (E) %{__ln_s} symkey-%{version}.jar symkey.jar -- (F) %endif %if 0%{?rhel} || 0%{?fedora} < 16 cd %{buildroot}%{_jnidir} %{__rm} symkey.jar -- (G) %{__ln_s} %{_libdir}/symkey/symkey.jar symkey.jar -- (H) %endif Some observations: 1. In A and B the code installs symkey.jar in /usr/lib64/symkey and /usr/lib64/java, respectively. In C the symkey.jar is removed from /usr/lib64/java. In D the symkey.jar is moved from /usr/lib64/symkey to /usr/lib64/java. It seems that the code in A, C, and D is not needed since we have B. 2. The code in E & F doesn't seem to be needed anymore since we don't support anything before F16. 3. The code in G & H removes the symkey.jar in /usr/lib64/java and replaces it with a link to symkey.jar in /usr/lib64/symkey. This is not necessary since we have B. If these are correct we probably can remove everything above except B. Other than that the patch looks good, ACK. -- Endi S. Dewata
Endi, Comments in-line. On 10/27/12 07:33, Endi Sukma Dewata wrote:
On 10/26/2012 7:06 PM, Matthew Harmsen wrote:
* The JNI 'symkey.jar' is a file and contains no embedded version in its name
Please take a look at the following code in base/symkey/src/CMakeLists.txt:
install( FILES ${CMAKE_BINARY_DIR}/dist/symkey.jar DESTINATION ${LIB_INSTALL_DIR}/symkey -- (A) )
'${LIB_INSTALL_DIR}' is defined in 'pki/cmake/Modules/DefineInstallationPaths.cmake' as '${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}' which basically places 'symkey.jar' into 'usr/lib/symkey' (32-bit) or 'usr/lib64/symkey' (64-bit) unless this is being somehow overridden by a newer version of cmake?
install( FILES ${CMAKE_BINARY_DIR}/dist/symkey.jar DESTINATION ${JAVA_LIB_INSTALL_DIR} -- (B) )
'${JAVA_LIB_INSTALL_DIR}' is defined in 'pki/cmake/Modules/DefineInstallationPaths.cmake' as '${CMAKE_INSTALL_PREFIX}/lib/java' which basically places 'symkey.jar' into 'usr/lib/java' (32-bit & 64-bit) unless this is being somehow overridden by a newer version of cmake?
and in pki-core.spec:
cd %{buildroot}%{_libdir}/symkey %if 0%{?fedora} >= 16 %{__rm} %{buildroot}%{_jnidir}/symkey.jar -- (C) %{__mv} symkey.jar %{buildroot}%{_jnidir}/symkey.jar -- (D) %else %{__rm} symkey.jar -- (E) %{__ln_s} symkey-%{version}.jar symkey.jar -- (F) %endif
For Fedora 16 and greater, this removes 'symkey.jar' on 32-bit and removes nothing on 64-bit systems, and moves symkey.jar under the appropriate 'usr/lib/java' (32-bit) and 'usr/lib64/java' (64-bit). This code block may not be necessary if we make the change I suggest below. As RHEL 5, RHEL 6, and Fedora 17 or less are not supported, and we are not yet certain of the RHEL 7 changes for JNI, I agree that the %else code block could be removed.
%if 0%{?rhel} || 0%{?fedora} < 16 cd %{buildroot}%{_jnidir} %{__rm} symkey.jar -- (G) %{__ln_s} %{_libdir}/symkey/symkey.jar symkey.jar -- (H) %endif
Since this code exists on the 'master', and RHEL 5, RHEL 6, and Fedora 15 or less are not supported, and we are not yet certain of the RHEL 7 changes for JNI, I agree that this code block could be removed.
Some observations:
1. In A and B the code installs symkey.jar in /usr/lib64/symkey and /usr/lib64/java, respectively. In C the symkey.jar is removed from /usr/lib64/java. In D the symkey.jar is moved from /usr/lib64/symkey to /usr/lib64/java. It seems that the code in A, C, and D is not needed since we have B.
2. The code in E & F doesn't seem to be needed anymore since we don't support anything before F16.
3. The code in G & H removes the symkey.jar in /usr/lib64/java and replaces it with a link to symkey.jar in /usr/lib64/symkey. This is not necessary since we have B.
If these are correct we probably can remove everything above except B.
Per my comments above, I think that we could remove everything above except B by making the following changes (I need to do test builds on 32-bit and 64-bit systems to prove this theory) from: install( FILES ${CMAKE_BINARY_DIR}/dist/symkey.jar DESTINATION *${JAVA_LIB_INSTALL_DIR}* -- (B) ) to: install( FILES ${CMAKE_BINARY_DIR}/dist/symkey.jar DESTINATION *${LIB_INSTALL_DIR}/java* -- (B) ) Do you agree with this approach?
Other than that the patch looks good, ACK.
participants (2)
-
Endi Sukma Dewata -
Matthew Harmsen