# 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.1-5.fc20.noarch.rpm"
+rpm_name="opendaylight-0.2.2-1.fc20.noarch.rpm"
rpm_out_path="$HOME/rpmbuild/RPMS/noarch/$rpm_name"
-src_name="distribution-karaf-0.2.1-Helium-SR1.1.tar.gz"
-src_cache_path="$HOME/$src_name"
-sysd_commit=520321a
+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
# Install required software, add user to mock group for rpmbuild
sudo yum install -y @development-tools fedora-packager
rpmdev-setuptree
# Put ODL source archive location required by rpmbuild
-if [ -f $src_cache_path ]; then
- echo "Using cached version of ODL at $src_cache_path"
- cp $src_cache_path $HOME/rpmbuild/SOURCES/$src_name
+if [ -f $src_cache_path0 ]; then
+ echo "Using cached version of ODL at $src_cache_path0"
+ cp $src_cache_path0 $HOME/rpmbuild/SOURCES/$src_name
+elif [ -f $src_cache_path1 ]; then
+ echo "Using cached version of ODL at $src_cache_path1"
+ cp $src_cache_path1 $HOME/rpmbuild/SOURCES/$src_name
else
echo "No cached ODL found, downloading from Nexus..."
- curl -o $HOME/rpmbuild/SOURCES/$src_name https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.1-Helium-SR1.1/$src_name
+ curl -o $HOME/rpmbuild/SOURCES/$src_name https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/$src_name
fi
# Put systemd unit file archive in rpmbuild's SOURCES dir
%define __jar_repack 0
# Update this commit if systemd unit file is updated
-%global commit 520321a932a15392a67f45bae52e879c703a2c85
+%global commit f984005039c39596a6cf4e7718b44a48db0ba849
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: opendaylight
-Version: 0.2.1
-Release: 5%{?dist}
+Version: 0.2.2
+Release: 1%{?dist}
Summary: OpenDaylight SDN Controller
Group: Applications/Communications
License: EPL-1.0
URL: http://www.opendaylight.org
BuildArch: noarch
-Source0: https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.2.1-Helium-SR1.1/distribution-karaf-0.2.1-Helium-SR1.1.tar.gz
+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
Buildroot: /tmp
%pre
# Create `odl` user/group
# Short circuits if the user/group already exists
-getent passwd odl > /dev/null || useradd odl -M
+# 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 group odl > /dev/null || groupadd odl
%description
-OpenDaylight Helium SR1.1 (0.2.1)
+OpenDaylight Helium SR2 (0.2.2)
%prep
# Extract Source0 (ODL archive)
-%autosetup -n distribution-karaf-0.2.1-Helium-SR1.1
+%autosetup -n distribution-karaf-0.2.2-Helium-SR2
# Extract Source1 (systemd config)
%autosetup -T -D -b 1 -n opendaylight-systemd-%{commit}
# Create directory in build root for ODL
mkdir -p $RPM_BUILD_ROOT/opt/%name-%version
# Move ODL from archive to its dir in build root
-cp -r ../distribution-karaf-0.2.1-Helium-SR1.1/* $RPM_BUILD_ROOT/opt/%name-%version
+cp -r ../distribution-karaf-0.2.2-Helium-SR2/* $RPM_BUILD_ROOT/opt/%name-%version
# 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
%changelog
+* 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
+- Give odl user a valid home dir for automatically created files
* Tue Jan 13 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.1-5
- Set ODL ownership to odl:odl vs root:odl
* Mon Jan 12 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.1-4