1008N/A# The contents of this file are subject to the terms of the
1008N/A# Common Development and Distribution License, Version 1.0 only
1008N/A# (the "License"). You may not use this file except in compliance
1008N/A# You can obtain a copy of the license at
1008N/A# See the License for the specific language governing permissions
1008N/A# and limitations under the License.
1008N/A# When distributing Covered Code, include this CDDL HEADER in each
1008N/A# file and include the License file at
1008N/A# add the following below this CDDL HEADER, with the fields enclosed
1008N/A# by brackets "[]" replaced with your own identifying information:
1008N/A# Portions Copyright [yyyy] [name of copyright owner]
1008N/A# Copyright 2013 ForgeRock AS
1008N/A%define _topdir [[ topDir ]]
1008N/A%define _prefix [[ prefix ]]
1008N/A%define __os_install_post %{nil}
1008N/A# Link to Application web site
1008N/AOpenDJ is an LDAPv3 compliant directory service, developed for the Java
1008N/Aplatform, providing a high performance, highly available and secure store
1008N/Afor the identities managed by enterprises. Its easy installation process,
1008N/Acombined with the power of the Java platform makes OpenDJ one of the
1008N/Asimplest and fastest directory servers to deploy and manage.
1008N/Amkdir -p "$RPM_BUILD_ROOT%{_prefix}"
1008N/Acd "$RPM_BUILD_ROOT%{_prefix}"
1008N/A# Remove the excluded files. They shouldn't be a part of this package.
1008N/A rm -r "$RPM_BUILD_ROOT%{_prefix}$excludedFiles"
1008N/A[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"
2517N/A# If the first argument to %pre is 1, the RPM operation is an initial
2517N/A# installation. If the argument to %pre is 2, the operation is an upgrade
2345N/A# from an existing version to a new one.
2345N/A# Similarly, the arguments to a %post are 1 and 2 for a new installation
2345N/A# and upgrade, respectively. (%pre and %post aren't executed during
1548N/A echo "Pre Install - initial install"
1548N/Aelse if [ "$1" == "2" ] ; then
1548N/A# Only if the instance has been configured
1565N/A echo "Pre Install - upgrade install"
1548N/A# If the server is running before upgrade, creates a file flag
1008N/A echo "Post Install - initial install"
1008N/Aelse if [ "$1" == "2" ] ; then
1008N/A echo "Post Install - upgrade install"
1008N/A# Only if the instance has been configured
1008N/A "%{_prefix}"/./upgrade -n --acceptLicense
1008N/A# Checks the server status flag for restart.
1008N/A echo "Restarting server..."
1008N/A# Upgrade fails, needs user interaction (eg. manual mode)
1008N/A echo "Instance is not configured. Upgrade aborted."
1008N/A# If the first argument to %preun and %postun is 0, the action is
1008N/A# If the first argument to %preun and %postun is 1, the action is an upgrade.
1548N/A echo "Pre Uninstall - uninstall"
1548N/A# Only if the instance has been configured
1548N/Aelse if [ "$1" == "1" ] ; then
1565N/A echo "Pre Uninstall - upgrade uninstall"
2648N/A echo "Post Uninstall - uninstall"
2648N/A echo "OpenDJ successfully removed."
2648N/Aelse if [ "$1" == "1" ] ; then
2648N/A echo "Post Uninstall - upgrade uninstall"
2648N/A%files -f "%{_sourcedir}"/files
1008N/A- Fixed the sections' order and added a new "clean" section.
1008N/A- Added '%changelog' at the end of the file.
1008N/A- Added license to header's files.