# Maintainer: Deposite Pirate # # Upstream: https://git.metalpunks.info/arch-ports pkgname=ergo pkgver=2.9.1 pkgrel=1 pkgdesc="A modern IRC server written in Go" arch=('x86_64') url="https://github.com/ergochat/ergo" license=('MIT') install=ergo.install depends=('glibc') makedepends=('go' 'git') source=("git+$url#tag=v$pkgver" "ergo-paths.patch" "ergo.service" "ergo.sysusers" "ergo.tmpfiles") sha256sums=('SKIP' '824b6618d0377c50645ff75cf1f3ad903e217476738728bc57102fd26ca766c8' 'e668371b2505832cc7f762f0f3b9f9503692f89882735b67eec05f7819cc19f7' '1930c0e32093b32ff7c05fe8548c20a90846acea08b62aab3194c1be7240a756' '1bc9acdd7fc1fb8251a0165a19d6f4383069e522827535b9c1f717de5495cb29') backup=('etc/ergo.conf') replaces=('oragono') conflicts=('oragono') provides=('oragono') prepare() { cd "${srcdir}/${pkgname}" # Fix paths patch -p1 -i ../ergo-paths.patch } build() { export GOPATH=$(pwd)/.. cd "${srcdir}/${pkgname}" GIT_COMMIT="$(git rev-parse HEAD 2> /dev/null)" # flags from https://wiki.archlinux.org/index.php/Go_package_guidelines # to address issues namcap warns about: # ergo W: ELF file ('usr/bin/ergo') lacks FULL RELRO, check LDFLAGS. # ergo W: ELF file ('usr/bin/ergo') lacks PIE. # related: https://bugs.archlinux.org/task/60928 go build \ -trimpath \ -buildmode=pie \ -ldflags "-X main.commit=${GIT_COMMIT} -linkmode external -extldflags \"${LDFLAGS}\"" \ -v \ . rm languages/README.md rm -rf languages/example } check() { export GOPATH=$(pwd)/.. cd "${srcdir}/${pkgname}" go test ./... } package() { install -Dm644 ergo.service "${pkgdir}/usr/lib/systemd/system/ergo.service" install -Dm644 "${srcdir}/ergo.sysusers" "${pkgdir}/usr/lib/sysusers.d/ergo.conf" install -Dm644 "${srcdir}/ergo.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/ergo.conf" cd "${srcdir}/${pkgname}" install -Dm755 -d "${pkgdir}/usr/share/${pkgname}/i18n" cp languages/* "${pkgdir}/usr/share/${pkgname}/i18n/" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -Dm755 ergo "${pkgdir}/usr/bin/ergo" install -Dm644 default.yaml "${pkgdir}/etc/ergo.conf" install -Dm644 ergo.motd "${pkgdir}/usr/share/${pkgname}/default.motd" }