Create Beryllium SR1 RPM, add ex repo config 93/36693/1
authorDaniel Farrell <dfarrell@redhat.com>
Wed, 23 Mar 2016 20:34:54 +0000 (16:34 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 23 Mar 2016 20:34:54 +0000 (16:34 -0400)
Define build logic for ODL Beryllium SR1 4.1.0 RPM.

Add example repository config for installing new Be SR1 RPM from the
CentOS Community Build System.

Update README with new supported ODL version.

Change-Id: Ie41f9a4cac7467831719a65132e07ae94bf67b25
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
rpm/README.markdown
rpm/build_vars.yaml
rpm/example_repo_configs/opendaylight-41-release.repo [new file with mode: 0644]
rpm/specs/opendaylight-4.1.0-1.spec [new file with mode: 0644]

index 34c6f3c0ce5dd0b3afe847941d2f0f7d35ce443d..d15968fb71d2b4ddb1c9024a4e9a630a5702f84d 100644 (file)
@@ -9,6 +9,7 @@ SRPM/RPM builds are supported for the following OpenDaylight major releases, as
 * Lithium SR3
 * Lithium SR4
 * Beryllium
+* Beryllium SR1
 
 ## Overview
 
index 91405a96b13a74ae0df0e9156c78b9545090775a..59c658bda6d622c8d8bde18713a04354b86d882a 100644 (file)
@@ -227,3 +227,15 @@ builds:
     changelog: |
       * Fri Mar 11 2016 Daniel Farrell <dfarrell@redhat.com> - 3.4.0-1
       - Create Lithium SR4 RPM
+  - version_major: "4"
+    version_minor: "1"
+    version_patch: "0"
+    rpm_release: "1"
+    rpm_disttag: el7
+    java_version: ">= 1:1.7.0"
+    sysd_commit: c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed
+    codename: Beryllium-SR1
+    download_url: "https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.1-Beryllium-SR1/distribution-karaf-0.4.1-Beryllium-SR1.tar.gz"
+    changelog: |
+      * Wed Mar 23 2016 Daniel Farrell <dfarrell@redhat.com> - 4.1.0-1
+      - Create Beryllium SR1 RPM
diff --git a/rpm/example_repo_configs/opendaylight-41-release.repo b/rpm/example_repo_configs/opendaylight-41-release.repo
new file mode 100644 (file)
index 0000000..944c834
--- /dev/null
@@ -0,0 +1,5 @@
+[opendaylight-41-release]
+name=CentOS CBS OpenDaylight Beryllium SR1 repository
+baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-41-release/$basearch/os/
+enabled=1
+gpgcheck=0
diff --git a/rpm/specs/opendaylight-4.1.0-1.spec b/rpm/specs/opendaylight-4.1.0-1.spec
new file mode 100644 (file)
index 0000000..5590539
--- /dev/null
@@ -0,0 +1,70 @@
+# ODL is a noarch package, so this isn't necessary. It's also very slow.
+%define __jar_repack 0
+
+Name:       opendaylight
+Version:    4.1.0
+# The Fedora/CentOS packaging guidelines *require* the use of a disttag. ODL's
+#   RPM build doesn't do anything Fedora/CentOS specific, so the disttag is
+#   unnecessary and unused in our case, but both the docs and the pros (apevec)
+#   agree that we should include it.
+# See: https://fedoraproject.org/wiki/Packaging:DistTag
+Release:    1.el7
+BuildArch:  noarch
+Summary:    OpenDaylight SDN Controller
+Group:      Applications/Communications
+License:    EPL-1.0
+URL:        http://www.opendaylight.org
+Source0:    https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.4.1-Beryllium-SR1/distribution-karaf-0.4.1-Beryllium-SR1.tar.gz
+Source1:    %name-c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed.service.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
+# Home dir must be a valid path for various files to be created in it
+getent passwd odl > /dev/null || useradd odl -M -d $RPM_BUILD_ROOT/opt/%name
+getent group odl > /dev/null || groupadd odl
+
+%description
+OpenDaylight Beryllium-SR1
+
+%prep
+# Extract Source0 (ODL archive)
+%autosetup -n distribution-karaf-0.4.1-Beryllium-SR1
+# Extract Source1 (systemd config)
+%autosetup -T -D -b 1 -c -n %name-c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed.service
+
+%install
+# Create directory in build root for ODL
+mkdir -p $RPM_BUILD_ROOT/opt/%name
+# Copy ODL from archive to its dir in build root
+cp -r ../distribution-karaf-0.4.1-Beryllium-SR1/* $RPM_BUILD_ROOT/opt/%name
+# Create directory in build root for systemd .service file
+mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
+# Copy ODL's systemd .service file to correct dir in build root
+cp ../../BUILD/%name-c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed.service/%name-c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed.service $RPM_BUILD_ROOT/%{_unitdir}/%name.service
+
+%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 preserved
+if [ $1 -eq 0 ]; then
+    rm -rf $RPM_BUILD_ROOT/opt/%name
+fi
+
+%files
+# ODL will run as odl:odl, set as user:group for ODL dir, don't override mode
+%attr(-,odl,odl) /opt/%name
+# Configure systemd unitfile user/group/mode
+%attr(0644,root,root) %{_unitdir}/%name.service
+
+
+%changelog
+* Wed Mar 23 2016 Daniel Farrell <dfarrell@redhat.com> - 4.1.0-1
+- Create Beryllium SR1 RPM