summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnmanuel2022-07-03 16:42:28 +0000
committerEnmanuel2022-07-03 16:42:28 +0000
commitd86b2f7f1eecac59154f13a5f82e577b5ccce4f1 (patch)
treec8ff52ad8b5c30096b6afda192e8f0c02a925197
parent338e49f4dda5baa03d93494ae758424acac6ed6d (diff)
downloadaur-d86b2f7f1eecac59154f13a5f82e577b5ccce4f1.tar.gz
renaming pkg
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD26
2 files changed, 29 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b088742a886b..241d52235ac0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,7 +5,14 @@ pkgbase = diun
url = https://github.com/crazy-max/diun
arch = x86_64
license = MIT
- source = diun-4.21.0_linux_amd64.tar.gz::https://github.com/crazy-max/diun/releases/download/v4.21.0/diun_4.21.0_linux_amd64.tar.gz
- sha256sums = 83f4bfa2d9b6a036e6b024fe0b42a0aa1b356139ce756dbf52a697104ba98b65
+ makedepends = go>=1.17
+ makedepends = git
+ makedepends = gzip
+ makedepends = tar
+ makedepends = gcc
+ provides = diun
+ conflicts = diun-bin
+ source = diun-4.21.0.tar.gz::https://github.com/crazy-max/diun/archive/v4.21.0.tar.gz
+ sha256sums = 581c7813089a0313a947c8be8683d9c566a63bfb63d0e4da597eeff98f97c2c5
pkgname = diun
diff --git a/PKGBUILD b/PKGBUILD
index 2665e76c2805..b35fdb89ff65 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,19 +1,33 @@
# Maintainer: Enmanuel Moreira <enmanuelmoreira@gmail.com>
pkgname=diun
-pkgver=4.21.0
+pkgver=$PKGVER
pkgrel=1
pkgdesc="Receive notifications when an image is updated on a Docker registry."
arch=('x86_64')
url="https://github.com/crazy-max/diun"
+conflicts=('diun-bin')
+provides=('diun')
license=('MIT')
-source=("${pkgname}-${pkgver}_linux_amd64.tar.gz::https://github.com/crazy-max/${pkgname}/releases/download/v${pkgver}/${pkgname}_${pkgver}_linux_amd64.tar.gz")
-sha256sums=('83f4bfa2d9b6a036e6b024fe0b42a0aa1b356139ce756dbf52a697104ba98b65')
+makedepends=('go>=1.17' 'git' 'gzip' 'tar' 'gcc')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/crazy-max/${pkgname}/archive/v${pkgver}.tar.gz")
+sha256sums=('581c7813089a0313a947c8be8683d9c566a63bfb63d0e4da597eeff98f97c2c5')
+
+build() {
+ cd "${pkgname}-${pkgver}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -buildvcs=false -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ BUILD_DATE=$(date '+%Y-%m-%d %H:%M:%S')
+ go build -o build/${pkgname} -ldflags="-X 'main.buildVersion=${pkgver}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/
+}
package() {
- cd "${srcdir}"
- install -Dm755 ${pkgname} ${pkgdir}/usr/bin/${pkgname}
+ cd "${srcdir}"/"${pkgname}-${pkgver}"
+ install -Dm755 build/"${pkgname}" "${pkgdir}"/usr/bin/"${pkgname}"
install -Dm644 README.md ${pkgdir}/usr/share/doc/${pkgname}/README.md
- install -Dm644 LICENSE ${pkgdir}/usr/share/doc/${pkgname}/LICENSE
+ install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
install -Dm644 CHANGELOG.md ${pkgdir}/usr/share/doc/${pkgname}/CHANGELOG.md
}