# BEGIN COPYRIGHT BLOCK # This Program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; version 2 of the License. # # This Program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this Program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place, Suite 330, Boston, MA 02111-1307 USA. # # In addition, as a special exception, Red Hat, Inc. gives You the additional # right to link the code of this Program with code not covered under the GNU # General Public License ("Non-GPL Code") and to distribute linked combinations # including the two, subject to the limitations in this paragraph. Non-GPL Code # permitted under this exception must only link to the code of this Program # through those well defined interfaces identified in the file named EXCEPTION # found in the source code files (the "Approved Interfaces"). The files of # Non-GPL Code may instantiate templates or use macros or inline functions from # the Approved Interfaces without causing the resulting work to be covered by # the GNU General Public License. Only Red Hat, Inc. may make changes or # additions to the list of Approved Interfaces. You must obey the GNU General # Public License in all respects for all of the Program code and other code used # in conjunction with the Program except the Non-GPL Code covered by this # exception. If you modify this file, you may extend this exception to your # version of the file, but you are not obligated to do so. If you do not wish to # provide this exception without modification, you must delete this exception # statement from your version and license this file solely under the GPL without # exception. # # # Copyright (C) 2005 Red Hat, Inc. # All rights reserved. # END COPYRIGHT BLOCK # The way we do packaging seems to leave unpackaged files in the builddir; # however, we really don't want them %define _unpackaged_files_terminate_build 0 # override the default build name format - we do not want the arch subdir %define _build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.%{flavor}.rpm # don't bother stripping - we already do this for optimized, and we definitely # want the symbols in the debug builds %define __os_install_post %{nil} Summary: @COMPANY-PRODUCT-NAME@ Name: @LCASE-COMPANY-NAME-NOSP@-ds Version: @NOSP-VERSION@ Release: 1.@PLATFORM@ License: GPL plus extensions Group: System Environment/Daemons URL: @COMPANY-URL@ Source: %{name}-%{version}.tar.gz BuildRoot: %{_builddir} BuildPreReq: perl, fileutils, make # Without Autoreq: 0, rpmbuild finds all sorts of crazy # dependencies that we don't care about, and refuses to install Autoreq: 0 # Don't automatically generate provides list AutoProv: 0 # Without Requires: something, rpmbuild will abort! Requires: perl,httpd,cyrus-sasl >= 2.1.15 Prefix: /opt/%{name} %description @COMPANY-PRODUCT-NAME@ is an LDAPv3 compliant server. # wait! what's going on here? where are the prep and build sections? # what kind of a .spec file is this anyway? # A: one that works well with the current DS build system # As we move towards a completely open source build # process, will begin doing things in the more RPM way # but for now, in order to make our tight deadlines and # support RHN distribution, this is the way we do it %install # all we do here is run setup -b to unpack the binaries # into the BuildRoot # the echo yes is for dsktune to continue # the second echo yes is for some platforms that need it (echo yes ; echo yes) | ./setup -b $RPM_BUILD_ROOT/%{prefix} # remove the setup log files so they aren't packaged rm -f $RPM_BUILD_ROOT/%{prefix}/setup/*/*.log %clean if [ -z "$RPM_INSTALL_PREFIX" ]; then RPM_INSTALL_PREFIX=%{prefix} fi rm -rf $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX %files # rather than listing individual files, we just package (and own) # the entire ldapserver directory - if we change this to put # files in different places, we won't be able to do this anymore %defattr(-,root,root,-) %{prefix} %pre # in case upgrade, need to shutdown the servers before the installation ls $RPM_INSTALL_PREFIX/slapd-* > /dev/null 2>&1 if [ $? -eq 0 ]; then for instance in `ls -d $RPM_INSTALL_PREFIX/slapd-*` do if [ -f $instance/logs/pid ]; then pid=`cat $instance/logs/pid` psval=`ps -ef | egrep $pid` if [ "$psval" != "" ]; then $instance/stop-slapd fi fi done fi if [ -f $RPM_INSTALL_PREFIX/admin-serv/logs/pid ]; then pid=`cat $RPM_INSTALL_PREFIX/admin-serv/logs/pid` psval=`ps -ef | egrep $pid` if [ "$psval" != "" ]; then $RPM_INSTALL_PREFIX/stop-admin fi fi %post echo "" if [ -z "$RPM_INSTALL_PREFIX" ]; then RPM_INSTALL_PREFIX=%{prefix} fi # patch file to fix console ld libpath if [ -f $RPM_INSTALL_PREFIX/setup/console-ld-libpath.patch ] ; then patch -s -f -d $RPM_INSTALL_PREFIX -p0 < $RPM_INSTALL_PREFIX/setup/console-ld-libpath.patch > /dev/null 2>&1 fi if [ "$1" -gt 1 ] ; then # patch file to upgrade admin server from 1.0 to 1.0.1 if [ -f $RPM_INSTALL_PREFIX/setup/adminserver10to101.patch ] ; then patch -s -f -d $RPM_INSTALL_PREFIX -p0 < $RPM_INSTALL_PREFIX/setup/adminserver10to101.patch > /dev/null 2>&1 fi # patch file to fix start-admin on Fedora Core 2 if [ -f $RPM_INSTALL_PREFIX/setup/adminserver-start-admin.patch ] ; then patch -s -f -d $RPM_INSTALL_PREFIX -p0 < $RPM_INSTALL_PREFIX/setup/adminserver-start-admin.patch > /dev/null 2>&1 fi # patch file to fix module load order if [ -f $RPM_INSTALL_PREFIX/setup/adminserver-httpd-moduleorder.patch ] ; then patch -s -f -d $RPM_INSTALL_PREFIX -p0 < $RPM_INSTALL_PREFIX/setup/adminserver-httpd-moduleorder.patch > /dev/null 2>&1 fi # patch file to fix use of admpw for basic auth in the template file if [ -f $RPM_INSTALL_PREFIX/setup/admserv-conf-tmpl.patch ] ; then patch -s -f -d $RPM_INSTALL_PREFIX -p0 < $RPM_INSTALL_PREFIX/setup/admserv-conf-tmpl.patch > /dev/null 2>&1 fi # patch file to fix use of admpw for basic auth in the real config file if [ -f $RPM_INSTALL_PREFIX/setup/admserv-conf-admpw.patch ] ; then patch -s -f -d $RPM_INSTALL_PREFIX -p0 < $RPM_INSTALL_PREFIX/setup/admserv-conf-admpw.patch > /dev/null 2>&1 fi # fix up file permissions testfile=$RPM_INSTALL_PREFIX/admin-serv/config/nss.conf if [ ! -f $testfile ] ; then testfile=$RPM_INSTALL_PREFIX/admin-serv/config/adm.conf fi if [ -f $testfile ] ; then usergroup=`ls -l $testfile | awk '{print $3":"$4}'` if [ -d $RPM_INSTALL_PREFIX/admin-serv/config ] ; then chown $usergroup $RPM_INSTALL_PREFIX/admin-serv/config fi if [ -d $RPM_INSTALL_PREFIX/bin/slapd/authck ] ; then chown $usergroup $RPM_INSTALL_PREFIX/bin/slapd/authck fi if [ -d $RPM_INSTALL_PREFIX/alias ] ; then chown $usergroup $RPM_INSTALL_PREFIX/alias fi fi echo "Upgrade finished. Please run $RPM_INSTALL_PREFIX/setup/setup to complete the upgrade." else echo "Install finished. Please run $RPM_INSTALL_PREFIX/setup/setup to complete installation and set up the servers." fi %preun # only run uninstall if this is the last version of the package if [ "$1" = 0 ] ; then if [ -z "$RPM_INSTALL_PREFIX" ]; then RPM_INSTALL_PREFIX=%{prefix} fi cd $RPM_INSTALL_PREFIX ./uninstall -s -force fi %changelog * Wed Mar 1 2006 Rich Megginson - 1.0.2-1 - Added admserv-conf-tmpl.patch and admserv-conf-admpw.patch to fix the use of admpw for basic auth * Wed Feb 22 2006 Rich Megginson - 1.0.2-1 - Add patch to fix admin server httpd module load order; you - must now run setup after an upgrade; copy in the new 00core.ldif - schema file to the server instances * Tue Dec 6 2005 Rich Megginson - 1.0.1-1 - Use nosp version instead of gen version to get patch version numbers - Patch the admin server in the post install section - Remove the unnecessary log files after setup so they aren't packaged * Wed Nov 09 2005 Nathan Kinder 7.1-2 - Changed cyrus-sasl dependency to >= 2.1.15 for RHEL3 compatibility * Fri Nov 04 2005 Noriko Hosoi 7.1-2 - Added a dependency: cyrus-sasl >= 2.1.19 * Wed Sep 14 2005 Nathan Kinder 7.1-2 - Added a dependency on the java-1.4.2-ibm package * Tue May 10 2005 Richard Megginson 7.1-2 - Change release to 2 * Fri Apr 8 2005 Rich Megginson 7.1-1 - check for last version removal in preun * Tue Apr 5 2005 Rich Megginson 7.1-1 - make rpm name .flavor.rpm - flavor must be defined in rpmbuild * Tue Apr 5 2005 Rich Megginson 7.1-1 - Removed all of the setup and build stuff - just use the regular DS build process for that * Tue Apr 5 2005 Rich Megginson 7.1-1 - use platform specific packaging directory; add preun to do uninstall * Fri Apr 1 2005 Rich Megginson 7.1-1 - use setup -q to suppress tar output * Tue Mar 29 2005 Richard Megginson 7.1-1 - use INTERNAL_BUILD=1 for internal builds - change rev to 1 * Tue Mar 8 2005 Richard Megginson 7.1-0 - use ${prefix} instead of /opt/ldapserver - prefix is defined as /opt/%{name} * Thu Jan 20 2005 Richard Megginson - Initial build.