pkgname="fathom-git"
pkgrel=1
pkgver="i.dont.know.what.to.put.here"
pkgdesc="Fathom - simple website analytics (Community Edition)"
url="https://github.com/usefathom/fathom"
license=("MIT")
arch=("any")
provides=("fathom")
conflicts=("fathom")
makedepends=("git" "go-pie" "npm")
source=("git+https://github.com/usefathom/fathom.git")
md5sums=("SKIP")
_gitname="fathom"
prepare(){
mkdir -p gopath/src/github.com/usefathom
ln -rTsf "$_gitname" gopath/src/github.com/usefathom/fathom
export GOPATH="$srcdir"/gopath
}
build(){
export GOPATH="$srcdir"/gopath
cd "$srcdir"/"$_gitname"
make build
}
package(){
cd "$srcdir"/"$_gitname"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
install -Dm755 fathom "$pkgdir"/bin/fathom
}
Cause is
install -Dm755 fathom "$pkgdir"/bin/fathom
Which conflicts with /bin provide by filesystem
stat /bin
File: /bin -> usr/bin
Instead of installing in /bin install to /usr/bin
Edit:
pkgver="i.dont.know.what.to.put.here"
VCS_package_guidelines#The_pkgver()_function
pkgdesc="Fathom - simple website analytics (Community Edition)"
arch=("any")
go generated a elf binary so the arch is the hosts architecture not any. The binary depends on glibc.
The following creates the binary with RELRO and changes linking from static to dynamic. There is probably a better way to achieve it.
sed -i 's/LDFLAGS += -extldflags "-static"/LDFLAGS := -extldflags "$(LDFLAGS)"/' Makefile
sed -i 's/go build -o $@ $(MAIN_PKG)/go build -trimpath -ldflags '\''-w $(LDFLAGS)'\'' -o $@ $(MAIN_PKG)/' Makefile
error: failed to commit transaction (conflicting files)
fathom-git: /bin exists in filesystem (owned by filesystem)
Here is the PKGBUILD: https://pastebin.com/cpB4JrSX
Any help is appreciated