summaryrefslogtreecommitdiff
path: root/community/go/go.install
blob: 9a87b9d11a18bf7093dfabebdea3e145d02ebcbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
post_upgrade() {
  # Backup any previous /usr/lib/go/bin directory
  if [ -e /usr/lib/go/bin ]; then
    mv /usr/lib/go/bin /usr/lib/go/bin.pacnew
  fi

  # Point /usr/lib/go/bin to /usr/bin
  #
  # This is to make go get code.google.com/p/go-tour/gotour and
  # then running the gotour executable work out of the box.
  #
  # Also, /usr/bin is the place for system-wide executables,
  # not /usr/lib/go/bin. Users should use different paths by
  # setting the appropriate environment variables.
  #
  ln -sf /usr/bin /usr/lib/go/bin
}

post_install() {
  post_upgrade
}

pre_remove() {
  if [ -c /usr/lib/go/bin ]; then
    rmdir --ignore-fail-on-non-empty /usr/lib/go/bin
  fi
  if [ -L /usr/lib/go/bin ]; then
    rm /usr/lib/go/bin
  fi
}

# vim:set ts=2 sw=2 et: