diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-09-25 00:43:31 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-09-28 09:42:24 -0500 |
commit | 9368ef42cea4e1e46f22628cffaa29fba66cfec6 (patch) | |
tree | cef737e524f9d19f919a5f3e260cc4bad6b35121 /base | |
parent | 854ecce0fc312e65804d84041cbc93b17cce88a5 (diff) | |
download | pki-9368ef42cea4e1e46f22628cffaa29fba66cfec6.tar.gz pki-9368ef42cea4e1e46f22628cffaa29fba66cfec6.tar.xz pki-9368ef42cea4e1e46f22628cffaa29fba66cfec6.zip |
Added VERSION file.
The CMake scripts have been modified to store the version number
in /usr/share/pki/VERSION and in JAR manifest files. These files
can be read by PKI applications to obtain the version number
without having to query the RPM database.
Fixed warnings in Java.cmake file.
Ticket #339
Diffstat (limited to 'base')
25 files changed, 180 insertions, 0 deletions
diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index 734057374..310a3e3c8 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -16,20 +16,35 @@ if (APPLICATION_FLAVOR_PKI_CORE) add_subdirectory(ocsp) add_subdirectory(tks) add_subdirectory(silent) + if(WITH_JAVADOC) add_subdirectory(javadoc) endif(WITH_JAVADOC) + + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/VERSION ${APPLICATION_VERSION}) + + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/VERSION + DESTINATION + ${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME} + ) + endif (APPLICATION_FLAVOR_PKI_CORE) + if (APPLICATION_FLAVOR_PKI_RA) add_subdirectory(ra) endif (APPLICATION_FLAVOR_PKI_RA) + if (APPLICATION_FLAVOR_PKI_TPS) add_subdirectory(tps) endif (APPLICATION_FLAVOR_PKI_TPS) + if (APPLICATION_FLAVOR_PKI_CONSOLE) add_subdirectory(test) add_subdirectory(console) endif (APPLICATION_FLAVOR_PKI_CONSOLE) + if (APPLICATION_FLAVOR_PKI_MIGRATE) add_subdirectory(test) add_subdirectory(migrate) diff --git a/base/ca/src/CMakeLists.txt b/base/ca/src/CMakeLists.txt index 09cea8ac2..9bfbb23a2 100644 --- a/base/ca/src/CMakeLists.txt +++ b/base/ca/src/CMakeLists.txt @@ -46,9 +46,18 @@ javac(pki-ca-classes symkey pki-nsutil pki-cmsutil pki-certsrv pki-cms pki-cmscore ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-ca.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-ca.mf +) + jar(pki-ca-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-ca-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-ca.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/ca/src/pki-ca.mf b/base/ca/src/pki-ca.mf new file mode 100644 index 000000000..056f7bc08 --- /dev/null +++ b/base/ca/src/pki-ca.mf @@ -0,0 +1,2 @@ +Name: pki-ca +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt index fb4f5675e..516c7ad2d 100644 --- a/base/common/src/CMakeLists.txt +++ b/base/common/src/CMakeLists.txt @@ -136,9 +136,18 @@ javac(pki-certsrv-classes pki-nsutil pki-cmsutil ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-certsrv.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-certsrv.mf +) + jar(pki-certsrv-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-certsrv-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-certsrv.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES @@ -187,9 +196,18 @@ javac(pki-cms-classes pki-nsutil pki-cmsutil pki-certsrv ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-cms.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-cms.mf +) + jar(pki-cms-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-cms-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-cms.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES @@ -232,9 +250,18 @@ javac(pki-tomcat-classes pki-cms ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-tomcat.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-tomcat.mf +) + jar(pki-tomcat-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-tomcat-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-tomcat.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES @@ -281,9 +308,18 @@ javac(pki-cmscore-classes pki-nsutil pki-cmsutil pki-certsrv pki-cms pki-tomcat ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-cmscore.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-cmscore.mf +) + jar(pki-cmscore-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-cmscore-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-cmscore.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES @@ -313,9 +349,18 @@ set(PKI_CMSCORE_JAR ${CMAKE_BINARY_DIR}/dist/pki-cmscore.jar CACHE INTERNAL "pki # build pki-cmsbundle +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-cmsbundle.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-cmsbundle.mf +) + jar(pki-cmsbundle-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-cmsbundle-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-cmsbundle.mf FILES LogMessages.properties UserMessages.properties diff --git a/base/common/src/pki-certsrv.mf b/base/common/src/pki-certsrv.mf new file mode 100644 index 000000000..fe2ed1ffe --- /dev/null +++ b/base/common/src/pki-certsrv.mf @@ -0,0 +1,2 @@ +Name: pki-certsrv +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/common/src/pki-cms.mf b/base/common/src/pki-cms.mf new file mode 100644 index 000000000..2c6f8010f --- /dev/null +++ b/base/common/src/pki-cms.mf @@ -0,0 +1,2 @@ +Name: pki-cms +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/common/src/pki-cmsbundle.mf b/base/common/src/pki-cmsbundle.mf new file mode 100644 index 000000000..84d6f0e7a --- /dev/null +++ b/base/common/src/pki-cmsbundle.mf @@ -0,0 +1,2 @@ +Name: pki-cmsbundle +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/common/src/pki-cmscore.mf b/base/common/src/pki-cmscore.mf new file mode 100644 index 000000000..1b1a03f50 --- /dev/null +++ b/base/common/src/pki-cmscore.mf @@ -0,0 +1,2 @@ +Name: pki-cmscore +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/common/src/pki-tomcat.mf b/base/common/src/pki-tomcat.mf new file mode 100644 index 000000000..a6e4889b8 --- /dev/null +++ b/base/common/src/pki-tomcat.mf @@ -0,0 +1,2 @@ +Name: pki-tomcat +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/console/src/CMakeLists.txt b/base/console/src/CMakeLists.txt index 335411e39..f53f2ddd7 100644 --- a/base/console/src/CMakeLists.txt +++ b/base/console/src/CMakeLists.txt @@ -98,10 +98,19 @@ javac(pki-console-classes ${CMAKE_BINARY_DIR}/classes ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-console.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-console.mf +) + # package console classes and resources jar(pki-console-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-console-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-console.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/console/src/pki-console.mf b/base/console/src/pki-console.mf new file mode 100644 index 000000000..91ec08905 --- /dev/null +++ b/base/console/src/pki-console.mf @@ -0,0 +1,2 @@ +Name: pki-console +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/java-tools/src/CMakeLists.txt b/base/java-tools/src/CMakeLists.txt index c01b425a6..d2169e1c2 100644 --- a/base/java-tools/src/CMakeLists.txt +++ b/base/java-tools/src/CMakeLists.txt @@ -97,9 +97,18 @@ javac(pki-tools-classes pki-nsutil pki-cmsutil pki-certsrv ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-tools.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-tools.mf +) + jar(pki-tools-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-tools-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-tools.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java index a6350e5d8..44ccf9511 100644 --- a/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java +++ b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java @@ -50,6 +50,11 @@ public class MainCLI extends CLI { addModule(new UserCLI(this)); } + public void printVersion() { + Package pkg = MainCLI.class.getPackage(); + System.out.println("PKI Command-Line Interface "+pkg.getImplementationVersion()); + } + public void printHelp() { formatter.printHelp(name+" [OPTIONS..] <command> [ARGS..]", options); @@ -118,6 +123,7 @@ public class MainCLI extends CLI { options.addOption("v", false, "Verbose"); options.addOption(null, "help", false, "Help"); + options.addOption(null, "version", false, "Version"); } public void parseOptions(CommandLine cmd) throws URISyntaxException { @@ -170,6 +176,11 @@ public class MainCLI extends CLI { String[] cmdArgs = cmd.getArgs(); + if (cmd.hasOption("version")) { + printVersion(); + System.exit(1); + } + if (cmdArgs.length == 0 || cmd.hasOption("help")) { printHelp(); System.exit(1); diff --git a/base/java-tools/src/pki-tools.mf b/base/java-tools/src/pki-tools.mf new file mode 100644 index 000000000..3cf1821aa --- /dev/null +++ b/base/java-tools/src/pki-tools.mf @@ -0,0 +1,2 @@ +Name: pki-tools +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/kra/src/CMakeLists.txt b/base/kra/src/CMakeLists.txt index 5f5e3f016..1d4f75b69 100644 --- a/base/kra/src/CMakeLists.txt +++ b/base/kra/src/CMakeLists.txt @@ -91,9 +91,18 @@ javac(pki-kra-classes symkey pki-nsutil pki-cmsutil pki-certsrv pki-cms pki-cmscore ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-kra.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-kra.mf +) + jar(pki-kra-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-kra-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-kra.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/kra/src/pki-kra.mf b/base/kra/src/pki-kra.mf new file mode 100644 index 000000000..3234421e7 --- /dev/null +++ b/base/kra/src/pki-kra.mf @@ -0,0 +1,2 @@ +Name: pki-kra +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/ocsp/src/CMakeLists.txt b/base/ocsp/src/CMakeLists.txt index 34b1ec4c2..2ea6a1536 100644 --- a/base/ocsp/src/CMakeLists.txt +++ b/base/ocsp/src/CMakeLists.txt @@ -91,9 +91,18 @@ javac(pki-ocsp-classes symkey pki-nsutil pki-cmsutil pki-certsrv pki-cms pki-cmscore ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-ocsp.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-ocsp.mf +) + jar(pki-ocsp-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-ocsp-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-ocsp.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/ocsp/src/pki-ocsp.mf b/base/ocsp/src/pki-ocsp.mf new file mode 100644 index 000000000..999e7d992 --- /dev/null +++ b/base/ocsp/src/pki-ocsp.mf @@ -0,0 +1,2 @@ +Name: pki-ocsp +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/silent/src/CMakeLists.txt b/base/silent/src/CMakeLists.txt index 0240439ce..00e1c4e46 100644 --- a/base/silent/src/CMakeLists.txt +++ b/base/silent/src/CMakeLists.txt @@ -39,9 +39,18 @@ javac(pki-silent-classes symkey pki-cmsutil pki-nsutil pki-certsrv pki-cms ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-silent.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-silent.mf +) + jar(pki-silent-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-silent-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-silent.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/silent/src/pki-silent.mf b/base/silent/src/pki-silent.mf new file mode 100644 index 000000000..5b66b7ffc --- /dev/null +++ b/base/silent/src/pki-silent.mf @@ -0,0 +1,2 @@ +Name: pki-silent +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/tks/src/CMakeLists.txt b/base/tks/src/CMakeLists.txt index 10660f511..cb901c446 100644 --- a/base/tks/src/CMakeLists.txt +++ b/base/tks/src/CMakeLists.txt @@ -92,9 +92,18 @@ javac(pki-tks-classes symkey pki-nsutil pki-cmsutil pki-certsrv pki-cms pki-cmscore ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-tks.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-tks.mf +) + jar(pki-tks-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-tks-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-tks.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/tks/src/pki-tks.mf b/base/tks/src/pki-tks.mf new file mode 100644 index 000000000..a9f3a3e50 --- /dev/null +++ b/base/tks/src/pki-tks.mf @@ -0,0 +1,2 @@ +Name: pki-tks +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/util/src/CMakeLists.txt b/base/util/src/CMakeLists.txt index 0f8eb496f..a39d9d828 100644 --- a/base/util/src/CMakeLists.txt +++ b/base/util/src/CMakeLists.txt @@ -57,9 +57,18 @@ javac(pki-nsutil-classes ${CMAKE_BINARY_DIR}/classes ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-nsutil.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-nsutil.mf +) + jar(pki-nsutil-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-nsutil-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-nsutil.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES @@ -101,9 +110,18 @@ javac(pki-cmsutil-classes pki-nsutil ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pki-cmsutil.mf + ${CMAKE_CURRENT_BINARY_DIR}/pki-cmsutil.mf +) + jar(pki-cmsutil-jar CREATE ${CMAKE_BINARY_DIR}/dist/pki-cmsutil-${APPLICATION_VERSION}.jar + OPTIONS + m + PARAMS + ${CMAKE_CURRENT_BINARY_DIR}/pki-cmsutil.mf INPUT_DIR ${CMAKE_BINARY_DIR}/classes FILES diff --git a/base/util/src/pki-cmsutil.mf b/base/util/src/pki-cmsutil.mf new file mode 100644 index 000000000..87382b9aa --- /dev/null +++ b/base/util/src/pki-cmsutil.mf @@ -0,0 +1,2 @@ +Name: pki-cmsutil +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file diff --git a/base/util/src/pki-nsutil.mf b/base/util/src/pki-nsutil.mf new file mode 100644 index 000000000..272200d67 --- /dev/null +++ b/base/util/src/pki-nsutil.mf @@ -0,0 +1,2 @@ +Name: pki-nsutil +Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file |