blob: 0bd637e5d684032dc1914855b861585da0a1a5e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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 644 libgopt.a "$pkgdir"/usr/lib/libgopt.a
install -D -m 644 gopt.h "$pkgdir"/usr/include/gopt.h
}
sha512sums="2b5d6ab23a5aeccf22a9476f409f392e083ff481a6a0ae435e8e31197c3e3cf83085e1ce3a08162d98d1084420baff6cd45cef87eafec7827b82f58f2c8993c6 gopt-8.1.tar.gz"
|