Subject: [alpine-aports] [PATCH] main/datamash: new aport

From: Assaf Gordon <[email-masked]>
Date: Sat, 1 Jul 2017 00:53:03 +0000

https://www.gnu.org/software/datamash/

GNU Datamash is command-line program which performs basic
numeric,textual and statistical operations on input textual
data files.

Includes 2 sub-packages:
  datamash-doc (man page + info file)
  datamash-bash-completion
---
Hello,

I'd like to suggest a new alpine package for GNU Datamash.
It is a single binary (/usr/bin/datamash) which is useful for command-line
operations. Usage examples available here:
  https://www.gnu.org/software/datamash/examples/
(disclaimier: I'm datamash's developer).

Comments welcomed,
Regards,
 -assaf

 main/datamash/APKBUILD | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 main/datamash/APKBUILD

diff --git a/main/datamash/APKBUILD b/main/datamash/APKBUILD
new file mode 100644
index 0000000..55771ea
--- /dev/null
+++ b/main/datamash/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Assaf Gordon <[email-masked]>
+pkgname=datamash
+pkgver=1.1.1
+pkgrel=0
+
+pkgdesc="command-line text/math processing"
+url="https://www.gnu.org/software/datamash/"
+arch="all"
+license="GPL"
+source="http://ftpmirror.gnu.org/datamash/$pkgname-$pkgver.tar.gz"
+subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
+
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+	cd "$builddir"
+
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info \
+		--disable-nls \
+		--disable-werror \
+		--with-bash-completion-dir=yes \
+		|| return 1
+	make || return 1
+}
+
+package() {
+	cd "$builddir"
+
+	make -j1 DESTDIR="$pkgdir" install || return 1
+	rm -rf "$pkgdir"/usr/share/datamash/examples \
+		"$pkgdir"/usr/lib/charset.alias \
+		|| return 1
+}
+
+bashcomp() {
+	depends=""
+	pkgdesc="Bash completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions/ || return 1
+	mv "$pkgdir"/usr/share/datamash/bash-completion.d/datamash \
+		"$subpkgdir"/usr/share/bash-completion/completions/ || return 1
+}
+
+md5sums="cb917de6a108e20b31aa817cd76463a8  datamash-1.1.1.tar.gz"
+sha256sums="420819b3d7372ee3ce704add847cff7d08c4f8176c1d48735d4a632410bb801b  datamash-1.1.1.tar.gz"
+sha511sums="8932ed5ec357348108cd559acada3bfdc12ee4e360d709d74a6a661bc55f80223baa493d9185be8816b550ef86ff1f760249deb77cbeee9aa1f4178043a1938f  datamash-1.1.1.tar.gz"
-- 
2.1.4

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Timo Teras <[email-masked]>
Date: Tue, 29 Aug 2017 08:50:42 +0300

Hi,

Sorry for late review.

On Sat,  1 Jul 2017 00:53:03 +0000
Assaf Gordon <[email-masked]> wrote:

> It is a single binary (/usr/bin/datamash) which is useful for
> command-line operations. Usage examples available here:

Sounds good. See review comments below.

>  main/datamash/APKBUILD | 52
> ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52
> insertions(+) create mode 100644 main/datamash/APKBUILD

New aports should start in 'testing'. We don't usually accept direct
contributions to 'main' or 'community'. In most cases 'community' will
be the right place for package, and I suspect this will be datamash's
place when matured. Packages in 'main' are expected to have long
maintained stable release branches.

> +++ b/main/datamash/APKBUILD

The '|| return 1' is no longer needed. Abuild runs in set -e mode now.

> +		"$subpkgdir"/usr/share/bash-completion/completions/
> || return 1 +}
> +

There's typo for sha511sums (should be 512). Please use 'abuild
checksum' to update checksums. We recently also dropped other checksums
than sha512.

Timo

---

---

From: Assaf Gordon <[email-masked]>
Date: Sun, 3 Sep 2017 02:39:38 +0000

Includes 2 sub-packages:
Timo,

Thank you for your comments.
Here's an update.

Changes v1 -> v2:
  - moved to 'testing'
  - updated to datamash 1.2
  - removed "|| return 1" in shell functions

 testing/datamash/APKBUILD | 51 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 testing/datamash/APKBUILD

diff --git a/testing/datamash/APKBUILD b/testing/datamash/APKBUILD
new file mode 100644
index 0000000000..327567f435
--- /dev/null
+++ b/testing/datamash/APKBUILD
@@ -0,0 +1,51 @@
+# Contributor: Assaf Gordon <[email-masked]>
+# Maintainer: Assaf Gordon <[email-masked]>
+pkgname=datamash
+pkgver=1.2
+pkgrel=0
+
+pkgdesc="command-line text/math procesing"
+url="https://www.gnu.org/software/datamash/"
+arch="all"
+license="GPL"
+source="http://ftpmirror.gnu.org/datamash/$pkgname-$pkgver.tar.gz"
+subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
+
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+	cd "$builddir"
+
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info \
+		--disable-nls \
+		--disable-werror \
+		--with-bash-completion-dir=local
+
+	make
+}
+
+package() {
+	cd "$builddir"
+
+	make -j1 DESTDIR="$pkgdir" install
+	rm -rf "$pkgdir"/usr/share/datamash/examples \
+		"$pkgdir"/usr/lib/charset.alias
+}
+
+bashcomp() {
+	depends=""
+	pkgdesc="Bash completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions/
+
+	mv "$pkgdir"/usr/share/datamash/bash-completion.d/datamash \
+		"$subpkgdir"/usr/share/bash-completion/completions/
+}
+
+sha512sums="afb0960ffa881e1112394f5e0355c7a6efea13d6bdcbccb9830a6cde617e13701ca361d62c8283b7a64a27135b2f54a75970b17a7d73a5f0ba914ab70f05c086  datamash-1.2.tar.gz"
-- 
2.13.5

---