summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-04-05 15:24:57 +0000
committerRich Megginson <rmeggins@redhat.com>2005-04-05 15:24:57 +0000
commit1e94426d2b84f4aa4f435b1a860f53702c159aad (patch)
tree77f7b905207e3250942a3a36dc88b2fdd2fd9a93
parentf414cb8bee55552248fcd32af49a2ffb9108ad1d (diff)
downloadds-1e94426d2b84f4aa4f435b1a860f53702c159aad.tar.gz
ds-1e94426d2b84f4aa4f435b1a860f53702c159aad.tar.xz
ds-1e94426d2b84f4aa4f435b1a860f53702c159aad.zip
Bug(s) fixed: 153686
Bug Description: New setup script displays wrong location if installing in non-default path Reviewed by: Nathan (Thanks!) Fix Description: Matt showed me a better way to get the prefix. These diffs also allow setup to be run from any directory so you don't have to cd serverroot to run it. I added uninstall support. uninstall is run in a preun script. I added initial support for doing multi platform builds in the same root. Platforms tested: RHEL3 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
-rwxr-xr-xldap/cm/newinst/setup7
-rw-r--r--ldapserver.spec.tmpl23
2 files changed, 26 insertions, 4 deletions
diff --git a/ldap/cm/newinst/setup b/ldap/cm/newinst/setup
index 87e20270..7162b919 100755
--- a/ldap/cm/newinst/setup
+++ b/ldap/cm/newinst/setup
@@ -79,6 +79,13 @@ for arg in "$@" ; do
fi
done
+# figure out where we are and make sure we cd to the serverroot dir
+setupdir=`dirname $0`
+sroot=`dirname $setupdir`
+cd $sroot
+
+rm -f $sroot/setup/install.inf
+
echo "INFO Begin Setup . . ." | tee -a $logfile
# cat LICENSE.txt
if ! [ $silent ]; then
diff --git a/ldapserver.spec.tmpl b/ldapserver.spec.tmpl
index ca2d871e..a4d7c42c 100644
--- a/ldapserver.spec.tmpl
+++ b/ldapserver.spec.tmpl
@@ -41,22 +41,24 @@ Prefix: /opt/%{name}
# like setupsdk, adminsdk, admin server
# BUILD_MODE=int builds the Redhat branded product
BUILDMODE=@BUILD-MODE@
+PLATFORM=@PLATFORM@
if [ $BUILDMODE = int ]; then
# brandDirectory makes the product use Redhat branded text and graphics
make brandDirectory
fi
-make INTERNAL_BUILD=1 BUILD_MODE=$BUILDMODE BUILD_JAVA_CODE=1 BUILD_DEBUG=optimize NO_INSTALLER_TAR_FILES=1 INSTDIR=../../pkg
+make INTERNAL_BUILD=1 BUILD_MODE=$BUILDMODE BUILD_JAVA_CODE=1 BUILD_DEBUG=optimize NO_INSTALLER_TAR_FILES=1 INSTDIR=../../pkg/$PLATFORM
%install
# all we do here is run setup -b to unpack the binaries
# into the BuildRoot
+PLATFORM=@PLATFORM@
rm -rf $RPM_BUILD_ROOT
-cd pkg
+cd pkg/$PLATFORM
# the echo yes is for dsktune to continue
echo yes | ./setup -b $RPM_BUILD_ROOT/%{prefix}
# this is our setup script that sets up the initial
# server instances after installation
-cd ..
+cd ../..
cp ldap/cm/newinst/setup $RPM_BUILD_ROOT/%{prefix}/setup
%clean
@@ -71,9 +73,22 @@ rm -rf $RPM_BUILD_ROOT
%post
echo ""
-echo "Please cd " %{prefix} " and run ./setup/setup"
+if [ -z "$RPM_INSTALL_PREFIX" ]; then
+ RPM_INSTALL_PREFIX=${prefix}
+fi
+echo "Please go to $RPM_INSTALL_PREFIX and run ./setup/setup"
+
+%preun
+if [ -z "$RPM_INSTALL_PREFIX" ]; then
+ RPM_INSTALL_PREFIX=${prefix}
+fi
+cd $RPM_INSTALL_PREFIX
+./uninstall -s -force
%changelog
+* Tue Apr 5 2005 Rich Megginson <rmeggins@redhat.com> 7.1-1
+- use platform specific packaging directory; add preun to do uninstall
+
* Fri Apr 1 2005 Rich Megginson <rmeggins@redhat.com> 7.1-1
- use setup -q to suppress tar output