makedeb


golang-go 2:1.23.0-1


The Go programming language

Click here to go back to the commit logs for golang-go.

Commit:


Hash: 378d972e6a0d1c72f05d846cecee759433c8a2bf

Message: Added 'preinst' script to handle potential symlink of Go stdlib

Diff


diff --git a/PKGBUILD b/PKGBUILD
index f9b5ced..f2b46a6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,13 +1,14 @@
 # Maintainer: Hunter Wittenborn <hunter@hunterwittenborn.com>
 pkgname=golang-go
 pkgver=1.17.7
-pkgrel=1
+pkgrel=2
 epoch=2
 pkgdesc='The Go programming language'
 arch=('any')
 makedepends=('gcc' 'golang-go')
 url='https://go.dev/'
 options=('!strip')
+preinst='./preinst'
 
 source=("${pkgname}-${pkgver}::git+https://go.googlesource.com/go/#tag=go${pkgver}")
 sha256sums=('SKIP')
diff --git a/preinst b/preinst
new file mode 100755
index 0000000..f58771e
--- /dev/null
+++ b/preinst
@@ -0,0 +1,14 @@
+#!/usr/bin/bash
+set -e
+
+# 'golang-go' from the Debian and Ubuntu repositories depends on 'golang-src',
+# which has '/usr/lib/go' set up as a symlink. We have '/usr/lib/go' set up as
+# a folder in our package, so dpkg won't unpack our folder when 'golang-src' is
+# installed.
+#
+# See Debian policy 6.6, number 4 for details.
+if [[ -L '/usr/lib/go' ]]; then
+    rm '/usr/lib/go'
+fi
+
+# vim: set syntax=bash ts=4 sw=4 expandtab: