--- libraries/liblmdb/Makefile.orig	2013-12-08 09:17:29.298223935 +0100
+++ libraries/liblmdb/Makefile	2013-12-08 09:18:54.841750719 +0100
@@ -35,10 +35,10 @@ PROGS	= $(IPROGS) mtest mtest2 mtest3 mt
 all:	$(ILIBS) $(PROGS)
 
 install: $(ILIBS) $(IPROGS) $(IHDRS)
-	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
-	for f in $(IDOCS); do cp $$f $(DESTDIR)$(prefix)/man/man1; done
+	for f in $(IPROGS); do install -Dm755 $$f $(DESTDIR)$(prefix)/bin/$$f; done
+	for f in $(ILIBS); do install -Dm644 $$f $(DESTDIR)$(prefix)/lib/$$f; done
+	for f in $(IHDRS); do install -Dm644 $$f $(DESTDIR)$(prefix)/include/$$f; done
+	for f in $(IDOCS); do install -Dm644 $$f $(DESTDIR)$(prefix)/share/man/man1/$$f; done
 
 clean:
 	rm -rf $(PROGS) *.[ao] *.so *~ testdb
