diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2005-09-10 00:41:48 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2005-09-10 00:41:48 +0000 |
commit | 5cfe3400049f664bedfe03a84c041996f1322cca (patch) | |
tree | f31b0bf5362bafa764bbea3727eca684bb9427ef | |
parent | 64d991605e24cf319c5880a0cf4a3fcf4ee15384 (diff) | |
download | ds-5cfe3400049f664bedfe03a84c041996f1322cca.tar.gz ds-5cfe3400049f664bedfe03a84c041996f1322cca.tar.xz ds-5cfe3400049f664bedfe03a84c041996f1322cca.zip |
[167982] Service Pack framework
1) added patch info files and a perl script to process the info (RPM)
2) modified makefiles to create RPM based as well as setupsdk based SP package
-rw-r--r-- | ldap/cm/Makefile | 46 | ||||
-rw-r--r-- | ldap/cm/fedora-patch.inf | 58 | ||||
-rwxr-xr-x | ldap/cm/genRpmPatch.pl | 231 | ||||
-rw-r--r-- | ldap/cm/newinst/Makefile | 3 | ||||
-rw-r--r-- | ldap/cm/newinst/slapd-patch.inf | 52 | ||||
-rw-r--r-- | ldap/cm/redhat-patch.inf | 58 | ||||
-rw-r--r-- | ldapserver.spec.tmpl | 36 | ||||
-rw-r--r-- | nsdefs.mk | 4 |
8 files changed, 486 insertions, 2 deletions
diff --git a/ldap/cm/Makefile b/ldap/cm/Makefile index a4800df6..550ae5ce 100644 --- a/ldap/cm/Makefile +++ b/ldap/cm/Makefile @@ -214,6 +214,13 @@ RELJDK = $(BUILD_DRIVE)$(RELTOP)/ldapjdk FIX_SETUP_INF = $(BUILD_ROOT)/ldap/cm/fixSetupInf.pl FIX_BASE_INF = $(BUILD_ROOT)/ldap/cm/fixBaseInf.pl +ABSBUILD_ROOT = $(shell cd $(BUILD_ROOT); pwd) +ABSRELDIR = $(ABSBUILD_ROOT)/built/release +GENRPMPATCH = $(ABSBUILD_ROOT)/ldap/cm/genRpmPatch.pl +PATCHINF = $(ABSBUILD_ROOT)/ldap/cm/fedora-patch.inf +DATETIME = $(shell date +%Y%m%d-%H%M%S) +SPEXT = .SP.$(DATETIME) + # This is the directory where we put what we're making: the files which go on the CD. ifndef INSTDIR ifeq ($(ARCH), WINNT) @@ -224,6 +231,13 @@ endif endif ABS_INSTDIR = $(shell cd $(INSTDIR); pwd) +ifdef BUILD_PATCH +ifndef BUILD_RPM +PATCHINSTDIR = $(ABS_INSTDIR)-SP +SLAPDSP = slapd-71sp1 +endif +endif + INST_TARGET_RESKIT=$(INSTDIR)/reskit INST_TARGET_INTL=./$(PRODUCT_MARKET)dir @@ -610,6 +624,15 @@ packageDirectory: $(INSTDIR)/slapd \ $(INSTDIR)/tools/infozip.zip \ $(ADMSERV_DEP) +ifdef BUILD_PATCH +ifdef BUILD_RPM +# create a patch + $(GENRPMPATCH) -i $(RPM_BASE_NAME) -o $(NS_BUILD_FLAVOR) -r $(ABSRELDIR) -e $(SPEXT) -f $(PATCHINF) -v + mv $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR) $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR).original + ln -s $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR)$(SPEXT)/opt/$(RPM_BASE_NAME)-ds $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR) +endif +endif + # copy over the setup sdk stuff # hack - remove once admin server bundles setupsdk 6.02 # cp -R $(SETUP_SDK_BUILD_DIR)/bin/* $(INSTDIR) @@ -779,6 +802,29 @@ ifdef BUILD_SHIP endif # BUILD_SHIP endif # BUILD_RPM +ifdef BUILD_PATCH +ifndef BUILD_RPM + mkdir -p $(PATCHINSTDIR)/$(SLAPDSP) + cp $(INSTDIR)/dssetup $(PATCHINSTDIR) + cp $(INSTDIR)/LICENSE.txt $(PATCHINSTDIR) + cp $(INSTDIR)/README.txt $(PATCHINSTDIR) +# prepare the main inf file: setup.inf pointing inf file $(SLAPDS)/$(SLAPD).inf + sed -e "s/Components.*=/Components = $(SLAPDSP)/" $(INSTDIR)/setup.inf > $(PATCHINSTDIR)/setup.inf + echo "" >> $(PATCHINSTDIR)/setup.inf + echo "[$(SLAPDSP)]" >> $(PATCHINSTDIR)/setup.inf + echo "ComponentInfoFile = $(SLAPDSP)/$(SLAPDSP).inf" >> $(PATCHINSTDIR)/setup.inf +# create a zip file based upon the $(PATCHINF) file + cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); zip -r $(PATCHINSTDIR)/$(SLAPDSP)/ns$(SLAPDSP).zip `egrep file: $(PATCHINF) | awk -F: '{print $$3}'` +# create patch inf file: $(SLAPD).inf + cp $(OBJDIR)/slapd-patch.inf $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf + cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); ls `egrep file: $(PATCHINF) | egrep -v "setup/setup" | awk -F: '{print $$3}'` > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp + echo `cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp` | sed -e "s/ /,/g" > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2 + echo "BackupFiles="`cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2`>> $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf + rm -f $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2 + cd $(PATCHINSTDIR); $(TAR) cvf - * | gzip -f > ../$(NS_BUILD_FLAVOR)-SP.tar.gz +endif +endif + else # ---THE NT PACKAGE--- diff --git a/ldap/cm/fedora-patch.inf b/ldap/cm/fedora-patch.inf new file mode 100644 index 00000000..e8a9978d --- /dev/null +++ b/ldap/cm/fedora-patch.inf @@ -0,0 +1,58 @@ +# +# 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 +# +# Info file to generate DS7.1 SP1 patch +# base: <builddir> containing the base package -- DS7.1 +# file: <patchfile> +# +base: /share/dev4/fedora-ds/fds71/ships/20050526.1 + +file: 147585: plugins/slapd/slapi/examples/testpreop.c +file: 164834,165641,166229: bin/slapd/server/ns-slapd +file: 155276,164834,164843,165641,166229: bin/slapd/server/libslapd.* +file: 151678: bin/slapd/admin/bin/ds_newinst +file: 151678: bin/slapd/admin/bin/ds_create +file: 155276,164843,165641,165827,165862,166012: lib/libback-ldbm.* +file: 160003: bin/slapd/admin/scripts/template-db2index.pl +file: 160003: bin/slapd/admin/bin/upgradeServer +file: 164836,165600: lib/attr-unique-plugin.* +file: 165640: lib/views-plugin.* +file: 167478,160589: setup/setup +file: 156120,159037: winsync/PassSync.msi +file: 156120,159037: winsync/ntds.msi +file: 167761: java/jars/ds71.jar diff --git a/ldap/cm/genRpmPatch.pl b/ldap/cm/genRpmPatch.pl new file mode 100755 index 00000000..d2f4648f --- /dev/null +++ b/ldap/cm/genRpmPatch.pl @@ -0,0 +1,231 @@ +#!/usr/bin/perl +# +# 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 +# +# +# + +sub usage { + print(STDERR "Usage : $0 -r <releasedir> -o <objdir> -e <extension> -i <identity> -f <inffile>\n"); + print(STDERR " -r <releasedir>: built/release dir\n"); + print(STDERR " -o <objdir>: e.g., RHEL4-domestic-full-normal-pth-slapd\n"); + print(STDERR " -e <extension>: extension for the patch dir\n"); + print(STDERR " -i <identity>: fedora or redhat\n"); + print(STDERR " -f <inffile>: file containing the patch info\n"); + print(STDERR "sample <inffile>\n"); + print(STDERR " ======================================================\n"); + print(STDERR " base: /share/dev4/fedora-ds/fds71/ships/20050526.1\n"); + print(STDERR " file: 147585: plugins/slapd/slapi/examples/testpreop.c\n"); + print(STDERR " file: 164834,165641: bin/slapd/server/ns-slapd\n"); + print(STDERR " ======================================================\n"); +} + +$verbose = 0; +$inffile = ""; +$builtdirname = ""; +$releasedir = ""; +$extension = ""; +$identity = ""; + +$i = 0; +while ($i <= $#ARGV) { + if ("$ARGV[$i]" eq "-o") { + $i++; + $builtdirname = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-r") { + $i++; + $releasedir = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-e") { + $i++; + $extension = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-i") { + $i++; + $identity = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-f") { + $i++; + $inffile = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-v") { + $verbose = 1; + } + $i++; +} + +if ("$builtdirname" eq "") { + print(STDERR "ERROR: builtdirname is not given\n"); + &usage; exit(1); +} +if ("$releasedir" eq "") { + print(STDERR "ERROR: releasedir is not given\n"); + &usage; exit(1); +} +if ("$extension" eq "") { + print(STDERR "ERROR: extension is not given\n"); + &usage; exit(1); +} +if ("$identity" eq "" || + (("$identity" ne "fedora") && ("$identity" ne "redhat"))) { + print(STDERR "ERROR: $identity is not fedora or redhat\n"); + &usage; exit(1); +} +if ("$inffile" eq "") { + print(STDERR "ERROR: inffile is not given\n"); + &usage; exit(1); +} +if (!(-d "$releasedir")) { + print(STDERR "ERROR: $releasedir does not exist\n"); + exit(1); +} + +unless (open (INFFILE, $inffile)) { + die "Error, cannot open info file $inffile\n"; +} + +$basedir = 0; +@newfiles = (); +while ($l = <INFFILE>) { + chop($l); + $pos = length($l); + if ($l =~ /^base: /) { + $pos = rindex($l, ":", $pos); + $pos++; + $basedir = substr($l, $pos); + $basedir =~ s/[ ]//g; + } elsif ($l =~ /^file: /) { + $pos = rindex($l, ":", $pos); + $pos++; + $file = substr($l, $pos); + $file =~ s/[ ]//g; + push(@newfiles, ($file)); + } +} +if (1 == $verbose) { + print "Base: $basedir\n"; + print "New Files:\n"; + foreach $afile (@newfiles) { + print " $afile\n"; + } +} + +if ($builtdirname !~ /RHEL/) { + print(STDERR "ERROR: Not RHEL\n"); + exit(1); +} + +# Get info from $builtdirname (e.g., RHEL4-domestic-full-normal-pth-slapd\n") +$rhelversion = ""; +$rhelversionl = ""; +if ($builtdirname =~ /RHEL3/) { + $rhelversion = "RHEL3"; + $rhelversionl = "rhel3"; +} elsif ($builtdirname =~ /RHEL4/) { + $rhelversion = "RHEL4"; + $rhelversionl = "rhel4"; +} else { + print(STDERR "ERROR: $builtdirname is not supported\n"); + exit(1); +} + +$optordbg = ""; +if ($builtdirname =~ /full/) { + $optordbg = "dbg"; +} elsif ($builtdirname =~ /optimized/) { + $optordbg = "opt"; +} else { + print(STDERR "ERROR: $builtdirname has no opt/debug info\n"); + exit(1); +} + +# Get fullpath to the RPM file +$fullrpmfile = ""; +$iddir = ""; +opendir(BASEDIR, $basedir) or die "ERROR: Could not open $basedir\n"; +while ( defined ( $subdir = readdir(BASEDIR))) { + if ($subdir =~ /$rhelversionl/ || $subdir =~ /$rhelversion/) { + $fullsubdir = $basedir . "/" . $subdir; + opendir(SUBDIR, $fullsubdir) or die "ERROR: Could not open $fullsubdir\n"; + while ( defined ( $rpmfile = readdir(SUBDIR))) { + if (($rpmfile =~ /$rhelversionl/ || $rpmfile =~ /$rhelversion/) && + $rpmfile =~ /$optordbg/ && $rpmfile =~ /\.rpm$/) { + $fullrpmfile = $fullsubdir . "/" . $rpmfile; + ($org, $ds, $rest) = split('-', $rpmfile, 3); + $iddir = $org . "-" . $ds; + if ("$org" ne "$identity") { + print "ERROR: rpmfile name $rpmfile does not match the given identity $identity\n"; + exit(1); + } + closedir(SUBDIR); + last; + } + } + closedir(BASEDIR); + last; + } +} +if ("$fullrpmfile" eq "") { + print(STDERR "ERROR: Cannot file an rpm file under $basedir\n"); + exit(1); +} +if (1 == $verbose) { + print "RPM File: $fullrpmfile\n"; +} + +# Expand the RPM file to the $releasedir +$workdir = $releasedir . "/slapd/" . $builtdirname . $extension; +mkdir($workdir, 0700); +chdir($workdir); +if (1 == $verbose) { + print "Work Dir: $workdir\n"; +} +open(RPM2CPIO, "rpm2cpio $fullrpmfile | cpio -id | ") or die "Cannot run program: $!\n"; +close(RPM2CPIO); + +# Copy new files onto the expanded files +foreach $afile (@newfiles) { + $srcfile = $releasedir . "/slapd/" . $builtdirname . "/" . $afile; + $destfile = $workdir . "/opt/" . $iddir . "/" . $afile; + $destdir = substr($destfile, 0, rindex($destfile, "/", length($destfile))); + if (!(-d $destdir)) { + print "WARNING: $destdir does not exist. Skipping ...\n"; + next; + } + if (1 == $verbose) { + print "Copy: $srcfile => $destdir\n"; + } + open(COPY, "cp $srcfile $destdir | ") or print "Copy $srcfile to $destdir failed: $!\n"; + close(COPY); +} diff --git a/ldap/cm/newinst/Makefile b/ldap/cm/newinst/Makefile index e8b7ac3f..a5c0477f 100644 --- a/ldap/cm/newinst/Makefile +++ b/ldap/cm/newinst/Makefile @@ -181,6 +181,9 @@ $(INFO): else $(INFO): $(PERL) fixINF.pl $(BUILD_MODULE) $(NOSP_DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat slapd.inf $(SECURITY) $(PRODUCT) $(IS_DIR_LITE) $(INSTANCE_NAME_PREFIX) $@.inf $(BUILD_BOMB) "$(addprefix lib/,$(LDAP_SOLIBS)) bin/admin/libnsslapd.sl bin/slapd/bin/ns-slapd bin/slapd/bin/ns-slapd.so bin/slapd/bin/libnsslapd_shr.a" +ifdef BUILD_PATCH + $(PERL) fixINF.pl $(BUILD_MODULE) $(NOSP_DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat slapd-patch.inf $(SECURITY) $(PRODUCT_NAME) $(IS_DIR_LITE) $(INSTANCE_NAME_PREFIX) $@-patch.inf $(BUILD_BOMB) "$(addprefix lib/,$(LDAP_SOLIBS)) bin/admin/libnsslapd.sl bin/slapd/bin/ns-slapd bin/slapd/bin/ns-slapd.so bin/slapd/bin/libnsslapd_shr.a" +endif endif $(OBJDEST)/%.o: %.c diff --git a/ldap/cm/newinst/slapd-patch.inf b/ldap/cm/newinst/slapd-patch.inf new file mode 100644 index 00000000..adfe9060 --- /dev/null +++ b/ldap/cm/newinst/slapd-patch.inf @@ -0,0 +1,52 @@ +# +# 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 +# +[General] +Name= %%%SERVER_NAME%%% +Components=slapd-71sp1 + +[slapd-71sp1] +Name= %%%SERVER_NAME%%% +Description= %%%SERVER_NAME%%% +NickName= slapd-71sp1 +Version= %%%SERVER_VERSION%%% +BuildNumber= %%%SERVER_BUILD_NUM%%% +Archive= nsslapd-71sp1.zip +SourcePath=slapd-71sp1 +Checked=True +Mandatory=False diff --git a/ldap/cm/redhat-patch.inf b/ldap/cm/redhat-patch.inf new file mode 100644 index 00000000..6842fccc --- /dev/null +++ b/ldap/cm/redhat-patch.inf @@ -0,0 +1,58 @@ +# +# 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 +# +# Info file to generate DS7.1 SP1 patch +# base: <builddir> containing the base package -- DS7.1 +# file: <patchfile> +# +base: /share/dev4/ds/ds71/ships/20050524.1 + +file: 147585: plugins/slapd/slapi/examples/testpreop.c +file: 164834,165641,166229: bin/slapd/server/ns-slapd +file: 155276,164834,164843,165641,166229: bin/slapd/server/libslapd.* +file: 151678: bin/slapd/admin/bin/ds_newinst +file: 151678: bin/slapd/admin/bin/ds_create +file: 155276,164843,165641,165827,165862,166012: lib/libback-ldbm.* +file: 160003: bin/slapd/admin/scripts/template-db2index.pl +file: 160003: bin/slapd/admin/bin/upgradeServer +file: 164836,165600: lib/attr-unique-plugin.* +file: 165640: lib/views-plugin.* +file: 167478,160589: setup/setup +file: 156120,159037: winsync/PassSync.msi +file: 156120,159037: winsync/ntds.msi +file: 167761: java/jars/ds71.jar diff --git a/ldapserver.spec.tmpl b/ldapserver.spec.tmpl index 026c0e84..4586e92a 100644 --- a/ldapserver.spec.tmpl +++ b/ldapserver.spec.tmpl @@ -91,10 +91,44 @@ rm -rf $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX %defattr(-,root,root,-) %{prefix} +%pre +# in case upgrade, need to shutdown the servers before the installation +ls $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX/slapd-* > /dev/null 2>&1 +if [ $? -eq 0 ]; then + for instance in `ls -d $RPM_BUILD_ROOT/$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_BUILD_ROOT/$RPM_INSTALL_PREFIX/admin-serv/logs/pid ]; then + pid=`cat $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX/admin-serv/logs/pid` + psval=`ps -ef | egrep $pid` + if [ "$psval" != "" ]; then + $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX/stop-admin + fi +fi + %post +# in case upgrade, need to start the servers before running setup +ls $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX/slapd-* > /dev/null 2>&1 +if [ $? -eq 0 ]; then + for instance in `ls -d $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX/slapd-*` + do + $instance/start-slapd + done +fi +if [ -f $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX/start-admin ]; then + $RPM_BUILD_ROOT/$RPM_INSTALL_PREFIX/start-admin +fi echo "" if [ -z "$RPM_INSTALL_PREFIX" ]; then - RPM_INSTALL_PREFIX=%{prefix} + RPM_INSTALL_PREFIX=%{prefix} fi echo "Install finished. Please run $RPM_INSTALL_PREFIX/setup/setup to set up the servers." @@ -238,7 +238,8 @@ else NSPR_DIR=nspr endif NSPR_BASENAME=libnspr21 -PRODUCT="Fedora Directory Server" +PRODUCTCORE=Fedora Directory Server +PRODUCT="$(PRODUCTCORE)" PRODUCT_IS_DIRECTORY_SERVER=1 INSTANCE_NAME_PREFIX="Directory Server" DIR=slapd @@ -267,6 +268,7 @@ DO_SEARCH=no DIR_VERSION:=7.1 SP1 NOSP_DIR_VERSION:=7.1SP1 DIR_NORM_VERSION:=7.1 +PRODUCT_NAME="$(PRODUCTCORE) $(DIR_VERSION)" # When you change DIRSDK_VERSION or DIRSDK_VERSION_DLL_SUFFIX, you must # update all of the .exp and .def files by executing the following command: # cd ldap/libraries; gmake exportfiles |