aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-07-15 16:33:15 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-07-15 16:34:35 +0200
commit18b2c7400586f3e4611f6cd316d7c36b77829460 (patch)
tree2b876b6936a0a5848f907a7fadae87479d1869d7 /testing
parent85005964836fd5beda35e2dec8387c9ca4fdc5c9 (diff)
downloadaports-18b2c7400586f3e4611f6cd316d7c36b77829460.tar.bz2
aports-18b2c7400586f3e4611f6cd316d7c36b77829460.tar.xz
testing/gopt: new aport
http://www.purposeful.co.uk/software/gopt/ C library for parsing POSIX and GNU style command line arguments
Diffstat (limited to 'testing')
-rw-r--r--testing/gopt/APKBUILD47
1 files changed, 47 insertions, 0 deletions
diff --git a/testing/gopt/APKBUILD b/testing/gopt/APKBUILD
new file mode 100644
index 0000000000..84de865a5b
--- /dev/null
+++ b/testing/gopt/APKBUILD
@@ -0,0 +1,47 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=gopt
+pkgver=8.1
+pkgrel=0
+pkgdesc="C library for parsing POSIX and GNU style command line arguments"
+url="http://www.purposeful.co.uk/software/gopt/"
+arch="all"
+license="TFL"
+subpackages="$pkgname-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/thoni56/$pkgname/archive/$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ $CC $CFLAGS -fPIC -pedantic -Wall -c gopt.c
+
+ # Build shared lib.
+ $CC $LDFLAGS -shared -o libgopt.so *.o
+
+ # Build static lib.
+ ar rc libgopt.a *.o
+ ranlib libgopt.a
+
+ # Build testing example.
+ $CC $CFLAGS $LDFLAGS -L. gopt-usage.c -o gopt-usage -lgopt
+}
+
+check() {
+ cd "$builddir"
+ LD_LIBRARY_PATH=. ./gopt-usage --version
+}
+
+package() {
+ local soname="libgopt.so.${pkgver%.*}"
+
+ cd "$builddir"
+
+ install -D -m 755 ${soname%.*} "$pkgdir"/usr/lib/$soname
+ ln -s $soname "$pkgdir"/usr/lib/${soname%.*}
+
+ install -D -m 755 libgopt.a "$pkgdir"/usr/include/libgopt.a
+ install -D -m 755 gopt.h "$pkgdir"/usr/include/gopt.h
+}
+
+sha512sums="2b5d6ab23a5aeccf22a9476f409f392e083ff481a6a0ae435e8e31197c3e3cf83085e1ce3a08162d98d1084420baff6cd45cef87eafec7827b82f58f2c8993c6 gopt-8.1.tar.gz"