specFile revision 6532
1008N/A#
1008N/A# CDDL HEADER START
1008N/A#
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# with the License.
1008N/A#
1008N/A# You can obtain a copy of the license at
1008N/A# trunk/opendj3/legal-notices/CDDLv1_0.txt
1008N/A# or http://forgerock.org/license/CDDLv1.0.html.
1008N/A# See the License for the specific language governing permissions
1008N/A# and limitations under the License.
1008N/A#
1008N/A# When distributing Covered Code, include this CDDL HEADER in each
1008N/A# file and include the License file at
1008N/A# trunk/opendj3/legal-notices/CDDLv1_0.txt. If applicable,
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#
1008N/A# CDDL HEADER END
1008N/A#
1008N/A# Copyright 2013 ForgeRock AS
1008N/A#
1008N/A%define _topdir [[ topDir ]]
1008N/A%define _arch noarch
1008N/A%define _prefix [[ prefix ]]
1008N/A%define _pre [[ pre ]]
1008N/A%define __os_install_post %{nil}
1008N/A
1008N/A# =========================
1008N/A# Header
1008N/A# =========================
1008N/A# Short Description
1008N/ASummary: [[ shortName ]]
1008N/A# Application Name
1008N/AName: [[ pkgName ]]
1008N/A# Application Version
1008N/AVersion: [[ version ]]
1008N/A# Packaging Revision
1008N/ARelease: [[ release ]]
1008N/A# Software Licenced Under
1008N/ALicense: CDDL
1008N/A# RPM Group
1008N/AGroup: Productivity/Networking/LDAP/Servers
1008N/A# Link to Application web site
1008N/AURL: [[ referenceURL ]]
1008N/A# Distributing Organisation
1008N/AVendor: ForgeRock AS
1008N/A# Build Architecture
1008N/ABuildArch: noarch
1008N/A
1008N/ARequires: jre >= 1.6
1008N/A
1008N/A# Long Description
1008N/A%Description
1008N/AOpenDJ LDAP Server
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/A
1008N/A
1008N/A# =========================
1008N/A# Prepare, Build, Install
1008N/A# =========================
1008N/A# %prep
1008N/A
1008N/A# %build
1008N/A
1008N/A%install
1008N/Amkdir -p "$RPM_BUILD_ROOT%{_prefix}"
1008N/Acd "$RPM_BUILD_ROOT%{_prefix}"
1008N/A# [[ installRpmFiles ]]
1008N/A# Remove the excluded files. They shouldn't be a part of this package.
1008N/A/bin/grep -v '^#' "$RPM_SOURCE_DIR/excludedFiles" | while read excludedFiles
1008N/Ado
1008N/A rm -r "$RPM_BUILD_ROOT%{_prefix}$excludedFiles"
1008N/Adone
1008N/A
1008N/A%clean
1008N/A[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"
1008N/A
1008N/A# =========================
2345N/A# Pre & Post Install
1008N/A# =========================
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
2345N/A# an uninstallation.)
2345N/A
1008N/A# -------------------------
1008N/A# Pre Install
1548N/A%pre
1548N/Aif [ "$1" == "1" ]; then
1548N/A echo "Pre Install - initial install"
1548N/Aelse if [ "$1" == "2" ] ; then
1548N/A# Only if the instance has been configured
1548N/A if [ -e "%{_prefix}"/config/buildinfo ] && [ "$(ls -A "%{_prefix}"/config/archived-configs)" ]
1565N/A then
1565N/A echo "Pre Install - upgrade install"
1548N/A# If the server is running before upgrade, creates a file flag
1548N/A if [ -f "%{_prefix}"/logs/server.pid ]
1565N/A then
1565N/A touch "%{_prefix}"/logs/status
1548N/A fi
1565N/A "%{_prefix}"/bin/./stop-ds
1548N/A fi
1548N/A fi
1008N/Afi
1008N/A
1008N/A# -------------------------
1008N/A# Post Install
1008N/A%post
1008N/Aif [ "$1" == "1" ] ; then
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 if [ -e "%{_prefix}"/config/buildinfo ] && [ "$(ls -A "%{_prefix}"/config/archived-configs)" ]
1008N/A then
1008N/A "%{_prefix}"/./upgrade -n --acceptLicense
1008N/A# Upgrade ok
1008N/A if [ "$?" == "0" ] ; then
1008N/A# Checks the server status flag for restart.
1008N/A if [ -f "%{_prefix}"/logs/status ]
1008N/A then
1008N/A echo ""
1008N/A echo "Restarting server..."
1008N/A "%{_prefix}"/./bin/start-ds
1008N/A echo ""
1008N/A rm -f "%{_prefix}"/logs/status
1008N/A fi
1008N/A fi
1008N/A# Upgrade fails, needs user interaction (eg. manual mode)
1008N/A if [ "$?" == "2" ] ; then
1008N/A exit "0"
1008N/A fi
1008N/A else
1008N/A echo "Instance is not configured. Upgrade aborted."
1008N/A exit -1
1008N/A fi
1008N/A fi
1008N/Afi
1008N/A
1008N/A# =========================
1008N/A# Pre & Post Uninstall
1008N/A# =========================
1008N/A# If the first argument to %preun and %postun is 0, the action is
1008N/A# uninstallation.
1008N/A# If the first argument to %preun and %postun is 1, the action is an upgrade.
1548N/A# -------------------------
1548N/A# Pre Uninstall
1548N/A%preun
1548N/Aif [ "$1" == "0" ] ; then
1548N/A echo "Pre Uninstall - uninstall"
1548N/A# Only if the instance has been configured
1565N/A if [ -e "%{_prefix}"/config/buildinfo ] && [ "$(ls -A "%{_prefix}"/config/archived-configs)" ]
1565N/A then
1565N/A "%{_prefix}"/bin/./stop-ds
1548N/A fi
1548N/Aelse if [ "$1" == "1" ] ; then
1565N/A echo "Pre Uninstall - upgrade uninstall"
1565N/A fi
1548N/Afi
1565N/A# -------------------------
1548N/A# Post Uninstall
1548N/A%postun
2648N/Aif [ "$1" == "0" ] ; then
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 fi
2648N/Afi
2648N/A
2648N/A# =========================
2648N/A# Files section
2648N/A# =========================
2648N/A%files -f "%{_sourcedir}"/files
2648N/A%defattr(-,root,root)
2648N/A# [[ docsList ]]
2648N/A
2648N/A# =========================
2648N/A# Changelog
2648N/A# =========================
2648N/A%changelog
1008N/A* Thu Jul 18 2013 ForgeRock
1008N/A- Fixed the sections' order and added a new "clean" section.
1008N/A- Added '%doc' section.
1008N/A- Added '%changelog' at the end of the file.
1008N/A- Added license to header's files.
1008N/A