+++ /dev/null
-The Fedora RPM spec is a work in progress. The current spec can build an
-RPM package for Fedora that still relies on Maven to include the JAVA
-artifacts. The plan is to create a dependencies RPM to package up all the
-artifacts.
-
-Release 0.1.0-0.7.0
---------------------------------------------------------------------------------
-1. Build
-cd ~/git/controller
-git archive --prefix=opendaylight-controller-0.1.0/ HEAD | xz > ../opendaylight-controller-0.1.0.tar.xz
-cd ~/git/integration
-git archive --prefix=opendaylight-integration-0.1.0/ HEAD | xz > ../opendaylight-integration-0.1.0.tar.xz
-cd ~/git/ovsdb
-git archive --prefix=opendaylight-ovsdb-0.1.0/ HEAD | xz > ../opendaylight-ovsdb-0.1.0.tar.xz
-cd ~/git/openflowjava
-git archive --prefix=opendaylight-openflowjava-0.1.0/ HEAD | xz > ../opendaylight-openflowjava-0.1.0.tar.xz
-cd ~/git/openflowplugin
-git archive --prefix=opendaylight-openflowplugin-0.1.0/ HEAD | xz > ../opendaylight-openflowplugin-0.1.0.tar.xz
-cd ..
-cp opendaylight-controller-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp opendaylight-integration-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp opendaylight-ovsdb-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp opendaylight-openflowjava-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp opendaylight-openflowplugin-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp intergration/packaging/rpm/opendaylight-integration-fix-paths.patch ~/rpmbuild/SOURCES/
-rpmbuild -bb --noclean opendaylight-controller.spec
-rpmbuild -bb --noclean opendaylight-ovsdb.spec
-rpmbuild -bb --noclean opendaylight-openflowjava.spec
-rpmbuild -bb --noclean opendaylight-openflowplugin.spec
-cp ~/rpmbuild/BUILD/opendaylight-controller-0.1.0/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage.zip ~/rpmbuild/SOURCES/opendaylight-controller-0.1.0.zip
-cp ~/rpmbuild/BUILD/opendaylight-ovsdb-0.1.0/distribution/opendaylight/target/distribution.ovsdb-1.0.0-SNAPSHOT-osgipackage.zip ~/rpmbuild/SOURCES/opendaylight-ovsdb-0.1.0.zip
-rpmbuild -bb --noclean opendaylight-controller-dependencies.spec
-rpmbuild -bb --noclean opendaylight-distribution.spec
-
-2. Install
-rpm -Uvh ~/rpmbuild/RPMS/noarch/*.rpm
-
-3. Enable
-sudo systemctl enable opendaylight-controller.service
-
-4. Start/stop
-sudo systemctl start opendaylight-controller.service
-sudo systemctl stop opendaylight-controller.service
-* to get the osgi console: telnet 127.0.0.1 2400
-
-5. Distribution
-Edit the sysconfig file to change the type of distribution:
-sudo vi /etc/sysconfig/opendaylight-controller
-Set ODL_DIST to the desired distribution, i.e.
-ODL_DIST="virt-ovsdb"
-
-# Use the following table to select the distribution:
-# Distribution Value
-# -------------------- -----------
-# base base
-# virtualization ovsdb virt-ovsdb
-# virtualization vtn virt-vtn
-# virtualization opendove virt-opendove
-# service provider sp
-ODL_DIST="virt-ovsdb"
-
-# Any additional options required.
-# I.E. -of13, -debug, or -console
-ODL_OPTS=""
-
-Release 0.1.0-0.6.0
---------------------------------------------------------------------------------
-1. Build
-cd ~/git/controller
-git archive --prefix=opendaylight-controller-0.1.0/ HEAD | xz > ../opendaylight-controller-0.1.0.tar.xz
-cd ~/git/integration
-git archive --prefix=opendaylight-integration-0.1.0/ HEAD | xz > ../opendaylight-integration-0.1.0.tar.xz
-cd ~/git/ovsdb
-git archive --prefix=opendaylight-ovsdb-0.1.0/ HEAD | xz > ../opendaylight-ovsdb-0.1.0.tar.xz
-cd ..
-cp opendaylight-controller-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp opendaylight-integration-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp opendaylight-ovsdb-0.1.0.tar.xz ~/rpmbuild/SOURCES
-cp ~/git/integration/packaging/rpm/opendaylight-integration-fix-paths.path ~/rpmbuild/SOURCES
-rpmbuild -bb --noclean opendaylight-controller.spec
-rpmbuild -bb --noclean opendaylight-ovsdb.spec
-cp ~/rpmbuild/BUILD/opendaylight-controller-0.1.0/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage.zip ~/rpmbuild/SOURCES/opendaylight-controller-0.1.0.zip
-cp ~/rpmbuild/BUILD/opendaylight-ovsdb-0.1.0/distribution/opendaylight/target/distribution.ovsdb-1.0.0-SNAPSHOT-osgipackage.zip ~/rpmbuild/SOURCES/opendaylight-ovsdb-0.1.0.zip
-rpmbuild -bb --noclean opendaylight-controller-dependencies.spec
-rpmbuild -bb --noclean opendaylight-distribution.spec
-
-2. Install
-rpm -Uvh ~/rpmbuild/RPMS/noarch/*.rpm
-
-3. Enable
-sudo systemctl enable opendaylight-controller.service
-
-4. Start/stop
-sudo systemctl start opendaylight-controller.service
-sudo systemctl stop opendaylight-controller.service
-* to get the osgi console: telnet 127.0.0.1 2400
-
-5. Distribution
-Edit the sysconfig file to change the type of distribution:
-sudo vi /etc/sysconfig/opendaylight-controller
-Set ODL_DIST to the desired distribution, i.e.
-ODL_DIST="virt-ovsdb"
-
-# Use the following table to select the distribution:
-# Distribution Value
-# -------------------- -----------
-# base base
-# virtualization ovsdb virt-ovsdb
-# virtualization vtn virt-vtn
-# virtualization opendove virt-opendove
-# service provider sp
-ODL_DIST="virt-ovsdb"
-
-# Any additional options required.
-# I.E. -of13, -debug, or -console
-ODL_OPTS=""
-
-Release 0.1.0-0.4.0
---------------------------------------------------------------------------------
-1. Build
-Build all the required packages:
-rpmbuild opendaylight-controller.spec
-rpmbuild opendaylight-ovsdb.spec
-rpmbuild opendaylight-dependencies.spec
-rpmbuild opendaylight-distribution.spec
-
-2. Install
-rpm -Uvh opendaylight-distribution
-* This will install all required packages.
-
-3. Start/Stop
-sudo systemctl start opendaylight-controller.service
-sudo systemctl stop opendaylight-controller.service
-* to get the osgi console: telnet 127.0.0.1 2400
-
-4. Distribution
-Edit the sysconfig file to change the type of distribution:
-sudo vi /etc/sysconfig/opendaylight-controller
-Set ODL_DIST to the desired distribution, i.e.
-ODL_DIST="-virt ovsdb" or ODL_DIST="-virt opendove"
-
-Release <0.1.0-0.4.0
-
-1. Get a source tarball:
-$git clone https://git.opendaylight.org/gerrit/p/controller.git
-$cd controller
-$git archive --prefix=opendaylight-controller-0.1.0/ d684dd4 | xz > opendaylight-controller-0.1.0.tar.xz
-
-2. Build rpm:
-$rpmbuild -ba opendaylight-controller.spec
-
-3. install rpm:
-#rpm -ivp opendaylight-controller-0.1.0-0.1.20131007gitd684dd4.fc19.noarch.rpm
-
-4. Start the controller:
-#su - opendaylight -s /bin/sh -c "export ODL_BASEDIR=/var/lib/opendaylight-controller && export ODL_DATADIR=/var/lib/opendaylight-controller && cd /var/lib/opendaylight-controller && /usr/share/opendaylight-controller/run.sh -start"
-*** If you need the console then telnet 127.0.0.1 2400 logs
-
-4. Stop the controller:
-#su - opendaylight -s /bin/sh -c "export ODL_BASEDIR=/var/lib/opendaylight-controller && export ODL_DATADIR=/var/lib/opendaylight-controller && cd /var/lib/opendaylight-controller && /usr/share/opendaylight-controller/run.sh -stop"
-
-4. uninstall rpm:
-#rpm -e opendaylight-controller-0.1.0-0.1.20131007gitd684dd4.fc19.noarch
-
-
-Using yum for testing.
-
-1. Create a local repo:
-yum install createrepo
-yum install vsftpd
-systemctl start vsftpd.service
-
-Add /etc/yum.repos.d/localftp.repo
-[localftp]
-name=Local FTP repo
-baseurl=file://127.0.0.1/pub
-enabled=0
-gpgcheck=0
-metadata_expire=1m
-
-2. Add packages to local repo:
-cp opendaylight-controller.spec /var/ftp/pub
-cp opendaylight-controller-dependencies.spec /var/ftp/pub
-
-3. Update local repo with new packages:
-Change the enabled=0 to enabled=1 in the localftp.repo file.
-createrepo /var/ftp/pub
-yum clean expire-cache
-
-4. Verify the repo is there:
-yum repolist
-
-Yum away...
-
-You could also use a fiel based repo and change the baseurl to:
-file:////var/ftp/pub.
-This failed with a network error for me so I switched to ftp.
-
-
-The file system after install should look like
-
-/etc/opendaylight-controller/config.ini
-/usr/share/java/opendaylight-dependencies/{all the non-opendaylight jars from
-the lib and plugin directories
-/usr/share/opendaylight-controller/run.bat, run.sh, ..
-/usr/share/opendaylight-controller/configuration/...
-/usr/share/opendaylight-controller/lib/*.jar ln's to /usr/share/java/opendaylight-dependencies/*.jar
-/usr/share/opendaylight-controller/plugins/*.jar ln's to /usr/share/java/opendaylight-dependencies/*.jar
-/var/lib/opendaylight-controller
-/var/lib/opendaylight-controller/configuration/ ln's back to /usr/share/opendaylight-controller/configuration
-/var/lib/opendaylight-controller/lib
-/var/lib/opendaylight-controller/plugins
-
--- /dev/null
+Everything required for building the Karaf OpenDaylight RPM.
+
+Note that the currently supported version is Helium SR1.1.
+
+## Building the RPM
+
+The `build.sh` script is a helper for building the RPM.
+
+```
+[fedora@dfarrell-rpm ~]$ ./build.sh
+<snip output of RPM building process>
+RPM built!
+Should be at: /home/fedora/rpmbuild/RPMS/noarch/opendaylight-0.2.1-5.fc20.noarch.rpm
+```
+
+## Working with the ODL RPM
+
+The familiar RPM-related commands apply to the OpenDaylight RPM.
+
+### Installing OpenDaylight via the RPM
+
+```
+# Note that there's nothing in /opt before the install
+[fedora@dfarrell-rpm ~]$ ls /opt/
+# Note that there are no opendaylight systemd files before install
+[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight
+# Install the ODL RPM
+[fedora@dfarrell-rpm ~]$ sudo rpm -i /home/fedora/rpmbuild/RPMS/noarch/opendaylight-0.2.1-5.fc20.noarch.rpm
+# Note that ODL is now installed in /opt
+[fedora@dfarrell-rpm ~]$ ls /opt/
+opendaylight-0.2.1
+# Note that there's now a systemd .service file for ODL
+[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight
+opendaylight.service
+```
+
+The `install.sh` script is a helper for doing the install. Note that the script's path to the RPM may need to be configured.
+
+### Uninstalling OpenDaylight via the RPM
+
+```
+# Note that ODL is installed in /opt/
+[fedora@dfarrell-rpm ~]$ ls /opt/
+opendaylight-0.2.1
+# Note that there's a systemd .service file for ODL
+[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight
+opendaylight.service
+# Uninstall the ODL RPM
+[fedora@dfarrell-rpm ~]$ sudo rpm -e opendaylight-0.2.1
+# Note that ODL has been removed from /opt/
+[fedora@dfarrell-rpm ~]$ ls /opt/
+# Note that the ODL systemd .service file has been removed
+[fedora@dfarrell-rpm ~]$ ls /usr/lib/systemd/system | grep -i opendaylight
+```
+
+## Managing OpenDaylight via systemd
+
+The OpenDaylight RPM ships with systemd support.
+
+### Starting OpenDaylight via systemd
+
+```
+[fedora@dfarrell-rpm ~]$ sudo systemctl start opendaylight
+[fedora@dfarrell-rpm ~]$ sudo systemctl status opendaylight
+opendaylight.service - OpenDaylight SDN Controller
+ Loaded: loaded (/usr/lib/systemd/system/opendaylight.service; disabled)
+ Active: active (running) since Tue 2015-01-13 21:43:05 UTC; 14s ago
+ Docs: https://wiki.opendaylight.org/view/Main_Page
+ http://www.opendaylight.org/
+ Main PID: 28731 (java)
+ CGroup: /system.slice/opendaylight.service
+ └─28731 java -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:MaxPermSize=512m -Dcom.sun.manage...
+
+Jan 13 21:43:14 dfarrell-rpm systemd[1]: Started OpenDaylight SDN Controller.
+```
+
+### Stopping OpenDaylight via systemd
+
+```
+[fedora@dfarrell-rpm ~]$ sudo systemctl stop opendaylight
+[fedora@dfarrell-rpm ~]$ sudo systemctl status opendaylight
+opendaylight.service - OpenDaylight SDN Controller
+ Loaded: loaded (/usr/lib/systemd/system/opendaylight.service; disabled)
+ Active: inactive (dead)
+ Docs: https://wiki.opendaylight.org/view/Main_Page
+ http://www.opendaylight.org/
+
+Jan 27 19:08:11 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Starting OpenDaylight SDN Controller...
+Jan 27 19:08:12 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Started OpenDaylight SDN Controller.
+Jan 27 19:08:50 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Stopping OpenDaylight SDN Controller...
+Jan 27 19:08:50 dfarrell-rpm.os1.phx2.redhat.com systemd[1]: Stopped OpenDaylight SDN Controller.
+```
+
+## Connecting to the Karaf shell
+
+A few seconds after OpenDaylight is started, its Karaf shell will be accessible.
+
+The `connect.sh` script is provided as an example of how to connect to the Karaf shell.
+
+Additionally, here's an example of connecting manually (password: `karaf`):
+
+```
+[fedora@dfarrell-rpm ~]$ ssh -p 8101 -o StrictHostKeyChecking=no karaf@localhost
+Authenticated with partial success.
+Password authentication
+Password:
+
+ ________ ________ .__ .__ .__ __
+ \_____ \ ______ ____ ____ \______ \ _____ ___.__.| | |__| ____ | |___/ |_
+ / | \\____ \_/ __ \ / \ | | \\__ \< | || | | |/ ___\| | \ __\
+ / | \ |_> > ___/| | \| ` \/ __ \\___ || |_| / /_/ > Y \ |
+ \_______ / __/ \___ >___| /_______ (____ / ____||____/__\___ /|___| /__|
+ \/|__| \/ \/ \/ \/\/ /_____/ \/
+
+
+Hit '<tab>' for a list of available commands
+and '[cmd] --help' for help on a specific command.
+Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.
+
+opendaylight-user@root>^D
+Connection to localhost closed.
+[fedora@dfarrell-rpm ~]$
+```
--- /dev/null
+#!/usr/bin/env sh
+
+# 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_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
+
+# Install required software, add user to mock group for rpmbuild
+sudo yum install -y @development-tools fedora-packager
+sudo usermod -a -G mock $USER
+
+# Configure rpmbuild dir
+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
+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
+fi
+
+# Put systemd unit file archive in rpmbuild's SOURCES dir
+# Need `-L` to follow redirects
+curl -L -o $HOME/rpmbuild/SOURCES/opendaylight-systemd-$sysd_commit.tar.gz https://github.com/dfarrell07/opendaylight-systemd/archive/$sysd_commit/opendaylight-systemd-$sysd_commit.tar.gz
+
+# Put ODL RPM .spec file in location required by rpmbuild
+cp opendaylight.spec $HOME/rpmbuild/SPECS
+
+# Build ODL RPM
+cd $HOME/rpmbuild/SPECS
+rpmbuild -ba opendaylight.spec
+
+# Confirm RPM found in expected location
+if [ -f $rpm_out_path ]; then
+ echo "RPM built!"
+ echo "Should be at: $rpm_out_path"
+else
+ echo "RPM seems to have failed. :(" &>2
+fi
+++ /dev/null
-#!/bin/bash
-# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
-
-# shague todo:
-# - Add -r option for mock to choose the distribution
-# - add option to pass in spec file name, maybe use spec.in template
-# - add option to pass in version and release
-
-#set -vx
-
-buildtype="snapshot"
-buildroot=""
-buildtag=""
-cleanroot=0
-cleantmp=0
-pushrpms=0
-getsource="buildroot"
-branch=""
-depth=0
-version=""
-edversion=""
-specrelease="1"
-releasetag=0
-versiontype="spec"
-repourl=""
-repouser=""
-repopw=""
-dist="fedora-19-x86_64"
-pkg_dist_suffix="fc19"
-mock_cmd="/usr/bin/mock"
-vers_controller=""
-vers_ovsdb=""
-suff_controller=""
-suff_ovsdb=""
-mockdebug=""
-mockinit=0
-tmpbuild=""
-mockmvn=""
-timesuffix=""
-shortcircuits=0
-shortcircuite=0
-listprojects=0
-
-# Maven is not installed at the system wide level but at the Jenkins level
-# We need to map our Maven call to the Jenkins installed version
-mvn_cmd="$JENKINS_HOME/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4/bin/mvn"
-
-# Define our push repositories here. We do it in code since we can't
-# use a POM file for the RPM pushes (we're doing "one-off" file pushes)
-#
-# Repositories will be of the form baseRepositoryId-$dist{-testing}
-# -testing if it's a snapshot build (not using -snapshot as the name as
-# -testing is the more common testing repo suffix for yum)
-baseURL="http://nexus.opendaylight.org/content/repositories/opendaylight-yum-"
-baseRepositoryId="opendaylight-yum-"
-
-readonly RCSUCCESS=0
-readonly RCERROR=64
-readonly RCPARMSERROR=65
-readonly RCRPMBUILDERROR=66
-readonly RCRMOCKERROR=67
-readonly RCGITERROR=68
-
-readonly LOGERROR=2
-readonly LOGINFO=5
-readonly LOGVERBOSE=7
-loglevel=$LOGVERBOSE
-
-
-function log {
- local level=$1; shift;
-
- if [ $level -le $loglevel ]; then
- echo "buildrpm: $@"
- fi
-}
-
-function usage {
- local rc=$1
- local outstr=$2
-
- if [ "$outstr" != "" ]; then
- echo "$outstr"
- echo
- fi
-
- echo "Usage: `basename $0` [OPTION...]"
- echo
- echo "Build options:"
- echo " --buildtype TYPE build type, either snapshot or release, default snapshot"
- echo " --buildroot DIRECTORY build root path. The path must exist."
- echo " --buildtag tag the tmpbuild directory, i.e. Jenkins build number"
- echo " --cleanroot clean buildroot directory before building"
- echo " --cleantmp clean tmpbuild directory before building"
- echo " --dist DIST distribution, default fedora-19-x86_64"
- echo " --distsuffix SUFFIX package distribution suffix, default f19"
- echo " --getsource METHOD method for getting source clone|snapshot|buildroot, default buildroot"
- echo
- echo "Tag options:"
- echo " --releasetag use the latest release tagged repos"
- echo " --specrelease version used for spec Release:, default 1"
- echo " --versiontype TYPE where to find version, user|pom|spec, default spec"
- echo " --version VERSION version value to use in build output. Required for --version_type user option."
- echo " --edversion VERSION version value to use in build output for edition rpms"
- echo " --branch BRANCH branch to use for source"
- echo
- echo "Repo sync options:"
- echo " --repourl REPOURL url of the repo, include http://"
- echo " --repouser REPOUSER user for repo"
- echo " --repopw REPOPW password for repo"
- echo
- echo "Deployment options:"
- echo " --pushrpms push the built rpms to a maven repository"
- echo " --mvn_cmd fully qualified path to where the mvn command"
- echo " (defaults to Jenkins installation of Maven 3.0.4)"
- echo " --baseURL base deployment URL. \$dist will be added to the end of this"
- echo " If this is a snapshot build then -testing be added at the end"
- echo " --baseRepositoryId base repository name. \$dist will be added to the end of this"
- echo " If this is a snapshot build then -testing be added at the end"
- echo
- echo "Mock options:"
- echo " --mockinit Run mock init"
- echo " --mockmvn replace the maven command used within mock"
- echo
- echo "Help options:"
- echo " -?, -h, --help Display this help and exit"
- echo " --debug Enable bash debugging output"
- echo " --mockdebug Enable mock debugging output"
- echo
- echo "Extras:"
- echo " --shortcircuits INDEX Start build with project index"
- echo " --shortcircuite INDEX End build with project index"
- echo " --listprojects List the projects and indexes"
- echo " --timesuffix TIME Set the time suffix to use for build output"
-
- exit $rc
-}
-
-readonly PJ_FIRST=0
-readonly PJ_INTEGRATION=0
-readonly PJ_CONTROLLER=1
-readonly PJ_OVSDB=2
-readonly PJ_OPENFLOWJAVA=3
-readonly PJ_OPENFLOWPLUGIN=4
-readonly PJ_DEPENDENCIES=5
-readonly PJ_OPENDAYLIGHT=6
-readonly PJ_LISPFLOWMAPPING=7
-readonly PJ_SNMP4SDN=8
-readonly PJ_AFFINITY=9
-readonly PJ_YANGTOOLS=10
-readonly PJ_BGPCEP=11
-readonly PJ_OPENDOVE=12
-#readonly PJ_LAST=$PJ_BGPCEP
-readonly PJ_LAST=$PJ_OPENDOVE
-
-projects[$PJ_INTEGRATION]="integration"
-projects[$PJ_CONTROLLER]="controller"
-projects[$PJ_OVSDB]="ovsdb"
-projects[$PJ_OPENFLOWJAVA]="openflowjava"
-projects[$PJ_OPENFLOWPLUGIN]="openflowplugin"
-projects[$PJ_DEPENDENCIES]="controller-dependencies"
-projects[$PJ_OPENDAYLIGHT]="opendaylight"
-projects[$PJ_LISPFLOWMAPPING]="lispflowmapping"
-projects[$PJ_SNMP4SDN]="snmp4sdn"
-projects[$PJ_AFFINITY]="affinity"
-projects[$PJ_YANGTOOLS]="yangtools"
-projects[$PJ_BGPCEP]="bgpcep"
-projects[$PJ_OPENDOVE]="opendove"
-
-versions[$PJ_INTEGRATION]=""
-versions[$PJ_CONTROLLER]=""
-versions[$PJ_OVSDB]=""
-versions[$PJ_OPENFLOWJAVA]=""
-versions[$PJ_OPENFLOWPLUGIN]=""
-versions[$PJ_DEPENDENCIES]=""
-versions[$PJ_OPENDAYLIGHT]=""
-versions[$PJ_LISPFLOWMAPPING]=""
-versions[$PJ_SNMP4SDN]=""
-versions[$PJ_AFFINITY]=""
-versions[$PJ_YANGTOOLS]=""
-versions[$PJ_BGPCEP]=""
-versions[$PJ_OPENDOVE]=""
-
-suffix[$PJ_INTEGRATION]=""
-suffix[$PJ_CONTROLLER]=""
-suffix[$PJ_OVSDB]=""
-suffix[$PJ_OPENFLOWJAVA]=""
-suffix[$PJ_OPENFLOWPLUGIN]=""
-suffix[$PJ_DEPENDENCIES]=""
-suffix[$PJ_OPENDAYLIGHT]=""
-suffix[$PJ_LISPFLOWMAPPING]=""
-suffix[$PJ_SNMP4SDN]=""
-suffix[$PJ_AFFINITY]=""
-suffix[$PJ_YANGTOOLS]=""
-suffix[$PJ_BGPCEP]=""
-suffix[$PJ_OPENDOVE]=""
-
-gitprojects="$PJ_INTEGRATION $PJ_CONTROLLER $PJ_OVSDB $PJ_OPENFLOWJAVA $PJ_OPENFLOWPLUGIN $PJ_LISPFLOWMAPPING $PJ_SNMP4SDN $PJ_AFFINITY $PJ_YANGTOOLS $PJ_BGPCEP $PJ_OPENDOVE"
-
-# Clone the projects.
-function clone_source {
- local depth=$1
- for i in $gitprojects; do
- if [ depth -eq 0 ]; then
- # We only care about a shallow clone (no need to grab the entire project)
- log $LOGINFO "Shallow cloning ${projects[$i]} to $buildroot/${projects[$i]}"
- git clone --depth 0 https://git.opendaylight.org/gerrit/p/${projects[$i]}.git $buildroot/${projects[$i]}
- else
- log $LOGINFO "Full cloning ${projects[$i]} to $buildroot/${projects[$i]}"
- git clone https://git.opendaylight.org/gerrit/p/${projects[$i]}.git $buildroot/${projects[$i]}
- fi
- done
-}
-
-# Copy the projects from snapshots.
-# shague: Fill in with the nexus info.
-# Make mk_snapshot_archives that just sets up the version strings.
-function snapshot_source {
- log $LOGINFO "$FUNCNAME: Not implemented yet."
-}
-
-# Checkout the latest release-tagged branch.
-# TODO: does this work for branches or for multiple releases?
-function checkout_release_tag {
- local tag=""
-
- for i in $gitprojects; do
- # Leave integration as is. The release version has a bug. Assume the latest in the
- # repo is good.
- if [ "${projects[$i]}" == "${projects[$PJ_INTEGRATION]}" ]; then
- continue
- fi
- cd $buildroot/${projects[$i]}
- # Find the last release tag for the project.
- # We assume that the first git log matching "[maven-release-plugin] prepare release"
- # is where the tag was created.
- tag=$(git log | grep -m 1 "\[maven-release-plugin\] prepare release" | awk '{print $4}')
- if [ "$tag" != "" ]; then
- git checkout --quiet "$tag"
- else
- log $LOGERROR "${projects[i]} is missing release tag"
- exit $RCGITERROR
- fi
- done
-}
-
-# Checkout the requested branch.
-function checkout_branch {
- local branch=$1
-
- for i in $gitprojects; do
- cd $buildroot/${projects[$i]}
- git checkout $branch
- done
-}
-
-function set_versions {
- local timesuffix=$1
- local versiontype=$2
- local version=$3
- local buildtype=$4
-
- for i in $gitprojects; do
- case "$versiontype" in
- "user")
- # User set the version.
- versions[$i]=$version
- ;;
-
- "spec")
- # rpm query the spec file to get the Version.
- cd $buildroot/${projects[$PJ_INTEGRATION]}/packaging/rpm
- if [ ${projects[$i]} == ${projects[$PJ_INTEGRATION]} ]; then
- # use opendaylight spec since there is no integration spec
- versions[$i]="$( rpm -q --queryformat="%{version}\n" --specfile opendaylight.spec | head -n 1 | awk '{print $1}')"
- else
- versions[$i]="$( rpm -q --queryformat="%{version}\n" --specfile opendaylight-${projects[$i]}.spec | head -n 1 | awk '{print $1}')"
- fi
- ;;
-
- "pom")
- # Find the first version tag in the pom.xml file - this should be the correct version.
- # Then strip the version tags and end up with the version string.
- versions[$i]=$(grep -m 1 "<version>" $buildroot/${projects[$i]}/pom.xml | sed -n -e '/<version>/s/.*<version>//p' | sed -n -e 's/<\/version>//p')
- ;;
- esac
-
- if [ "$buildtype" == "snapshot" ]; then
- cd $buildroot/${projects[$i]}
- suffix[$i]="snap.$timesuffix.git.$(git log -1 --pretty=format:%h)"
- versions[$i]="${versions[$i]}.${suffix[$i]}"
- else
- suffix[$i]=""
- fi
-
- # Remove any -'s from the version. rpmbuild does not like them.
- version=${versions[$i]}
- versions[$i]=${version//-/.}
- done
-
- # The dependencies and opendaylight projects do not have a repo so set them to the
- # controller and integration versions.
-
- # Dependencies follows the controller.
- suffix[$PJ_DEPENDENCIES]=${suffix[$PJ_CONTROLLER]}
- versions[$PJ_DEPENDENCIES]=${versions[$PJ_CONTROLLER]}
-
- # Opendaylight follows integration since they are the editions, unless the
- # user wants to set the value explicitly.
- if [ "$edversion" == "" ]; then
- suffix[$PJ_OPENDAYLIGHT]=${suffix[$PJ_INTEGRATION]}
- versions[$PJ_OPENDAYLIGHT]=${versions[$PJ_INTEGRATION]}
- else
- suffix[$PJ_OPENDAYLIGHT]=""
- versions[$PJ_OPENDAYLIGHT]=$edversion
- fi
-}
-
-# Archive the projects to create the SOURCES for rpmbuild:
-# - xz the source for later use by rpmbuild.
-# - get the version and git hashes to produce a versions and suffix for each project.
-# - copy the archives to the SOURCES dir
-# shague: need another archive method for snapshot getsource builds since
-# the source did not come from a git repo.
-# versionmajor=0.1.0.snap.20140201.191633.git.7c5788d
-# versionsnapsuffix=snap.20140201.191633.git.7c5788d
-
-function mk_git_archives {
-# local timesuffix=$1
-
- for i in $gitprojects; do
- log $LOGINFO "Building archive: $tmpbuild/opendaylight-${projects[$i]}-${versions[$i]}.tar.xz"
- cd $buildroot/${projects[$i]}
- git archive --prefix=opendaylight-${projects[$i]}-${versions[$i]}/ HEAD | \
- xz > $tmpbuild/opendaylight-${projects[$i]}-${versions[$i]}.tar.xz
- done
-
- # Don't forget any patches.
- cp $buildroot/${projects[$PJ_INTEGRATION]}/packaging/rpm/opendaylight-integration-fix-paths.patch $tmpbuild
-}
-
-# Pushes rpms to the specified Nexus repository
-# This only happens if pushrpms is true
-function push_rpms {
- if [ $pushrpms = 1 ]; then
- allrpms=`find $tmpbuild/repo -iname '*.rpm'`
- echo
- log $LOGINFO "RPMS found"
- for i in $allrpms; do
- log $LOGINFO $i
- done
-
- log $LOGINFO ":::::"
- log $LOGINFO "::::: pushing RPMs"
- log $LOGINFO ":::::"
- for i in $allrpms; do
- rpmname=`rpm -qp --queryformat="%{name}" $i`
- rpmversion=`rpm -qp --queryformat="%{version}" $i`
- distro=`echo $dist | tr - .`
-
- if [ `echo $i | grep 'src.rpm'` ]; then
- rpmrelease=`rpm -qp --queryformat="%{release}.src" $i`
- groupId="srpm"
- else
- rpmrelease=`rpm -qp --queryformat="%{release}.%{arch}" $i`
- groupId="rpm"
- fi
-
-
- if [ "$buildtype" == "snapshot" ]; then
- repositoryId="${baseRepositoryId}${dist}-testing"
- pushURL="${baseURL}${dist}-testing"
- else
- repositoryId="${baseRepositoryId}${dist}"
- pushURL="${baseURL}${dist}"
- fi
-
- # Note version is the full version+release+{arch|src}
- # if it is not configured this way on pushes then a download
- # of the artifact will result in just the name-version.rpm
- # instead of name-version-release.{arch|src}.rpm
- $mvn_cmd org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy-file \
- -Dfile=$i -DrepositoryId=$repositoryId \
- -Durl=$pushURL -DgroupId=$groupId \
- -Dversion=$rpmversion-$rpmrelease -DartifactId=$rpmname \
- -Dtype=rpm
- done
- fi
-}
-
-function show_vars {
- cat << EOF
-Building controller using:
-distribution: $dist
-suffix: $pkg_dist_suffix
-buildtype: $buildtype
-versiontype: $versiontype
-version: $version
-edversion: $edversion
-branch: $branch
-specrelease: $specrelease
-releasetag: $releasetag
-getsource: $getsource
-buildroot: $buildroot
-buildtag: $buildtag
-tmpbuild: $tmpbuild
-mockmvn: $mockmvn
-mockinit: $mockinit
-shortcircuits: $shortcircuits
-shortcircuite: $shortcircuite
-time: $timesuffix
-EOF
-}
-
-# Build a single project.
-function build_project {
- local project="$1"
- local versionmajor="$2"
- local versionsnapsuffix="$3"
- local projectspec=""
-
- if [ "$project" == "opendaylight" ]; then
- projectspec="opendaylight"
- else
- projectspec="opendaylight-$project"
- fi
-
- log $LOGINFO ":::::"
- log $LOGINFO "::::: building $projectspec.rpm"
- log $LOGINFO ":::::"
-
- cp -f $buildroot/${projects[$PJ_INTEGRATION]}/packaging/rpm/$projectspec.spec $tmpbuild
-
- cd $tmpbuild
- # Rewrite the Version and Release values in the spec files.
- sed -r -i -e '/^Version:./c\Version: '"$versionmajor" $projectspec.spec
- if [ "$buildtype" == "release" ]; then
- if [ "$specrelease" != "" ]; then
- sed -r -i -e '/^Release:./c\Release: '"$specrelease%{?dist}" $projectspec.spec
- fi
- fi
-# if [ "$buildtype" == "release" ] && [ "$version" != "" ]; then
-# # Find lines starting with Version: and replace the whole line with the version requested
-# sed -r -i -e '/^Version:./c\Version: '"$versionmajor" $projectspec.spec
-# else
-# # Find lines starting with Version: and replace the rest of the line with the versionsnapsuffix
-# sed -r -i -e '/^Version:/s/\s*$/'".$versionsnapsuffix/" $projectspec.spec
-# fi
-
- # Set the right values in the spec files.
- case "$project" in
- ${projects[$PJ_CONTROLLER]})
- # Set the version for the integration source.
- # Find lines with opendaylight-integration-%{version} and replace %{version} with the version.
- sed -r -i -e '/opendaylight-integration-\%\{version\}/s/\%\{version\}/'"${versions[$PJ_INTEGRATION]}"'/g' \
- $projectspec.spec
- ;;
-
- ${projects[$PJ_DEPENDENCIES]})
- # Set the version for ovsdb in the dependencies spec.
- # Don't worry about opendaylight-controller version since the dependencies
- # version is the same as the controller version.
- # Find lines with opendaylight-ovsdb-%{version} and replace %{version} with the version.
- sed -r -i -e '/opendaylight-ovsdb-\%\{version\}/s/\%\{version\}/'"${versions[$PJ_OVSDB]}"'/g' \
- $projectspec.spec
- # Find lines with opendaylight-ovsdb-dependencies-%{version} and replace %{version} with the version.
- sed -r -i -e '/opendaylight-ovsdb-dependencies-\%\{version\}/s/\%\{version\}/'"${versions[$PJ_OVSDB]}"'/g' \
- $projectspec.spec
- ;;
-
- *)
- ;;
- esac
-
- # Rewrite the mvn command in the rpmbuild if the user requests it.
- if [ "$mockmvn" != "" ]; then
- # Find lines starting with export MAVEN_OPTS= and replace the whole line with $mockmvn
- sed -r -i -e '/^export MAVEN_OPTS=./c\ '"$mockmvn" $projectspec.spec
- fi
-
- # Build the source RPM for use by mock later.
- #rm -f SRPMS/*.src.rpm
- log $LOGINFO "::::: building $projectspec.src.rpm with rpmbuild"
- rpmbuild -bs --define '%_topdir '"`pwd`" --define '%_sourcedir %{_topdir}' \
- --define "%dist .$pkg_dist_suffix" $projectspec.spec
-
- rc=$?
- if [ $rc != 0 ]; then
- log $LOGERROR "rpmbuild of $projectspec.src.rpm failed (rc=$rc)."
- exit $RCRPMBUILDERROR
- fi
-
- log $LOGINFO "::::: building $projectspec.rpm with mock"
-
- if [ "$buildtype" == "release" ]; then
- resultdir="repo/$projectspec.$pkg_dist_suffix.noarch"
- else
- resultdir="repo/$projectspec.$pkg_dist_suffix.noarch.snap"
- fi
-
- # Build the rpm using mock.
- # Keep the build because we will need the distribution zip file for later
- # when building the controller-dependencies.rpm.
- eval $mock_cmd $mockdebug -r $dist --no-clean --no-cleanup-after --resultdir \"$resultdir\" \
- -D \"dist .$pkg_dist_suffix\" -D \"noclean 1\" \
- SRPMS/$projectspec-$versionmajor-*.src.rpm
-
- rc=$?
- if [ $rc != 0 ]; then
- log $LOGERROR "mock of $projectspec.rpm failed (rc=$rc)."
- exit $RCRMOCKERROR
- fi
-
- log $LOGINFO "::::: finished building $projectspec.rpm in mock"
-
- # Copy the distribution zip from the controller and ovsdb projects
- # for use in the dependencies.rpm.
- case "$project" in
- ${projects[$PJ_CONTROLLER]})
- log $LOGINFO "::::: Copying $projectspec distribution.zip."
- eval $mock_cmd $mockdebug -r $dist --no-clean --no-cleanup-after --resultdir \"$resultdir\" \
- -D \"dist .$pkg_dist_suffix\" -D \"noclean 1\" \
- --copyout \"builddir/build/BUILD/$projectspec-$versionmajor/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage.zip\" \"$resultdir/$projectspec-$versionmajor.zip\"
- rc1=$?
- ln -sf $resultdir/$projectspec-$versionmajor.zip $tmpbuild
- rc2=$?
- if [ ! -e $tmpbuild/$projectspec-$versionmajor.zip ]; then
- log $LOGERROR "cannot find $projectspec distribution zip file (rc=$rc1:$rc2)."
- exit $RCERROR
- fi
- ;;
-
- ${projects[$PJ_OVSDB]})
- log $LOGINFO "::::: Copying $projectspec distribution.zip."
- # Grab the version from the pom.xml file.
- # Get the lines between the parent tags, then get the line with the version tag and remove leading space and
- # the tag itself, then remove the trailing tag to be left with the version.
- pomversion=`sed -n -e '/<parent>/,/<\/parent>/p' "$buildroot/${projects[$PJ_OVSDB]}/pom.xml" | sed -n -e '/<version>/s/.*<version>//p' | sed -n -e 's/<\/version>//p'`
- eval $mock_cmd $mockdebug -r $dist --no-clean --no-cleanup-after --resultdir \"$resultdir\" \
- -D \"dist .$pkg_dist_suffix\" -D \"noclean 1\" \
- --copyout \"builddir/build/BUILD/$projectspec-$versionmajor/distribution/opendaylight/target/distribution.ovsdb-$pomversion-osgipackage.zip\" \"$resultdir/$projectspec-$versionmajor.zip\"
- rc1=$?
- ln -sf $resultdir/$projectspec-$versionmajor.zip $tmpbuild
- rc2=$?
- if [ ! -e $tmpbuild/$projectspec-$versionmajor.zip ]; then
- log $LOGERROR "cannot find $projectspec distribution zip file (rc=$rc1:$rc2)."
- exit $RCERROR
- fi
- ;;
-
- *)
- ;;
- esac
-}
-
-# Main function that builds the rpm's for snapshot's.
-function build_snapshot {
- set_versions "$timesuffix" "$versiontype" "$version" "$buildtype"
- mk_git_archives "$timesuffix"
-
- # Initialize our mock build location (we'll be using --no-clean later)
- # If we don't do the first init we can't build since the environment
- # doesn't get setup correctly!
- if [ $mockinit -eq 1 ]; then
- eval $mock_cmd $mockdebug -r $dist --init
- fi
-
- start=$PJ_CONTROLLER
- end=$PJ_LAST
-
- if [ $shortcircuits -ne 0 ]; then
- start=$shortcircuits
- fi
-
- if [ $shortcircuite -ne 0 ]; then
- end=$shortcircuite
- fi
-
- echo "start:end = $start:$end"
-
- for i in `seq $start $end`; do
- build_project "${projects[$i]}" "${versions[$i]}" "${suffix[$i]}"
- done
-
- log $LOGINFO ":::::"
- log $LOGINFO "::::: All projects have been built"
- log $LOGINFO ":::::"
-
- push_rpms
-}
-
-# Main function that builds the rpm's for release's.
-# shague: should be similar to snapshot but use a different version or tag.
-# spec files should be updated with correct version. If so, do
-function build_release {
- log $LOGINFO "$FUNCNAME: Not implemented yet."
-}
-
-function parse_options {
- while true ; do
- case "$1" in
- --debug)
- set -vx; shift;
- ;;
-
- --mockdebug)
- mockdebug="-v"; shift;
- ;;
-
- --buildtype)
- shift; buildtype="$1"; shift;
- if [ "$buildtype" != "snapshot" ] && [ "$buildtype" != "release" ]; then
- usage $RCPARMSERROR "Invalid build type.";
- fi
- ;;
-
- --buildroot)
- shift; buildroot="$1"; shift;
- if [ "$buildroot" == "" ]; then
- usage $RCPARMSERROR "Missing build root.";
- fi
- if [ ! -d "$buildroot" ]; then
- usage $RCPARMSERROR "Invalid build root path."
- fi
- ;;
-
- --buildtag)
- shift; buildtag="$1"; shift;
- if [ "$buildtag" == "" ]; then
- usage $RCPARMSERROR "Missing build tag.";
- fi
- ;;
-
- --cleanroot)
- cleanroot=1; shift;
- ;;
-
- --cleantmp)
- cleantmp=1; shift;
- ;;
-
- --getsource)
- shift; getsource="$1"; shift;
- if [ "$getsource" != "clone" ] && [ "$getsource" != "snapshot" ] && \
- [ "$getsource" != "buildroot" ]; then
- usage $RCPARMSERROR "Invalid getsource method.";
- fi
- ;;
-
- --dist)
- shift; dist="$1"; shift;
- if [ "$dist" == "" ]; then
- usage $RCPARMSERROR "Missing distribution.";
- fi
- ;;
-
- --distsuffix)
- shift; pkg_dist_suffix="$1"; shift;
- if [ "$pkg_dist_suffix" == "" ]; then
- usage $RCPARMSERROR "Missing package distribution suffix.";
- fi
- ;;
-
- --versiontype)
- shift; versiontype="$1"; shift;
- if [ "$versiontype" != "user" ] && [ "$versiontype" != "pom" ] && [ "$versiontype" != "spec" ]; then
- usage $RCPARMSERROR "Invalid version type.";
- fi
- ;;
-
- --specrelease)
- shift; specrelease="$1"; shift;
- if [ "$specrelease" == "" ]; then
- usage $RCPARMSERROR "Missing specrelease.";
- fi
- ;;
-
- --releasetag)
- releasetag=1; shift;
- ;;
-
- --version)
- shift; version="$1"; shift;
- if [ "$version" == "" ]; then
- usage $RCPARMSERROR "Missing version.";
- fi
- ;;
-
- --edversion)
- shift; edversion="$1"; shift;
- if [ "$edversion" == "" ]; then
- usage $RCPARMSERROR "Missing edversion.";
- fi
- ;;
-
- --branch)
- shift; branch="$1"; shift;
- if [ "$branch" == "" ]; then
- usage $RCPARMSERROR "Missing branch.";
- fi
- depth=1
- ;;
-
- --repourl)
- shift; repourl="$1"; shift;
- if [ "$repourl" == "" ]; then
- usage $RCPARMSERROR "Missing repo url.";
- fi
- ;;
-
- --repouser)
- shift; repouser="$1"; shift;
- if [ "$repouser" == "" ]; then
- usage $RCPARMSERROR "Missing repo user.";
- fi
- ;;
-
- --repopw)
- shift; repopw="$1"; shift;
- if [ "$repopw" == "" ]; then
- usage $RCPARMSERROR "Missing repo pw.";
- fi
- ;;
-
- --pushrpms)
- pushrpms=1; shift;
- ;;
-
- --timesuffix)
- shift; timesuffix="$1"; shift;
- if [ "$timesuffix" == "" ]; then
- usage $RCPARMSERROR "Missing time suffix.";
- fi
- ;;
-
- --mvn_cmd)
- shift; mvn_cmd="$1"; shift;
- if [ "$mvn_cmd" == "" ]; then
- usage $RCPARMSERROR "Missing mvn_cmd.";
- fi
- ;;
-
- --mockinit)
- mockinit=1; shift;
- ;;
-
- --mockmvn)
- shift; mockmvn="$1"; shift;
- if [ "$mockmvn" == "" ]; then
- usage $RCPARMSERROR "Missing mockmvn.";
- fi
- ;;
-
- --baseURL)
- shift; baseURL="$1"; shift;
- if [ "$baseURL" == "" ]; then
- usage $RCPARMSERROR "Missing baseURL.";
- fi
- ;;
-
- --baseRepositoryId)
- shift; baseRepositoryId="$1"; shift;
- if [ "$baseRepositoryId" == "" ]; then
- usage $RCPARMSERROR "Missing baseRepositoryId.";
- fi
- ;;
-
- --shortcircuits)
- shift; shortcircuits=$1; shift;
- ;;
-
- --shortcircuite)
- shift; shortcircuite=$1; shift;
- ;;
-
- --listprojects)
- listprojects=1; shift;
- ;;
-
- -? | -h | --help)
- usage $RCSUCCESS
- ;;
- "")
- break
- ;;
- *)
- log $LOGINFO "Ignoring unknown option: $1"; shift;
- esac
- done
-}
-
-
-#################### main ####################
-
-if [ "$timesuffix" == "" ]; then
- timesuffix="$(date +%F_%T | tr -d .:- | tr _ .)"
-fi
-date_start=$(date +%s)
-
-parse_options "$@"
-
-if [ $listprojects -eq 1 ]; then
- for i in `seq $PJ_FIRST $PJ_LAST`; do
- echo "$i ${projects[$i]}"
- done
- exit $RCSUCCESS
-fi
-
-# Some more error checking...
-if [ -z $buildroot ]; then
- log $LOGERROR "Mising buildroot"
- exit $RCPARMSERROR
-fi
-
-if [ $cleanroot -eq 1 ] && [ $getsource = "buildroot" ]; then
- log $LOGERROR "Aborting. You probably do not want to clean the directory" \
- "containing the source."
- exit $RCPARMSERROR
-fi
-
-if [ "$versiontype" != "user" ] && [ "$version" == "" ]; then
- log $LOGERROR "version type user requires a version"
-fi
-
-# Can change tmpbuild to be an index or other tag
-if [ -n "$buildtag" ]; then
- tmpbuild="$buildroot/bld_$buildtag"
-else
- tmpbuild="$buildroot/bld"
-fi
-
-show_vars
-
-if [ $cleanroot -eq 1 ]; then
- rm -rf $buildroot
- mkdir -p $buildroot
-fi
-
-if [ $cleantmp -eq 1 ]; then
- rm -rf $tmpbuild
-fi
-
-# Setup the temp build directory.
-mkdir -p $tmpbuild/repo
-
-# Get the source.
-case "$getsource" in
-clone)
- clone_source "$depth";
-
- if [ -n "$branch" ]; then
- checkout_branch $branch
- fi
-
- if [ $releasetag -eq 1 ]; then
- checkout_release_tag
- fi
- ;;
-
-snapshot)
- snapshot_source;
- exit $RCSUCCESS
- ;;
-
-buildroot)
- cd $buildroot
-
- # Check if all the projects dirs are really there.
- for i in $gitprojects; do
- if [ ! -d ${projects[$i]} ]; then
- log $LOGERROR "Missing ${projects[$i]}"
- exit $RCPARMSERROR
- fi
- done
-
- if [ -n "$branch" ]; then
- checkout_branch $branch
- fi
-
- if [ $releasetag -eq 1 ]; then
- checkout_release_tag
- fi
-
- ;;
-esac
-#exit $RCSUCCESS
-if [ "$buildtype" == "snapshot" ]; then
- log $LOGINFO "Building a snapshot build"
- build_snapshot
-else
- log $LOGINFO "Building a release build"
- build_snapshot
-fi
-
-date_end=$(date +%s)
-diff=$(($date_end - $date_start))
-log $LOGINFO "Build took $(($diff / 3600 % 24)) hours $(($diff / 60 % 60)) minutes and $(($diff % 60)) seconds."
-
-exit $RCSUCCESS
--- /dev/null
+#!/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
+ fi
+fi
+
+echo "Will repeatedly attempt connecting to Karaf shell until it's ready"
+# Loop until exit status 0 (success) given by Karaf shell
+# Exit status 255 means Karaf shell isn't open for SSH connections yet
+# Exit status 1 means `dropAllPacketsRpc on` isn't runnable yet
+until sshpass -p karaf ssh -p $KARAF_SHELL_PORT -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password karaf@localhost
+do
+ echo "Karaf shell isn't ready yet, sleeping 5 seconds..."
+ sleep 5
+done
--- /dev/null
+#!/usr/bin/env sh
+
+# Update if needed
+rpm_path="$HOME/rpmbuild/RPMS/noarch/opendaylight-0.2.1-5.fc20.noarch.rpm"
+
+# Install ODL
+echo "Installing ODL"
+sudo rpm -i $rpm_path
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-affinity
-Version: 0.1.0
-Release: 0.1.0%{?dist}
-Summary: OpenDaylight affinity
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/affinity.git
-# cd affinity
-# git archive --prefix=opendaylight-affinity-0.1.0/ HEAD | xz > opendaylight-affinity-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-OpenDaylight affinity is a southbound plugin that can control
-off-the-shelf commodity Ethernet switches using SNMP.
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Create the directories:
-install -d -m 755 %{buildroot}%{resources_dir}/plugins
-
-while read artifact; do
- src=$(find . -name "*${artifact}")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.affinity.${tgt}
- fi
-done <<'.'
-affinity-*.jar
-affinity.implementation-*.jar
-affinity.northbound-*.jar
-analytics-*.jar
-analytics.implementation-*.jar
-analytics.northbound-*.jar
-flatl2-*.jar
-flatl2.northbound-*.jar
-l2agent-*.jar
-.
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-bgpcep
-Version: 0.1.0
-Release: 0.2.0%{?dist}
-Summary: OpenDaylight bgpcep
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/bgpcep.git
-# cd bgpcep
-# git archive --prefix=opendaylight-bgpcep-0.1.0/ HEAD | xz > opendaylight-bgpcep-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-BGP/LS and PCEP project is an effort to bring two south-bound plugins
-into the controller: one for supporting BGP Linkstate Distribution as
-a source of L3 topology information, the other one to add support for
-Path Computation Element Protocol as a way to instantiate paths into
-the underlying network.
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Create the directories:
-install -d -m 755 %{buildroot}%{resources_dir}/plugins
-
-while read artifact; do
- src=$(find . -name "*${artifact}")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.bgpcep.${tgt}
- fi
-done <<'.'
-bgp-concepts-*.jar
-bgp-controller-config-*.jar
-bgp-linkstate-*.jar
-bgp-linkstate-config-*.jar
-bgp-parser-api-*.jar
-bgp-parser-impl-*.jar
-bgp-parser-spi-*.jar
-bgp-parser-spi-config-*.jar
-bgp-rib-api-*.jar
-bgp-rib-api-config-*.jar
-bgp-rib-impl-*.jar
-bgp-rib-impl-config-*.jar
-bgp-rib-spi-*.jar
-bgp-rib-spi-config-*.jar
-bgp-topology-provider-*.jar
-bgp-topology-provider-config-*.jar
-bgp-update-api-config-*.jar
-bgp-util-*.jar
-concepts-*.jar
-pcep-api-*.jar
-pcep-api-config-*.jar
-pcep-controller-config-*.jar
-pcep-ietf-stateful02-*.jar
-pcep-ietf-stateful07-*.jar
-pcep-impl-*.jar
-pcep-impl-config-*.jar
-pcep-spi-*.jar
-pcep-spi-config-*.jar
-pcep-testtool-*.jar
-pcep-topology-api-*.jar
-pcep-topology-provider-*.jar
-pcep-topology-provider-config-*.jar
-pcep-topology-spi-*.jar
-pcep-tunnel-api-*.jar
-pcep-tunnel-provider-*.jar
-pcep-tunnel-provider-config-*.jar
-programming-api-*.jar
-programming-controller-config-*.jar
-programming-impl-*.jar
-programming-impl-config-*.jar
-programming-spi-*.jar
-programming-spi-config-*.jar
-programming-topology-api-*.jar
-programming-tunnel-api-*.jar
-rsvp-api-*.jar
-tcpmd5-api-*.jar
-tcpmd5-api-cfg-*.jar
-tcpmd5-jni-*.jar
-tcpmd5-jni-cfg-*.jar
-tcpmd5-netty-*.jar
-tcpmd5-netty-cfg-*.jar
-tcpmd5-nio-*.jar
-topology-api-*.jar
-topology-api-config-*.jar
-topology-tunnel-api-*.jar
-util-*.jar
-.
-
-install -d -m 755 %{buildroot}%{resources_dir}/configuration/initial
-
-while read config; do
- src=$(find . -not -path "*/src/*" -name "${config}")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/configuration/initial/${tgt}
- fi
-done <<'.'
-30-programming.xml
-31-bgp.xml
-32-pcep.xml
-39-pcep-provider.xml
-41-bgp-example.xml
-.
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Tue May 13 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Add additional artifacts and xml files.
-
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-Name: opendaylight-controller-dependencies
-Version: 0.1.0
-Release: 0.4.0%{?dist}
-Summary: OpenDaylight SDN Controller Dependencies
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# The sources are built by the other projects so just copy them:
-# cp ~/rpmbuild/BUILD/opendaylight-controller-0.1.0/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage.zip ~/rpmbuild/SOURCES/opendaylight-controller-%{version}.zip
-# cp ~/rpmbuild/BUILD/opendaylight-ovsdb-0.1.0/distribution/opendaylight/target/distribution.ovsdb-1.0.0-SNAPSHOT-osgipackage.zip ~/rpmbuild/SOURCES/opendaylight-ovsdb-%{version}.zip
-Source0: opendaylight-controller-%{version}.zip
-Source1: opendaylight-ovsdb-%{version}.zip
-BuildArch: noarch
-Requires: java >= 1:1.7.0
-
-# Here you should have at least dependencies for the packages containing .jar
-# files that you want to create symlinks to:
-# First pass just use everything from the distribution zip.
-#Requires: slf4j
-
-# This is the directory where all dependencies will go:
-# /usr/share/java/opendaylight-controller-dependencies
-%global deps_dir %{_javadir}/%{name}
-
-%description
-OpenDaylight SDN Controller Dependencies
-
-
-%prep
-
-%setup -q -c -n opendaylight-controller-dependencies-%{version}
-%setup -q -T -a 1 -c -n opendaylight-ovsdb-dependencies-%{version}
-
-
-%build
-exit 0
-
-
-%install
-
-mv -f ../opendaylight-controller-dependencies-%{version}/opendaylight/lib/* opendaylight/lib/
-mv -f ../opendaylight-controller-dependencies-%{version}/opendaylight/plugins/* opendaylight/plugins/
-
-# Create the directory for the dependencies:
-mkdir -p %{buildroot}%{deps_dir}
-
-for src in $( ls -I "org.opendaylight.*" opendaylight/lib );
-do
- #tgt=$(echo ${src} | sed -e "s/-[0-9].*/.jar/")
- #mv opendaylight/lib/${src} %{buildroot}%{deps_dir}/${tgt}
- mv opendaylight/lib/${src} %{buildroot}%{deps_dir}/${src}
-done
-
-for src in $( ls -I "org.opendaylight.*" opendaylight/plugins );
-do
- #tgt=$(echo ${src} | sed -e "s/-[0-9].*/.jar/")
- #mv opendaylight/plugins/${src} %{buildroot}%{deps_dir}/${tgt}
- mv opendaylight/plugins/${src} %{buildroot}%{deps_dir}/${src}
-done
-
-
-%files
-
-# Own the directory containing the dependencies and its contents:
-%{deps_dir}
-
-
-%changelog
-* Sat Jan 18 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.4.0
-- Minor cleanup to setup option.
-
-* Thu Jan 02 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.3.0
-- Updates to include building distributions.
-
-* Fri Nov 22 2013 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Updates to support building rpm with jenkins.
-
-* Fri Nov 01 2013 Sam Hague <shague@redhat.com> - 0.1.0-0.1.20131007git31c8f18
-- Initial Fedora package.
+++ /dev/null
-opendaylight - nofile 30720
-opendaylight - nproc 20480
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-controller
-Version: 0.1.0
-Release: 0.12.0%{?dist}
-Summary: OpenDaylight SDN Controller
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/controller.git
-# cd controller
-# git archive --prefix=opendaylight-controller-0.1.0/ HEAD | xz > opendaylight-controller-0.1.0.tar.xz
-# git clone https://git.opendaylight.org/gerrit/p/integration.git
-# cd integration
-# git archive --prefix=opendaylight-integration-0.1.0/HEAD | xz > opendaylight-integration-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-Source1: opendaylight-integration-%{version}.tar.xz
-Patch0: opendaylight-integration-fix-paths.patch
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-%if 0%{?fedora}
-BuildRequires: systemd
-%else
-BuildRequires: sysvinit-tools
-%endif
-
-
-# todo: Need to create proper packages for all the dependencies.
-# Here you should have at least dependencies for the packages containing .jar
-# files that you want to create symlinks to. For now all the jars in a
-# dependencies package.
-#Requires: slf4j
-
-#Requires: %{name}-dependencies
-#Requires: opendaylight-openflowjava
-#Requires: opendaylight-openflowplugin
-
-%if 0%{?fedora}
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
-%else
-# use sysV for rhel
-Requires(post): chkconfig
-Requires(preun): chkconfig
-
-# This is for /sbin/service
-Requires(preun): initscripts
-Requires(postun): initscripts
-%endif
-
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/%{name}
-
-# This is the directory where variable data used by the application should be
-# created: /var/lib/opendaylight
-%global data_dir %{_localstatedir}/lib/%{name}
-
-# This is the directory where the application stores its configuration:
-# /etc/opendaylight
-%global configuration_dir %{_sysconfdir}/%{name}
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-# This is the integration buildsubdir and packaging dirs:
-#%global intbuildsubdir %{_builddir}/%{buildsubdir}/opendaylight-integration-%{version}
-%global pkgdir opendaylight-integration-%{version}/packaging/rpm
-
-
-%description
-The OpenDaylight SDN Controller Platform provides the core services
-and abstractions needed for building an SDN controller.
-
-
-%prep
-
-%setup -q
-%setup -q -D -T -a 1
-cd opendaylight-integration-%{version}
-%patch0 -p1
-
-
-# In more restrictive distributions we should also here remove from the source
-# package any third party binaries, or replace them with those provided by the
-# distribution, before performing the actual build.
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Extract the contents of the distribution to a temporary directory so that we
-# can take things from there and move them to the correct locations:
-mkdir -p tmp
-unzip -o -d tmp opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage.zip
-
-# Create the directories:
-mkdir -p %{buildroot}%{configuration_dir}
-mkdir -p %{buildroot}%{resources_dir}/configuration
-mkdir -p %{buildroot}%{data_dir}/configuration
-
-mv tmp/opendaylight/configuration/config.ini %{buildroot}%{configuration_dir}
-sed -i -e 's/#\ ovsdb.of.version=1.3/ovsdb.of.version=1.3/' %{buildroot}%{configuration_dir}/config.ini
-ln -s %{configuration_dir}/config.ini %{buildroot}%{data_dir}/configuration
-mv tmp/opendaylight/configuration/* %{buildroot}%{resources_dir}/configuration
-rmdir tmp/opendaylight/configuration
-ln -s %{resources_dir}/configuration/initial %{buildroot}%{data_dir}/configuration
-ln -s %{resources_dir}/configuration/context.xml %{buildroot}%{data_dir}/configuration
-ln -s %{resources_dir}/configuration/logback.xml %{buildroot}%{data_dir}/configuration
-ln -s %{resources_dir}/configuration/tomcat-server.xml %{buildroot}%{data_dir}/configuration
-ln -s %{resources_dir}/configuration/tomcat-logging.properties %{buildroot}%{data_dir}/configuration
-ln -s %{resources_dir}/configuration/RSA.pk %{buildroot}%{data_dir}/configuration
-
-mv tmp/opendaylight/* %{buildroot}%{resources_dir}
-
-ln -s %{resources_dir}/lib %{buildroot}%{data_dir}
-ln -s %{resources_dir}/plugins %{buildroot}%{data_dir}
-
-%if 0%{?fedora}
-install -m 644 -D %{pkgdir}/%{name}.systemd %{buildroot}%{_unitdir}/%{name}.service
-%else
-install -m 644 -D %{pkgdir}/%{name}.sysv %{buildroot}%{_initddir}/%{name}
-install -m 644 -D %{pkgdir}/%{name}.limits %{buildroot}%{_sysconfdir}/security/limits.d/%{name}
-%endif
-install -m 644 -D %{pkgdir}/%{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}
-
-# Fix all the run.sh files to the right names.
-install -m 755 -D %{buildroot}%{resources_dir}/run.sh %{buildroot}%{resources_dir}/run.internal.sh
-install -m 755 -D opendaylight-integration-%{version}/distributions/base/src/assemble/resources/run.sh \
- %{buildroot}%{resources_dir}/run.base.sh
-rm %{buildroot}%{resources_dir}/run.sh
-install -m 755 -D opendaylight-integration-%{version}/distributions/virtualization/src/assemble/resources/run.sh \
- %{buildroot}%{resources_dir}/run.sh
-install -m 755 -D opendaylight-integration-%{version}/packaging/rpm/run.odl.sh %{buildroot}%{resources_dir}/run.odl.sh
-
-# Usually one wants to replace the .jar files of the dependencies by symlinks
-# to the ones provided to the system. This assumes the dependencies have been
-# installed as separate packages and listed in the Requires header.
-cd %{buildroot}%{resources_dir}/lib
-for src in $( ls -I "org.opendaylight.*" );
-do
- rm -f ${src}
- #tgt=$(echo ${src} | sed -e "s/-[0-9].*/.jar/")
- #ln -s %{deps_dir}/${tgt} ${src}
- ln -s %{deps_dir}/${src} ${src}
-done
-
-cd %{buildroot}%{resources_dir}/plugins
-# rm the yangtools since they are part of the yangtools.rpm, but keep the yangtools.thirdparty
-mv org.opendaylight.yangtools.thirdparty.* /tmp
-rm -f org.opendaylight.yangtools.*
-mv /tmp/org.opendaylight.yangtools.thirdparty.* .
-for src in $( ls -I "org.opendaylight.*" );
-do
- rm -f ${src}
- #tgt=$(echo ${src} | sed -e "s/-[0-9].*/.jar/")
- #ln -s %{deps_dir}/${tgt} ${src}
- ln -s %{deps_dir}/${src} ${src}
-done
-
-
-# Fix the permissions as they come with all the permissions (mode 777)
-# from the .zip file:
-find %{buildroot}%{resources_dir} -type d -exec chmod 755 {} \;
-find %{buildroot}%{resources_dir} -type f -exec chmod 644 {} \;
-find %{buildroot}%{data_dir} -type d -exec chmod 755 {} \;
-find %{buildroot}%{data_dir} -type f -exec chmod 755 {} \;
-chmod 755 %{buildroot}%{resources_dir}/run.sh
-chmod 755 %{buildroot}%{resources_dir}/run.base.sh
-chmod 755 %{buildroot}%{resources_dir}/run.internal.sh
-chmod 755 %{buildroot}%{resources_dir}/run.odl.sh
-%if 0%{?rhel}
-chmod 755 %{buildroot}%{_initddir}/%{name}
-%endif
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%pre
-
-# todo: register the opendaylight group:user.
-# Create the group and user that will run the service before installing the
-# package, as some of the files and directories will be owned by this user:
-getent group opendaylight > /dev/null
-if [ "$?" != 0 ]; then
- groupadd \
- -f \
- -r \
- opendaylight
-fi
-
-getent passwd opendaylight > /dev/null
-if [ "$?" != 0 ]; then
- useradd \
- -r \
- -g opendaylight \
- -c "OpenDaylight SDN" \
- -s /sbin/nologin \
- -d %{data_dir} \
- opendaylight
-fi
-
-# Currently not enabling service on boot.
-#%post
-#%systemd_post %{name}.service
-
-%preun
-%if 0%{?fedora}
-%systemd_preun %{name}.service
-%else
-if [ $1 -eq 0 ] ; then
- /sbin/service %{name} stop >/dev/null 2>&1
- /sbin/chkconfig --del %{name}
-fi
-%endif
-
-%postun
-%if 0%{?fedora}
-%systemd_postun
-%else
-if [ "$1" -ge "1" ] ; then
- /sbin/service %{name} condrestart >/dev/null 2>&1 || :
-fi
-%endif
-
-%clean
-# This check is used for mock build so the build files are not deleted.
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-%if 0%{?fedora}
-%{_unitdir}/%{name}.service
-%else
-%{_initddir}/%{name}
-%{_sysconfdir}/security/limits.d/%{name}
-%endif
-
-# Configuration files should marked as such, so that they aren't overwritten
-# when updating the package:
-%dir %{configuration_dir}
-%config(noreplace) %{configuration_dir}/config.ini
-%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
-
-# The data directory needs to be owned by the user that will run the service,
-# as it will need to write inside:
-%attr(-, opendaylight, opendaylight) %{data_dir}
-
-# Documentation:
-%doc LICENSE
-%doc NOTICE
-%doc README.OPENDAYLIGHT
-
-%endif
-
-%changelog
-* Mon Feb 10 2014 Miroslav Miklus <mmiklus@cisco.com> - 0.1.0-0.12.0
-- Updates to include higher resource limits.
-
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.11.0
-- Remove yangtools artifacts.
-
-* Sat Feb 01 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.10.0
-- Changed package name to opendaylight.
-- Removed openflowjava and openflowplugin Requires.
-
-* Wed Jan 22 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.9.0
-- Updates to support editions.
-
-* Wed Jan 22 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.8.0
-- Fix changelog day error.
-
-* Fri Jan 10 2014 Hsin-Yi Shen <hshen@redhat.com> - 0.1.0-0.7.0
-- Updates to include openflowjava and openflowplugin.
-
-* Fri Jan 10 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.6.0
-- Updates to include new configuration files.
-
-* Thu Jan 09 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.5.0
-- Updates for OF1.3 support.
-
-* Thu Jan 02 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.4.0
-- Updates to include building distributions.
-
-* Mon Dec 23 2013 Hsin-Yi Shen <hshen@redhat.com> - 0.1.0-0.3.0
-- Updates to support building rpm for both RHEL and fedora.
-
-* Fri Nov 22 2013 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Updates to support building rpm with jenkins.
-
-* Tue Nov 12 2013 Sam Hague <shague@redhat.com> - 0.1.0-0.1.20131007git20dcbd1
-- Modify the source tarball instructions and name.
-
-* Wed Nov 06 2013 Sam Hague <shague@redhat.com> - 0.1.0-0.1.20131007git2f02ee4
-- Add systemd support to install the service.
-- Simplify the file permission modification logic.
-- Modify the mvn command to not build tests.
-
-* Fri Nov 01 2013 Sam Hague <shague@redhat.com> - 0.1.0-0.1.20131007git31c8f18
-- Modify to include opendaylight-controller-dependencies.
-- Do not delete the files in var
-
-* Mon Oct 07 2013 Sam Hague <shague@redhat.com> - 0.1.0-0.1.20131007gitd684dd4
-- Initial Fedora package.
+++ /dev/null
-# The installation and configuration directories:
-ODL_BASEDIR=/var/lib/opendaylight-controller
-ODL_DATADIR=/var/lib/opendaylight-controller
-
-# The path to the java jre or jdk:
-#JAVA_HOME=/usr
-
-# The requested distribution:
-# Use the following table to select the distribution:
-# Distribution Value
-# -------------------- -----------
-# base base
-# virtualization ovsdb virt-ovsdb
-# virtualization vtn virt-vtn
-# virtualization opendove virt-opendove
-# virtualization affinity virt-affinity
-# service provider sp
-ODL_DIST="base"
-
-# Any additional options required.
-# I.E. -of13, -debug, or -console
-ODL_OPTS=""
\ No newline at end of file
+++ /dev/null
-[Unit]
-Description=OpenDaylight Controller
-After=network.service
-
-[Service]
-Type=forking
-PIDFile=/tmp/opendaylight.PID
-User=opendaylight
-Group=opendaylight
-EnvironmentFile=-/etc/sysconfig/opendaylight-controller
-WorkingDirectory=/var/lib/opendaylight-controller
-LimitNOFILE=30720
-LimitNPROC=20480
-ExecStart=-/usr/share/opendaylight-controller/run.odl.sh $ODL_DIST $ODL_OPTS -start
-ExecStop=-/usr/share/opendaylight-controller/run.odl.sh -stop
-
-[Install]
-WantedBy=multi-user.target
+++ /dev/null
-#!/bin/sh
-#
-# Opendaylight controller
-#
-# chkconfig: 2345 95 15
-# description: OpenDaylight Controller
-
-### BEGIN INIT INFO
-# Provides: opendaylight-controller
-# Required-Start: $network
-# Required-Stop: $network
-# Should-Start:
-# Should-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: start and stop opendaylight controller
-# Description: Opendaylight controller
-### END INIT INFO
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-exec="/usr/share/opendaylight-controller/run.odl.sh"
-prog="opendaylight-controller"
-config="/etc/opendaylight-controller/config.ini"
-
-[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-lockfile=/var/lock/subsys/$prog
-
-start() {
- [ -x $exec ] || exit 5
- [ -f $config ] || exit 6
- echo -n $"Starting $prog: "
- # if not running, start it up here, usually something like "daemon $exec"
- $exec $ODL_DIST $ODL_OPTS -start
- retval=$?
- echo
- # [ $retval -eq 0 ] && touch $lockfile
- return $retval
-}
-
-stop() {
- echo -n $"Stopping $prog: "
- # stop it here, often "killproc $prog"
- $exec -stop
- retval=$?
- echo
- # [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-force_reload() {
- restart
-}
-
-rh_status() {
- # run checks to determine if the service is running or use generic status
- #status $prog
- $exec -status
-}
-
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
-
-case "$1" in
- start)
- rh_status_q && exit 0
- $1
- ;;
- stop)
- rh_status_q || exit 0
- $1
- ;;
- restart)
- $1
- ;;
- reload)
- rh_status_q || exit 7
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
- ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-esac
-exit $?
+++ /dev/null
-diff -uNr opendaylight-integration-0.1.0/distributions/base/src/assemble/resources/run.sh opendaylight-integration-0.1.0p/distributions/base/src/assemble/resources/run.sh
---- opendaylight-integration-0.1.0/distributions/base/src/assemble/resources/run.sh 2014-01-22 17:37:08.000000000 -0500
-+++ opendaylight-integration-0.1.0p/distributions/base/src/assemble/resources/run.sh 2014-01-22 17:40:53.706000212 -0500
-@@ -42,4 +42,4 @@
- FILTER=${FILTERBEGINING}${OF_FILTER}${BUNDLEFILTER}${FILTERENDING}
-
- # Run the command
--$CONTROLLER_RUNSH -Dfelix.fileinstall.filter="$FILTER" $NEWARGS
-+/usr/share/opendaylight-controller/run.internal.sh -Dfelix.fileinstall.filter="$FILTER" $NEWARGS
-diff -uNr opendaylight-integration-0.1.0/distributions/virtualization/src/assemble/resources/run.sh opendaylight-integration-0.1.0p/distributions/virtualization/src/assemble/resources/run.sh
---- opendaylight-integration-0.1.0/distributions/virtualization/src/assemble/resources/run.sh 2014-01-22 17:37:08.000000000 -0500
-+++ opendaylight-integration-0.1.0p/distributions/virtualization/src/assemble/resources/run.sh 2014-01-22 17:40:31.513958423 -0500
-@@ -34,4 +34,4 @@
- fi
- fi
-
--$RUN_BASE_SH -bundlefilter "org.opendaylight.(${ODL_VIRT_FILTER})" "${@:1:$virtIndex-1}" "${@:virtIndex+2}"
-+/usr/share/opendaylight-controller/run.base.sh -bundlefilter "org.opendaylight.(${ODL_VIRT_FILTER})" "${@:1:$virtIndex-1}" "${@:virtIndex+2}"
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-lispflowmapping
-Version: 0.1.0
-Release: 0.3.0%{?dist}
-Summary: OpenDaylight LispFlowMapping
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/lispflowmapping.git
-# cd lispflowmapping
-# git archive --prefix=opendaylight-lispflowmapping-1.0.0/ HEAD | xz > opendaylight-lispflowmapping-1.0.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-OpenDaylight LispFlowMapping
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Create the directories:
-install -d -m 755 %{buildroot}%{resources_dir}/plugins
-
-while read artifact; do
- src=$(find . -name "*${artifact}")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.lispflowmapping.${tgt}
- fi
-done <<'.'
-mappingservice.api-*.jar
-mappingservice.clusterdao-*.jar
-mappingservice.config-*.jar
-mappingservice.implementation-*.jar
-mappingservice.northbound-*.jar
-mappingservice.southbound-*.jar
-mappingservice.yangmodel-*.jar
-.
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Tue May 13 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.3.0
-- Add additional jars.
-
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Include only lispflowmapping jars.
-
-* Wed Jan 22 2014 David Goldberg <david.goldberg@contextream.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-opendove
-Version: 0.1.0
-Release: 0.3.0%{?dist}
-Summary: OpenDaylight Open DOVE Virtualization Platform
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/ovsdb.git
-# cd ovsdb
-# git archive --prefix=opendaylight-ovsdb-0.1.0/ HEAD | xz > opendaylight-ovsdb-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: x86_64
-
-BuildRequires: python-devel
-BuildRequires: jansson-devel
-BuildRequires: libevent-devel
-BuildRequires: libnl-devel
-BuildRequires: libuuid-devel
-BuildRequires: openssl
-BuildRequires: openssl-devel
-BuildRequires: maven
-BuildRequires: wget
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-# for odmc component
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-# for odmc component
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-DOVE (distributed overlay virtual Ethernet) is a network
-virtualization platform that provides isolated multi-tenant networks
-on any IP network in a virtualized data center. DOVE consists of:
-o odmc - Open DOVE Management Console (OpenDaylight controller bundle)
-o odcs - Open DOVE Connectivity Server with clustering
-o ovs-agent - DOVE vswitch agent (works with Open vSwitch)
-o odgw - DOVE Gateway user agent (works with DOVE Gateway kernel module)
-
-
-%package odmc
-Summary: Open DOVE Management Console
-Group: Applications/Communications
-Buildarch: noarch
-
-%description odmc
-The Open DOVE Management Console (DMC) provides a
-REST API for programmatic virtual network management. The DMC is also
-used to configure the Open DOVE Gateway, the Open DOVE Connectivity
-Server and and the DOVE vswitches.
-
-%package ovs-agent
-Summary: Open DOVE vswitch agent
-Group: Applications/Communications
-
-%description ovs-agent
-User-level agent on each host that interfaces Open DOVE components to
-the DOVE vswithes (based on Open vSwitch). The DOVE vswitches
-implement virtual networks by encapsulating tenant traffic in overlays
-that span virtualized hosts in the data center, using the VxLAN frame
-format.
-
-
-%package odcs
-Summary: Open DOVE Connectivity Server
-Group: Applications/Communications
-
-%description odcs
-
-The Open DOVE Connectivity Server (DCS) supplies address and policy
-information to individual Open DOVE vswitches. The DCS also includes
-support for high-availability and scale-out deployments through a
-clustering protocol between replicated DCS instances.
-
-
-%package odgw
-Summary: Open DOVE Gateway
-Group: Applications/Communications
-
-%description odgw
-
-The Open DOVE Gateway is a software-based gateway that allow traffic
-to be exchanged between DOVE virtual networks and legacy IP or
-Ethernet networks. It operates in external or VLAN mode. The DOVE
-Gateway requires a kernel module to implement the forwarding path.
-
-%prep
-
-%setup -q
-
-
-%build
-
-cd odcs; make; cd ..
-cd odgw; make; cd ..
-cd third-party; ./getdeps.sh; cd ..
-cd ovs-agent; make; cd ..
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-
-%install
-rm -rf %{buildroot}
-cd odcs; make DESTDIR=%{buildroot} install; cd ..
-cd odgw; make DESTDIR=%{buildroot} install; cd ..
-cd ovs-agent; make DESTDIR=%{buildroot} install; cd ..
-
-# Extract the contents of the distribution to a temporary directory so that we
-# can take things from there and move them to the correct locations:
-# todo: Need spec and pom file versions to be consistent so we don't have to
-# hardcode the version here.
-#mkdir -p tmp
-#unzip -o -d tmp distribution/opendaylight/target/distribution.opendove-1.0.0-SNAPSHOT-osgipackage.zip
-
-# Create the directories:
-mkdir -p %{buildroot}%{resources_dir}/plugins
-
-# Only install the extra jars needed by ovsdb.
-# opendaylight jars will be moved to the plugins dir and external jars will be
-# symlinked to the opendaylight dependencies directory.
-for src in $( ls %{_builddir}/%{buildsubdir}/odmc/target/*.jar);
-do
- tgt=org.opendaylight.opendove.$(basename ${src})
-# if [ ! -f %{_builddir}/%{buildsubdir}/distribution/opendaylight/target/generated-resources/opendaylight/plugins/${tgt} ]; then
-# if [ "${tgt}" != "${tgt/org.opendaylight/}" ]; then
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
-# else
-# ln -s %{deps_dir}/${tgt} %{buildroot}%{resources_dir}/plugins/${tgt}
-# fi
-# fi
-done
-
-for src in $( ls %{_builddir}/%{buildsubdir}/odmc/implementation/target/*.jar);
-do
- tgt=org.opendaylight.opendove.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
-done
-
-for src in $( ls %{_builddir}/%{buildsubdir}/odmc/rest/target/*.jar);
-do
- tgt=org.opendaylight.opendove.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
-done
-
-for src in $( ls %{_builddir}/%{buildsubdir}/odmc/rest/northbound/target/*.jar);
-do
- tgt=org.opendaylight.opendove.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
-done
-
-for src in $( ls %{_builddir}/%{buildsubdir}/odmc/rest/southbound/target/*.jar);
-do
- tgt=org.opendaylight.opendove.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
-done
-
-# Fix the permissions as they come with all the permissions (mode 777)
-# from the .zip file:
-find %{buildroot}%{resources_dir} -type d -exec chmod 755 {} \;
-find %{buildroot}%{resources_dir} -type f -exec chmod 644 {} \;
-
-# Remove the temporary directory:
-#rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files odcs
-
-/opt/opendove/odcs/*
-
-%files odgw
-
-/opt/opendove/odgw/*
-
-%files ovs-agent
-
-/opt/opendove/ovs-agent/*
-
-%files odmc
-
-%{resources_dir}
-
-%endif
-
-%changelog
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.3.0
-- Change libevent2_devel to libevent_devel for Fedora and RHEL.
-
-* Thu Jan 23 2014 Anees Shaikh <aasdevaddr@gmail.com> - 0.1.0-0.2.0
-- Added subpackages for all Open DOVE components
-
-* Tue Jan 07 2014 Hsin-Yi Shen <hshen@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-openflowjava
-Version: 0.1.0
-Release: 0.2.0%{?dist}
-Summary: OpenDaylight Openflow Java
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/openflowjava.git
-# cd openflowjava
-# git archive --prefix=opendaylight-openflowjava-0.1.0/ HEAD | xz > opendaylight-openflowjava-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-OpenDaylight Openflow Java
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Create the directories:
-mkdir -p %{buildroot}%{resources_dir}/plugins
-
-# Only install the extra jars needed by openflowjava.
-# opendaylight jars will be moved to the plugins dir and external jars will be
-# symlinked to the opendaylight dependencies directory.
-
-for src in $( ls %{_builddir}/%{buildsubdir}/simple-client/target/*.jar);
-do
- if [ "${src}" == "${src/javadoc.jar/}" ]; then
- tgt=org.opendaylight.openflowjava.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
- fi
-done
-
-for src in $( ls %{_builddir}/%{buildsubdir}/openflow-protocol-spi/target/*.jar);
-do
- if [ "${src}" == "${src/javadoc.jar/}" ]; then
- tgt=org.opendaylight.openflowjava.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
- fi
-done
-
-for src in $( ls %{_builddir}/%{buildsubdir}/openflow-protocol-api/target/*.jar);
-do
- if [ "${src}" == "${src/javadoc.jar/}" ]; then
- if [ "${src}" == "${src/sources.jar/}" ]; then
- tgt=org.opendaylight.openflowjava.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
- fi
- fi
-done
-
-for src in $( ls %{_builddir}/%{buildsubdir}/openflow-protocol-impl/target/*.jar);
-do
- if [ "${src}" == "${src/javadoc.jar/}" ]; then
- tgt=org.opendaylight.openflowjava.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
- fi
-done
-
-# Comment out third-party jars since they are not used by anyone.
-# User can uncomment following line if third-party jars are needed in the future.
-
-#for src in $( ls %{_builddir}/%{buildsubdir}/third-party/openflowj_netty/target/*.jar);
-#do
-# if [ "${src}" == "${src/javadoc.jar/}" ]; then
-# tgt=$(basename ${src})
-# mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
-# fi
-#done
-
-#for src in $( ls %{_builddir}/%{buildsubdir}/third-party/openflow-codec/target/*.jar);
-#do
-# if [ "${src}" == "${src/javadoc.jar/}" ]; then
-# tgt=$(basename ${src})
-# mv ${src} %{buildroot}%{resources_dir}/plugins/${tgt}
-# fi
-#done
-
-# Fix the permissions as they come with all the permissions (mode 777)
-# from the .zip file:
-find %{buildroot}%{resources_dir} -type d -exec chmod 755 {} \;
-find %{buildroot}%{resources_dir} -type f -exec chmod 644 {} \;
-
-# Remove the temporary directory:
-#rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Remove test artifacts.
-
-* Tue Jan 07 2014 Hsin-Yi Shen <hshen@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-openflowplugin
-Version: 0.1.0
-Release: 0.2.0%{?dist}
-Summary: OpenDaylight Openflow Plugin
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/openflowplugin.git
-# cd openflowplugin
-# git archive --prefix=opendaylight-openflowplugin-0.1.0/ HEAD | xz > opendaylight-openflowplugin-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-The Openflow Protocol Library will be an implementation of Openflow
-Protocol as defined in Openflow Switch Specification v1.3 and later
-versions.
-
-The library is designed to be extensible from third-party bundles in
-order to support vendor extensions and should serve as a basis for
-Openflow Southbound Plugin for Controller.
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Extract the contents of the distribution to a temporary directory so that we
-# can take things from there and move them to the correct locations:
-# todo: Need spec and pom file versions to be consistent so we don't have to
-# hardcode the version here.
-mkdir -p tmp
-unzip -o -d tmp distribution/base/target/distributions-openflowplugin-base-*-osgipackage.zip
-
-# Create the directories:
-mkdir -p %{buildroot}%{resources_dir}/plugins
-
-# Only install the extra jars needed by openflowplugin
-# opendaylight jars will be moved to the plugins dir and external jars will be
-# symlinked to the opendaylight dependencies directory.
-# rm some test files that are not distributed
-rm -f tmp/opendaylight/plugins/org.opendaylight.openflowplugin.drop-test-*
-rm -f tmp/opendaylight/plugins/org.opendaylight.openflowplugin.test-provider-*
-
-for src in $( ls tmp/opendaylight/plugins/*.jar); do
- tgt=$(basename ${src})
- if [ ! -f %{_builddir}/%{buildsubdir}/distribution/base/target/generated-resources/opendaylight/plugins/${tgt} ]; then
- if [ "${tgt}" != "${tgt/org.opendaylight/}" ]; then
- if [ "${tgt}" == "${tgt/org.opendaylight.openflowjava/}" ]; then
- mv ${src} %{buildroot}%{resources_dir}/plugins
- fi
- else
- ln -s %{deps_dir}/${tgt} %{buildroot}%{resources_dir}/plugins/${tgt}
- fi
- fi
-done
-
-
-# Fix the permissions as they come with all the permissions (mode 777)
-# from the .zip file:
-find %{buildroot}%{resources_dir} -type d -exec chmod 755 {} \;
-find %{buildroot}%{resources_dir} -type f -exec chmod 644 {} \;
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Remove test artifacts.
-- Update description.
-
-* Wed Jan 08 2014 Hsin-Yi Shen <hshen@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-ovsdb
-Version: 0.1.0
-Release: 0.2.0%{?dist}
-Summary: OpenDaylight OVSDB
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/ovsdb.git
-# cd ovsdb
-# git archive --prefix=opendaylight-ovsdb-0.1.0/ HEAD | xz > opendaylight-ovsdb-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-OpenDaylight OVSDB
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Extract the contents of the distribution to a temporary directory so that we
-# can take things from there and move them to the correct locations:
-# todo: Need spec and pom file versions to be consistent so we don't have to
-# hardcode the version here.
-mkdir -p tmp
-unzip -o -d tmp distribution/opendaylight/target/distribution.ovsdb-*-osgipackage.zip
-
-# Create the directories:
-mkdir -p %{buildroot}%{resources_dir}/plugins
-
-# Only install the extra jars needed by ovsdb.
-# opendaylight jars will be moved to the plugins dir and external jars will be
-# symlinked to the opendaylight dependencies directory.
-for src in $( ls tmp/opendaylight/plugins/*.jar);
-do
- tgt=$(basename ${src})
- if [ ! -f %{_builddir}/%{buildsubdir}/distribution/opendaylight/target/generated-resources/opendaylight/plugins/${tgt} ]; then
- if [ "${tgt}" != "${tgt/org.opendaylight/}" ]; then
- mv ${src} %{buildroot}%{resources_dir}/plugins
- else
- ln -s %{deps_dir}/${tgt} %{buildroot}%{resources_dir}/plugins/${tgt}
- fi
- fi
-done
-
-
-# Fix the permissions as they come with all the permissions (mode 777)
-# from the .zip file:
-find %{buildroot}%{resources_dir} -type d -exec chmod 755 {} \;
-find %{buildroot}%{resources_dir} -type f -exec chmod 644 {} \;
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Fri Jan 31 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Update the version for the distribution.zip.
-
-* Thu Jan 02 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-snmp4sdn
-Version: 0.1.0
-Release: 0.1.0%{?dist}
-Summary: OpenDaylight SNMP4SDN
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/snmp4sdn.git
-# cd snmp4sdn
-# git archive --prefix=opendaylight-snmp4sdn-0.1.0/ HEAD | xz > opendaylight-snmp4sdn-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-OpenDaylight SNMP4SDN is a southbound plugin that can control
-off-the-shelf commodity Ethernet switches using SNMP.
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Create the directories:
-install -d -m 755 %{buildroot}%{resources_dir}/plugins
-
-while read artifact; do
- src=$(find . -name "*${artifact}")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.snmp4sdn.${tgt}
- fi
-done <<'.'
-snmp4sdn-*.jar
-.
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-vtn
-Version: 0.1.0
-Release: 0.1.0%{?dist}
-Summary: OpenDaylight VTN
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/vtn.git
-# cd vtn
-# git archive --prefix=opendaylight-vtn-0.1.0/ HEAD | xz > opendaylight-vtn-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-OpenDaylight VTN
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-%install
-
-# Extract the contents of the distribution to a temporary directory so that we
-# can take things from there and move them to the correct locations:
-# todo: Need spec and pom file versions to be consistent so we don't have to
-# hardcode the version here.
-mkdir -p tmp
-unzip -o -d tmp manager/dist/target/distribution.vtn-manager-0.1.0-SNAPSHOT-osgipackage.zip
-
-# Create the directories:
-mkdir -p %{buildroot}%{resources_dir}/plugins
-
-# Only install the extra jars needed by vtn.
-# opendaylight jars will be moved to the plugins dir and external jars will be
-# symlinked to the opendaylight dependencies directory.
-for src in $( ls tmp/opendaylight/plugins/*.jar);
-do
- tgt=$(basename ${src})
- if [ ! -f %{_builddir}/%{buildsubdir}/manager/dist/target/generated-resources/opendaylight/plugins/${tgt} ]; then
- if [ "${tgt}" != "${tgt/org.opendaylight/}" ]; then
- mv ${src} %{buildroot}%{resources_dir}/plugins
- else
- ln -s %{deps_dir}/${tgt} %{buildroot}%{resources_dir}/plugins/${tgt}
- fi
- fi
-done
-
-# Create the directories for VTN coordinator
-mkdir -p %{buildroot}%{resources_dir}/externalapps
-
-#VTN coordinator has tar.bz2 as external apps
-for src in $( ls %{_builddir}/%{buildsubdir}/coordinator/dist/target/*.tar.bz2);
-do
- tgt=org.opendaylight.vtn.$(basename ${src})
- mv ${src} %{buildroot}%{resources_dir}/externalapps/${tgt}
-done
-
-
-# Fix the permissions as they come with all the permissions (mode 777)
-# from the .zip file:
-find %{buildroot}%{resources_dir} -type d -exec chmod 755 {} \;
-find %{buildroot}%{resources_dir} -type f -exec chmod 644 {} \;
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Tue Jan 07 2014 Hsin-Yi Shen <hshen@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight-yangtools
-Version: 0.1.0
-Release: 0.1.0%{?dist}
-Summary: OpenDaylight yangtools
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-
-# todo: Temporary method for generating tarball
-# git clone https://git.opendaylight.org/gerrit/p/yangtools.git
-# cd yangtools
-# git archive --prefix=opendaylight-yangtools-0.1.0/ HEAD | xz > opendaylight-yangtools-0.1.0.tar.xz
-Source0: %{name}-%{version}.tar.xz
-
-BuildArch: noarch
-
-BuildRequires: java-devel
-BuildRequires: maven
-Requires: java >= 1:1.7.0
-
-# This is the directory where all the application resources (scripts,
-# libraries, etc) will be installed: /usr/share/opendaylight
-%global resources_dir %{_datadir}/opendaylight-controller
-
-# This is the directory that has all the JAVA dependencies.
-%global deps_dir %{_javadir}/opendaylight-controller-dependencies
-
-
-%description
-YANG Tools is a infrastructure project aiming to develop necessary
-tooling and libraries providing support of NETCONF and YANG for Java
-(JVM-language based) projects and applications, such as Model Driven
-SAL for Controller (which uses YANG as it's modeling language) and
-Netconf / OFConfig plugins.
-
-
-%prep
-
-%setup -q
-
-
-%build
-
-# This regular maven build will need to be replaced by the distribution
-# specific maven build command, but this is ok for now:
-# todo: eventually move to using mvn-build or mvn-rpmbuild so dependencies are
-# not downloaded.
-# Don't do the tests since those are already covered by the normal merge and
-# verify process and this build does not need to verify them.
-# maven.compile.fork is used to reduce the build time.
-#export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && \
-# mvn clean install -Dmaven.test.skip=true -DskipIT -Dmaven.compile.fork=true
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" && mvn clean install -Dmaven.test.skip=true
-
-
-%install
-
-# Create the directories:
-install -d -m 755 %{buildroot}%{resources_dir}/plugins
-
-while read artifact; do
- src=$(find . -name "*${artifact}" -a ! -name "*javadoc.jar" -a ! -name "*sources.jar")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.yangtools.${tgt}
- fi
-done <<'.'
-binding-generator-api-*.jar
-binding-generator-impl-*.jar
-binding-generator-spi-*.jar
-binding-generator-util-*.jar
-binding-model-api-*.jar
-binding-type-provider-*.jar
-concepts-*.jar
-yang-binding-*.jar
-yang-common-*.jar
-yang-data-api-*.jar
-yang-data-impl-*.jar
-yang-data-util-*.jar
-yang-model-api-*.jar
-yang-model-util-*.jar
-yang-parser-api-*.jar
-yang-parser-impl-*.jar
-.
-
-# These next two loops have chairs that need a model prefix.
-# But first take care of these topology jars. Notice there is another topology jar
-# in the loop after this one, but its pattern matches all the topology jars and
-# causes the -f to fail so break the loops apart. Some master regex god can
-# probably combine the loops with magic.
-while read base artifact; do
- src=$(find . -name "*${artifact}" -a ! -name "*javadoc.jar" -a ! -name "*sources.jar")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.yangtools.model.${tgt}
- rm -f ${src}
- fi
-done <<'.'
-model ietf-topology-isis-*.jar
-model ietf-topology-l3-unicast-igp-*.jar
-model ietf-topology-ospf-*.jar
-.
-
-while read base artifact; do
- src=$(find . -name "*${artifact}" -a ! -name "*javadoc.jar" -a ! -name "*sources.jar")
- if [ -f "${src}" ]; then
- tgt=$(basename ${src})
- install -m 644 ${src} %{buildroot}%{resources_dir}/plugins/org.opendaylight.yangtools.model.${tgt}
- fi
-done <<'.'
-model ietf-inet-types-*.jar
-model ietf-ted-*.jar
-model ietf-topology-*.jar
-model ietf-yang-types-*.jar
-model opendaylight-l2-types-*.jar
-model yang-ext-*.jar
-.
-
-# Remove the temporary directory:
-rm -rf tmp
-
-
-%clean
-%if "%{noclean}" == "1"
- exit 0
-%endif
-
-
-%files
-
-%{resources_dir}
-
-
-%endif
-
-%changelog
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.1.0
-- Initial package.
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-Name: opendaylight
-Version: 0.1.0
-Release: 0.7.0%{?dist}
-Summary: OpenDaylight SDN Controller Platform
-Group: Applications/Communications
-License: EPL
-URL: http://www.opendaylight.org
-BuildArch: noarch
-
-Requires: opendaylight-controller
-Requires: opendaylight-controller-dependencies
-Requires: opendaylight-openflowjava
-Requires: opendaylight-openflowplugin
-Requires: opendaylight-ovsdb
-Requires: opendaylight-yangtools
+# jar_repack step takes a long time and doesn't seem to be necessary, so skip
+%define __jar_repack 0
+
+# Update this commit if systemd unit file is updated
+%global commit 520321a932a15392a67f45bae52e879c703a2c85
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+Name: opendaylight
+Version: 0.2.1
+Release: 5%{?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
+Source1: https://github.com/dfarrell07/opendaylight-systemd/archive/b080cdc/opendaylight-systemd-%{shortcommit}.tar.gz
+Buildroot: /tmp
+
+# Required for ODL at run time
+Requires: java >= 1:1.7.0
+# Required for creating odl group
+Requires(pre): shadow-utils
+# Required for configuring systemd
+BuildRequires: systemd
+
+%pre
+# Create `odl` user/group
+# Short circuits if the user/group already exists
+getent passwd odl > /dev/null || useradd odl -M
+getent group odl > /dev/null || groupadd odl
%description
-The OpenDaylight SDN Controller Platform provides the core
-services and abstractions needed for building an SDN controller.
-
-The Base edition of OpenDaylight is designed for testing and experimental
-purposes.
-
-%package virtualization
-Summary: OpenDaylight SDN Controller Platform Virtualization Edition
-Group: Applications/Communications
-Requires: %{name}
-Requires: opendaylight-affinity
-#Requires: opendaylight-defense4all
-Requires: opendaylight-opendove-odmc
-#Requires: opendaylight-vtn
-
-%description virtualization
-The Virtualization edition of OpenDaylight is geared towards data centers.
-It includes the OVSDB protocol southbound and the Affinity Service, VTN,
-DOVE, and the OpenStack Service.
-
-%package serviceprovider
-Summary: OpenDaylight SDN Controller Platform Virtualization Edition
-Group: Applications/Communications
-Requires: %{name}
-Requires: opendaylight-affinity
-Requires: opendaylight-bgpcep
-#Requires: opendaylight-defense4all
-Requires: opendaylight-lispflowmapping
-Requires: opendaylight-snmp4sdn
-
-%description serviceprovider
-The Service Provider edition of OpenDaylight is designed for network operator
-use. It does not include OVSDB, VTN or DOVE, but does include SNMP, BGP-LS,
-PCEP, and LISP southbound and the Affinity Service and the LISP Service northbound.
+OpenDaylight Helium SR1.1 (0.2.1)
+
+%prep
+# Extract Source0 (ODL archive)
+%autosetup -n distribution-karaf-0.2.1-Helium-SR1.1
+# Extract Source1 (systemd config)
+%autosetup -T -D -b 1 -n opendaylight-systemd-%{commit}
+
+%install
+# 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
+# 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
+cp ../../BUILD/opendaylight-systemd-%{commit}/opendaylight.service $RPM_BUILD_ROOT/%{_unitdir}
+
+%postun
+# 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
%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
-%files virtualization
-
-%files serviceprovider
-
-%endif
%changelog
-* Tue May 13 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.7.0
-- Include opendaylight-opendove-odmc to virtualization edition.
-
-* Sun Feb 09 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.6.0
-- Add affinity and snmp4sdn packages.
-
-* Sat Feb 08 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.5.0
-- Add yangtools package.
-
-* Sat Feb 01 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.4.0
-- Changed package name to opendaylight.
-- Added edition sub packages.
-
-* Sat Jan 18 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.3.0
-- Removed controller-dependencies from Requires because controller already pulls it in.
-
-* Thu Jan 09 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.2.0
-- Updates for OF1.3 support.
-- Remove java Requires.
-
-* Thu Jan 02 2014 Sam Hague <shague@redhat.com> - 0.1.0-0.1.0
-- Initial package.
+* 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
+- Added systemd config as a source
+* Sat Jan 10 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.1-3
+- Completely clean up ODL after uninstall
+* Fri Jan 9 2015 Daniel Farrell <dfarrell@redhat.com> - 0.2.1-2
+- Added systemd configuration
+* Tue Dec 16 2014 Daniel Farrell <dfarrell@redhat.com> - 0.2.1-1
+- Initial Karaf-based RPM
+++ /dev/null
-#!/bin/bash
-
-usage() {
- echo -e "Usage:\t$0 base|virt-ovsdb|virt-vtn|virt-opendove|virt-affinity|sp|-stop|-status|help\n"
-
- echo -e "\tbase: base controller edition, good for simple testing"
- echo -e "\tvirt-ovsdb: virtualization controller edition based on ovsdb"
- echo -e "\tvirt-vtn: virtualization controller edition based on vtn (not supported yet)"
- echo -e "\tvirt-opendove: virtualization controller edition based on opendove (not supported yet)"
- echo -e "\tsp: service provider controller edition (not supported yet)"
- echo -e "\t-stop: stop the controller"
- echo -e "\t-status: check if controller is currently running"
- echo -e "\thelp: generate this help text"
-}
-
-option=$1;
-shift
-
-case "$option" in
-base)
- filter="affinity|bgpcep|lispflowmapping|opendove|ovsdb.ovsdb.neutron|snmp4sdn|vtn|\
-yangtools.model.(ietf-ted-2013|ietf-topology-isis-2013|ietf-topology-2013|\
-ietf-topology-l3-unicast-igp-2013|ietf-topology-ospf-2013)"
-
- bundlefilter="-bundlefilter org.opendaylight.(${filter})"
- exec /usr/share/opendaylight-controller/run.base.sh $bundlefilter "$@"
- ;;
-
-virt-ovsdb)
- filter="opendove|vtn|\
-bgpcep|lispflowmapping|snmp4sdn|\
-yangtools.model.(ietf-ted-2013|ietf-topology-isis-2013|ietf-topology-2013|\
-ietf-topology-l3-unicast-igp-2013|ietf-topology-ospf-2013)"
-
- bundlefilter="-bundlefilter org.opendaylight.(${filter})"
- exec /usr/share/opendaylight-controller/run.base.sh $bundlefilter "$@"
- ;;
-
-virt-opendove)
- echo "$option not supported yet"
- filter="ovsdb|vtn|\
-bgpcep|lispflowmapping|snmp4sdn|\
-yangtools.model.(ietf-ted-2013|ietf-topology-isis-2013|ietf-topology-2013|\
-ietf-topology-l3-unicast-igp-2013|ietf-topology-ospf-2013)"
-
- bundlefilter="-bundlefilter org.opendaylight.(${filter})"
- exec /usr/share/opendaylight-controller/run.base.sh $bundlefilter "$@"
- ;;
-
-virt-vtn)
- echo "$option not supported yet"
- filter="affinity|opendove|ovsdb|controller.(arphandler|samples)|\
-bgpcep|lispflowmapping|snmp4sdn|\
-yangtools.model.(ietf-ted-2013|ietf-topology-isis-2013|ietf-topology-2013|\
-ietf-topology-l3-unicast-igp-2013|ietf-topology-ospf-2013)"
-
- bundlefilter="-bundlefilter org.opendaylight.(${filter})"
- exec /usr/share/opendaylight-controller/run.base.sh $bundlefilter "$@"
- ;;
-
-virt-affinity)
- echo "$option not supported yet"
- filter="vtn|opendove|ovsdb|controller.samples|\
-bgpcep|lispflowmapping|snmp4sdn|\
-yangtools.model.(ietf-ted-2013|ietf-topology-isis-2013|ietf-topology-2013|\
-ietf-topology-l3-unicast-igp-2013|ietf-topology-ospf-2013)"
-
- bundlefilter="-bundlefilter org.opendaylight.(${filter})"
- exec /usr/share/opendaylight-controller/run.base.sh $bundlefilter "$@"
- ;;
-
-sp)
- echo "$option not supported yet"
- filter="opendove|ovsdb.ovsdb.neutron|vtn"
-
- bundlefilter="-bundlefilter org.opendaylight.(${filter})"
- exec /usr/share/opendaylight-controller/run.base.sh $bundlefilter "$@"
- ;;
-
--stop)
- exec /usr/share/opendaylight-controller/run.internal.sh -stop
- ;;
-
--status)
- exec /usr/share/opendaylight-controller/run.internal.sh -status
- ;;
-
-help)
- usage
- exit 0
- ;;
-*)
- echo "Invalid option: $option"
- usage
- ;;
-esac
-
-exit -1
+++ /dev/null
-#!/bin/bash
-#set -vx
-
-options=$1
-gitdir=$2
-
-function usage {
- local rc=$1
- local outstr=$2
-
- if [ "$outstr" != "" ]; then
- echo "$outstr"
- echo
- fi
-
- echo "This script is used to validate the rpm builds for each edition."
- echo "The script will compare the different editions against each other"
- echo "to identify the proper filters when starting the controller,"
- echo "list the dependencies in the different editions and identify"
- echo "any inconsistencies between the edition poms and the project specs."
- echo
- echo "Usage: `basename $0` [OPTION...]"
- echo
- echo "Test options:"
- echo " --options OPTIONS List of test options. Available options:"
- echo " integration: compare integration editions"
- echo " pom: get pom dependencies from integration poms"
- echo " spec: compare projects specs against the pom dependencies"
- echo " --gitdir DIR git root directory where projects are cloned"
- echo
- echo "Help options:"
- echo " -?, -h, --h, --help Display this help and exit"
- echo
-
- exit $rc
-}
-
-function parse_options {
- while true ; do
- case "$1" in
- --options)
- shift; options="$1"; shift
- ;;
-
- --gitdir)
- shift; gitdir="$1"; shift
- if [ "$gitdir" = "" ]; then
- usage 1 "Missing directory.";
- fi
- ;;
-
- -? | -h | --h | --help)
- usage 0
- ;;
- "")
- break
- ;;
- *)
- echo "Ignoring unknown option: $1"; shift;
- esac
- done
-}
-
-function array_contains () {
- local array="$1[@]"
- local seeking=$2
- local in=1
- for element in "${!array}"; do
- if [ $element = $seeking ]; then
- in=0
- break
- fi
- done
- return $in
-}
-
-
-function compare_integration () {
- local gitdir=$1
-
- echo
- echo "========================================================================="
- echo " Comparing dirs"
- echo "========================================================================="
-
- cd $gitdir/integration
-
- rm -rf /tmp/base/*
- basezip=$(find . -name "*distributions-base*.zip")
- unzip -qd /tmp/base $basezip
-
- rm -rf /tmp/virt/*
- virtzip=$(find . -name "*distributions-virtualization*.zip")
- unzip -qd /tmp/virt $virtzip
-
- rm -rf /tmp/sp/*
- spzip=$(find . -name "*distributions-serviceprovider*.zip")
- unzip -qd /tmp/sp $spzip
-
- # Compare one edition against another.
-
- echo
- echo "Compare base and virt:"
- echo "-------------------------------------------------------------------------"
- diff -qr /tmp/base/opendaylight/ /tmp/virt/opendaylight/
- echo
- echo "Compare base and sp:"
- echo "-------------------------------------------------------------------------"
- diff -qr /tmp/base/opendaylight/ /tmp/sp/opendaylight/
- echo
- echo "Compare virt and sp:"
- echo "-------------------------------------------------------------------------"
- diff -qr /tmp/virt/opendaylight/ /tmp/sp/opendaylight/
-
- # Compare one edition against the other two.
-
- rm -rf /tmp/base_virt
- mkdir /tmp/base_virt
- cp -rf /tmp/base/* /tmp/base_virt/
- cp -rf /tmp/virt/* /tmp/base_virt/
-
- rm -rf /tmp/base_sp
- mkdir /tmp/base_sp
- cp -rf /tmp/base/* /tmp/base_sp/
- cp -rf /tmp/sp/* /tmp/base_sp/
-
- rm -rf /tmp/virt_sp
- mkdir /tmp/virt_sp
- cp -rf /tmp/virt/* /tmp/virt_sp/
- cp -rf /tmp/sp/* /tmp/virt_sp/
-
- echo
- echo
- echo "Compare base and virt_sp."
- echo "-------------------------------------------------------------------------"
- diff -qr /tmp/base/opendaylight/ /tmp/virt_sp/opendaylight/
- echo
- echo "Compare virt and base_sp. Useful to see what virt pulls in - look for Only in /tmp/virt."
- echo "-------------------------------------------------------------------------"
- diff -qr /tmp/virt/opendaylight/ /tmp/base_sp/opendaylight/
- echo
- echo "Compare sp and base_virt. Useful to see what sp pulls in - look for Only in /tmp/sp."
- echo "-------------------------------------------------------------------------"
- diff -qr /tmp/sp/opendaylight/ /tmp/base_virt/opendaylight/
-}
-
-function check_affinity () {
-# allaffinity=$(find /tmp/virt -name "*affinity.*.jar")
-# while read line; do
-# if [ "line" ]
- echo "here"
-}
-
-function read_dom () {
- local IFS=\>
- read -d \< ENTITY CONTENT
-}
-
-function read_poms () {
- local gitdir="$1"
- local distribution="$2"
- local pomfile=$gitdir/integration/distributions/$distribution/pom.xml
- local FILE=$pomfile
- local i=$pomcnt
- local groupy=0
- local state="null"
-
- echo
- echo "read_poms $gitdir $distribution"
- echo "-------------------------------------------------------------------------"
-
- while read_dom; do
- case "$state" in
- null)
- if [ "$ENTITY" = "dependencies" ]; then
- state="dependencies"
- fi
- ;;
-
- dependencies)
- case "$ENTITY" in
- groupId)
- groupIds[i]=$CONTENT
- groups=1
- editions[i]=$distribution
- ;;
-
- artifactId)
- if [ $groups -eq 1 ]; then
- artifactIds[i]=$CONTENT
- fi
- ;;
-
- version)
- if [ $groups -eq 1 ]; then
- versions[i]=$CONTENT
- groups=0
- ((i++))
- fi
- ;;
-
- /dependencies)
- state="done"
- break
- ;;
- esac
- ;;
- esac
- done < "$pomfile"
-
- end=$((i-1))
- for index in `seq $pomcnt $end`; do
- echo "$index artifact: ${groupIds[$index]}.${artifactIds[$index]}-${versions[$index]}"
- done
-
- pomcnt=$i
-}
-
-function check_poms () {
- local gitdir=$1
- pomcnt=0
-
- echo
- echo "========================================================================="
- echo " Checking poms"
- echo "========================================================================="
-
- read_poms "$gitdir" "base"
- read_poms "$gitdir" "serviceprovider"
- read_poms "$gitdir" "virtualization"
-}
-
-function read_spec () {
- local gitdir="$1"
- local project="$2"
- local specfile=$gitdir/integration/packaging/rpm/opendaylight-$project.spec
- local FILE=$specfile
- local state="null"
- local i=0
-
- unset specarts
-
- echo
- echo "read_spec $gitdir $project"
- echo "-------------------------------------------------------------------------"
-
- while read line; do
- case "$state" in
- null)
- if [ "$line" = "done <<'.'" ]; then
- state="artifacts"
- fi
- ;;
-
- artifacts)
- if [ "$line" = "." ]; then
- state="done"
- break
- else
- specarts[i]=$line
- ((i++))
- fi
- ;;
- esac
- done < "$specfile"
-
- for index in ${!specarts[*]}; do
- echo "$index spec artifact: ${specarts[$index]}"
- done
-}
-
-
-function check_project () {
- local gitdir=$1
- local project=$2
- local specfile=$gitdir/integration/packaging/rpm/opendaylight-$project.specfile
- local k=0
-
- unset notfoundarts
- unset notfoundeds
-
- echo
- echo "check_project $gitdir $project"
- echo "-------------------------------------------------------------------------"
-
- read_spec "$gitdir" "$project"
-
- for i in ${!groupIds[*]}; do
- if [ ${groupIds[$i]} = "org.opendaylight.$project" ]; then
- found=0
- for j in ${!specarts[*]}; do
- specart=$(echo ${specarts[$j]} | sed -e "s/-\*.*//")
- artifactId=${artifactIds[$i]}
- if [ "$specart" = "$artifactId" ]; then
- found=1
- break
- fi
- done
-
- if [ $found -eq 0 ]; then
- notfoundeds[k]=${editions[$i]}
- notfoundarts[k]=${artifactIds[$i]}
- ((k++))
- fi
- fi
- done
-
- for index in ${!notfoundarts[*]}; do
- echo ">>>>> $index missing artifact: ${notfoundeds[$index]}: ${notfoundarts[$index]}"
- done
-}
-
-function check_specs () {
- local gitdir=$1
-
- echo
- echo "========================================================================="
- echo " Checking specs"
- echo "========================================================================="
-
- check_project "$gitdir" "affinity"
- check_project "$gitdir" "bgpcep"
- check_project "$gitdir" "lispflowmapping"
- check_project "$gitdir" "snmp4sdn"
- check_project "$gitdir" "yangtools"
-}
-
-function main () {
- parse_options "$@"
-
- if [ ! -d "$dir" ]; then
- usage 1 "Invalid path."
- fi
-
-}
-
-main "$@"
-
-exit 0
+++ /dev/null
-#!/bin/bash
-#set -vx
-
-mkrepofile=0
-mkrepo=0
-crrepo=0
-cprpms=0
-repodir="/home/repo"
-yumdir="/etc/yum.repos.d"
-reponame="localodl.repo"
-rpmdir="~/data/rpmbuild/test1/bld_1/repo"
-
-
-function usage {
- local rc=$1
- local outstr=$2
-
- if [ "$outstr" != "" ]; then
- echo "$outstr"
- echo
- fi
-
- echo "This script is used to create a local yum repo for testing rpm installs."
- echo "The script can make the local repo directory, run createrepo to"
- echo "initialize it as a repo, create the yum repo file and copy rpms to"
- echo "the repo."
- echo
- echo "Usage: `basename $0` [OPTION...]"
- echo
- echo "Script options"
- echo " --mkrepo make the repodir"
- echo " --crrepo createrepo the repodir"
- echo " --mkrepofile name of the yum.repos.d repo file"
- echo " --cprpms copy the rpms to the repo"
- echo " --repodir DIR directory to make into a repo"
- echo " --yumdir DIR yum directory with repo files"
- echo " --rpmdir DIR directory with rpms"
- echo
- echo "Help options:"
- echo " -?, -h, --h, --help Display this help and exit"
- echo
-
- exit $rc
-}
-
-function parse_options {
- while true ; do
- case "$1" in
- --mkrepofile)
- shift; mkrepofile=1;
- ;;
-
- --mkrepo)
- shift; mkrepo=1;
- ;;
-
- --crrepo)
- shift; crrepo=1;
- ;;
-
- --cprpms)
- shift; cprpms=1;
- ;;
-
- --reponame)
- shift; reponame="$1"; shift
- if [ "$reponame" = "" ]; then
- usage 1 "Missing repo name.";
- fi
- ;;
-
- --repodir)
- shift; repodir="$1"; shift
- if [ "$repodir" = "" ]; then
- usage 1 "Missing yum directory.";
- fi
- ;;
-
- --yumdir)
- shift; yumdir="$1"; shift
- if [ "$yumdir" = "" ]; then
- usage 1 "Missing yum directory.";
- fi
- ;;
-
- --rpmdir)
- shift; rpmdir="$1"; shift
- if [ "$rpmdir" = "" ]; then
- usage 1 "Missing rpm directory.";
- fi
- ;;
-
- -? | -h | --h | --help)
- usage 0
- ;;
- "")
- break
- ;;
- *)
- echo "Ignoring unknown option: $1"; shift;
- esac
- done
-}
-
-function check_dir () {
- local dir=$1
-
- if [ ! -d "$dir" ]; then
- usage 1 "Invalid dir: $dir"
- fi
-}
-
-function make_repo_file () {
- local yumdir=$1
- local reponame=$2
-
- rm -f $yumdir/$reponame
-
- echo "$yumdir/$reponame"
- cat <<EOF > $yumdir/$reponame
-[localodl]
-name=Local ODL
-baseurl=file:///home/repo
-enabled=1
-gpgcheck=0
-metadata_expire=1m
-
-[localodlftp]
-name=Local FTP ODL
-baseurl=ftp://127.0.0.1/pub
-enabled=1
-gpgcheck=0
-metadata_expire=1m
-EOF
-}
-
-function make_repo () {
- local repodir=$1
-
- mkdir -p $repodir
- chmod -R 777 $repodir
-}
-
-function create_repo () {
- local repodir=$1
-
- check_dir $repodir
-
- createrepo -d $repodir
-}
-
-function copy_rpms_to_repo () {
- local rpmdir=$1
- local repodir=$2
-
- check_dir $rpmdir
- check_dir $repodir
-
- for rpm in $( find $rpmdir -name *.rpm ); do
- cp $rpm $repodir
- done
-}
-
-function main () {
- parse_options "$@"
-
- eval rpmdir=$rpmdir
-
- if [ $mkrepo -eq 1 ]; then
- make_repo $repodir
- fi
-
- if [ $cprpms -eq 1 ]; then
- copy_rpms_to_repo $rpmdir $repodir
- fi
-
- if [ $crrepo -eq 1 ]; then
- create_repo $repodir
- fi
-
- if [ $mkrepofile -eq 1 ]; then
- make_repo_file $yumdir $reponame
- fi
-}
-
-main "$@"
-
-exit 0
+++ /dev/null
-#!/bin/bash
-#set -vx
-
-archive=0
-cloneremote=0
-clonelocal=0
-gitdir="~/git"
-rpmbuilddir="~/rpmbuild"
-version="0.1.0"
-
-projects=(integration controller ovsdb openflowjava openflowplugin lispflowmapping snmp4sdn affinity yangtools bgpcep opendove)
-
-function usage {
- local rc=$1
- local outstr=$2
-
- if [ "$outstr" != "" ]; then
- echo "$outstr"
- echo
- fi
-
- echo "This script is used to prepare a buildrpm environment."
- echo "The script can archive and existing git dir containing all the projects,"
- echo "clone all projects from a remote repo or from a local repo."
- echo
- echo "Usage: `basename $0` [OPTION...]"
- echo
- echo "Script options"
- echo " --archive archive all the projects in the git directory"
- echo " --cloneremote clone all the projects in the remote repo"
- echo " --clonelocal clone all the projects in the local repo"
- echo " --gitdir DIR git root directory where projects are cloned"
- echo " --rpmbuilddir DIR rpmbuild root directory where rpms are built"
- echo " --version VERSION version tag to use for archives"
- echo
- echo "Help options:"
- echo " -?, -h, --h, --help Display this help and exit"
- echo
-
- exit $rc
-}
-
-function parse_options {
- while true ; do
- case "$1" in
- --archive)
- shift; archive=1;
- ;;
-
- --cloneremote)
- shift; cloneremote=1;
- ;;
-
- --clonelocal)
- shift; clonelocal=1;
- ;;
-
- --gitdir)
- shift; gitdir="$1"; shift
- if [ "$gitdir" = "" ]; then
- usage 1 "Missing git directory.";
- fi
- ;;
-
- --outdir)
- shift; outdir="$1"; shift
- if [ "$outdir" = "" ]; then
- usage 1 "Missing out directory.";
- fi
- ;;
-
- --rpmbuilddir)
- shift; rpmbuilddir="$1"; shift
- if [ "$rpmbuilddir" = "" ]; then
- usage 1 "Missing rpmbuild directory.";
- fi
- ;;
-
- --version)
- shift; version="$1"; shift
- if [ "$version" = "" ]; then
- usage 1 "Missing version.";
- fi
- ;;
-
- -? | -h | --h | --help)
- usage 0
- ;;
- "")
- break
- ;;
- *)
- echo "Ignoring unknown option: $1"; shift;
- esac
- done
-}
-
-function check_dir () {
- local dir=$1
-
- if [ ! -d "$dir" ]; then
- usage 1 "Invalid dir: $dir"
- fi
-}
-
-function archive_projects () {
- local gitdir=$1
- local rpmbuilddir=$2
- local version=$3
-
- check_dir "$gitdir"
- check_dir "$rpmbuilddir"
-
- cd $gitdir
- mkdir -p zips
-
- for project in ${projects[*]}; do
- cd $gitdir/$project
- zipfile=../zips/opendaylight-$project-$version.tar.xz
- echo "Archiving $project to $zipfile"
- git archive --prefix=opendaylight-$project-$version/ HEAD | xz > $zipfile
- src=$gitdir/zips/opendaylight-$project-$version.tar.xz
- echo "Linking $src to $rpmbuilddir/SOURCES"
- ln -sf $src $rpmbuilddir/SOURCES
- done
-}
-
-function clone_remote () {
- local outdir=$1
-
- mkdir -p $outdir
- cd $outdir
-
- for project in ${projects[*]}; do
- echo "Cloning $project to $outdir/$project"
- git clone https://git.opendaylight.org/gerrit/p/$project.git
- done
-}
-
-function clone_local () {
- local gitdir=$1
- local outdir=$2
-
- mkdir -p $outdir
- cd $outdir
-
- check_dir "$gitdir"
-
- for project in ${projects[*]}; do
- echo "Cloning $project to $outdir/$project"
- git clone $gitdir/$project
- done
-}
-
-function main () {
- parse_options "$@"
-
- eval gitdir=$gitdir
- eval rpmbuilddir=$rpmbuilddir
-
-
- if [ ! -d "$gitdir" ]; then
- usage 1 "Invalid path."
- fi
-
- if [ $archive -eq 1 ]; then
- archive_projects "$gitdir" "$rpmbuilddir" "$version"
- fi
-
- if [ $cloneremote -eq 1 ]; then
- clone_remote $outdir
- fi
-
- if [ $clonelocal -eq 1 ]; then
- clone_local $gitdir $outdir
- fi
-}
-
-main "$@"
-
-exit 0
+++ /dev/null
-# Spec file only supports RHEL and Fedora now
-%if 0%{?rhel} || 0%{?fedora}
-
-%if 0%{?rhel}
-%define YUMREPO epel-%{rhel}-x86_64
-%else
-%define YUMREPO fedora-%{fedora}-x86_64
-%endif
-
-Name: opendaylight-release
-Version: 0.1.0
-Release: 2%{?dist}
-Summary: OpenDaylight Repository Configuration
-
-Group: System Environment/Base
-License: EPL
-URL: http://www.opendaylight.org
-Source0: opendaylight.repo
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildRequires: sed
-BuildArch: noarch
-
-%description
-The OpenDaylight repository contains RPMs for installing the
-OpenDaylight components on a system.
-
-%install
-rm -rf %{buildroot}
-%{__mkdir} -p %{buildroot}%{_sysconfdir}/yum.repos.d
-sed 's/MOCKENV/%{YUMREPO}/g' %{SOURCE0} > %{buildroot}%{_sysconfdir}/yum.repos.d/opendaylight.repo
-
-%clean
-rm -rf %{buildroot}
-
-
-%files
-%defattr(-,root,root,-)
-%{_sysconfdir}/yum.repos.d/*.repo
-
-%endif
-
-%changelog
-* Mon Jan 27 2014 Andrew Grimberg <agrimberg@linuxfoundation.org> - 0.1.0-2
-- Fix fedora releas packages to have correct URL
-
-* Wed Jan 22 2014 Andrew Grimberg <agrimberg@linuxfoundation.org> - 0.1.0-1
-- Initial packaging
+++ /dev/null
-[opendaylight-release]
-name=opendaylight-release
-baseurl=https://nexus.opendaylight.org/content/repositories/opendaylight-yum-MOCKENV
-enabled=1
-gpgcheck=0
-metadata_expire=10m
-autorefresh=1
-type=rpm-md
-
-[opendaylight-testing]
-name=opendaylight-testing
-baseurl=https://nexus.opendaylight.org/content/repositories/opendaylight-yum-MOCKENV-testing
-enabled=0
-gpgcheck=0
-metadata_expire=10m
-autorefresh=1
-type=rpm-md