edited sonar.sh to enable different java-versions on arch linux.
[archlinuxdevstack.git] / sonar / sonar.install
blob233279081dd34fe75bd34e40fe930392a40e8e6a
1 #!/bin/sh
2 # $Id$
3 # vim:set ts=2 sw=2 et:
5 # arg 1: the new package version
6 pre_install() {
7 /bin/true
10 # arg 1: the new package version
11 post_install() {
12 ln -s /opt/sonar/bin/sonar.sh /etc/rc.d/sonar
14 echo ">>> Creating user and group and setting permissions..."
15 getent group sonar > /dev/null || usr/sbin/groupadd sonar
16 getent passwd sonar > /dev/null || usr/sbin/useradd -c \
17 'Sonar Code Quality metric system' -g sonar -d '/opt/sonar' \
18 --system -s /bin/bash sonar &> /dev/null
20 cd opt/sonar
22 chown -R sonar:sonar *
23 chown -R root:sonar /var/log/sonar
24 chmod -R 775 /var/log/sonar
26 chown -R sonar:sonar /var/run/sonar
28 cat << EOF
29 >>>
30 >>> This package is part of the ArchLinux Development Stack, vist
31 >>> http://openpario.mime.oregonstate.edu:3000/projects/archdevstack for
32 >>> more information.
33 >>>
34 >>> Sonar can now be started via /opt/sonar/bin/sonar.sh or via
35 >>> /etc/rc.d/sonar.
36 >>>
37 >>> Sonar will run by default using the Derby embedded database, to change this
38 >>> to another database (e.g. MySql), please edit the
39 >>> /opt/sonar/conf/sonar.properties accordingly.
40 >>>
41 >>> Sonar is running by default on port 9000 and is bound to all interfaces,
42 >>> you can change this in the file /etc/sonar/sonar.properties.
43 >>>
44 >>> For additional information please visit http://sonar.codehaus.org
45 EOF
48 # arg 1: the new package version
49 # arg 2: the old package version
50 pre_upgrade() {
51 /bin/true
54 # arg 1: the new package version
55 # arg 2: the old package version
56 post_upgrade() {
57 /bin/true
60 # arg 1: the old package version
61 pre_remove() {
62 /bin/true
65 # arg 1: the old package version
66 post_remove() {
67 getent passwd sonar > /dev/null && usr/sbin/userdel sonar &>/dev/null
68 getent group sonar > /dev/null && usr/sbin/groupdel sonar &>/dev/null
70 if [ -x /var/run/sonar ] ; then
71 rm -r /var/run/sonar
72 fi