diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2011-10-28 10:54:30 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2011-10-28 10:54:30 +0000 |
commit | 65aafbcdb6b7718c16699e5284df12e364ef7b19 (patch) | |
tree | 3ad08580001579532eaedc42b5e31c0192b56d48 | |
parent | 5bc148fb49f344096c1b58fc5cdea109d4171688 (diff) |
Notes
-rw-r--r-- | databases/Makefile | 1 | ||||
-rw-r--r-- | databases/leveldb/Makefile | 49 | ||||
-rw-r--r-- | databases/leveldb/distinfo | 2 | ||||
-rw-r--r-- | databases/leveldb/files/patch-Makefile | 60 | ||||
-rw-r--r-- | databases/leveldb/pkg-descr | 26 | ||||
-rw-r--r-- | databases/leveldb/pkg-plist | 18 |
6 files changed, 156 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile index 2e9949372bd4..df6ecc6764af 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -142,6 +142,7 @@ SUBDIR += kumofs SUBDIR += kyotocabinet SUBDIR += ldb + SUBDIR += leveldb SUBDIR += libdbi SUBDIR += libdbi-drivers SUBDIR += libdrizzle diff --git a/databases/leveldb/Makefile b/databases/leveldb/Makefile new file mode 100644 index 000000000000..6e0e19e852f1 --- /dev/null +++ b/databases/leveldb/Makefile @@ -0,0 +1,49 @@ +# New ports collection makefile for: leveldb +# Date created: 2011-10-04 +# Whom: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= leveldb +PORTVERSION= 1.2.20111024 +CATEGORIES= databases +MASTER_SITES= LOCAL/sunpoet + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= A fast and lightweight key/value database library by Google + +OPTIONS= PERFTOOLS "Build with Google perftools" on \ + SNAPPY "Build with snappy" on + +USE_GMAKE= yes +USE_LDCONFIG= yes +USE_XZ= yes + +.include <bsd.port.options.mk> + +.if !defined(WITHOUT_PERFTOOLS) +LIB_DEPENDS+= tcmalloc:${PORTSDIR}/devel/google-perftools +.endif + +.if !defined(WITHOUT_SNAPPY) +LIB_DEPENDS+= snappy:${PORTSDIR}/archivers/snappy +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|' ${WRKSRC}/build_detect_platform +.if defined(WITHOUT_PERFTOOLS) + @${REINPLACE_CMD} -e '/^LDFLAGS=/ s| $$(GOOGLE_PERFTOOLS_LDFLAGS)||' ${WRKSRC}/Makefile +.endif +.if defined(WITHOUT_SNAPPY) + @${REINPLACE_CMD} -e '/^LDFLAGS=/ s| $$(SNAPPY_LDFLAGS)||' ${WRKSRC}/Makefile +.endif + +do-install: + ${MKDIR} ${PREFIX}/include/leveldb/ ${DATADIR}/ + ${INSTALL_DATA} ${WRKSRC}/include/leveldb/* ${PREFIX}/include/leveldb/ + ${INSTALL_LIB} ${WRKSRC}/libleveldb.* ${PREFIX}/lib/ + ${INSTALL_DATA} ${WRKSRC}/build_config.mk ${DATADIR}/ + ${LN} -s libleveldb.so.0 ${PREFIX}/lib/libleveldb.so + +.include <bsd.port.mk> diff --git a/databases/leveldb/distinfo b/databases/leveldb/distinfo new file mode 100644 index 000000000000..cb201e1d3190 --- /dev/null +++ b/databases/leveldb/distinfo @@ -0,0 +1,2 @@ +SHA256 (leveldb-1.2.20111024.tar.xz) = bf035a366f6a6839b0abd2afa33d17a96a50f1a25c72784c4bbcd19100510313 +SIZE (leveldb-1.2.20111024.tar.xz) = 142316 diff --git a/databases/leveldb/files/patch-Makefile b/databases/leveldb/files/patch-Makefile new file mode 100644 index 000000000000..bddd5e9be47f --- /dev/null +++ b/databases/leveldb/files/patch-Makefile @@ -0,0 +1,60 @@ +--- Makefile.orig 2011-10-24 18:02:13.000000000 +0800 ++++ Makefile 2011-10-27 18:37:46.857260892 +0800 +@@ -2,13 +2,13 @@ + # 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. + +-CC = g++ ++CC ?= g++ + + #----------------------------------------------- + # Uncomment exactly one of the lines labelled (A), (B), and (C) below + # to switch between compilation modes. + +-OPT = -O2 -DNDEBUG # (A) Production use (optimized mode) ++OPT ?= -O2 -DNDEBUG # (A) Production use (optimized mode) + # OPT = -g2 # (B) Debug mode, w/ full line-level debugging symbols + # OPT = -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols + #----------------------------------------------- +@@ -36,7 +36,7 @@ + GOOGLE_PERFTOOLS_LDFLAGS= + endif + +-CFLAGS = -c -I. -I./include $(PORT_CFLAGS) $(PLATFORM_CFLAGS) $(OPT) $(SNAPPY_CFLAGS) ++CFLAGS += -c -fPIC -I. -I./include $(PORT_CFLAGS) $(PLATFORM_CFLAGS) $(OPT) $(SNAPPY_CFLAGS) + + LDFLAGS=$(PLATFORM_LDFLAGS) $(SNAPPY_LDFLAGS) $(GOOGLE_PERFTOOLS_LDFLAGS) + +@@ -103,15 +103,19 @@ + BENCHMARKS = db_bench_sqlite3 db_bench_tree_db + + LIBRARY = libleveldb.a ++SHARED_LIBRARY = libleveldb.so ++SHARED_LIBRARY_VER = 0 + MEMENVLIBRARY = libmemenv.a + +-all: $(LIBRARY) ++SHARED_LIBOBJECTS = $(LIBOBJECTS:.o=.so) ++ ++all: $(LIBRARY) $(SHARED_LIBRARY) + + check: $(PROGRAMS) $(TESTS) + for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done + + clean: +- -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(MEMENVLIBRARY) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o ++ -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(SHARED_LIBRARY) $(MEMENVLIBRARY) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o + -rm -rf ios-x86/* ios-arm/* + -rm build_config.mk + +@@ -119,6 +123,10 @@ + rm -f $@ + $(AR) -rs $@ $(LIBOBJECTS) + ++$(SHARED_LIBRARY): $(LIBOBJECTS) ++ rm -f $@ ++ $(CC) -shared -Wl,-soname,$@.$(SHARED_LIBRARY_VER) -o $@.$(SHARED_LIBRARY_VER) $(LDFLAGS) $(LIBOBJECTS) ++ + db_bench: db/db_bench.o $(LIBOBJECTS) $(TESTUTIL) + $(CC) $(LDFLAGS) db/db_bench.o $(LIBOBJECTS) $(TESTUTIL) -o $@ + diff --git a/databases/leveldb/pkg-descr b/databases/leveldb/pkg-descr new file mode 100644 index 000000000000..018dc8243c99 --- /dev/null +++ b/databases/leveldb/pkg-descr @@ -0,0 +1,26 @@ +LevelDB is a fast key-value storage library written at Google that provides an +ordered mapping from string keys to string values. + +Features: +- Keys and values are arbitrary byte arrays. +- Data is stored sorted by key. +- Callers can provide a custom comparison function to override the sort order. +- The basic operations are Put(key,value), Get(key), Delete(key). +- Multiple changes can be made in one atomic batch. +- Users can create a transient snapshot to get a consistent view of data. +- Forward and backward iteration is supported over the data. +- Data is automatically compressed using the Snappy compression library. +- External activity (file system operations etc.) is relayed through a virtual + interface so users can customize the operating system interactions. +- Detailed documentation about how to use the library is included with the + source code. + +Limitations: +- This is not a SQL database. It does not have a relational data model, it does + not support SQL queries, and it has no support for indexes. +- Only a single process (possibly multi-threaded) can access a particular + database at a time. +- There is no client-server support builtin to the library. An application that + needs such support will have to wrap their own server around the library. + +WWW: http://code.google.com/p/leveldb/ diff --git a/databases/leveldb/pkg-plist b/databases/leveldb/pkg-plist new file mode 100644 index 000000000000..525bbfc1e9d4 --- /dev/null +++ b/databases/leveldb/pkg-plist @@ -0,0 +1,18 @@ +include/leveldb/c.h +include/leveldb/cache.h +include/leveldb/comparator.h +include/leveldb/db.h +include/leveldb/env.h +include/leveldb/iterator.h +include/leveldb/options.h +include/leveldb/slice.h +include/leveldb/status.h +include/leveldb/table.h +include/leveldb/table_builder.h +include/leveldb/write_batch.h +lib/libleveldb.a +lib/libleveldb.so +lib/libleveldb.so.0 +%%DATADIR%%/build_config.mk +@dirrm %%DATADIR%% +@dirrm include/leveldb |