Mail archive
alpine-aports

[alpine-aports] [PATCH 1/2] testing/html-xml-utils: Modernize APKBUILD.

From: Przemyslaw Pawelczyk <przemoc_at_zoho.com>
Date: Sat, 27 Aug 2016 00:06:36 +0200

* APKBUILD:
 - Use builddir (no _).
 - Leverage default_prepare.
 - Reformat prepare(), build(), package() to make them more readable.
 - Update URL (use https instead of http).
 - Bump pkgrel.
---
 testing/html-xml-utils/APKBUILD | 44 +++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/testing/html-xml-utils/APKBUILD b/testing/html-xml-utils/APKBUILD
index 4bc8ceb84460..bbd7c3300631 100644
--- a/testing/html-xml-utils/APKBUILD
+++ b/testing/html-xml-utils/APKBUILD
_at_@ -2,9 +2,9 @@
 # Maintainer: Francesco Colista <fcolista_at_alpinelinux.org>
 pkgname=html-xml-utils
 pkgver=7.0
-pkgrel=0
+pkgrel=1
 pkgdesc="A number of simple utilities for manipulating HTML and XML files."
-url="http://www.w3.org/Tools/HTML-XML-utils/"
+url="https://www.w3.org/Tools/HTML-XML-utils/"
 arch="all"
 license="Custom"
 depends=""
_at_@ -12,33 +12,39 @@ depends_dev=""
 makedepends="$depends_dev"
 install=""
 subpackages="$pkgname-doc"
-source="http://www.w3.org/Tools/HTML-XML-utils/$pkgname-$pkgver.tar.gz
+source="$url/$pkgname-$pkgver.tar.gz
 	getopt-musl-fix.patch"
 
-_builddir="$srcdir"/$pkgname-$pkgver
+builddir="$srcdir"/$pkgname-$pkgver
+
 prepare() {
-	local i
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
-	sed -e "/doc_DATA = COPYING/d" -i Makefile.in || return 1
+	default_prepare || return 1
+	sed \
+	    -e "/doc_DATA = COPYING/d" \
+	    -i Makefile.in \
+		|| return 1
 }
 
 build() {
-	cd "$_builddir"
+	cd "$builddir"
 	./configure \
-		--prefix=/usr \
-		--disable-dependency-tracking 
-	make || return 1
+	            --prefix=/usr \
+	            --disable-dependency-tracking \
+		|| return 1
+
+	make \
+		|| return 1
 }
 
 package() {
-	cd "$_builddir"
-	make DESTDIR="$pkgdir" install
-	install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
+	cd "$builddir"
+	make install \
+	     DESTDIR="$pkgdir" \
+		|| return 1
+	install -D -m 644 \
+	        COPYING \
+	        "$pkgdir"/usr/share/licenses/$pkgname/COPYING \
+		|| return 1
 }
 
 md5sums="b513432f7f084c158495815cc5118f0f  html-xml-utils-7.0.tar.gz
-- 
2.8.3
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sat Aug 27 2016 - 00:06:36 GMT