[arch-commits] Commit in tomcat8/trunk (PKGBUILD tomcat8.install)

Guillaume Alaux guillaume at nymeria.archlinux.org
Sat Feb 15 16:11:34 UTC 2014


    Date: Saturday, February 15, 2014 @ 17:11:34
  Author: guillaume
Revision: 206016

Rewrote install script for genericity

Modified:
  tomcat8/trunk/PKGBUILD
  tomcat8/trunk/tomcat8.install

-----------------+
 PKGBUILD        |    4 ++--
 tomcat8.install |   24 +++++++++++++++++-------
 2 files changed, 19 insertions(+), 9 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-02-15 16:11:08 UTC (rev 206015)
+++ PKGBUILD	2014-02-15 16:11:34 UTC (rev 206016)
@@ -22,9 +22,9 @@
         ${pkgname}.install)
 
 sha256sums=('c2ef50159348a660eeecf310d75a8c05d02dc33904c59bb14b2b51fb5b3ca232'
-            'a72a07377b5c30b36923a410172a4b02925f7743a61ebd39c183b48c427b48a0'
+            '4f895aa4834489411a1b19027e12e8eb0d3a7408127be720e5aad8f9a0e1d660'
             'cd637d5b1a0e816c149c868a72d3d315ea0061efc9e544cadfbc73859dedb847'
-            '901c9262d869b4788a1ebb0cd50c5f2a195ebf26d9a8eac74679361f1a19fae1')
+            '32fcb0f44e32cd8901e936ebad4942a399efa8b98fdc42f5345dd8929b6c1887')
 
 _gid_log=19
 _gid_tomcat=57

Modified: tomcat8.install
===================================================================
--- tomcat8.install	2014-02-15 16:11:08 UTC (rev 206015)
+++ tomcat8.install	2014-02-15 16:11:34 UTC (rev 206016)
@@ -1,6 +1,16 @@
+_pkgname='tomcat8'
+_gid_tomcat_name='tomcat8'
+_gid_tomcat=57
+_uid_tomcat_name='tomcat8'
+_uid_tomcat=57
+
 post_install() {
-  getent group  tomcat8 >/dev/null 2>&1 || groupadd -g 57 tomcat8
-  getent passwd tomcat8 >/dev/null 2>&1 || useradd  -u 57 -g tomcat8 -d /usr/share/tomcat8 -s /bin/false tomcat8
+  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
 
   if [ -f lib/modules/$(uname -r)/kernel/security/capability.ko ]; then
     echo 'It appears that your current kernel has linux security'
@@ -14,12 +24,12 @@
 }
 
 pre_remove() {
-  if getent passwd tomcat8 > /dev/null 2>&1; then
-      userdel tomcat8
+  if getent passwd ${_uid_tomcat_name} > /dev/null 2>&1; then
+    userdel ${_uid_tomcat_name}
   fi
-  if getent group tomcat8 > /dev/null 2>&1; then
-      groupdel tomcat8
+  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}/tomcat8'
+  echo "To fully clean Tomcat's file, consider removing directories /var/{lib,tmp,log}/${_pkgname}"
 }




More information about the arch-commits mailing list