summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD61
2 files changed, 30 insertions, 40 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 90d6040272da..8eff7f5a8009 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,15 @@
pkgbase = go-pkgs-git
pkgdesc = Command gopkgs list your installed Go packages for import
- pkgver = 20160408.11_01f4431
+ pkgver = r14.81e90e2
pkgrel = 1
+ epoch = 1
+ url = https://github.com/tpng/gopkgs
arch = i686
arch = x86_64
- license = GPL
+ license = MIT
makedepends = go
makedepends = git
- source = git://github.com/tpng/gopkgs.git
+ source = git+https://github.com/tpng/gopkgs
md5sums = SKIP
pkgname = go-pkgs-git
-
diff --git a/PKGBUILD b/PKGBUILD
index 2646fe827db9..b0bc2f377d7f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,49 +1,38 @@
pkgname=go-pkgs-git
-pkgver=20160408.11_01f4431
+pkgver=r14.81e90e2
pkgrel=1
+epoch=1
pkgdesc="Command gopkgs list your installed Go packages for import"
arch=('i686' 'x86_64')
-license=('GPL')
-depends=(
-)
-makedepends=(
- 'go'
- 'git'
-)
-
-source=(
- "git://github.com/tpng/gopkgs.git"
-)
-
-md5sums=(
- 'SKIP'
-)
-
-backup=(
-)
-
-conflicts=(
-)
+url="https://github.com/tpng/gopkgs"
+license=('MIT')
+makedepends=('go' 'git')
+source=("git+${url}")
+md5sums=('SKIP')
pkgver() {
- cd "$srcdir/gopkgs"
- local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
- local count=$(git rev-list --count HEAD)
- local commit=$(git rev-parse --short HEAD)
- echo "$date.${count}_$commit"
+ cd gopkgs
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd gopkgs
+ go mod init "${url#https://}"
+ go mod tidy
}
build() {
- GOPATH=$srcdir
- GOBIN=$srcdir/bin/
- mkdir -p $srcdir/src
- ln -sf $srcdir/gopkgs $srcdir/src
- cd $srcdir/src/gopkgs
- go get -v
+ cd gopkgs
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ go build
}
package() {
- find "$srcdir/bin/" -type f -executable | while read filename; do
- install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
- done
+ cd gopkgs
+ install -Dm755 -t "$pkgdir/usr/bin" gopkgs
+ install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}