Update buildrpm to include latest project changes.
authorSam Hague <shague@redhat.com>
Wed, 14 May 2014 00:19:49 +0000 (20:19 -0400)
committerSam Hague <shague@redhat.com>
Wed, 14 May 2014 00:19:49 +0000 (20:19 -0400)
This commit adds post-hydrogen changes for bgpcep and
lispflowmapping projects.

Also add changes to buildrpm.sh to build from a specific
branch.

Change-Id: Icba5360be510a94bb59a480bbcafe0e9dbf54f27
Signed-off-by: Sam Hague <shague@redhat.com>
packaging/rpm/buildrpm.sh
packaging/rpm/opendaylight-bgpcep.spec
packaging/rpm/opendaylight-lispflowmapping.spec
packaging/rpm/opendaylight.spec
packaging/rpm/run.odl.sh

index de9eaf5a788308bee7532381d4afc76f4867ab5e..0d3e65c6315f6f93904e6a3d86f4bf5e4813d57d 100755 (executable)
@@ -15,6 +15,8 @@ cleanroot=0
 cleantmp=0
 pushrpms=0
 getsource="buildroot"
+branch=""
+depth=0
 version=""
 edversion=""
 specrelease="1"
@@ -86,7 +88,7 @@ function usage {
     echo
     echo "Build options:"
     echo "  --buildtype TYPE       build type, either snapshot or release, default snapshot"
-    echo "  --buildroot DIRECTORY  build root path"
+    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"
@@ -98,8 +100,9 @@ function usage {
     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 "  --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://"
@@ -147,7 +150,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_BGPCEP
+readonly PJ_LAST=$PJ_OPENDOVE
 
 projects[$PJ_INTEGRATION]="integration"
 projects[$PJ_CONTROLLER]="controller"
@@ -195,10 +199,16 @@ gitprojects="$PJ_INTEGRATION $PJ_CONTROLLER $PJ_OVSDB $PJ_OPENFLOWJAVA $PJ_OPENF
 
 # Clone the projects.
 function clone_source {
+    local depth=$1
     for i in $gitprojects; do
-        # We only care about a shallow clone (no need to grab the entire project)
-        log $LOGINFO "Cloning ${projects[$i]} to $buildroot/${projects[$i]}"
-        git clone --depth 0 https://git.opendaylight.org/gerrit/p/${projects[$i]}.git $buildroot/${projects[$i]}
+        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
 }
 
@@ -210,6 +220,7 @@ function snapshot_source {
 }
 
 # Checkout the latest release-tagged branch.
+# TODO: does this work for branches or for multiple releases?
 function checkout_release_tag {
     local tag=""
 
@@ -233,6 +244,16 @@ function checkout_release_tag {
     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
@@ -277,7 +298,8 @@ function set_versions {
         versions[$i]=${version//-/.}
     done
 
-    # Next two projects do not have a repo so set them to something.
+    # 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]}
@@ -307,72 +329,12 @@ function mk_git_archives {
 #    local timesuffix=$1
 
     for i in $gitprojects; do
-if [ 1 -eq 0 ]; then
-        case "$versiontype" in
-        "user")
-            versions[$i]=$version
-            ;;
-        "snap")
-            cd $buildroot/${projects[$i]}
-            suffix[$i]="snap.$timesuffix.git.$(git log -1 --pretty=format:%h)"
-            ;;
-        "spec")
-            cd $buildroot/${projects[$PJ_INTEGRATION]}/packaging/rpm
-            versions[$i]="$( rpm -q --queryformat="%{version}\n" --specfile opendaylight-${projects[$i]}.spec | head -n 1 | awk '{print $1}').${suffix[$i]}"
-            ;;
-
-        "pom")
-            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 [ "$version" == "" ]; then
-            if [ "$buildtype" == "snapshot" ]; then
-                cd $buildroot/${projects[$i]}
-                suffix[$i]="snap.$timesuffix.git.$(git log -1 --pretty=format:%h)"
-            else
-                suffix[$i]=""
-            fi
-        else
-            if [ "$buildtype" == "snapshot" ]; then
-                suffix[$i]="snap.$version"
-            else
-                suffix[$i]=""
-            fi
-        fi
-
-        cd $buildroot/${projects[$PJ_INTEGRATION]}/packaging/rpm
-        # Get the version from the spec and append the suffix.
-        # integration uses the controller.spec because there isn't an integration.spec to query.
-        if [ ${projects[$i]} == ${projects[$PJ_INTEGRATION]} ]; then
-            versions[$i]="$( rpm -q --queryformat="%{version}\n" --specfile opendaylight-${projects[$PJ_CONTROLLER]}.spec | head -n 1 | awk '{print $1}').${suffix[$i]}"
-        else
-            versions[$i]="$( rpm -q --queryformat="%{version}\n" --specfile opendaylight-${projects[$i]}.spec | head -n 1 | awk '{print $1}').${suffix[$i]}"
-        fi
-
-        if [ "$buildtype" == "release" ]; then
-            if [ "$version" != "" ]; then
-                # User really wants to set the version.
-                versions[$i]=$version
-            else
-                # User wants the pom version
-                versions[$i]=$(grep -m 1 "<version>" $buildroot/${projects[$i]}/pom.xml | sed -n -e '/<version>/s/.*<version>//p' | sed -n -e 's/<\/version>//p')
-            fi
-        fi
-fi
         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
 
-    # Use the integration versions because the following projects don't have a repo.
-#    for i in `seq $PJ_DEPENDENCIES $PJ_OPENDAYLIGHT`; do
-#        suffix[$i]=${suffix[$PJ_INTEGRATION]}
-#        versions[$i]=${versions[$PJ_INTEGRATION]}
-#    done
-
     # Don't forget any patches.
     cp $buildroot/${projects[$PJ_INTEGRATION]}/packaging/rpm/opendaylight-integration-fix-paths.patch $tmpbuild
 }
@@ -435,6 +397,7 @@ buildtype:      $buildtype
 versiontype:    $versiontype
 version:        $version
 edversion:      $edversion
+branch:         $branch
 specrelease:    $specrelease
 releasetag:     $releasetag
 getsource:      $getsource
@@ -484,7 +447,7 @@ function build_project {
 #        sed -r -i -e '/^Version:/s/\s*$/'".$versionsnapsuffix/" $projectspec.spec
 #    fi
 
-    # Set the write values in the spec files.
+    # Set the right values in the spec files.
     case "$project" in
     ${projects[$PJ_CONTROLLER]})
         # Set the version for the integration source.
@@ -687,14 +650,14 @@ function parse_options {
         --dist)
             shift; dist="$1"; shift;
             if [ "$dist" == "" ]; then
-                $RCPARMSERROR "Missing distribution.";
+                usage $RCPARMSERROR "Missing distribution.";
             fi
             ;;
 
         --distsuffix)
             shift; pkg_dist_suffix="$1"; shift;
             if [ "$pkg_dist_suffix" == "" ]; then
-                $RCPARMSERROR "Missing package distribution suffix.";
+                usage $RCPARMSERROR "Missing package distribution suffix.";
             fi
             ;;
 
@@ -708,7 +671,7 @@ function parse_options {
         --specrelease)
             shift; specrelease="$1"; shift;
             if [ "$specrelease" == "" ]; then
-                $RCPARMSERROR "Missing specrelease.";
+                usage $RCPARMSERROR "Missing specrelease.";
             fi
             ;;
 
@@ -719,35 +682,43 @@ function parse_options {
         --version)
             shift; version="$1"; shift;
             if [ "$version" == "" ]; then
-                $RCPARMSERROR "Missing version.";
+                usage $RCPARMSERROR "Missing version.";
             fi
             ;;
 
         --edversion)
             shift; edversion="$1"; shift;
             if [ "$edversion" == "" ]; then
-                $RCPARMSERROR "Missing edversion.";
+                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
-                $RCPARMSERROR "Missing repo url.";
+                usage $RCPARMSERROR "Missing repo url.";
             fi
             ;;
 
         --repouser)
             shift; repouser="$1"; shift;
             if [ "$repouser" == "" ]; then
-                $RCPARMSERROR "Missing repo user.";
+                usage $RCPARMSERROR "Missing repo user.";
             fi
             ;;
 
         --repopw)
             shift; repopw="$1"; shift;
             if [ "$repopw" == "" ]; then
-                $RCPARMSERROR "Missing repo pw.";
+                usage $RCPARMSERROR "Missing repo pw.";
             fi
             ;;
 
@@ -765,7 +736,7 @@ function parse_options {
         --mvn_cmd)
             shift; mvn_cmd="$1"; shift;
             if [ "$mvn_cmd" == "" ]; then
-                $RCPARMSERROR "Missing mvn_cmd.";
+                usage $RCPARMSERROR "Missing mvn_cmd.";
             fi
             ;;
 
@@ -776,21 +747,21 @@ function parse_options {
         --mockmvn)
             shift; mockmvn="$1"; shift;
             if [ "$mockmvn" == "" ]; then
-                $RCPARMSERROR "Missing mockmvn.";
+                usage $RCPARMSERROR "Missing mockmvn.";
             fi
             ;;
 
         --baseURL)
             shift; baseURL="$1"; shift;
             if [ "$baseURL" == "" ]; then
-                $RCPARMSERROR "Missing baseURL.";
+                usage $RCPARMSERROR "Missing baseURL.";
             fi
             ;;
 
         --baseRepositoryId)
             shift; baseRepositoryId="$1"; shift;
             if [ "$baseRepositoryId" == "" ]; then
-                $RCPARMSERROR "Missing baseRepositoryId.";
+                usage $RCPARMSERROR "Missing baseRepositoryId.";
             fi
             ;;
 
@@ -875,7 +846,12 @@ mkdir -p $tmpbuild/repo
 # Get the source.
 case "$getsource" in
 clone)
-    clone_source;
+    clone_source "$depth";
+
+    if [ -n "$branch" ]; then
+        checkout_branch $branch
+    fi
+
     if [ $releasetag -eq 1 ]; then
         checkout_release_tag
     fi
@@ -897,13 +873,17 @@ buildroot)
         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
index 4fbbf8d408cbd7efdbc5552b761dce84ba515920..12a16b9776101ccbadc2d072d6b89b1cd10fb532 100644 (file)
@@ -3,7 +3,7 @@
 
 Name: opendaylight-bgpcep
 Version: 0.1.0
-Release: 0.1.0%{?dist}
+Release: 0.2.0%{?dist}
 Summary: OpenDaylight bgpcep
 Group: Applications/Communications
 License: EPL
@@ -113,12 +113,35 @@ 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
 
@@ -137,5 +160,8 @@ rm -rf tmp
 %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.
index 0d37f8189037ac7b64ad059e038f639b837fc9c7..9e43c957df90aa6807159f271ae70e11dffa913b 100644 (file)
@@ -3,7 +3,7 @@
 
 Name: opendaylight-lispflowmapping
 Version: 0.1.0
-Release: 0.2.0%{?dist}
+Release: 0.3.0%{?dist}
 Summary: OpenDaylight LispFlowMapping
 Group: Applications/Communications
 License: EPL
@@ -65,6 +65,7 @@ while read artifact; do
     fi
 done <<'.'
 mappingservice.api-*.jar
+mappingservice.clusterdao-*.jar
 mappingservice.config-*.jar
 mappingservice.implementation-*.jar
 mappingservice.northbound-*.jar
@@ -90,6 +91,9 @@ rm -rf tmp
 %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.
 
index 88a8446cd0ea9a7ab3b5b6ba32062fa5412b53a9..c43c994743c5fa4f7b8c298957b645d1bdde71c0 100644 (file)
@@ -3,7 +3,7 @@
 
 Name: opendaylight
 Version: 0.1.0
-Release: 0.6.0%{?dist}
+Release: 0.7.0%{?dist}
 Summary: OpenDaylight SDN Controller Platform
 Group: Applications/Communications
 License: EPL
@@ -30,7 +30,7 @@ Group: Applications/Communications
 Requires: %{name}
 Requires: opendaylight-affinity
 #Requires: opendaylight-defense4all
-#Requires: opendaylight-opendove-odmc
+Requires: opendaylight-opendove-odmc
 #Requires: opendaylight-vtn
 
 %description virtualization
@@ -62,6 +62,9 @@ PCEP, and LISP southbound and the Affinity Service and the LISP Service northbou
 %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.
 
index 9ecae9ae6f3be5f117fefb0974ce9594975f452b..45cd69650e5160fcab5e7593cf8438e4630b3428 100755 (executable)
@@ -19,7 +19,7 @@ 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-l3-2013|\
+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})"
@@ -29,7 +29,7 @@ ietf-topology-l3-unicast-igp-2013|ietf-topology-ospf-2013)"
 virt-ovsdb)
     filter="opendove|vtn|\
 bgpcep|lispflowmapping|snmp4sdn|\
-yangtools.model.(ietf-ted-2013|ietf-topology-isis-2013|ietf-topology-l3-2013|\
+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})"
@@ -40,7 +40,7 @@ virt-opendove)
     echo "$option not supported yet"
     filter="ovsdb|vtn|\
 bgpcep|lispflowmapping|snmp4sdn|\
-yangtools.model.(ietf-ted-2013|ietf-topology-isis-2013|ietf-topology-l3-2013|\
+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})"
@@ -51,7 +51,7 @@ 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-l3-2013|\
+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})"
@@ -62,7 +62,7 @@ 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-l3-2013|\
+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})"