From f8b1537a5d2fb21a92516c0db1596a813ce18548 Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Sun, 30 Sep 2012 12:21:46 -0500
Subject: [PATCH] Using RPM version number in CMake.

The RPM spec files have been modified to pass the full RPM version
number to CMake. The version number contains the product version
number, release number, milestone, and platform. The CMake scritps
will parse and use this version number to generate Java manifest
files. The product version number will be used as the specification
version and full version number will be used as the implementation
version.

Ticket #339
---
 CMakeLists.txt                       | 10 +++++++---
 base/CMakeLists.txt                  |  5 ++++-
 base/VERSION                         |  3 +++
 base/ca/shared/conf/CMakeLists.txt   |  4 ----
 base/ca/shared/conf/CS.cfg.in        |  2 +-
 base/ca/src/pki-ca.mf                |  3 ++-
 base/common/src/pki-certsrv.mf       |  3 ++-
 base/common/src/pki-cms.mf           |  3 ++-
 base/common/src/pki-cmsbundle.mf     |  3 ++-
 base/common/src/pki-cmscore.mf       |  3 ++-
 base/common/src/pki-tomcat.mf        |  3 ++-
 base/console/src/pki-console.mf      |  3 ++-
 base/java-tools/src/pki-tools.mf     |  3 ++-
 base/kra/shared/conf/CMakeLists.txt  |  4 ----
 base/kra/shared/conf/CS.cfg.in       |  2 +-
 base/kra/src/pki-kra.mf              |  3 ++-
 base/ocsp/shared/conf/CMakeLists.txt |  4 ----
 base/ocsp/shared/conf/CS.cfg.in      |  4 ++--
 base/ocsp/src/pki-ocsp.mf            |  3 ++-
 base/ra/doc/CS.cfg.in                |  2 +-
 base/silent/src/pki-silent.mf        |  3 ++-
 base/tks/shared/conf/CMakeLists.txt  |  4 ----
 base/tks/shared/conf/CS.cfg.in       |  4 ++--
 base/tks/src/pki-tks.mf              |  3 ++-
 base/tps/doc/CS.cfg.in               |  2 +-
 base/util/src/pki-cmsutil.mf         |  3 ++-
 base/util/src/pki-nsutil.mf          |  3 ++-
 scripts/compose_pki_core_packages    |  1 +
 specs/dogtag-pki-theme.spec          | 11 +++++++++--
 specs/ipa-pki-theme.spec             |  9 +++++++--
 specs/pki-console.spec               |  8 ++++++--
 specs/pki-core.spec                  |  8 ++++++--
 specs/pki-migrate.spec               | 10 ++++++++--
 specs/pki-ra.spec                    | 12 +++++++++---
 specs/pki-tps.spec                   | 12 +++++++++---
 35 files changed, 105 insertions(+), 58 deletions(-)
 create mode 100644 base/VERSION

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf61fbc48028f133691d166820ad80951a71bf0b..3bb5be00bfdca0ba06000d76b78344db1a0361d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,9 +6,13 @@ cmake_minimum_required(VERSION 2.6.0)
 # global needed variables
 set(APPLICATION_NAME ${PROJECT_NAME})
 
-set(APPLICATION_VERSION_MAJOR "10")
-set(APPLICATION_VERSION_MINOR "0")
-set(APPLICATION_VERSION_PATCH "0")
+if (NOT ${VERSION})
+    set(VERSION "10.0.0")
+endif(NOT ${VERSION})
+
+string(REGEX REPLACE "^([0-9]+).*" "\\1" APPLICATION_VERSION_MAJOR ${VERSION})
+string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" APPLICATION_VERSION_MINOR ${VERSION})
+string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" APPLICATION_VERSION_PATCH ${VERSION})
 
 option(WITH_JAVADOC "Build with Javadoc" ON)
 
diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt
index 310a3e3c8cf1b7f0635e2c0c7b5b984ffdb4ecf2..c0de97171f39e2b520715a4e04abc7af80f73246 100644
--- a/base/CMakeLists.txt
+++ b/base/CMakeLists.txt
@@ -21,7 +21,10 @@ if (APPLICATION_FLAVOR_PKI_CORE)
         add_subdirectory(javadoc)
     endif(WITH_JAVADOC)
 
-    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/VERSION ${APPLICATION_VERSION})
+    configure_file(
+        ${CMAKE_CURRENT_SOURCE_DIR}/VERSION
+        ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+    )
 
     install(
         FILES
diff --git a/base/VERSION b/base/VERSION
new file mode 100644
index 0000000000000000000000000000000000000000..066f31138a9787b79943d349a713c4ee0a30c5c5
--- /dev/null
+++ b/base/VERSION
@@ -0,0 +1,3 @@
+Name: pki
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/ca/shared/conf/CMakeLists.txt b/base/ca/shared/conf/CMakeLists.txt
index e3cef59155e6a464751814a08a37cdb9ed5b8b24..419289d03e616384bc2397d3e9bab41472bae26a 100644
--- a/base/ca/shared/conf/CMakeLists.txt
+++ b/base/ca/shared/conf/CMakeLists.txt
@@ -1,7 +1,3 @@
-set(VERSION ${APPLICATION_VERSION})
-set(MAJOR_VERSION ${APPLICATION_VERSION_MAJOR})
-set(MINOR_VERSION ${APPLICATION_VERSION_MINOR})
-
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CS.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/CS.cfg @ONLY)
 
 install(
diff --git a/base/ca/shared/conf/CS.cfg.in b/base/ca/shared/conf/CS.cfg.in
index 4d148945c57db1084a43e77d60bacb4e6b158559..27c6dd3d753d7ed88daad2b3fb90b11042bc135f 100644
--- a/base/ca/shared/conf/CS.cfg.in
+++ b/base/ca/shared/conf/CS.cfg.in
@@ -734,7 +734,7 @@ cmc.revokeCert.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
 cmc.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
 cms.passwordlist=internaldb,replicationdb
 cms.password.ignore.publishing.failure=true
-cms.version=@MAJOR_VERSION@.@MINOR_VERSION@
+cms.version=@APPLICATION_VERSION_MAJOR@.@APPLICATION_VERSION_MINOR@
 cmsgateway._000=##
 cmsgateway._001=## In the event that all Admin Certificates have been lost
 cmsgateway._002=## for a given instance, perform the following steps to
diff --git a/base/ca/src/pki-ca.mf b/base/ca/src/pki-ca.mf
index 056f7bc081a1688cba4cd7cd586652a2b4650242..ae5a8975f07765cad1822ade005e821f7976d470 100644
--- a/base/ca/src/pki-ca.mf
+++ b/base/ca/src/pki-ca.mf
@@ -1,2 +1,3 @@
 Name: pki-ca
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/common/src/pki-certsrv.mf b/base/common/src/pki-certsrv.mf
index fe2ed1ffef99a22ba8081d775e056b82ef22c874..0614e4d8ca25558f246561ee3db02150fe14c643 100644
--- a/base/common/src/pki-certsrv.mf
+++ b/base/common/src/pki-certsrv.mf
@@ -1,2 +1,3 @@
 Name: pki-certsrv
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/common/src/pki-cms.mf b/base/common/src/pki-cms.mf
index 2c6f8010f179222495343d65044aaaab290c9ebe..4810f3fb0303b4d43dbfc200af5c2f7c5ad7f2d7 100644
--- a/base/common/src/pki-cms.mf
+++ b/base/common/src/pki-cms.mf
@@ -1,2 +1,3 @@
 Name: pki-cms
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/common/src/pki-cmsbundle.mf b/base/common/src/pki-cmsbundle.mf
index 84d6f0e7a40256a309c29171c0a61bd58dccc71d..ee384386e7f3e63ab04e4c2c29cad752ace03263 100644
--- a/base/common/src/pki-cmsbundle.mf
+++ b/base/common/src/pki-cmsbundle.mf
@@ -1,2 +1,3 @@
 Name: pki-cmsbundle
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/common/src/pki-cmscore.mf b/base/common/src/pki-cmscore.mf
index 1b1a03f5094795009885392da67292e9106d8d36..c23d7b2996f392150a7415e6f9212b4d385346f4 100644
--- a/base/common/src/pki-cmscore.mf
+++ b/base/common/src/pki-cmscore.mf
@@ -1,2 +1,3 @@
 Name: pki-cmscore
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/common/src/pki-tomcat.mf b/base/common/src/pki-tomcat.mf
index a6e4889b84847144e3d65b684cefbb3b557ae9cb..ca8d3bf1bd7d1b22a6cfda85d949298e44cab95d 100644
--- a/base/common/src/pki-tomcat.mf
+++ b/base/common/src/pki-tomcat.mf
@@ -1,2 +1,3 @@
 Name: pki-tomcat
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/console/src/pki-console.mf b/base/console/src/pki-console.mf
index 91ec08905f83a1ff837e01aa9933f6128475fedd..4f7799ad3c959c3f1d0bece6149e6036457768df 100644
--- a/base/console/src/pki-console.mf
+++ b/base/console/src/pki-console.mf
@@ -1,2 +1,3 @@
 Name: pki-console
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/java-tools/src/pki-tools.mf b/base/java-tools/src/pki-tools.mf
index 3cf1821aa6c1c7dff5b248e06f77a81214e6dc3d..712f450c04999e8deae357ecb70572cc243b18d6 100644
--- a/base/java-tools/src/pki-tools.mf
+++ b/base/java-tools/src/pki-tools.mf
@@ -1,2 +1,3 @@
 Name: pki-tools
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/kra/shared/conf/CMakeLists.txt b/base/kra/shared/conf/CMakeLists.txt
index e3cef59155e6a464751814a08a37cdb9ed5b8b24..419289d03e616384bc2397d3e9bab41472bae26a 100644
--- a/base/kra/shared/conf/CMakeLists.txt
+++ b/base/kra/shared/conf/CMakeLists.txt
@@ -1,7 +1,3 @@
-set(VERSION ${APPLICATION_VERSION})
-set(MAJOR_VERSION ${APPLICATION_VERSION_MAJOR})
-set(MINOR_VERSION ${APPLICATION_VERSION_MINOR})
-
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CS.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/CS.cfg @ONLY)
 
 install(
diff --git a/base/kra/shared/conf/CS.cfg.in b/base/kra/shared/conf/CS.cfg.in
index c2655fc756b32f774762db32aad3925d6efa8db5..5268a858966988cf7609a855d2acc057bccec19c 100644
--- a/base/kra/shared/conf/CS.cfg.in
+++ b/base/kra/shared/conf/CS.cfg.in
@@ -175,7 +175,7 @@ cmc.lraPopWitness.verify.allow=true
 cmc.revokeCert.verify=true
 cmc.revokeCert.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
 cmc.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
-cms.version=@MAJOR_VERSION@.@MINOR_VERSION@
+cms.version=@APPLICATION_VERSION_MAJOR@.@APPLICATION_VERSION_MINOR@
 dbs.enableSerialManagement=false
 dbs.beginRequestNumber=1
 dbs.endRequestNumber=10000000
diff --git a/base/kra/src/pki-kra.mf b/base/kra/src/pki-kra.mf
index 3234421e7dd149b3642941d1a6994156e2e79bfa..dba4e6c7cadc474c1ac8906be809708b6084a2bb 100644
--- a/base/kra/src/pki-kra.mf
+++ b/base/kra/src/pki-kra.mf
@@ -1,2 +1,3 @@
 Name: pki-kra
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/ocsp/shared/conf/CMakeLists.txt b/base/ocsp/shared/conf/CMakeLists.txt
index e3cef59155e6a464751814a08a37cdb9ed5b8b24..419289d03e616384bc2397d3e9bab41472bae26a 100644
--- a/base/ocsp/shared/conf/CMakeLists.txt
+++ b/base/ocsp/shared/conf/CMakeLists.txt
@@ -1,7 +1,3 @@
-set(VERSION ${APPLICATION_VERSION})
-set(MAJOR_VERSION ${APPLICATION_VERSION_MAJOR})
-set(MINOR_VERSION ${APPLICATION_VERSION_MINOR})
-
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CS.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/CS.cfg @ONLY)
 
 install(
diff --git a/base/ocsp/shared/conf/CS.cfg.in b/base/ocsp/shared/conf/CS.cfg.in
index 0910d66720bd0cf4f32746c74bdd8a08a80107ab..79448104ee3c641be5d2bcf49f56b38d3de3cec0 100644
--- a/base/ocsp/shared/conf/CS.cfg.in
+++ b/base/ocsp/shared/conf/CS.cfg.in
@@ -25,7 +25,7 @@ preop.admincert.profile=caAdminCert
 preop.securitydomain.admin_url=https://[PKI_MACHINE_NAME]:9445
 preop.wizard.name=OCSP Setup Wizard
 preop.product.name=CS
-preop.product.version=@VERSION@
+preop.product.version=@APPLICATION_VERSION@
 preop.system.name=OCSP
 preop.system.fullname=OCSP Responder
 proxy.securePort=[PKI_PROXY_SECURE_PORT]
@@ -159,7 +159,7 @@ cmc.lraPopWitness.verify.allow=true
 cmc.revokeCert.verify=true
 cmc.revokeCert.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
 cmc.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
-cms.version=@MAJOR_VERSION@.@MINOR_VERSION@
+cms.version=@APPLICATION_VERSION_MAJOR@.@APPLICATION_VERSION_MINOR@
 dbs.ldap=internaldb
 dbs.newSchemaEntryAdded=true
 debug.append=true
diff --git a/base/ocsp/src/pki-ocsp.mf b/base/ocsp/src/pki-ocsp.mf
index 999e7d992056b19d9ad991b8ebd33559c171b6d8..1f436c9985fca33f49c5544dc2a8b972b4f40078 100644
--- a/base/ocsp/src/pki-ocsp.mf
+++ b/base/ocsp/src/pki-ocsp.mf
@@ -1,2 +1,3 @@
 Name: pki-ocsp
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/ra/doc/CS.cfg.in b/base/ra/doc/CS.cfg.in
index 0581e3a786515fd1148431d89bbd0467535a20ee..702dda90b18161c124f3ca912402bfa5dc0860dd 100644
--- a/base/ra/doc/CS.cfg.in
+++ b/base/ra/doc/CS.cfg.in
@@ -190,7 +190,7 @@ conn.ca1.timeout=100
 conn.ca1.SSLOn=true
 conn.ca1.keepAlive=true
 preop.pin=[PKI_RANDOM_NUMBER]
-preop.product.version=@VERSION@
+preop.product.version=@APPLICATION_VERSION@
 preop.cert._000=#########################################
 preop.cert._001=# Installation configuration "preop" certs parameters
 preop.cert._002=#########################################
diff --git a/base/silent/src/pki-silent.mf b/base/silent/src/pki-silent.mf
index 5b66b7ffcf21ba33946abfb61ef2e42e0cd2998b..13c91de27be280655dfc713e1aa22f5c31f00430 100644
--- a/base/silent/src/pki-silent.mf
+++ b/base/silent/src/pki-silent.mf
@@ -1,2 +1,3 @@
 Name: pki-silent
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/tks/shared/conf/CMakeLists.txt b/base/tks/shared/conf/CMakeLists.txt
index e3cef59155e6a464751814a08a37cdb9ed5b8b24..419289d03e616384bc2397d3e9bab41472bae26a 100644
--- a/base/tks/shared/conf/CMakeLists.txt
+++ b/base/tks/shared/conf/CMakeLists.txt
@@ -1,7 +1,3 @@
-set(VERSION ${APPLICATION_VERSION})
-set(MAJOR_VERSION ${APPLICATION_VERSION_MAJOR})
-set(MINOR_VERSION ${APPLICATION_VERSION_MINOR})
-
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CS.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/CS.cfg @ONLY)
 
 install(
diff --git a/base/tks/shared/conf/CS.cfg.in b/base/tks/shared/conf/CS.cfg.in
index f641e026f564553d749f99e3ed1e603b25ddb981..7f11c4b18829c2f5f8360b705a7018c82e0fce26 100644
--- a/base/tks/shared/conf/CS.cfg.in
+++ b/base/tks/shared/conf/CS.cfg.in
@@ -25,7 +25,7 @@ preop.securitydomain.admin_url=https://[PKI_MACHINE_NAME]:9445
 preop.wizard.name=TKS Setup Wizard
 preop.system.name=TKS
 preop.product.name=CS
-preop.product.version=@VERSION@
+preop.product.version=@APPLICATION_VERSION@
 preop.system.fullname=Token Key Service
 proxy.securePort=[PKI_PROXY_SECURE_PORT]
 proxy.unsecurePort=[PKI_PROXY_UNSECURE_PORT]
@@ -152,7 +152,7 @@ cmc.lraPopWitness.verify.allow=true
 cmc.revokeCert.verify=true
 cmc.revokeCert.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
 cmc.sharedSecret.class=com.netscape.cms.authentication.SharedSecret
-cms.version=@MAJOR_VERSION@.@MINOR_VERSION@
+cms.version=@APPLICATION_VERSION_MAJOR@.@APPLICATION_VERSION_MINOR@
 dbs.ldap=internaldb
 dbs.newSchemaEntryAdded=true
 debug.append=true
diff --git a/base/tks/src/pki-tks.mf b/base/tks/src/pki-tks.mf
index a9f3a3e50d04ed7f217e729fb0074f36750ebb49..38d85b998675c168dd96e5004e573ca7196513f3 100644
--- a/base/tks/src/pki-tks.mf
+++ b/base/tks/src/pki-tks.mf
@@ -1,2 +1,3 @@
 Name: pki-tks
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/tps/doc/CS.cfg.in b/base/tps/doc/CS.cfg.in
index 64dadc6a6fc947767136e2b12ee51ae1c9bb5ecc..93e53fddeedf648b5f79dd54c2b5774f206c25fc 100644
--- a/base/tps/doc/CS.cfg.in
+++ b/base/tps/doc/CS.cfg.in
@@ -362,7 +362,7 @@ channel.defKeyIndex=0
 #            * channel.appletMemorySize=5000
 #
 preop.pin=[PKI_RANDOM_NUMBER]
-preop.product.version=@VERSION@
+preop.product.version=@APPLICATION_VERSION@
 preop.cert._000=#########################################
 preop.cert._001=# Installation configuration "preop" certs parameters
 preop.cert._002=#########################################
diff --git a/base/util/src/pki-cmsutil.mf b/base/util/src/pki-cmsutil.mf
index 87382b9aa7a70b1dab32b193108ba75bbe311e99..dace8f426dee2857f77490071441d5d34d3cb47a 100644
--- a/base/util/src/pki-cmsutil.mf
+++ b/base/util/src/pki-cmsutil.mf
@@ -1,2 +1,3 @@
 Name: pki-cmsutil
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/base/util/src/pki-nsutil.mf b/base/util/src/pki-nsutil.mf
index 272200d679a2cc6bb04c01f493e5fe4fd75139d1..483d46756446f54d8c68d17d40d3810c145406c8 100644
--- a/base/util/src/pki-nsutil.mf
+++ b/base/util/src/pki-nsutil.mf
@@ -1,2 +1,3 @@
 Name: pki-nsutil
-Implementation-Version: ${APPLICATION_VERSION}
\ No newline at end of file
+Specification-Version: ${APPLICATION_VERSION}
+Implementation-Version: ${VERSION}
diff --git a/scripts/compose_pki_core_packages b/scripts/compose_pki_core_packages
index fa1ed31029999194619aa6d34379a8e7afeae600..dc13b63b0e0104cec0e8adedfbd5220f26f6a3ca 100755
--- a/scripts/compose_pki_core_packages
+++ b/scripts/compose_pki_core_packages
@@ -148,6 +148,7 @@ else
 	mkdir -p ${PKI_CORE_BASE_DIR}
 	cd ${PKI_BASE_DIR}
 	cp -p ${PKI_BASE_MANIFEST} ${PKI_CORE_BASE_DIR}
+	cp -p VERSION ${PKI_CORE_BASE_DIR}
 	for component in "${PKI_COMPONENT_LIST}" ;
 	do
 		find ${component}             \
diff --git a/specs/dogtag-pki-theme.spec b/specs/dogtag-pki-theme.spec
index abd436af16560c7d766ba299fd101f6460a7771d..e7699d220227fd5e540b490ad35c447bce6c84a4 100644
--- a/specs/dogtag-pki-theme.spec
+++ b/specs/dogtag-pki-theme.spec
@@ -7,7 +7,7 @@
 
 Name:             dogtag-pki-theme
 Version:          10.0.0
-Release:          %{?relprefix}1%{?prerel}%{?dist}
+Release:          %{?relprefix}2%{?prerel}%{?dist}
 Summary:          Certificate System - Dogtag PKI Theme Components
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -281,7 +281,11 @@ This package is used by the Dogtag Certificate System.
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_DOGTAG_PKI_THEME:BOOL=ON -DJAVA_LIB_INSTALL_DIR=%{_jnidir} ..
+%cmake -DVERSION=%{version}-%{release} \
+	-DVAR_INSTALL_DIR:PATH=/var \
+	-DBUILD_DOGTAG_PKI_THEME:BOOL=ON \
+	-DJAVA_LIB_INSTALL_DIR=%{_jnidir} \
+	..
 %{__make} VERBOSE=1 %{?_smp_mflags}
 
 
@@ -357,6 +361,9 @@ chmod 755 %{buildroot}%{_datadir}/pki/tps-ui/cgi-bin/sow/cfg.pl
 
 
 %changelog
+* Sun Sep 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.2.a1
+- Modified CMake to use RPM version number
+
 * Wed Feb  1 2012 Nathan Kinder <nkinder@redhat.com> 10.0.0-0.1.a1
 - Updated package version number
 
diff --git a/specs/ipa-pki-theme.spec b/specs/ipa-pki-theme.spec
index 1b9ef9eba3f2061ffe8d0ac7b0c6830ab34c374b..5ebc8ce7193ad4346b2f56dc66222d4c0abdea77 100644
--- a/specs/ipa-pki-theme.spec
+++ b/specs/ipa-pki-theme.spec
@@ -7,7 +7,7 @@
 
 Name:             ipa-pki-theme
 Version:          10.0.0
-Release:          %{?relprefix}1%{?prerel}%{?dist}
+Release:          %{?relprefix}2%{?prerel}%{?dist}
 Summary:          Certificate System - IPA PKI Theme Components
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -109,7 +109,9 @@ This package is used by the Certificate System utilized by IPA.
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DBUILD_IPA_PKI_THEME:BOOL=ON ..
+%cmake -DVERSION=%{version}-%{release} \
+	-DBUILD_IPA_PKI_THEME:BOOL=ON \
+	..
 %{__make} VERBOSE=1 %{?_smp_mflags}
 
 
@@ -133,6 +135,9 @@ cd build
 
 
 %changelog
+* Sun Sep 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.2.a1
+- Modified CMake to use RPM version number
+
 * Wed Feb  1 2012 Nathan Kinder <nkinder@redhat.com> 10.0.0-0.1.a1
 - Updated package version number
 
diff --git a/specs/pki-console.spec b/specs/pki-console.spec
index 5821db181485b609bd55ea6f1c8c84dd4a81a7f8..d2d892a3d86da56cd496d175e0d9fc29dd80932d 100644
--- a/specs/pki-console.spec
+++ b/specs/pki-console.spec
@@ -7,7 +7,7 @@
 
 Name:             pki-console
 Version:          10.0.0
-Release:          %{?relprefix}7%{?prerel}%{?dist}
+Release:          %{?relprefix}8%{?prerel}%{?dist}
 Summary:          Certificate System - PKI Console
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -79,7 +79,8 @@ following "Mutually-Exclusive" PKI Theme packages:
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var \
+%cmake -DVERSION=%{version}-%{release} \
+	-DVAR_INSTALL_DIR:PATH=/var \
     -DBUILD_PKI_CONSOLE:BOOL=ON \
     -DJAVA_LIB_INSTALL_DIR=%{_jnidir} \
     %{?_without_javadoc:-DWITH_JAVADOC:BOOL=OFF} \
@@ -101,6 +102,9 @@ cd build
 
 
 %changelog
+* Sun Sep 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.8.a1
+- Modified CMake to use RPM version number
+
 * Thu Aug 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.7.a1
 - Added runtime dependency on pki-base
 
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index feef82ab26e6bb4a156195ed27cbb506eef12b0e..788afdb538af31c7c63adc662b24882f5869cbca 100644
--- a/specs/pki-core.spec
+++ b/specs/pki-core.spec
@@ -14,7 +14,7 @@ distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 
 Name:             pki-core
 Version:          10.0.0
-Release:          %{?relprefix}35%{?prerel}%{?dist}
+Release:          %{?relprefix}36%{?prerel}%{?dist}
 Summary:          Certificate System - PKI Core Components
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -641,7 +641,8 @@ This package is a part of the PKI Core used by the Certificate System.
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var \
+%cmake -DVERSION=%{version}-%{release} \
+	-DVAR_INSTALL_DIR:PATH=/var \
 	-DBUILD_PKI_CORE:BOOL=ON \
 	-DJAVA_LIB_INSTALL_DIR=%{_jnidir} \
 	-DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir} \
@@ -1298,6 +1299,9 @@ fi
 
 
 %changelog
+* Sun Sep 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.36.a1
+- Modified CMake to use RPM version number
+
 * Tue Sep 25 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.35.a1
 - Added VERSION file
 
diff --git a/specs/pki-migrate.spec b/specs/pki-migrate.spec
index 9047e3b2bc5e7f1a86d99c05cc84dd638dcfbe01..8334b928b8e5bf101e8d7d333cf1a6b80afba50f 100644
--- a/specs/pki-migrate.spec
+++ b/specs/pki-migrate.spec
@@ -7,7 +7,7 @@
 
 Name:             pki-migrate
 Version:          10.0.0
-Release:          %{?relprefix}1%{?prerel}%{?dist}
+Release:          %{?relprefix}2%{?prerel}%{?dist}
 Summary:          Red Hat Certificate System - PKI Migration Scripts
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -57,7 +57,10 @@ hardware platforms as well as earlier versions of this operating system.
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_PKI_MIGRATE:BOOL=ON ..
+%cmake -DVERSION=%{version}-%{release} \
+	-DVAR_INSTALL_DIR:PATH=/var \
+	-DBUILD_PKI_MIGRATE:BOOL=ON \
+	..
 %{__make} VERBOSE=1 %{?_smp_mflags}
 
 
@@ -75,6 +78,9 @@ cd build
 
 
 %changelog
+* Sun Sep 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.2.a1
+- Modified CMake to use RPM version number
+
 * Wed Feb  1 2012 Nathan Kinder <nkinder@redhat.com> 10.0.0-0.1.a1
 - Updated package version number
 
diff --git a/specs/pki-ra.spec b/specs/pki-ra.spec
index 5d5315538042dcace4f9327851277f81fd6a6d6b..c6debdaccdb6f35c2dfaf621f01801ee2c112452 100644
--- a/specs/pki-ra.spec
+++ b/specs/pki-ra.spec
@@ -7,7 +7,7 @@
 
 Name:             pki-ra
 Version:          10.0.0
-Release:          %{?relprefix}7%{?prerel}%{?dist}
+Release:          %{?relprefix}8%{?prerel}%{?dist}
 Summary:          Certificate System - Registration Authority
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -111,8 +111,11 @@ chmod +x %{__perl_requires}
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_PKI_RA:BOOL=ON .. \
-    -DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir}
+%cmake -DVERSION=%{version}-%{release} \
+	-DVAR_INSTALL_DIR:PATH=/var \
+	-DBUILD_PKI_RA:BOOL=ON \
+	-DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir} \
+	..
 %{__make} VERBOSE=1 %{?_smp_mflags}
 
 
@@ -245,6 +248,9 @@ fi
 
 
 %changelog
+* Sun Sep 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.8.a1
+- Modified CMake to use RPM version number
+
 * Mon Sep 24 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.7.a1
 - Merged pki-setup into pki-server
 
diff --git a/specs/pki-tps.spec b/specs/pki-tps.spec
index 967d2d9ab7558a4567a8442895a7e2a8dfb15d57..b5d811f5b81df495deeb8e897b6c58b22b7781c7 100644
--- a/specs/pki-tps.spec
+++ b/specs/pki-tps.spec
@@ -7,7 +7,7 @@
 
 Name:             pki-tps
 Version:          10.0.0
-Release:          %{?relprefix}7%{?prerel}%{?dist}
+Release:          %{?relprefix}8%{?prerel}%{?dist}
 Summary:          Certificate System - Token Processing System
 URL:              http://pki.fedoraproject.org/
 License:          LGPLv2
@@ -134,8 +134,11 @@ chmod +x %{__perl_requires}
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_PKI_TPS:BOOL=ON .. \
-    -DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir}
+%cmake -DVERSION=%{version}-%{release} \
+	-DVAR_INSTALL_DIR:PATH=/var \
+	-DBUILD_PKI_TPS:BOOL=ON \
+	-DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir} \
+	..
 %{__make} VERBOSE=1 %{?_smp_mflags}
 
 
@@ -280,6 +283,9 @@ fi
 
 
 %changelog
+* Sun Sep 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.8.a1
+- Modified CMake to use RPM version number
+
 * Mon Sep 24 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.7.a1
 - Merged pki-setup into pki-server
 
-- 
1.7.11.4

