Update Li SR3 RPM to handle upgrade cleanly 16/33516/1
authorDaniel Farrell <dfarrell@redhat.com>
Mon, 25 Jan 2016 23:03:39 +0000 (18:03 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Mon, 25 Jan 2016 23:03:39 +0000 (18:03 -0500)
OPNFV found a bug where the RPM didn't upgrade properly. The

/opt/opendaylight

directory wasn't being layed down by the newer RPM. The updated
.spec file's postrun logic seems to fix the issue.

Change-Id: I2bb0116d9e2217e0753502bbfb04ec345a12df38
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
rpm/build_vars.yaml
rpm/specs/opendaylight-3.3.0-2.spec [moved from rpm/specs/opendaylight-3.3.0-1.spec with 93% similarity]

index bb56a469e8340bd5c8e3523b81c9b5252ba0a3d8..463abfb04a80d71c880d38ae6f26c474bd38eef4 100644 (file)
@@ -74,15 +74,15 @@ builds:
   - version_major: "3"
     version_minor: "3"
     version_patch: "0"
-    rpm_release: "1"
+    rpm_release: "2"
     rpm_disttag: el7
     java_version: ">= 1:1.7.0"
     sysd_commit: c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed
     codename: Lithium-SR3
     download_url: "https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.3.3-Lithium-SR3/distribution-karaf-0.3.3-Lithium-SR3.tar.gz"
     changelog: |
-      * Fri Dec 11 2015 Daniel Farrell <dfarrell@redhat.com> - 3.3.0-1
-      - Create Lithium SR3 RPM
+      * Mon Jan 25 2016 Daniel Farrell <dfarrell@redhat.com> - 3.3.0-2
+      - Make Lithium SR3 RPM upgrade properly
   - version_major: "4"
     version_minor: "0"
     version_patch: "0"
similarity index 93%
rename from rpm/specs/opendaylight-3.3.0-1.spec
rename to rpm/specs/opendaylight-3.3.0-2.spec
index cfce8e057b6fd454dd3fdab3513459e2f588bc5a..ffcba08d398a7f205c7099bb5e79be682aa38027 100644 (file)
@@ -8,7 +8,7 @@ Version:    3.3.0
 #   unnecessary and unused in our case, but both the docs and the pros (apevec)
 #   agree that we should include it.
 # See: https://fedoraproject.org/wiki/Packaging:DistTag
-Release:    1.el7
+Release:    2.el7
 BuildArch:  noarch
 Summary:    OpenDaylight SDN Controller
 Group:      Applications/Communications
@@ -54,7 +54,9 @@ cp ../../BUILD/%name-c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed.service/%name-c6d7
 # When the RPM is removed, the subdirs containing new files wouldn't normally
 #   be deleted. Manually clean them up.
 #   Warning: This does assume there's no data there that should be preserved
-rm -rf $RPM_BUILD_ROOT/opt/%name
+if [ $1 -eq 0 ]; then
+    rm -rf $RPM_BUILD_ROOT/opt/%name
+fi
 
 %files
 # ODL will run as odl:odl, set as user:group for ODL dir, don't override mode
@@ -64,5 +66,5 @@ rm -rf $RPM_BUILD_ROOT/opt/%name
 
 
 %changelog
-* Fri Dec 11 2015 Daniel Farrell <dfarrell@redhat.com> - 3.3.0-1
-- Create Lithium SR3 RPM
+* Mon Jan 25 2016 Daniel Farrell <dfarrell@redhat.com> - 3.3.0-2
+- Make Lithium SR3 RPM upgrade properly