[arch-commits] Commit in tomcat6/trunk (PKGBUILD tomcat6.install)
Guillaume Alaux
guillaume at nymeria.archlinux.org
Sat Feb 15 16:18:28 UTC 2014
Date: Saturday, February 15, 2014 @ 17:18:27
Author: guillaume
Revision: 206019
Rewrote install scripts
Modified:
tomcat6/trunk/PKGBUILD
tomcat6/trunk/tomcat6.install
-----------------+
PKGBUILD | 2 +-
tomcat6.install | 34 +++++++++++++++++++++-------------
2 files changed, 22 insertions(+), 14 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2014-02-15 16:15:55 UTC (rev 206018)
+++ PKGBUILD 2014-02-15 16:18:27 UTC (rev 206019)
@@ -24,7 +24,7 @@
sha256sums=('debdeafe900f5eb85f8816ea235ab7e3e5261071b2ea01ac288241e794e911a7'
'b6d85501b00032a1385222e80a5f8e357276aaad605e699f40d5cc3770b8ce68'
'07b9ff0686134b3256cda8b5253b91ba23f54b547640729e2382c3c12067ea80'
- '53ec4e24b3c4eec9d5dd4ac6e84d5758de4f459031d630486812439cce74af21')
+ '35c9607502237febba2e588185b8eed4936a061c8926bbb86c3b99e0b67f6e0e')
_gid_log=19
_gid_tomcat=66
Modified: tomcat6.install
===================================================================
--- tomcat6.install 2014-02-15 16:15:55 UTC (rev 206018)
+++ tomcat6.install 2014-02-15 16:18:27 UTC (rev 206019)
@@ -1,13 +1,21 @@
+_pkgname='tomcat6'
+_gid_tomcat_name='tomcat6'
+_gid_tomcat=66
+_uid_tomcat_name='tomcat6'
+_uid_tomcat=66
+
post_install() {
- getent group tomcat >/dev/null 2>&1 || groupadd -g 66 tomcat
- getent passwd tomcat >/dev/null 2>&1 || useradd -u 66 -g tomcat -d /usr/share/tomcat6 -s /bin/false tomcat
+ 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"
- echo ">>> capabilities built as a module. Tomcat requires this"
- echo ">>> functionality to operate."
- echo ">>>"
- echo ">>> To activate the module, please load it now (modprobe capability)."
+ if [ -f lib/modules/$(uname -r)/kernel/security/capability.ko ]; then
+ echo 'It appears that your current kernel has linux security'
+ echo 'capabilities built as a module. Tomcat requires this'
+ echo ' functionality to operate.'
fi
}
@@ -16,12 +24,12 @@
}
pre_remove() {
- if getent passwd tomcat >/dev/null 2>&1; then
- userdel tomcat
+ if getent passwd ${_uid_tomcat_name} > /dev/null 2>&1; then
+ userdel ${_uid_tomcat_name}
fi
- if getent group tomcat >/dev/null 2>&1; then
- groupdel tomcat
+ 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}/tomcat6'
+ echo "To fully clean Tomcat's file, consider removing directories /var/{lib,tmp,log}/${_pkgname}"
}
More information about the arch-commits
mailing list