Override RPM disttag to el7 for CBS best practices
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 4 Aug 2015 20:11:24 +0000 (16:11 -0400)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 5 Aug 2015 15:02:57 +0000 (15:02 +0000)
The CentOS Community Build System, where we're hosting this
RPM, prefers el7 disttags to el7.centos, mostly for clarity.

Also some minor helper script cleanups, including adding logic for
installing EPEL in connect.sh and removing unnecessary version
info in uninstall.sh.

Change-Id: I1f6b2725b2d4cfb193d577710a83ed1c1a9b0478
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
packaging/rpm/build.sh
packaging/rpm/connect.sh
packaging/rpm/install.sh
packaging/rpm/uninstall.sh

index 70c1251d604c999a4b4d776e0bad5e95b27606d6..0fb1634307fae79fd8a8f05041575cd7f7c67ace 100755 (executable)
@@ -19,7 +19,7 @@ fi
 # NB: These will need to be updated for version bumps
 odl_version="0.3.0-Lithium"
 rpm_version="3.0.0"
-rpm_release="2.el7.centos"
+rpm_release="2.el7"
 sysd_commit="4a87227"
 
 # Common names used in this script
@@ -75,8 +75,10 @@ cp $unitfile_cache_path $rpmbuild_src_dir
 cp opendaylight.spec $rpmbuild_spec_dir
 
 # Build ODL SRPM and noarch RPM
+# Override disttag from .el7.centos to .el7 per best-practices/expected norms
+#   See: https://bugs.centos.org/view.php?id=9098
 cd $rpmbuild_spec_dir
-rpmbuild -ba opendaylight.spec
+rpmbuild -ba --define "dist .el7" opendaylight.spec
 
 # Confirm SRPM found in expected location
 if [ -f  $srpm_out_path ]; then
index 99c938485c5372edf1f05574ff731776f6a73fa9..1823563cd1df876f1af7738cc04e63906245dc69 100755 (executable)
@@ -1,18 +1,21 @@
 #!/usr/bin/env sh
 # Connect to ODL Karaf shell. Mostly used for testing.
 
-# Output verbose debug info (true) or not (anything else)
-VERBOSE=true
 # Port that the Karaf shell listens on
 KARAF_SHELL_PORT=8101
 
 # This could be done with public key crypto, but sshpass is easier
 if ! command -v sshpass &> /dev/null; then
     echo "Installing sshpass. It's used connecting non-interactively"
-    if "$VERBOSE" = true; then
-        sudo yum install -y sshpass
-    else
-        sudo yum install -y sshpass &> /dev/null
+    if ! sudo yum install -y sshpass; then
+        echo "Couldn't find sshpass pkg, trying to install EPEL"
+        if sudo yum install -y epel-release; then
+            echo "Installed EPEL, re-attempting to install sshpass"
+            sudo yum install -y sshpass
+        else
+            echo "Failed to install sshpass and EPEL, giving up"
+            exit 1
+        fi
     fi
 fi
 
index dac40a2bb4385e5d020085ef6ec6816a9e76bbaf..78b35d75bd1fc8bf944fd87e5df94b7aad2e41f8 100755 (executable)
@@ -17,7 +17,7 @@ fi
 
 # NB: These will need to be updated for version bumps
 rpm_version="3.0.0"
-rpm_release="2.el7.centos"
+rpm_release="2.el7"
 odl_rpm="opendaylight-$rpm_version-$rpm_release.noarch.rpm"
 rpm_path="$cache_dir/$odl_rpm"
 
index ac37cc713cb8a52b27877bcb9a40f07b8d414a13..9b51538a10bd46f6caab2e90ccc5dc0b1d69f234 100755 (executable)
@@ -4,9 +4,6 @@
 # Echo commands as they are run
 set -x
 
-# NB: These will need to be updated for version bumps
-rpm_version="3.0.0"
-
 # Uninstall ODL
 echo "Uninstalling ODL"
-sudo rpm -e opendaylight-$rpm_version
+sudo rpm -e opendaylight