[arch-commits] Commit in tomcat6/trunk (3 files)

Guillaume Alaux guillaume at archlinux.org
Sat Feb 14 11:19:10 UTC 2015


    Date: Saturday, February 14, 2015 @ 12:19:10
  Author: guillaume
Revision: 231389

Report latest changes from tomcat7/8

- Create 'tomcat' user throught systemd
- Do not remove 'tomcat' user after package removal
- Fix /var/tmp/tomcat6 rights

Added:
  tomcat6/trunk/systemd_sysusers.d_tomcat6.conf
Modified:
  tomcat6/trunk/PKGBUILD
  tomcat6/trunk/tomcat6.install

---------------------------------+
 PKGBUILD                        |   13 ++++++++++---
 systemd_sysusers.d_tomcat6.conf |    1 +
 tomcat6.install                 |   24 ++++--------------------
 3 files changed, 15 insertions(+), 23 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-02-14 06:06:25 UTC (rev 231388)
+++ PKGBUILD	2015-02-14 11:19:10 UTC (rev 231389)
@@ -1,7 +1,7 @@
 # Maintainer: Guillaume ALAUX <guillaume at archlinux.org>
 pkgname=tomcat6
 pkgver=6.0.43
-pkgrel=1
+pkgrel=2
 pkgdesc='Open source implementation of the Java Servlet 2.5 and JavaServer Pages 2.1 technologies'
 arch=('any')
 url='http://tomcat.apache.org/'
@@ -18,8 +18,8 @@
 install=${pkgname}.install
 source=(http://archive.apache.org/dist/tomcat/tomcat-6/v${pkgver}/bin/apache-tomcat-${pkgver}.tar.gz
         systemd_${pkgname}.service
-        systemd_tmpfiles.d_${pkgname}.conf
-        ${pkgname}.install)
+        systemd_sysusers.d_${pkgname}.conf
+        systemd_tmpfiles.d_${pkgname}.conf)
 
 sha256sums=('8952239e20856714fd3ae0ae88aa57e69f50c196091c39ec033906109f67b068'
             'df31fc3e41164bc7888516eebadb6f38fbbfe5882b8489928f8944237a3942a1'
@@ -61,6 +61,7 @@
   install -dm775 "${pkgdir}"/var/lib/${pkgname}
   cp -r webapps "${pkgdir}"/var/lib/${pkgname}
   chown -R ${_uid_tomcat}:${_gid_tomcat} "${pkgdir}"/var/lib/${pkgname}
+  chmod 775 "${pkgdir}"/var/lib/${pkgname}/webapps
   ln -s /var/lib/${pkgname}/webapps "${pkgdir}"/usr/share/${pkgname}/webapps
 
   install -dm1777 "${pkgdir}"/var/tmp
@@ -70,6 +71,12 @@
 
   install -Dm644 "${srcdir}"/systemd_${pkgname}.service \
                  "${pkgdir}"/usr/lib/systemd/system/${pkgname}.service
+  install -Dm644 "${srcdir}"/systemd_sysusers.d_${pkgname}.conf \
+                 "${pkgdir}"/usr/lib/sysusers.d/${pkgname}.conf
   install -Dm644 "${srcdir}"/systemd_tmpfiles.d_${pkgname}.conf \
                  "${pkgdir}"/usr/lib/tmpfiles.d/${pkgname}.conf
 }
+sha256sums=('8952239e20856714fd3ae0ae88aa57e69f50c196091c39ec033906109f67b068'
+            'df31fc3e41164bc7888516eebadb6f38fbbfe5882b8489928f8944237a3942a1'
+            '59307049dab88a7adeb3b0a8e5c77a6e5950b48482be09650d899222c521b589'
+            '07b9ff0686134b3256cda8b5253b91ba23f54b547640729e2382c3c12067ea80')

Added: systemd_sysusers.d_tomcat6.conf
===================================================================
--- systemd_sysusers.d_tomcat6.conf	                        (rev 0)
+++ systemd_sysusers.d_tomcat6.conf	2015-02-14 11:19:10 UTC (rev 231389)
@@ -0,0 +1 @@
+u tomcat 66 "Tomcat 6 user" /usr/share/tomcat6

Modified: tomcat6.install
===================================================================
--- tomcat6.install	2015-02-14 06:06:25 UTC (rev 231388)
+++ tomcat6.install	2015-02-14 11:19:10 UTC (rev 231389)
@@ -1,16 +1,6 @@
-_pkgname='tomcat6'
-_gid_tomcat_name='tomcat'
-_gid_tomcat=66
-_uid_tomcat_name='tomcat'
-_uid_tomcat=66
-
 post_install() {
-  if ! getent group ${_gid_tomcat_name} >/dev/null 2>&1; then
-    groupadd -g ${_gid_tomcat} ${_gid_tomcat_name}
-  fi
-  if ! getent passwd ${_uid_tomcat_name} >/dev/null 2>&1; then
-    useradd  -u ${_uid_tomcat} -g ${_gid_tomcat_name} -d /usr/share/${_pkgname} -s /bin/false ${_uid_tomcat_name}
-  fi
+    systemd-sysusers tomcat6.conf
+    systemd-tmpfiles --create tomcat6.conf
 
   if [ -f lib/modules/$(uname -r)/kernel/security/capability.ko ]; then
     echo 'It appears that your current kernel has linux security'
@@ -24,12 +14,6 @@
 }
 
 pre_remove() {
-  if getent passwd ${_uid_tomcat_name} > /dev/null 2>&1; then
-    userdel ${_uid_tomcat_name}
-  fi
-  if getent group ${_gid_tomcat_name} > /dev/null 2>&1; then
-    groupdel ${_gid_tomcat_name}
-  fi
-
-  echo "To fully clean Tomcat's file, consider removing directories /var/{lib,tmp,log}/${_pkgname}"
+  echo "Leftover files may reside in /var/{lib,tmp,log}/tomcat6"
+  echo "If you remove them, you may also want to remove user and group 'tomcat'"
 }



More information about the arch-commits mailing list