Small batch of ODL RPM updates, version to 0.2.2-4
authorDaniel Farrell <dfarrell@redhat.com>
Mon, 16 Mar 2015 03:24:02 +0000 (23:24 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Mon, 16 Mar 2015 03:24:02 +0000 (23:24 -0400)
* Bugfix in URL to download ODL systemd .service file
* Don't include ODL version in ODL dir name
* Don't override ODL dir mode, explicitly set unitfile owner:group
* Generic related updates to RPM helper scripts

Change-Id: I3f59793311874f30031a3fda7c24f03498b946a9
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
packaging/rpm/build.sh
packaging/rpm/install.sh
packaging/rpm/opendaylight.spec

index 999ddb144134db4aefc121d453441fe53c05e1a1..c8ba2b0f14725574693052271a005b7e65fe846d 100755 (executable)
@@ -2,12 +2,15 @@
 
 # Common paths used in this script
 # NB: Name will need to be updated for both ODL and RMP version bumps
-rpm_name="opendaylight-0.2.2-1.fc20.noarch.rpm"
-rpm_out_path="$HOME/rpmbuild/RPMS/noarch/$rpm_name"
+version=4
+rpm_name="opendaylight-0.2.2-$version.noarch.rpm"
+rpm_out_path="$HOME/rpmbuild/RPMS/noarch/opendaylight-0.2.2-$version.fc20.noarch.rpm"
+srpm_name="opendaylight-0.2.2-$version.src.rpm"
+srpm_out_path="$HOME/rpmbuild/SRPMS/opendaylight-0.2.2-$version.fc20.src.rpm"
 src_name="distribution-karaf-0.2.2-Helium-SR2.tar.gz"
 src_cache_path0="$HOME/$src_name"
 src_cache_path1="/vagrant/$src_name"
-sysd_commit=f984005
+sysd_commit=4a87227
 
 # Install required software, add user to mock group for rpmbuild
 sudo yum install -y @development-tools fedora-packager
@@ -39,10 +42,30 @@ cp opendaylight.spec $HOME/rpmbuild/SPECS
 cd $HOME/rpmbuild/SPECS
 rpmbuild -ba opendaylight.spec
 
+# Confirm SRPM found in expected location
+if [ -f  $srpm_out_path ]; then
+    echo "SRPM built!"
+    echo "Location: $srpm_out_path"
+    if [ -d  /vagrant/ ]; then
+        echo "Assuming you want to move RPM off Vagrant box"
+        echo "Also renaming RPM, not actually tagged as for FC20 target OS"
+        echo "cp $srpm_out_path /vagrant/$srpm_name"
+        cp $srpm_out_path /vagrant/$srpm_name
+    fi
+else
+    echo "SRPM seems to have failed. :(" >&2
+fi
+
 # Confirm RPM found in expected location
 if [ -f  $rpm_out_path ]; then
     echo "RPM built!"
-    echo "Should be at: $rpm_out_path"
+    echo "Location: $rpm_out_path"
+    if [ -d  /vagrant/ ]; then
+        echo "Assuming you want to move RPM off Vagrant box"
+        echo "Also renaming RPM, not actually tagged as for FC20 target OS"
+        echo "cp $rpm_out_path /vagrant/$rpm_name"
+        cp $rpm_out_path /vagrant/$rpm_name
+    fi
 else
-    echo "RPM seems to have failed. :(" &>2
+    echo "RPM seems to have failed. :(" >&2
 fi
index 10203f6c9028ddfd1197edf1c7d81b7d768607ff..09a618e2536ef11b1aa7e985440275533f21d424 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env sh
 
 # Update if needed
-rpm_path="$HOME/rpmbuild/RPMS/noarch/opendaylight-0.2.2-1.fc20.noarch.rpm"
+rpm_path="$HOME/rpmbuild/RPMS/noarch/opendaylight-0.2.2-4.noarch.rpm"
 
 # Install ODL
 echo "Installing ODL"
index 52b221921ae3fbd235b4d7c87a1f8f6c61f41be9..b28749f7157576858c66d7422c0a67073f530bea 100644 (file)
@@ -2,12 +2,12 @@
 %define __jar_repack 0
 
 # Update this commit if systemd unit file is updated
-%global commit f984005039c39596a6cf4e7718b44a48db0ba849
+%global commit 4a872270893f0daeebcbbcc0ff0014978e3c5f68
 %global shortcommit %(c=%{commit}; echo ${c:0:7})
 
 Name:       opendaylight
 Version:    0.2.2
-Release:    1%{?dist}
+Release:    4%{?dist}
 Summary:    OpenDaylight SDN Controller
 
 Group:      Applications/Communications
@@ -15,7 +15,7 @@ License:    EPL-1.0
 URL:        http://www.opendaylight.org
 BuildArch:  noarch
 Source0:    https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz
-Source1:    https://github.com/dfarrell07/opendaylight-systemd/archive/b080cdc/opendaylight-systemd-%{shortcommit}.tar.gz
+Source1:    https://github.com/dfarrell07/opendaylight-systemd/archive/%{shortcommit}/opendaylight-systemd-%{shortcommit}.tar.gz
 Buildroot:  /tmp
 
 # Required for ODL at run time
@@ -29,7 +29,7 @@ BuildRequires: systemd
 # Create `odl` user/group
 # Short circuits if the user/group already exists
 # Home dir must be a valid path for various files to be created in it
-getent passwd odl > /dev/null || useradd odl -M -d $RPM_BUILD_ROOT/opt/%name-%version
+getent passwd odl > /dev/null || useradd odl -M -d $RPM_BUILD_ROOT/opt/%name
 getent group odl > /dev/null || groupadd odl
 
 %description
@@ -43,9 +43,9 @@ OpenDaylight Helium SR2 (0.2.2)
 
 %install
 # Create directory in build root for ODL
-mkdir -p $RPM_BUILD_ROOT/opt/%name-%version
+mkdir -p $RPM_BUILD_ROOT/opt/%name
 # Move ODL from archive to its dir in build root
-cp -r ../distribution-karaf-0.2.2-Helium-SR2/* $RPM_BUILD_ROOT/opt/%name-%version
+cp -r ../distribution-karaf-0.2.2-Helium-SR2/* $RPM_BUILD_ROOT/opt/%name
 # Create directory in build root for systemd .service file
 mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
 # Move ODL's systemd .service file to correct dir in build root
@@ -55,16 +55,22 @@ cp ../../BUILD/opendaylight-systemd-%{commit}/opendaylight.service $RPM_BUILD_RO
 # 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 persevered
-rm -rf $RPM_BUILD_ROOT/opt/%name-%version
+rm -rf $RPM_BUILD_ROOT/opt/%name
 
 %files
-# ODL uses systemd to run as user:group odl:odl
-%attr(0775,odl,odl) /opt/%name-%version/
-# Configure systemd
-%attr(0644,-,-) %{_unitdir}/%name.service
+# ODL will run as odl:odl, set as user:group for ODL dir, dont override mode
+%attr(-,odl,odl) /opt/%name
+# Configure systemd unitfile user/group/mode
+%attr(0644,root,root) %{_unitdir}/%name.service
 
 
 %changelog
+* Sun Mar 15 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.2-4
+- Don't override ODL dir mode, explicitly set unitfile owner:group
+* Fri Mar 13 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.2-3
+- Don't include ODL version in ODL dir name
+* Tue Feb 10 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.2-2
+- Bugfix in URL to download ODL systemd .service file
 * Sat Jan 31 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.2-1
 - Upgrade from Helium SR1.1 to Helium SR2
 * Thu Jan 29 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.1-6