From d9413405614bbe71f8df9e2b38606e629e069166 Mon Sep 17 00:00:00 2001
From: Ben Couturier <ben.couturier@cern.ch>
Date: Tue, 10 Jan 2017 11:48:40 +0100
Subject: [PATCH 1/3] Change DataPackage naming convention and remove
 dependency to COMPAT

---
 python/LbRPMTools/LHCbRPMSpecBuilder.py | 26 ++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/python/LbRPMTools/LHCbRPMSpecBuilder.py b/python/LbRPMTools/LHCbRPMSpecBuilder.py
index 787db305..de535486 100644
--- a/python/LbRPMTools/LHCbRPMSpecBuilder.py
+++ b/python/LbRPMTools/LHCbRPMSpecBuilder.py
@@ -873,7 +873,7 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
     def __init__(self, project, fulldatapkg, version, sharedTar, buildarea, release = 0):
         """ Constructor  """
         super(LHCbDatapkgRpmSpec, self).__init__(project, version)
-        __log__.debug("Creating Shared RPM for %s/%s" % (project, version))
+        __log__.debug("Creating Data Pkg RPM for %s/%s" % (project, version))
         self._project = project
         self._fulldatapkg = fulldatapkg
         if "/" in fulldatapkg:
@@ -882,11 +882,14 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
             self._package = fulldatapkg
         self._normfulldatapkg =  fulldatapkg.replace("/", "_")
         self._fullname = "_".join([self._project.upper(),  self._normfulldatapkg])
+        self._fullnameWithVer = "_".join([self._project.upper(),
+                                          self._normfulldatapkg, self._version])
         self._versiondir = os.path.join(self._project.upper(), self._fulldatapkg)
         self._version = version
         self._sharedTar = sharedTar
         self._buildarea = buildarea
         (self._lhcb_maj_version, self._lhcb_min_version, self._lhcb_patch_version) = parseVersion(version)
+        #(self._lhcb_maj_version, self._lhcb_min_version, self._lhcb_patch_version) = (1, 0, 0)
         self._lhcb_release_version = release
         self._arch = "noarch"
 
@@ -896,10 +899,12 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
 
     def getRPMName(self, norelease=False):
         ''' Return the architecture, always noarch for our packages'''
-        projname =  "_".join([self._project.upper(), self._normfulldatapkg])
-        projver = ".".join([str(n) for n in [ self._lhcb_maj_version,
-                                              self._lhcb_min_version,
-                                              self._lhcb_patch_version]])
+        projname =  "_".join([self._project.upper(), self._normfulldatapkg, self._version])
+        # We keep this package to 1.0.0, but the requirements map the vXrY
+        projver = ".".join([str(n) for n in [ 1, 0, 0 ]])
+        #projver = ".".join([str(n) for n in [ self._lhcb_maj_version,
+        #                                      self._lhcb_min_version,
+        #                                      self._lhcb_patch_version]])
         if norelease:
             return "-".join([projname, projver])
         full = "-".join([projname, projver, str(self._lhcb_release_version)])
@@ -921,6 +926,7 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
 %define normfulldatapkg ${normfulldatapkg}
 %define fulldatapkg ${fulldatapkg}
 %define fullname ${fullname}
+%define fullnameWithVer ${fullnameWithVer}
 %define package ${package}
 %define lbversion ${version}
 %define _postshell /bin/bash
@@ -933,8 +939,9 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
 %define tmpdir %{buildarea}/tmpbuild
 %define _tmppath %{buildarea}/tmp
 
-Name: %{fullname}
-Version: %{lhcb_maj_version}.%{lhcb_min_version}.%{lhcb_patch_version}
+Name: %{fullnameWithVer}
+#Version: %{lhcb_maj_version}.%{lhcb_min_version}.%{lhcb_patch_version}
+Version: 1.0.0
 Release: %{lhcb_release_version}
 Vendor: LHCb
 Summary: %{project}
@@ -953,7 +960,6 @@ Provides: %{package}_v%{lhcb_maj_version} = %{lhcb_maj_version}.%{lhcb_min_versi
 Provides: %{fullname}_v%{lhcb_maj_version} = %{lhcb_maj_version}.%{lhcb_min_version}.%{lhcb_patch_version}
 Requires: %{projectUp}_common
 Requires(post): LBSCRIPTS
-Requires(post): COMPAT
         \n""").substitute(buildarea = self._buildarea,
                           project = self._project,
                           projectUp = self._project.upper(),
@@ -965,6 +971,7 @@ Requires(post): COMPAT
                           lhcb_patch_version = self._lhcb_patch_version,
                           lhcb_release_version = self._lhcb_release_version,
                           fullname = self._fullname,
+                          fullnameWithVer = self._fullnameWithVer,
                           versiondir = self._versiondir,
                           package = self._package,
                           prefix = PREFIX
@@ -1157,9 +1164,6 @@ Provides: /bin/bash
         '''
         return """
 
-Requires: CMT
-Requires: COMPAT
-
 """
 
     def _createDescription(self):
-- 
GitLab


From 8584eccf3eb29400510b0497d15c87e59f34c8d4 Mon Sep 17 00:00:00 2001
From: Ben Couturier <ben.couturier@cern.ch>
Date: Tue, 10 Jan 2017 13:01:51 +0100
Subject: [PATCH 2/3] Removed unnecessary comments

---
 python/LbRPMTools/LHCbRPMSpecBuilder.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/python/LbRPMTools/LHCbRPMSpecBuilder.py b/python/LbRPMTools/LHCbRPMSpecBuilder.py
index de535486..43182728 100644
--- a/python/LbRPMTools/LHCbRPMSpecBuilder.py
+++ b/python/LbRPMTools/LHCbRPMSpecBuilder.py
@@ -902,9 +902,6 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
         projname =  "_".join([self._project.upper(), self._normfulldatapkg, self._version])
         # We keep this package to 1.0.0, but the requirements map the vXrY
         projver = ".".join([str(n) for n in [ 1, 0, 0 ]])
-        #projver = ".".join([str(n) for n in [ self._lhcb_maj_version,
-        #                                      self._lhcb_min_version,
-        #                                      self._lhcb_patch_version]])
         if norelease:
             return "-".join([projname, projver])
         full = "-".join([projname, projver, str(self._lhcb_release_version)])
@@ -940,7 +937,6 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
 %define _tmppath %{buildarea}/tmp
 
 Name: %{fullnameWithVer}
-#Version: %{lhcb_maj_version}.%{lhcb_min_version}.%{lhcb_patch_version}
 Version: 1.0.0
 Release: %{lhcb_release_version}
 Vendor: LHCb
-- 
GitLab


From c4124ecc26a19ea921dbde03d8f0249f5b37188d Mon Sep 17 00:00:00 2001
From: Ben Couturier <ben.couturier@cern.ch>
Date: Tue, 10 Jan 2017 13:07:39 +0100
Subject: [PATCH 3/3] Removed unnecessary comments

---
 python/LbRPMTools/LHCbRPMSpecBuilder.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/python/LbRPMTools/LHCbRPMSpecBuilder.py b/python/LbRPMTools/LHCbRPMSpecBuilder.py
index 43182728..73129753 100644
--- a/python/LbRPMTools/LHCbRPMSpecBuilder.py
+++ b/python/LbRPMTools/LHCbRPMSpecBuilder.py
@@ -889,7 +889,6 @@ class LHCbDatapkgRpmSpec(LHCbBaseRpmSpec):
         self._sharedTar = sharedTar
         self._buildarea = buildarea
         (self._lhcb_maj_version, self._lhcb_min_version, self._lhcb_patch_version) = parseVersion(version)
-        #(self._lhcb_maj_version, self._lhcb_min_version, self._lhcb_patch_version) = (1, 0, 0)
         self._lhcb_release_version = release
         self._arch = "noarch"
 
-- 
GitLab