[jetty] Move configuration directories to %{_sysconfdir}

Mikolaj Izdebski mizdebsk at fedoraproject.org
Fri Sep 27 12:22:58 UTC 2013


commit a8823ba40f871246be5dc3c150ea338e3bc89aaf
Author: Mikolaj Izdebski <mizdebsk at redhat.com>
Date:   Fri Sep 27 14:22:24 2013 +0200

    Move configuration directories to %{_sysconfdir}
    
    - Resolves: rhbz#596611

 jetty.spec |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)
---
diff --git a/jetty.spec b/jetty.spec
index dd44003..f0b1e18 100644
--- a/jetty.spec
+++ b/jetty.spec
@@ -55,7 +55,7 @@
 
 Name:           jetty
 Version:        9.0.5
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Java Webserver and Servlet Container
 
 # Jetty is dual licensed under both ASL 2.0 and EPL 1.0, see NOTICE.txt
@@ -697,12 +697,22 @@ rm %{buildroot}%{homedir}/*.txt  %{buildroot}%{homedir}/*.html
 # See: https://bugzilla.redhat.com/show_bug.cgi?id=845993
 ln -sf %{rundir} %{buildroot}%{homedir}/work
 
-# this should be symlinked the other way around but rpm doesn't let us
-# do that! BAD BAD rpm
-# https://bugzilla.redhat.com/show_bug.cgi?id=447156
-for cdir in contexts contexts-available resources;do
-    ln -sf %{homedir}/$cdir %{buildroot}/%{confdir}/$cdir
-done
+# Resources directory ought to be in /etc.
+# See: https://bugzilla.redhat.com/show_bug.cgi?id=596611
+mv %{buildroot}/%{homedir}/resources %{buildroot}/%{confdir}
+
+
+# RPM cannot replace symlink with a directory, workaround this bug.
+# See: https://bugzilla.redhat.com/show_bug.cgi?id=447156
+%pretrans -p <lua>
+if (posix.stat("%{homedir}/resources", "type") == "directory") then
+    posix.unlink("%{homedir}/resources/jetty-logging.properties")
+    posix.unlink("%{homedir}/resources/log4j.properties")
+    posix.rmdir("%{homedir}/resources")
+end
+if (posix.stat("%{confdir}/resources", "type") == "link") then
+    posix.unlink("%{confdir}/resources")
+end
 
 
 %pre
@@ -712,6 +722,9 @@ getent passwd %username &>/dev/null || useradd  -r -u %jtuid -g %username \
                              -d %homedir -M -s /sbin/nologin %username || :
 
 %post
+if [ ! -e %{homedir}/resources ]; then
+    ln -s %{confdir}/resources %{homedir}/resources
+fi
 %systemd_post jetty.service
 
 %preun
@@ -742,6 +755,7 @@ getent passwd %username &>/dev/null || useradd  -r -u %jtuid -g %username \
 %dir %{jettylibdir}
 %dir %{jettycachedir}
 %{homedir}
+%ghost %{homedir}/resources
 %attr(755, jetty, jetty) %{logdir}
 %attr(755, jetty, jetty) %{tempdir}
 %ghost %dir %attr(755, jetty, jetty) %{rundir}
@@ -814,6 +828,10 @@ getent passwd %username &>/dev/null || useradd  -r -u %jtuid -g %username \
 %doc NOTICE.txt LICENSE*
 
 %changelog
+* Sat Sep 21 2013 Mikolaj Izdebski <mizdebsk at redhat.com> - 9.0.5-2
+- Move configuration directories to %{_sysconfdir}
+- Resolves: rhbz#596611
+
 * Thu Aug 22 2013 Michal Srb <msrb at redhat.com> - 9.0.5-1
 - Update to upstream version 9.0.5
 


More information about the scm-commits mailing list