summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pgschema/.SRCINFO13
-rw-r--r--pgschema/PKGBUILD39
2 files changed, 52 insertions, 0 deletions
diff --git a/pgschema/.SRCINFO b/pgschema/.SRCINFO
new file mode 100644
index 0000000..2f37af3
--- /dev/null
+++ b/pgschema/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = pgschema
+ pkgdesc = Declarative schema migration for Postgres
+ pkgver = 1.12.0
+ pkgrel = 1
+ url = https://github.com/pgplex/pgschema
+ arch = x86_64
+ license = Apache-2.0
+ makedepends = go
+ depends = glibc
+ source = pgschema-1.12.0.tar.gz::https://github.com/pgplex/pgschema/archive/refs/tags/v1.12.0.tar.gz
+ sha256sums = 68e627939cc8e1eced8de79cbad6a6ceb809ca3bbe06831677da631f8134b7f5
+
+pkgname = pgschema
diff --git a/pgschema/PKGBUILD b/pgschema/PKGBUILD
new file mode 100644
index 0000000..e9bb20a
--- /dev/null
+++ b/pgschema/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer: Guillaume Horel <guillaume.horel@gmail.com>
+
+pkgname=pgschema
+pkgver=1.12.0
+pkgrel=1
+pkgdesc="Declarative schema migration for Postgres"
+arch=('x86_64')
+url="https://github.com/pgplex/pgschema"
+license=('Apache-2.0')
+depends=('glibc')
+makedepends=('go')
+source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
+sha256sums=('68e627939cc8e1eced8de79cbad6a6ceb809ca3bbe06831677da631f8134b7f5')
+
+build() {
+ cd "$pkgname-$pkgver"
+
+ local builddate
+ builddate=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" +"%Y-%m-%d %H:%M:%S")
+
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
+
+ go build \
+ -ldflags "-linkmode=external \
+ -X github.com/pgplex/pgschema/cmd.GitCommit=v$pkgver \
+ -X 'github.com/pgplex/pgschema/cmd.BuildDate=$builddate'" \
+ -o "$pkgname" .
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
+}