updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / sonar / sonar.install
blobc2cbfde5fc4b0a94155c5a736afa1634882ba762
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
13 ln -s /etc/sonar/ -d /opt/sonar/conf
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 >>>
46 >>> If you are upgrading from an earlier version, please read http://sonar.codehaus.org/
47 >>> and browse to http://localhost:9000/setup.
48 EOF
51 # arg 1: the new package version
52 # arg 2: the old package version
53 pre_upgrade() {
54 /bin/true
57 # arg 1: the new package version
58 # arg 2: the old package version
59 post_upgrade() {
60 cd opt/sonar
62 chown -R sonar:sonar *
63 chown -R root:sonar /var/log/sonar
64 chmod -R 775 /var/log/sonar
66 chown -R sonar:sonar /var/run/sonar
70 # arg 1: the old package version
71 pre_remove() {
72 /bin/true
75 # arg 1: the old package version
76 post_remove() {
77 getent passwd sonar > /dev/null && usr/sbin/userdel sonar &>/dev/null
78 getent group sonar > /dev/null && usr/sbin/groupdel sonar &>/dev/null
80 if [ -x /var/run/sonar ] ; then
81 rm -r /var/run/sonar
82 fi