Package: leveldb / 1.17-1

0112-makefile_install.patch Patch series | download
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
Description: Improvements to the Makefile.
 Replace INSTALL_PATH with the most commonly use DESTDIR variable.
 Add an 'install' target.
Author: Alessio Treglia <alessio@debian.org>
Forwarded: http://code.google.com/p/leveldb/issues/detail?id=27
---
 Makefile |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- leveldb.orig/Makefile
+++ leveldb/Makefile
@@ -2,6 +2,10 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file. See the AUTHORS file for names of contributors.
 
+PREFIX ?= /usr/local
+LIBDIR ?= lib
+INCLUDEDIR ?= include
+
 #-----------------------------------------------
 # Uncomment exactly one of the lines labelled (A), (B), and (C) below
 # to switch between compilation modes.
@@ -90,6 +94,17 @@ endif  # PLATFORM_SHARED_EXT
 
 all: $(SHARED) $(LIBRARY)
 
+install: all
+	install -d $(DESTDIR)$(PREFIX)/$(LIBDIR)
+	install -d $(DESTDIR)$(PREFIX)/$(INCLUDEDIR)/leveldb
+	install -m 0644 $(LIBRARY) $(DESTDIR)$(PREFIX)/$(LIBDIR)
+ifneq ($(PLATFORM_SHARED_EXT),)
+	install -m 0644 $(SHARED3) $(DESTDIR)$(PREFIX)/$(LIBDIR)
+	cd $(DESTDIR)$(PREFIX)/$(LIBDIR) && ln -sf $(SHARED3) $(SHARED2)
+	cd $(DESTDIR)$(PREFIX)/$(LIBDIR) && ln -sf $(SHARED3) $(SHARED1)
+endif
+	install -m 0644 include/leveldb/* $(DESTDIR)$(PREFIX)/$(INCLUDEDIR)/leveldb
+
 check: all $(PROGRAMS) $(TESTS)
 	for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done