Add Lithium SR2 RPM build definition 07/28807/2
authorDaniel Farrell <dfarrell@redhat.com>
Mon, 26 Oct 2015 16:30:24 +0000 (12:30 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Tue, 27 Oct 2015 13:40:42 +0000 (13:40 +0000)
Change-Id: I70a8be03d63e6e7f7c4c8d0cfef54080fd81f145
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
rpm/README.md
rpm/build_vars.yaml
rpm/specs/opendaylight-3.2.0-1.spec [new file with mode: 0644]

index 6c0171153c3fd2b25d19a7eebd289e7c3ac1830d..fd7033399d9d6ca014149338a0c8e8b98fc739c6 100644 (file)
@@ -5,6 +5,7 @@ SRPM/RPM builds are supported for the following OpenDaylight versions:
 * Helium SR4
 * Lithium
 * Lithium SR1
+* Lithium SR2
 
 ## Overview
 
index 81384756c6e47c78a7f89ca5c9b58bfdb9c30a49..aaad2f051f49e40c230ff94c8c4a461af3ad90db 100644 (file)
@@ -56,3 +56,14 @@ builds:
     changelog: |
       * Tue Sep 15 2015 Daniel Farrell <dfarrell@redhat.com> - 3.1.0-1
       - Create Lithium SR1 RPM
+  - version_major: 3
+    version_minor: 2
+    version_patch: 0
+    rpm_release: 1
+    rpm_disttag: el7
+    java_version: ">= 1:1.7.0"
+    sysd_commit: c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed
+    codename: Lithium-SR2
+    changelog: |
+      * Mon Oct 26 2015 Daniel Farrell <dfarrell@redhat.com> - 3.2.0-1
+      - Create Lithium SR2 RPM
diff --git a/rpm/specs/opendaylight-3.2.0-1.spec b/rpm/specs/opendaylight-3.2.0-1.spec
new file mode 100644 (file)
index 0000000..6ba3e2f
--- /dev/null
@@ -0,0 +1,68 @@
+# ODL is a noarch package, so this isn't necessary. It's also very slow.
+%define __jar_repack 0
+
+Name:       opendaylight
+Version:    3.2.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.3.2-Lithium-SR2/distribution-karaf-0.3.2-Lithium-SR2.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 Lithium-SR2
+
+%prep
+# Extract Source0 (ODL archive)
+%autosetup -n distribution-karaf-0.3.2-Lithium-SR2
+# 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.3.2-Lithium-SR2/* $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
+rm -rf $RPM_BUILD_ROOT/opt/%name
+
+%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
+* Mon Oct 26 2015 Daniel Farrell <dfarrell@redhat.com> - 3.2.0-1
+- Create Lithium SR2 RPM