aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-06-12 11:07:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-06-12 11:11:39 +0000
commitb50df9c61513c1d0b25b8142926c4cddece687a3 (patch)
tree9b05f5ed9009290fae85a17643d34a3b997f4893 /community
parent5add9615fe020fd0d057e2b5b7082f7e60eb0819 (diff)
downloadaports-b50df9c61513c1d0b25b8142926c4cddece687a3.tar.bz2
aports-b50df9c61513c1d0b25b8142926c4cddece687a3.tar.xz
community/lmdb: claim maintainership, build dynamic lib
and install pkg-config file
Diffstat (limited to 'community')
-rw-r--r--community/lmdb/APKBUILD29
-rw-r--r--community/lmdb/lmdb-make.patch81
-rw-r--r--community/lmdb/lmdb_make.patch18
3 files changed, 103 insertions, 25 deletions
diff --git a/community/lmdb/APKBUILD b/community/lmdb/APKBUILD
index 8df23a5e27..71698bcffd 100644
--- a/community/lmdb/APKBUILD
+++ b/community/lmdb/APKBUILD
@@ -1,30 +1,45 @@
# Contributor: Olivier Mauras <olivier@mauras.ch>
-# Maintainer:
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lmdb
pkgver=0.9.22
-pkgrel=0
+pkgrel=1
pkgdesc="Lightning Memory-Mapped Database"
url="http://symas.com/mdb"
arch="all"
license="OLDAP-2.8"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
source="https://github.com/LMDB/lmdb/archive/LMDB_$pkgver.tar.gz
- lmdb_make.patch"
+ lmdb-make.patch"
builddir="$srcdir/$pkgname-LMDB_$pkgver/libraries/liblmdb"
build() {
cd "$builddir"
- make
+ make CFLAGS+="-fPIC"
}
check() {
cd "$builddir"
- make test
+ LD_LIBRARY_PATH="$PWD" make test
}
package() {
cd "$builddir"
- make DESTDIR="$pkgdir" install
+ make DESTDIR="$pkgdir" prefix=/usr install
+
+ mkdir -p "$pkgdir"/usr/lib/pkgconfig
+ cat >"$pkgdir"/usr/lib/pkgconfig/lmdb.pc <<-EOF
+ prefix=/usr
+ exec_prefix=\${prefix}
+ libdir=\${exec_prefix}/lib
+ includedir=\${prefix}/include
+
+ Name: liblmdb
+ Description: Lightning Memory-mapped key-value database
+ URL: http://symas.com/mdb/
+ Version: @PACKAGE_VERSION@
+ Libs: -L\${libdir} -llmdb
+ Cflags: -I\${includedir}
+ EOF
}
tools() {
@@ -33,4 +48,4 @@ tools() {
}
sha512sums="49afca13b9683ed571c274380bb5e111236903b12d19bcb8781d6bbc00f711766b0d62de0b36536c85309cc9ff9e9d0aaa708e27bae9be6cfcaed8ba91e5545d LMDB_0.9.22.tar.gz
-151022cad94d2138146e3cd36622171f07fb03cc66d116ac9ce766c61a8b1aa65b521bfda88b27456204f53ecd430bdeddb4d7786956a12ed0cd53f8323ffd03 lmdb_make.patch"
+1ae28e850a32694f81cb7bf4abaab9cd96ef6c963de91f96810de3afee4da41102e310a6fb0ed889e9e9e04e00342f25272c04a8b483615dccfc039e34538594 lmdb-make.patch"
diff --git a/community/lmdb/lmdb-make.patch b/community/lmdb/lmdb-make.patch
new file mode 100644
index 0000000000..e053b796e8
--- /dev/null
+++ b/community/lmdb/lmdb-make.patch
@@ -0,0 +1,81 @@
+diff --git a/Makefile b/Makefile
+index f254511..949d9ae 100644
+--- a/Makefile
++++ b/Makefile
+@@ -26,6 +26,10 @@ OPT = -O2 -g
+ CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS)
+ LDLIBS =
+ SOLIBS =
++SOVER_MAJ = 0
++SOVER_MIN = 0
++SOVER_PATCH = 0
++SOVERSION = $(SOVER_MAJ).$(SOVER_MIN).$(SOVER_PATCH)
+ SOEXT = .so
+ prefix = /usr/local
+ exec_prefix = $(prefix)
+@@ -38,7 +42,7 @@ mandir = $(datarootdir)/man
+ ########################################################################
+
+ IHDRS = lmdb.h
+-ILIBS = liblmdb.a liblmdb$(SOEXT)
++ILIBS = liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVERSION) liblmdb$(SOEXT).$(SOVER_MAJ)
+ IPROGS = mdb_stat mdb_copy mdb_dump mdb_load
+ IDOCS = mdb_stat.1 mdb_copy.1 mdb_dump.1 mdb_load.1
+ PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
+@@ -49,13 +53,13 @@ install: $(ILIBS) $(IPROGS) $(IHDRS)
+ mkdir -p $(DESTDIR)$(libdir)
+ mkdir -p $(DESTDIR)$(includedir)
+ mkdir -p $(DESTDIR)$(mandir)/man1
+- for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
+- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
+- for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
+- for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
++ for f in $(IPROGS); do cp -a $$f $(DESTDIR)$(bindir); done
++ for f in $(ILIBS); do cp -a $$f $(DESTDIR)$(libdir); done
++ for f in $(IHDRS); do cp -a $$f $(DESTDIR)$(includedir); done
++ for f in $(IDOCS); do cp -a $$f $(DESTDIR)$(mandir)/man1; done
+
+ clean:
+- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb
++ rm -rf $(PROGS) *.[ao] *.[ls]o* *~ testdb
+
+ test: all
+ rm -rf testdb && mkdir testdb
+@@ -64,20 +68,24 @@ test: all
+ liblmdb.a: mdb.o midl.o
+ $(AR) rs $@ mdb.o midl.o
+
+-liblmdb$(SOEXT): mdb.lo midl.lo
++liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVER_MAJ): liblmdb$(SOEXT).$(SOVERSION)
++ rm -f $@
++ ln -s $< $@
++
++liblmdb$(SOEXT).$(SOVERSION): mdb.lo midl.lo
+ # $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS)
+- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS)
+-
+-mdb_stat: mdb_stat.o liblmdb.a
+-mdb_copy: mdb_copy.o liblmdb.a
+-mdb_dump: mdb_dump.o liblmdb.a
+-mdb_load: mdb_load.o liblmdb.a
+-mtest: mtest.o liblmdb.a
+-mtest2: mtest2.o liblmdb.a
+-mtest3: mtest3.o liblmdb.a
+-mtest4: mtest4.o liblmdb.a
+-mtest5: mtest5.o liblmdb.a
+-mtest6: mtest6.o liblmdb.a
++ $(CC) $(LDFLAGS) -pthread -shared -Wl,-soname,liblmdb$(SOEXT).$(SOVER_MAJ) -o $@ mdb.lo midl.lo $(SOLIBS)
++
++mdb_stat: mdb_stat.o liblmdb.so
++mdb_copy: mdb_copy.o liblmdb.so
++mdb_dump: mdb_dump.o liblmdb.so
++mdb_load: mdb_load.o liblmdb.so
++mtest: mtest.o liblmdb.so
++mtest2: mtest2.o liblmdb.so
++mtest3: mtest3.o liblmdb.so
++mtest4: mtest4.o liblmdb.so
++mtest5: mtest5.o liblmdb.so
++mtest6: mtest6.o liblmdb.so
+
+ mdb.o: mdb.c lmdb.h midl.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c
diff --git a/community/lmdb/lmdb_make.patch b/community/lmdb/lmdb_make.patch
deleted file mode 100644
index deb49ee76b..0000000000
--- a/community/lmdb/lmdb_make.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 0940c49..7a47dc2 100644
---- a/Makefile
-+++ b/Makefile
-@@ -23,11 +23,11 @@ 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 =
- SOEXT = .so
--prefix = /usr/local
-+prefix = /usr
- exec_prefix = $(prefix)
- bindir = $(exec_prefix)/bin
- libdir = $(exec_prefix)/lib