updated on Wed Jan 18 16:10:53 UTC 2012
[aur-mirror.git] / nexus / nexus.install
bloba8a1f15d527ca8d1c23ddd278a0000cb26ead734
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/nexus/bin/nexus /etc/rc.d/nexus
14 echo ">>> Creating user and group and setting permissions..."
15 getent group nexus > /dev/null || usr/sbin/groupadd nexus
16 getent passwd nexus > /dev/null || usr/sbin/useradd -c \
17 'Maven Repository Manager' -g nexus -d '/opt/nexus' \
18 --system -s /bin/bash nexus &> /dev/null
20 cd opt/nexus
22 chown -R nexus:nexus *
23 chown -R nexus:nexus /var/lib/nexus
24 chown -R nexus:nexus /opt/nexus
25 chown -R nexus:nexus /var/run/nexus
27 cat << EOF
28 >>>
29 >>> Nexus can be started via /opt/nexus/bin/nexus or via /etc/rc.d/nexus.
30 >>> If you would like to start it on system startup, please add it to the
31 >>> DAEMONS entry in your rc.conf.
32 >>>
33 >>> Nexus is running by default on port 8081 and is bound to all interfaces,
34 >>> you can change this in the nexus.properties as well.
35 >>>
36 >>> The nexus.log can be found in /var/lib/nexus/logs.
37 >>>
38 >>> For additional information please visit http://nexus.sonatype.org
39 EOF
42 # arg 1: the new package version
43 # arg 2: the old package version
44 pre_upgrade() {
45 /bin/true
48 # arg 1: the new package version
49 # arg 2: the old package version
50 post_upgrade() {
51 cd opt/nexus
53 chown -R nexus:nexus *
54 chown -R nexus:nexus /var/lib/nexus
55 chown -R nexus:nexus /opt/nexus
56 chown -R nexus:nexus /var/run/nexus
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 nexus > /dev/null && usr/sbin/userdel nexus &>/dev/null
68 getent group nexus > /dev/null && usr/sbin/groupdel nexus &>/dev/null
70 if [ -d /var/run/nexus ] ; then
71 rm -r /var/run/nexus
72 fi
74 if [ -d /var/lib/nexus ] ; then
75 rm -r /var/lib/nexus
76 fi
78 if [ -h /etc/rc.d/nexus ] ; then
79 rm /etc/rc.d/nexus
80 fi