[tomcat6/f13/master] rhbz 640686 - appdir, libdir, and confdir are copied to __tmppath during pre and copied back during

Dave Knox dknox at fedoraproject.org
Wed Dec 1 18:56:52 UTC 2010


commit 2f2d6d0ba3e1013add3093c3f0ecdb900af664c1
Author: david knox <dknox at 78-97-42-72.skybeam.com>
Date:   Wed Dec 1 11:53:03 2010 -0700

    rhbz 640686 - appdir, libdir, and confdir are copied to __tmppath during pre and copied back during posttrans.

 tomcat6.spec |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/tomcat6.spec b/tomcat6.spec
index eebfa22..295cff9 100644
--- a/tomcat6.spec
+++ b/tomcat6.spec
@@ -55,7 +55,7 @@
 Name: tomcat6
 Epoch: 0
 Version: %{major_version}.%{minor_version}.%{micro_version}
-Release: 12%{?dist}
+Release: 13%{?dist}
 Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
 
 Group: Networking/Daemons
@@ -443,6 +443,12 @@ done
 %{_sbindir}/groupadd -g %{tcuid} -r tomcat 2>/dev/null || :
 %{_sbindir}/useradd -c "Apache Tomcat" -u %{tcuid} -g tomcat \
     -s /sbin/nologin -r -d %{homedir} tomcat 2>/dev/null || :
+# Save the conf, app, and lib dirs
+# due to rbgz 640686. Copy them to the _tmppath so we don't pollute 
+# the tomcat file structure
+[ -d %{appdir} ] && %{__cp} -rp %{appdir} %{_tmppath}/%{name}-webapps.bak || :
+[ -d %{confdir} ] && %{__cp} -rp %{confdir} %{_tmppath}/%{name}-confdir.bak || :
+[ -d %{libdir}  ] && %{__cp} -rp %{libdir} %{_tmppath}/%{name}-libdir.bak || :
 
 %post
 # install but don't activate
@@ -511,6 +517,23 @@ if [ "$1" = "0" ]; then
         %{_javadir}/%{name}-el-%{elspec}-api.jar
 fi
 
+# move the temporary backups to the correct tomcat directory
+# due to rhbz 640686
+%posttrans
+if [ -d %{_tmppath}/%{name}-webapps.bak ]; then
+  %{__cp} -rp %{_tmppath}/%{name}-webapps.bak/* %{appdir}
+  %{__rm} -rf %{_tmppath}/%{name}-webapps.bak
+fi
+if [ -d %{_tmppath}/%{name}-libdir.bak ]; then
+  %{__cp} -rp %{_tmppath}/%{name}-libdir.bak/* %{libdir}
+  %{__rm} -rf %{_tmppath}/%{name}-libdir.bak
+fi
+if [ -d %{_tmppath}/%{name}-confdir.bak ]; then
+  %{__cp} -rp %{_tmppath}/%{name}-confdir.bak/* %{confdir}
+  %{__rm} -rf %{_tmppath}/%{name}-confdir.bak
+fi
+
+
 %files
 %defattr(0644,root,tomcat,0775)
 %doc %{packdname}/{LICENSE,NOTICE,RELEASE*}
@@ -606,6 +629,11 @@ fi
 %{appdir}/sample
 
 %changelog
+* Wed Dec 1 2010  David Knox <dknox at redhat.com> 0:6.0.26-13
+- rhbz 640686 - appdir, libdir, and confdir are copied in 
+- pre to __tmppath. The are copied back in postrans and 
+- removed from __tmppath.
+
 * Tue Nov 23 2010  David Knox <dknox at redhat.com> 0:6.0.26-12
 - Resolves: rhbz#640686. Removed __rm appdir, confdir, libdir from
 post


More information about the scm-commits mailing list