Subject: [alpine-aports] [PATCH] testing/lmdb: New package

From: Olivier <[email-masked]>
Date: Fri, 11 Dec 2015 11:41:51 +0100

From 0ebe30d8f1cfa7b4eca712c8a78b8adeafc74a99 Mon Sep 17 00:00:00 2001
From: Olivier Mauras <[email-masked]>
Date: Fri, 11 Dec 2015 11:17:36 +0100
Subject: [PATCH 1/2] testing/lmdb: New package

---
 testing/lmdb/APKBUILD        | 43 +++++++++++++++++++++++++++++++++++++++++++
 testing/lmdb/lmdb_make.patch | 17 +++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 testing/lmdb/APKBUILD
 create mode 100644 testing/lmdb/lmdb_make.patch

diff --git a/testing/lmdb/APKBUILD b/testing/lmdb/APKBUILD
new file mode 100644
index 0000000..fbb7074
--- /dev/null
+++ b/testing/lmdb/APKBUILD
@@ -0,0 +1,43 @@
+pkgname=lmdb
+pkgver=0.9.17
+pkgrel=0
+pkgdesc="Lightning Memory-Mapped Database"
+url="http://symas.com/mdb/"
+arch="all"
+license="custom"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-dev"
+source="https://github.com/LMDB/lmdb/archive/LMDB_$pkgver.tar.gz
+	lmdb_make.patch
+	"
+
+_builddir="$srcdir"/$pkgname-LMDB_$pkgver/libraries/liblmdb
+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
+}
+
+build() {
+	cd "$_builddir"
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" install || return 1
+}
+
+md5sums="8a5501c8b8535ddd6de67e95a8633aff  LMDB_0.9.17.tar.gz
+fac0cc7847df9c34b6366ccd31952583  lmdb_make.patch"
+sha256sums="80a08218e40f76a0485ec18c42de6f1e020b1ed0268f7cb34c69746e8d98c72c  LMDB_0.9.17.tar.gz
+26c40e869b579ce2077bd4590997940aa9e1f2ccb625470b07eca8ed37e776de  lmdb_make.patch"
+sha512sums="2f6108364973e01f6379613c02b9fa11933d6c91eadc5ae0cad55818bc0205041d0663a5dd936d89ec651eb1de0257390d48d549d1bc24ef29d7ee57c9fcb941  LMDB_0.9.17.tar.gz
+c46acb1125315e4bc1e5ccc49f6adbdabc5eb2274e22700af71d5a6759b6ed7f243f5287d49f118e557bdbe3715c33118dd479a71df8132ff41ad377ea4b3e58  lmdb_make.patch"
diff --git a/testing/lmdb/lmdb_make.patch b/testing/lmdb/lmdb_make.patch
new file mode 100644
index 0000000..ceff5ff
--- /dev/null
+++ b/testing/lmdb/lmdb_make.patch
@@ -0,0 +1,17 @@
+diff --git a/Makefile b/Makefile
+index dbb5d69..ec1f881 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,10 +23,10 @@ AR	= ar
+ W	= -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized
+ THREADS = -pthread
+ OPT = -O2 -g
+-CFLAGS	= $(THREADS) $(OPT) $(W) $(XCFLAGS)
++CFLAGS	= $(THREADS) $(OPT) $(W) $(XCFLAGS) -fPIC
+ LDLIBS	=
+ SOLIBS	=
+-prefix	= /usr/local
++prefix	= /usr
+ mandir = $(prefix)/man
+ 
+ ########################################################################
-- 
2.6.3

---

From: Olivier <[email-masked]>
Date: Fri, 11 Dec 2015 14:27:45 +0100

From ef16a6a1e57ce65497c6164c5782adeb0cbd8d66 Mon Sep 17 00:00:00 2001
From: Olivier Mauras <[email-masked]>
Date: Fri, 11 Dec 2015 14:25:25 +0100
Subject: [PATCH] testing/lmdb: Add -doc -tools subpackages

---
 testing/lmdb/APKBUILD        | 15 ++++++++++-----
 testing/lmdb/lmdb_make.patch | 17 ++++++++++++++---
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/testing/lmdb/APKBUILD b/testing/lmdb/APKBUILD
index fbb7074..fdc49a1 100644
--- a/testing/lmdb/APKBUILD
+++ b/testing/lmdb/APKBUILD
@@ -1,6 +1,6 @@
 pkgname=lmdb
 pkgver=0.9.17
-pkgrel=0
+pkgrel=1
 pkgdesc="Lightning Memory-Mapped Database"
 url="http://symas.com/mdb/"
 arch="all"
@@ -9,7 +9,7 @@ depends=""
 depends_dev=""
 makedepends="$depends_dev"
 install=""
-subpackages="$pkgname-dev"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
 source="https://github.com/LMDB/lmdb/archive/LMDB_$pkgver.tar.gz
 	lmdb_make.patch
 	"
@@ -35,9 +35,14 @@ package() {
 	make DESTDIR="$pkgdir" install || return 1
 }
 
+tools() {
+	mkdir -p "$subpkgdir"/usr
+	mv "$pkgdir"/usr/bin "$subpkgdir"/usr
+}
+
 md5sums="8a5501c8b8535ddd6de67e95a8633aff  LMDB_0.9.17.tar.gz
-fac0cc7847df9c34b6366ccd31952583  lmdb_make.patch"
+57ec2294bfbf1136f3c0380878bdb7fa  lmdb_make.patch"
 sha256sums="80a08218e40f76a0485ec18c42de6f1e020b1ed0268f7cb34c69746e8d98c72c  LMDB_0.9.17.tar.gz
-26c40e869b579ce2077bd4590997940aa9e1f2ccb625470b07eca8ed37e776de  lmdb_make.patch"
+3e1828561bcfddab00afb0ef858c6225630730669b7f16a922eb9546b65ff28d  lmdb_make.patch"
 sha512sums="2f6108364973e01f6379613c02b9fa11933d6c91eadc5ae0cad55818bc0205041d0663a5dd936d89ec651eb1de0257390d48d549d1bc24ef29d7ee57c9fcb941  LMDB_0.9.17.tar.gz
-c46acb1125315e4bc1e5ccc49f6adbdabc5eb2274e22700af71d5a6759b6ed7f243f5287d49f118e557bdbe3715c33118dd479a71df8132ff41ad377ea4b3e58  lmdb_make.patch"
+fd88db63888eb1fd54e4ba86801ff5ff2881f642086f22ca84d7154912b150cea83b9579aeda3ae08750f0a7e3774899ef3e22ef8b95be42295a5c01f079807b  lmdb_make.patch"
diff --git a/testing/lmdb/lmdb_make.patch b/testing/lmdb/lmdb_make.patch
index ceff5ff..b5b2baf 100644
--- a/testing/lmdb/lmdb_make.patch
+++ b/testing/lmdb/lmdb_make.patch
@@ -1,8 +1,8 @@
 diff --git a/Makefile b/Makefile
-index dbb5d69..ec1f881 100644
+index dbb5d69..149bdbf 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -23,10 +23,10 @@ AR	= ar
+@@ -23,11 +23,11 @@ AR	= ar
  W	= -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized
  THREADS = -pthread
  OPT = -O2 -g
@@ -11,7 +11,18 @@ index dbb5d69..ec1f881 100644
  LDLIBS	=
  SOLIBS	=
 -prefix	= /usr/local
+-mandir = $(prefix)/man
 +prefix	= /usr
- mandir = $(prefix)/man
++mandir = $(prefix)/share/man
  
  ########################################################################
+ 
+@@ -42,7 +42,7 @@ install: $(ILIBS) $(IPROGS) $(IHDRS)
+ 	mkdir -p $(DESTDIR)$(prefix)/bin
+ 	mkdir -p $(DESTDIR)$(prefix)/lib
+ 	mkdir -p $(DESTDIR)$(prefix)/include
+-	mkdir -p $(DESTDIR)$(prefix)/man/man1
++	mkdir -p $(DESTDIR)$(mandir)/man1
+ 	for f in $(IPROGS); do cp $$f $(DESTDIR)$(prefix)/bin; done
+ 	for f in $(ILIBS); do cp $$f $(DESTDIR)$(prefix)/lib; done
+ 	for f in $(IHDRS); do cp $$f $(DESTDIR)$(prefix)/include; done
-- 
2.6.3