apkbuilds @ 121d6f029f4ebc205915bb5a0c74ecde7d874b32

 1# Contributor: <xmingske@gmail.com>
 2# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 3pkgname=libsearpc
 4pkgver=3.1
 5pkgrel=0
 6pkgdesc="A simple and easy-to-use C language RPC framework"
 7url="https://github.com/haiwen/libsearpc/"
 8arch="all"
 9license="LGPL2.1"
10makedepends="autoconf automake bash glib-dev jansson-dev libtool python3-dev"
11source="$pkgname-$pkgver.tar.gz::https://github.com/haiwen/libsearpc/archive/v3.1-latest.tar.gz"
12subpackages="$pkgname-dev py-$pkgname:py"
13
14_builddir="${srcdir}"/${pkgname}-3.1-latest
15
16prepare() {
17	local pf
18	cd "${_builddir}"
19	for pf in $source; do
20		case $pf in
21		*.patch) msg $pf; patch -p1 -i "$srcdir"/${pf} || return 1;;
22		esac
23	done
24}
25
26build() {
27	cd "${_builddir}"
28	./autogen.sh
29	./configure \
30                --prefix=/usr \
31                --sysconfdir=/etc \
32                --mandir=/usr/share/man \
33                --infodir=/usr/share/info
34	make || return 1
35}
36
37package() {
38	cd "${_builddir}"
39	make DESTDIR="${pkgdir}" install || return 1
40	rm "${pkgdir}"/usr/lib/libsearpc.la
41	echo ${pkgdir}/usr/lib/pkgconfig/libsearpc.pc
42	sed -i -e 's/(DESTDIR)//' "${pkgdir}"/usr/lib/pkgconfig/libsearpc.pc
43	sed -i -e 's/prefix=.*/prefix=\/usr/' "${pkgdir}"/usr/lib/pkgconfig/libsearpc.pc
44}
45
46py() {
47	arch="noarch"
48	cd "$_builddir"
49	pkgdesc="$pkgname python bindings"
50	install -d "$subpkgdir"/usr/lib
51	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
52}
53sha512sums="
544dfb14601819c634078f7bd538da13e70d6c714297c777bd2af07521d8fefd6c71a0f00bf135349f2efb3e809a27500b459af727471915bd47d8b351e069e120  libsearpc-3.1.tar.gz
55"