From 4b13add2c687b61f521a6951dbd641245d75d3b0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 13:30:30 +0000 Subject: import ceph-common-0.80.7-2.el7 --- diff --git a/.ceph-common.metadata b/.ceph-common.metadata new file mode 100644 index 0000000..66d001d --- /dev/null +++ b/.ceph-common.metadata @@ -0,0 +1 @@ +3db33986291c8fc8fb572099ec2915690d88512b SOURCES/ceph-0.80.7.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b852b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ceph-0.80.7.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-google-.h-gperftools-header-files-were-deprecated-in.patch b/SOURCES/0001-google-.h-gperftools-header-files-were-deprecated-in.patch new file mode 100644 index 0000000..423de97 --- /dev/null +++ b/SOURCES/0001-google-.h-gperftools-header-files-were-deprecated-in.patch @@ -0,0 +1,28 @@ +From a1a927ba0e124a58103f56b5e4adb2e15bc1b9e8 Mon Sep 17 00:00:00 2001 +From: Boris Ranto +Date: Mon, 22 Sep 2014 14:20:28 +0200 +Subject: [PATCH] google/*.h gperftools header files were deprecated in the + fedora rawhide gperftools release + +--- + src/perfglue/heap_profiler.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/perfglue/heap_profiler.cc b/src/perfglue/heap_profiler.cc +index 6b079b8..cdd5ccb 100644 +--- a/src/perfglue/heap_profiler.cc ++++ b/src/perfglue/heap_profiler.cc +@@ -12,8 +12,8 @@ + * + */ + +-#include +-#include ++#include ++#include + #include "heap_profiler.h" + #include "common/environment.h" + #include "common/LogClient.h" +-- +1.9.3 + diff --git a/SOURCES/0002-ceph_test_librbd_fsx-no-longer-need-Wno-format-remov.patch b/SOURCES/0002-ceph_test_librbd_fsx-no-longer-need-Wno-format-remov.patch new file mode 100644 index 0000000..5a001f6 --- /dev/null +++ b/SOURCES/0002-ceph_test_librbd_fsx-no-longer-need-Wno-format-remov.patch @@ -0,0 +1,26 @@ +From 290fabdd58155634e52adbfad8f017cc6d6092a0 Mon Sep 17 00:00:00 2001 +From: Boris Ranto +Date: Mon, 22 Sep 2014 14:22:26 +0200 +Subject: [PATCH] ceph_test_librbd_fsx no longer need -Wno-format, remove + it + +--- + src/test/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/test/Makefile.am b/src/test/Makefile.am +index f527b96..718ab60 100644 +--- a/src/test/Makefile.am ++++ b/src/test/Makefile.am +@@ -642,7 +642,7 @@ bin_DEBUGPROGRAMS += ceph_test_librbd + if LINUX + ceph_test_librbd_fsx_SOURCES = test/librbd/fsx.c + ceph_test_librbd_fsx_LDADD = $(LIBRBD) $(LIBRADOS) -lm +-ceph_test_librbd_fsx_CFLAGS = ${AM_CFLAGS} -Wno-format ++ceph_test_librbd_fsx_CFLAGS = ${AM_CFLAGS} + bin_DEBUGPROGRAMS += ceph_test_librbd_fsx + endif + +-- +1.9.3 + diff --git a/SOURCES/0003-Limit-the-include-scope-do-not-indirectly-include-le.patch b/SOURCES/0003-Limit-the-include-scope-do-not-indirectly-include-le.patch new file mode 100644 index 0000000..8e89915 --- /dev/null +++ b/SOURCES/0003-Limit-the-include-scope-do-not-indirectly-include-le.patch @@ -0,0 +1,45 @@ +From 4a530a12ac1ffae4e935f59262b62d893acb9751 Mon Sep 17 00:00:00 2001 +From: Boris Ranto +Date: Mon, 22 Sep 2014 14:43:50 +0200 +Subject: [PATCH] Limit the include scope -- do not (indirectly) include + leveldb to ceph-conf and cephx authentication + +--- + src/auth/cephx/CephxServiceHandler.cc | 3 +-- + src/tools/ceph_conf.cc | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/auth/cephx/CephxServiceHandler.cc b/src/auth/cephx/CephxServiceHandler.cc +index c5d91d9..77b9bb5 100644 +--- a/src/auth/cephx/CephxServiceHandler.cc ++++ b/src/auth/cephx/CephxServiceHandler.cc +@@ -14,12 +14,11 @@ + + + #include "CephxServiceHandler.h" ++#include "CephxKeyServer.h" + #include "CephxProtocol.h" + + #include "../Auth.h" + +-#include "mon/Monitor.h" +- + #include + #include + +diff --git a/src/tools/ceph_conf.cc b/src/tools/ceph_conf.cc +index 09bbc56..8cbfcbf 100644 +--- a/src/tools/ceph_conf.cc ++++ b/src/tools/ceph_conf.cc +@@ -18,7 +18,7 @@ + #include + #include + +-#include "mon/AuthMonitor.h" ++#include "mon/MonMap.h" + #include "common/ConfUtils.h" + #include "global/global_init.h" + #include "common/entity_name.h" +-- +1.9.3 + diff --git a/SOURCES/0004-Introduce-enable-disable-server-option.patch b/SOURCES/0004-Introduce-enable-disable-server-option.patch new file mode 100644 index 0000000..e575f5a --- /dev/null +++ b/SOURCES/0004-Introduce-enable-disable-server-option.patch @@ -0,0 +1,460 @@ +From 3b780ba9feab2557add8cc76022a58a76b89daf1 Mon Sep 17 00:00:00 2001 +From: Boris Ranto +Date: Tue, 30 Sep 2014 11:49:01 +0200 +Subject: [PATCH] Introduce enable/disable server option + +--- + configure.ac | 22 ++++++++++++++--- + man/Makefile.am | 46 ++++++++++++++++++++++------------- + src/Makefile.am | 42 ++++++++++++++++++++++---------- + src/cls/Makefile.am | 2 ++ + src/erasure-code/jerasure/Makefile.am | 2 ++ + src/key_value_store/Makefile.am | 4 ++- + src/mon/Makefile.am | 2 ++ + src/os/Makefile.am | 16 +++++++----- + src/osd/Makefile.am | 2 ++ + src/test/Makefile.am | 2 ++ + src/test/erasure-code/Makefile.am | 2 ++ + src/tools/Makefile.am | 5 +++- + 12 files changed, 105 insertions(+), 42 deletions(-) + +diff --git a/configure.ac b/configure.ac +index fb54df1..3b5cc78 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -489,10 +489,24 @@ AC_ARG_WITH([ocf], + [with_ocf=no]) + AM_CONDITIONAL(WITH_OCF, [ test "$with_ocf" = "yes" ]) + +-# check is snappy-devel is installed, needed by leveldb +-AC_CHECK_LIB([snappy], [snappy_compress], [true], [AC_MSG_FAILURE([libsnappy not found])]) +-# use system leveldb +-AC_CHECK_LIB([leveldb], [leveldb_open], [true], [AC_MSG_FAILURE([libleveldb not found])], [-lsnappy -lpthread]) ++# server? ++AC_ARG_ENABLE([server], ++ [AS_HELP_STRING([--enable-server], [enable server binaries build])], ++ [], ++ [enable_server=yes]) ++AM_CONDITIONAL(ENABLE_SERVER, test "$enable_server" = "yes") ++if test "$enable_server" = "yes"; then ++ AC_DEFINE([ENABLE_SERVER], [1], [Define if you want to build server-side binaries]) ++fi ++ ++# cond-check if snappy-devel is installed, needed by leveldb that is need by server parts of the project ++AS_IF([test "$enable_server" = "yes"], ++ [AC_CHECK_LIB([snappy], [snappy_compress], [true], [AC_MSG_FAILURE([libsnappy not found])])]) ++ ++# cond-check leveldb, necessary if server enabled ++AS_IF([test "$enable_server" = "yes"], ++ [AC_CHECK_LIB([leveldb], [leveldb_open], [true], [AC_MSG_FAILURE([libleveldb not found])], [-lsnappy -lpthread])]) ++ + # see if we can use bloom filters with leveldb + AC_LANG_PUSH([C++]) + AC_CHECK_HEADER([leveldb/filter_policy.h], [AC_DEFINE([HAVE_LEVELDB_FILTER_POLICY], [1], [Defined if LevelDB supports bloom filters ])]) +diff --git a/man/Makefile.am b/man/Makefile.am +index be071b1..0b6564f 100644 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -1,30 +1,42 @@ + AUTOMAKE_OPTIONS = gnu + + dist_man_MANS = \ +- ceph-osd.8 \ +- ceph-mds.8 \ +- ceph-mon.8 \ +- mkcephfs.8 \ +- ceph-fuse.8 \ + ceph-syn.8 \ +- crushtool.8 \ +- osdmaptool.8 \ +- monmaptool.8 \ + ceph-conf.8 \ +- ceph-run.8 \ + ceph.8 \ +- mount.ceph.8 \ +- radosgw.8 \ +- radosgw-admin.8 \ + ceph-authtool.8 \ + rados.8 \ +- librados-config.8 \ + rbd.8 \ +- ceph-clsinfo.8 \ +- ceph-debugpack.8 \ +- cephfs.8 \ + ceph-dencoder.8 \ ++ ceph-post-file.8 ++ ++if ENABLE_SERVER ++dist_man_MANS += \ ++ ceph-mds.8 \ ++ ceph-mon.8 \ ++ ceph-osd.8 \ ++ mkcephfs.8 \ ++ ceph-run.8 \ + ceph-rest-api.8 \ ++ crushtool.8 \ ++ osdmaptool.8 \ ++ monmaptool.8 \ ++ cephfs.8 \ ++ mount.ceph.8 \ + ceph-rbdnamer.8 \ +- ceph-post-file.8 \ ++ ceph-debugpack.8 \ ++ ceph-clsinfo.8 \ ++ librados-config.8 ++endif ++ ++if WITH_RADOSGW ++dist_man_MANS += \ ++ radosgw.8 \ ++ radosgw-admin.8 ++endif ++ ++if WITH_FUSE ++dist_man_MANS += \ ++ ceph-fuse.8 \ + rbd-fuse.8 ++endif +diff --git a/src/Makefile.am b/src/Makefile.am +index edec05e..a9299d5 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -36,6 +36,7 @@ include tools/Makefile.am + + # core daemons + ++if ENABLE_SERVER + ceph_mon_SOURCES = ceph_mon.cc + ceph_mon_LDADD = $(LIBMON) $(LIBOS) $(CEPH_GLOBAL) $(LIBCOMMON) + bin_PROGRAMS += ceph-mon +@@ -47,13 +48,14 @@ bin_PROGRAMS += ceph-osd + ceph_mds_SOURCES = ceph_mds.cc + ceph_mds_LDADD = $(LIBMDS) $(LIBOSDC) $(CEPH_GLOBAL) $(LIBCOMMON) + bin_PROGRAMS += ceph-mds +- ++endif # ENABLE_SERVER + + # admin tools + + + # user tools + ++if ENABLE_SERVER + mount_ceph_SOURCES = mount/mount.ceph.c common/secret.c + mount_ceph_LDADD = $(LIBCOMMON) $(KEYUTILS_LIB) + if LINUX +@@ -68,6 +70,7 @@ bin_PROGRAMS += cephfs + librados_config_SOURCES = librados-config.cc + librados_config_LDADD = $(LIBRADOS) $(CEPH_GLOBAL) + bin_PROGRAMS += librados-config ++endif # ENABLE_SERVER + + ceph_syn_SOURCES = ceph_syn.cc + ceph_syn_SOURCES += client/SyntheticClient.cc # uses g_conf.. needs cleanup +@@ -127,7 +130,7 @@ editpaths = sed \ + -e 's|@datadir[@]|$(pkgdatadir)|g' \ + -e 's|@prefix[@]|$(prefix)|g' \ + -e 's|@@GCOV_PREFIX_STRIP[@][@]|$(GCOV_PREFIX_STRIP)|g' +-shell_scripts = ceph-debugpack ceph-post-file ceph-crush-location ++shell_scripts = ceph-post-file ceph-crush-location + $(shell_scripts): Makefile + $(shell_scripts): %: %.in + rm -f $@ $@.tmp +@@ -206,6 +209,7 @@ EXTRA_DIST += \ + libs3/test \ + unittest_bufferlist.sh + ++if ENABLE_SERVER + # work around old versions of automake that don't define $docdir + # NOTE: this won't work on suse, where docdir is /usr/share/doc/packages/$package. + docdir ?= ${datadir}/doc/ceph +@@ -216,34 +220,43 @@ doc_DATA = $(srcdir)/sample.ceph.conf sample.fetch_config + + shell_commondir = $(libdir)/ceph + shell_common_SCRIPTS = ceph_common.sh ++endif # ENABLE_SERVER + + bash_completiondir = $(sysconfdir)/bash_completion.d + bash_completion_DATA = $(srcdir)/bash_completion/ceph \ + $(srcdir)/bash_completion/rados \ +- $(srcdir)/bash_completion/rbd \ +- $(srcdir)/bash_completion/radosgw-admin ++ $(srcdir)/bash_completion/rbd ++if WITH_RADOSGW ++bash_completion_DATA += $(srcdir)/bash_completion/radosgw-admin ++endif + ++if ENABLE_SERVER + ceph_sbin_SCRIPTS = \ + ceph-disk \ + ceph-disk-prepare \ + ceph-disk-activate \ + ceph-disk-udev \ + ceph-create-keys ++endif # ENABLE_SERVER + + bin_SCRIPTS += \ + ceph \ ++ ceph-post-file \ ++ ceph-crush-location ++ ++if ENABLE_SERVER ++bin_SCRIPTS += \ + ceph-run \ + ceph-rest-api \ + ceph-clsinfo \ + ceph-debugpack \ + ceph-rbdnamer \ +- ceph-post-file \ +- ceph-crush-location +- +-BUILT_SOURCES += init-ceph + su_sbin_SCRIPTS += mkcephfs ++BUILT_SOURCES += init-ceph ++shell_scripts += init-ceph mkcephfs ceph-debugpack ++endif # ENABLE_SERVER ++ + +-shell_scripts += init-ceph mkcephfs + + + +@@ -269,6 +282,7 @@ base: core-daemons admin-tools \ + cephfs ceph-syn ceph-conf \ + rados librados-config \ + init-ceph mkcephfs ceph_mon_store_converter ceph-post-file ++client: ceph ceph-authtool ceph-conf ceph-syn ceph-crush-location rados rbd ceph-post-file brag librbd librados pybind libcephfs + + + # version stuff +@@ -331,8 +345,12 @@ clean-local: + python_PYTHON = pybind/rados.py \ + pybind/rbd.py \ + pybind/cephfs.py \ +- pybind/ceph_argparse.py \ ++ pybind/ceph_argparse.py ++ ++if ENABLE_SERVER ++python_PYTHON += \ + pybind/ceph_rest_api.py ++endif + + + # everything else we want to include in a 'make dist' +@@ -354,11 +372,9 @@ noinst_HEADERS += \ + + # coverage + ++if ENABLE_COVERAGE + shell_scripts += ceph-coverage + bin_SCRIPTS += ceph-coverage +- +- +-if ENABLE_COVERAGE + COV_DIR = $(DESTDIR)$(libdir)/ceph/coverage + COV_FILES = $(srcdir)/*.gcno + COV_LIB_FILES = $(srcdir)/.libs/*.gcno +diff --git a/src/cls/Makefile.am b/src/cls/Makefile.am +index ea44fe7..81ebdbc 100644 +--- a/src/cls/Makefile.am ++++ b/src/cls/Makefile.am +@@ -1,5 +1,6 @@ + ## Rados object classes + ++if ENABLE_SERVER + libcls_hello_la_SOURCES = cls/hello/cls_hello.cc + libcls_hello_la_LIBADD = $(PTHREAD_LIBS) $(EXTRALIBS) + libcls_hello_la_LDFLAGS = ${AM_LDFLAGS} -module -avoid-version -shared -export-symbols-regex '.*__cls_.*' +@@ -56,6 +57,7 @@ libcls_rgw_la_SOURCES = \ + libcls_rgw_la_LIBADD = libjson_spirit.la $(PTHREAD_LIBS) $(EXTRALIBS) + libcls_rgw_la_LDFLAGS = ${AM_LDFLAGS} -module -avoid-version -shared -export-symbols-regex '.*__cls_.*' + radoslib_LTLIBRARIES += libcls_rgw.la ++endif # ENABLE_SERVER + + ## Rados object client classes + +diff --git a/src/erasure-code/jerasure/Makefile.am b/src/erasure-code/jerasure/Makefile.am +index e16fe07..e70c8f1 100644 +--- a/src/erasure-code/jerasure/Makefile.am ++++ b/src/erasure-code/jerasure/Makefile.am +@@ -12,6 +12,7 @@ noinst_HEADERS += \ + erasure-code/jerasure/gf-complete/include/gf_general.h \ + erasure-code/jerasure/ErasureCodeJerasure.h + ++if ENABLE_SERVER + jerasure_sources = \ + erasure-code/jerasure/jerasure/src/cauchy.c \ + erasure-code/jerasure/jerasure/src/galois.c \ +@@ -108,3 +109,4 @@ libec_jerasure_la_LDFLAGS += -export-symbols-regex '.*__erasure_code_.*' + endif + + erasure_codelib_LTLIBRARIES += libec_jerasure.la ++endif # ENABLE_SERVER +diff --git a/src/key_value_store/Makefile.am b/src/key_value_store/Makefile.am +index c4b854f..e69af82 100644 +--- a/src/key_value_store/Makefile.am ++++ b/src/key_value_store/Makefile.am +@@ -1,9 +1,11 @@ ++if ENABLE_SERVER + if LINUX + libcls_kvs_la_SOURCES = key_value_store/cls_kvs.cc + libcls_kvs_la_LIBADD = $(PTHREAD_LIBS) $(EXTRALIBS) + libcls_kvs_la_LDFLAGS = ${AM_LDFLAGS} -module -avoid-version -shared -export-symbols-regex '.*__cls_.*' + radoslib_LTLIBRARIES += libcls_kvs.la +-endif ++endif # LINUX ++endif # ENABLE_SERVER + + noinst_HEADERS += \ + key_value_store/key_value_structure.h \ +diff --git a/src/mon/Makefile.am b/src/mon/Makefile.am +index 6016355..d979eea 100644 +--- a/src/mon/Makefile.am ++++ b/src/mon/Makefile.am +@@ -2,6 +2,7 @@ libmon_types_la_SOURCES = \ + mon/PGMap.cc + noinst_LTLIBRARIES += libmon_types.la + ++if ENABLE_SERVER + libmon_la_SOURCES = \ + mon/Monitor.cc \ + mon/Paxos.cc \ +@@ -19,6 +20,7 @@ libmon_la_SOURCES = \ + mon/ConfigKeyService.cc + libmon_la_LIBADD = $(LIBAUTH) $(LIBCOMMON) $(LIBOS) $(LIBMON_TYPES) + noinst_LTLIBRARIES += libmon.la ++endif + + noinst_HEADERS += \ + mon/AuthMonitor.h \ +diff --git a/src/os/Makefile.am b/src/os/Makefile.am +index 63a1846..9065aa0 100644 +--- a/src/os/Makefile.am ++++ b/src/os/Makefile.am +@@ -3,6 +3,7 @@ libos_types_la_SOURCES = \ + libos_types_la_CXXFLAGS = ${AM_CXXFLAGS} + noinst_LTLIBRARIES += libos_types.la + ++if ENABLE_SERVER + libos_la_SOURCES = \ + os/chain_xattr.cc \ + os/DBObjectMap.cc \ +@@ -38,6 +39,15 @@ libos_la_CXXFLAGS = ${AM_CXXFLAGS} + libos_la_LIBADD = $(LIBOS_TYPES) + noinst_LTLIBRARIES += libos.la + ++if WITH_LIBZFS ++libos_zfs_a_SOURCES = os/ZFS.cc ++libos_zfs_a_CXXFLAGS = ${AM_CXXFLAGS} ${LIBZFS_CFLAGS} ++noinst_LIBRARIES += libos_zfs.a ++noinst_HEADERS += os/ZFS.h ++endif # WITH_LIBZFS ++ ++endif # ENABLE_SERVER ++ + noinst_HEADERS += \ + os/btrfs_ioctl.h \ + os/chain_xattr.h \ +@@ -66,10 +76,4 @@ noinst_HEADERS += \ + os/XfsFileStoreBackend.h \ + os/ZFSFileStoreBackend.h + +-if WITH_LIBZFS +-libos_zfs_a_SOURCES = os/ZFS.cc +-libos_zfs_a_CXXFLAGS = ${AM_CXXFLAGS} ${LIBZFS_CFLAGS} +-noinst_LIBRARIES += libos_zfs.a +-noinst_HEADERS += os/ZFS.h +-endif + +diff --git a/src/osd/Makefile.am b/src/osd/Makefile.am +index 75e4877..0b55e84 100644 +--- a/src/osd/Makefile.am ++++ b/src/osd/Makefile.am +@@ -5,6 +5,7 @@ libosd_types_la_SOURCES = \ + libosd_types_la_CXXFLAGS = ${AM_CXXFLAGS} + noinst_LTLIBRARIES += libosd_types.la + ++if ENABLE_SERVER + libosd_la_SOURCES = \ + osd/PG.cc \ + osd/ReplicatedPG.cc \ +@@ -26,6 +27,7 @@ libosd_la_SOURCES = \ + libosd_la_CXXFLAGS = ${AM_CXXFLAGS} + libosd_la_LIBADD = $(LIBOSDC) $(LIBOS) $(LIBOSD_TYPES) $(LIBOS_TYPES) + noinst_LTLIBRARIES += libosd.la ++endif # ENABLE_SERVER + + noinst_HEADERS += \ + osd/Ager.h \ +diff --git a/src/test/Makefile.am b/src/test/Makefile.am +index 718ab60..67bbf9b 100644 +--- a/src/test/Makefile.am ++++ b/src/test/Makefile.am +@@ -71,9 +71,11 @@ endif + + bin_PROGRAMS += ceph-dencoder + ++if ENABLE_SERVER + get_command_descriptions_SOURCES = test/common/get_command_descriptions.cc + get_command_descriptions_LDADD = $(LIBMON) $(LIBCOMMON) $(CEPH_GLOBAL) + noinst_PROGRAMS += get_command_descriptions ++endif + + + ## Build tests +diff --git a/src/test/erasure-code/Makefile.am b/src/test/erasure-code/Makefile.am +index fdbe003..1732391 100644 +--- a/src/test/erasure-code/Makefile.am ++++ b/src/test/erasure-code/Makefile.am +@@ -17,6 +17,7 @@ ceph_erasure_code_LDADD += -ldl + endif + bin_DEBUGPROGRAMS += ceph_erasure_code + ++if ENABLE_SERVER + libec_example_la_SOURCES = test/erasure-code/ErasureCodePluginExample.cc + libec_example_la_CFLAGS = ${AM_CFLAGS} + libec_example_la_CXXFLAGS= ${AM_CXXFLAGS} +@@ -110,6 +111,7 @@ noinst_HEADERS += test/erasure-code/ErasureCodeExample.h + unittest_erasure_code_example_CXXFLAGS = $(UNITTEST_CXXFLAGS) + unittest_erasure_code_example_LDADD = $(LIBOSD) $(LIBCOMMON) $(UNITTEST_LDADD) $(CEPH_GLOBAL) + check_PROGRAMS += unittest_erasure_code_example ++endif # ENABLE_SERVER + + noinst_HEADERS += \ + test/erasure-code/ceph_erasure_code_benchmark.h +diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am +index 6078eb4..efa9ff5 100644 +--- a/src/tools/Makefile.am ++++ b/src/tools/Makefile.am +@@ -11,7 +11,7 @@ ceph_kvstore_tool_LDADD = $(LIBOS) $(CEPH_GLOBAL) + ceph_kvstore_tool_CXXFLAGS = $(UNITTEST_CXXFLAGS) + bin_DEBUGPROGRAMS += ceph-kvstore-tool + +- ++if ENABLE_SERVER + ceph_filestore_tool_SOURCES = tools/ceph_filestore_tool.cc + ceph_filestore_tool_LDADD = $(LIBOSD) $(LIBOS) $(CEPH_GLOBAL) -lboost_program_options + if LINUX +@@ -37,6 +37,7 @@ bin_PROGRAMS += crushtool + osdmaptool_SOURCES = tools/osdmaptool.cc + osdmaptool_LDADD = $(CEPH_GLOBAL) + bin_PROGRAMS += osdmaptool ++endif # ENABLE_SERVER + + ceph_scratchtool_SOURCES = tools/scratchtool.c + ceph_scratchtool_LDADD = $(LIBRADOS) $(CEPH_GLOBAL) +@@ -94,9 +95,11 @@ ceph_authtool_SOURCES = tools/ceph_authtool.cc + ceph_authtool_LDADD = $(CEPH_GLOBAL) $(LIBCOMMON) + bin_PROGRAMS += ceph-authtool + ++if ENABLE_SERVER + ceph_mon_store_converter_SOURCES = tools/mon_store_converter.cc + ceph_mon_store_converter_LDADD = $(LIBMON) $(LIBOS) $(CEPH_GLOBAL) + bin_PROGRAMS += ceph_mon_store_converter ++endif + + noinst_HEADERS += \ + tools/rados/rados_sync.h \ +-- +1.9.3 + diff --git a/SOURCES/0005-os-KeyValueDB-generic-create-test_init.patch b/SOURCES/0005-os-KeyValueDB-generic-create-test_init.patch new file mode 100644 index 0000000..87167d9 --- /dev/null +++ b/SOURCES/0005-os-KeyValueDB-generic-create-test_init.patch @@ -0,0 +1,122 @@ +From 041e760440682af7640d75ed6de3365307dcb062 Mon Sep 17 00:00:00 2001 +From: xinxinsh +Date: Mon, 31 Mar 2014 17:55:16 -0700 +Subject: [PATCH] os/KeyValueDB: generic create(), test_init() + +Let us create an implemenetation by name. Include a test_init() method +that will instantiate an instance and verify it could start up. + +Signed-off-by: Sage Weil +(cherry picked from commit 4bf929ef21b6710f60f01cb8f7095ad0a440709f) +--- + src/os/KeyValueDB.cc | 32 ++++++++++++++++++++++++++++++++ + src/os/KeyValueDB.h | 6 ++++++ + src/os/LevelDBStore.cc | 10 ++++++++++ + src/os/LevelDBStore.h | 1 + + src/os/Makefile.am | 1 + + 5 files changed, 50 insertions(+) + create mode 100644 src/os/KeyValueDB.cc + +diff --git a/src/os/KeyValueDB.cc b/src/os/KeyValueDB.cc +new file mode 100644 +index 0000000..8e590e2 +--- /dev/null ++++ b/src/os/KeyValueDB.cc +@@ -0,0 +1,32 @@ ++// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- ++// vim: ts=8 sw=2 smarttab ++ ++#include "KeyValueDB.h" ++#include "LevelDBStore.h" ++ ++KeyValueDB *KeyValueDB::create(CephContext *cct, const string& type, ++ const string& dir) ++{ ++ if (type == "leveldb") { ++ return new LevelDBStore(cct, dir); ++ } ++#ifdef HAVE_KINETIC ++ if (kv_type == KV_TYPE_KINETIC) { ++ store = new KineticStore(g_ceph_context); ++ } ++#endif ++ return NULL; ++} ++ ++int KeyValueDB::test_init(const string& type, const string& dir) ++{ ++ if (type == "leveldb"){ ++ return LevelDBStore::_test_init(dir); ++ } ++#ifdef HAVE_KINETIC ++ if (kv_type == KV_TYPE_KINETIC) { ++ return 0; ++ } ++#endif ++ return -EINVAL; ++} +diff --git a/src/os/KeyValueDB.h b/src/os/KeyValueDB.h +index c581aa5..f8e0b68 100644 +--- a/src/os/KeyValueDB.h ++++ b/src/os/KeyValueDB.h +@@ -64,6 +64,12 @@ public: + }; + typedef ceph::shared_ptr< TransactionImpl > Transaction; + ++ /// create a new instance ++ static KeyValueDB *create(CephContext *cct, const string& type, ++ const string& dir); ++ ++ /// test whether we can successfully initialize; may have side effects (e.g., create) ++ static int test_init(const string& type, const string& dir); + virtual int init() = 0; + virtual int open(ostream &out) = 0; + virtual int create_and_open(ostream &out) = 0; +diff --git a/src/os/LevelDBStore.cc b/src/os/LevelDBStore.cc +index 326862f..818396a 100644 +--- a/src/os/LevelDBStore.cc ++++ b/src/os/LevelDBStore.cc +@@ -92,6 +92,16 @@ int LevelDBStore::do_open(ostream &out, bool create_if_missing) + return 0; + } + ++int LevelDBStore::_test_init(const string& dir) ++{ ++ leveldb::Options options; ++ options.create_if_missing = true; ++ leveldb::DB *db; ++ leveldb::Status status = leveldb::DB::Open(options, dir, &db); ++ delete db; ++ return status.ok() ? 0 : -EIO; ++} ++ + LevelDBStore::~LevelDBStore() + { + close(); +diff --git a/src/os/LevelDBStore.h b/src/os/LevelDBStore.h +index 26e7bbe..1c072da 100644 +--- a/src/os/LevelDBStore.h ++++ b/src/os/LevelDBStore.h +@@ -154,6 +154,7 @@ public: + + ~LevelDBStore(); + ++ static int _test_init(const string& dir); + int init(); + + /// Opens underlying db +diff --git a/src/os/Makefile.am b/src/os/Makefile.am +index 39bbdb2..f2303fb 100644 +--- a/src/os/Makefile.am ++++ b/src/os/Makefile.am +@@ -18,6 +18,7 @@ libos_la_SOURCES = \ + os/LevelDBStore.cc \ + os/LFNIndex.cc \ + os/MemStore.cc \ ++ os/KeyValueDB.cc \ + os/KeyValueStore.cc \ + os/ObjectStore.cc \ + os/WBThrottle.cc \ +-- +1.9.3 + diff --git a/SOURCES/0006-os-KeyValueDB-make-compaction-interface-generic.patch b/SOURCES/0006-os-KeyValueDB-make-compaction-interface-generic.patch new file mode 100644 index 0000000..f0a0da3 --- /dev/null +++ b/SOURCES/0006-os-KeyValueDB-make-compaction-interface-generic.patch @@ -0,0 +1,72 @@ +From 38e4b6a19202ed0afa7700e37faaaea2903199ca Mon Sep 17 00:00:00 2001 +From: Sage Weil +Date: Mon, 31 Mar 2014 18:05:13 -0700 +Subject: [PATCH] os/KeyValueDB: make compaction interface generic + +Signed-off-by: Sage Weil +(cherry picked from commit 86a0b9dd9ad2f3b0996b3f72a79fd1b13726b4ad) +--- + src/os/KeyValueDB.h | 12 ++++++++++++ + src/os/LevelDBStore.h | 13 ++++++++----- + 2 files changed, 20 insertions(+), 5 deletions(-) + +diff --git a/src/os/KeyValueDB.h b/src/os/KeyValueDB.h +index f8e0b68..3929ed4 100644 +--- a/src/os/KeyValueDB.h ++++ b/src/os/KeyValueDB.h +@@ -179,6 +179,18 @@ public: + + virtual ~KeyValueDB() {} + ++ /// compact the underlying store ++ virtual void compact() {} ++ ++ /// compact db for all keys with a given prefix ++ virtual void compact_prefix(const string& prefix) {} ++ /// compact db for all keys with a given prefix, async ++ virtual void compact_prefix_async(const string& prefix) {} ++ virtual void compact_range(const string& prefix, ++ const string& start, const string& end) {} ++ virtual void compact_range_async(const string& prefix, ++ const string& start, const string& end) {} ++ + protected: + virtual WholeSpaceIterator _get_iterator() = 0; + virtual WholeSpaceIterator _get_snapshot_iterator() = 0; +diff --git a/src/os/LevelDBStore.h b/src/os/LevelDBStore.h +index 1c072da..3dbc0f9 100644 +--- a/src/os/LevelDBStore.h ++++ b/src/os/LevelDBStore.h +@@ -85,21 +85,24 @@ public: + /// compact the underlying leveldb store + void compact(); + +- /// compact leveldb for all keys with a given prefix ++ /// compact db for all keys with a given prefix + void compact_prefix(const string& prefix) { + compact_range(prefix, past_prefix(prefix)); + } + void compact_prefix_async(const string& prefix) { + compact_range_async(prefix, past_prefix(prefix)); + } +- +- void compact_range(const string& prefix, const string& start, const string& end) { ++ void compact_range(const string& prefix, ++ const string& start, const string& end) { + compact_range(combine_strings(prefix, start), combine_strings(prefix, end)); + } +- void compact_range_async(const string& prefix, const string& start, const string& end) { +- compact_range_async(combine_strings(prefix, start), combine_strings(prefix, end)); ++ void compact_range_async(const string& prefix, ++ const string& start, const string& end) { ++ compact_range_async(combine_strings(prefix, start), ++ combine_strings(prefix, end)); + } + ++ + /** + * options_t: Holds options which are minimally interpreted + * on initialization and then passed through to LevelDB. +-- +1.9.3 + diff --git a/SOURCES/0007-mon-MonitorDBStore-uninline-init_options.patch b/SOURCES/0007-mon-MonitorDBStore-uninline-init_options.patch new file mode 100644 index 0000000..e35dc32 --- /dev/null +++ b/SOURCES/0007-mon-MonitorDBStore-uninline-init_options.patch @@ -0,0 +1,105 @@ +From cebf864174ad3d3340094130e591a9f04faa970b Mon Sep 17 00:00:00 2001 +From: Sage Weil +Date: Fri, 19 Sep 2014 18:00:37 -0700 +Subject: [PATCH] mon/MonitorDBStore: uninline init_options + +These assume leveldb but we can't reference that from the header +(for ceph-dencoder's sake). Not that this is firefly-only; upstream +this has been cleaned up. + +Signed-off-by: Sage Weil +--- + src/mon/Makefile.am | 1 + + src/mon/MonitorDBStore.cc | 36 ++++++++++++++++++++++++++++++++++++ + src/mon/MonitorDBStore.h | 20 +------------------- + 3 files changed, 38 insertions(+), 19 deletions(-) + create mode 100644 src/mon/MonitorDBStore.cc + +diff --git a/src/mon/Makefile.am b/src/mon/Makefile.am +index de5bbca..ceabe30 100644 +--- a/src/mon/Makefile.am ++++ b/src/mon/Makefile.am +@@ -9,6 +9,7 @@ libmon_la_SOURCES = \ + mon/PaxosService.cc \ + mon/OSDMonitor.cc \ + mon/MDSMonitor.cc \ ++ mon/MonitorDBStore.cc \ + mon/MonmapMonitor.cc \ + mon/PGMonitor.cc \ + mon/LogMonitor.cc \ +diff --git a/src/mon/MonitorDBStore.cc b/src/mon/MonitorDBStore.cc +new file mode 100644 +index 0000000..83107c0 +--- /dev/null ++++ b/src/mon/MonitorDBStore.cc +@@ -0,0 +1,36 @@ ++// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- ++// vim: ts=8 sw=2 smarttab ++/* ++* Ceph - scalable distributed file system ++* ++* Copyright (C) 2012 Inktank, Inc. ++* ++* This is free software; you can redistribute it and/or ++* modify it under the terms of the GNU Lesser General Public ++* License version 2.1, as published by the Free Software ++* Foundation. See file COPYING. ++*/ ++ ++#include "MonitorDBStore.h" ++#include "os/LevelDBStore.h" ++ ++void MonitorDBStore::init_options() ++{ ++ db->init(); ++ if (g_conf->mon_leveldb_write_buffer_size) ++ db->options.write_buffer_size = g_conf->mon_leveldb_write_buffer_size; ++ if (g_conf->mon_leveldb_cache_size) ++ db->options.cache_size = g_conf->mon_leveldb_cache_size; ++ if (g_conf->mon_leveldb_block_size) ++ db->options.block_size = g_conf->mon_leveldb_block_size; ++ if (g_conf->mon_leveldb_bloom_size) ++ db->options.bloom_size = g_conf->mon_leveldb_bloom_size; ++ if (g_conf->mon_leveldb_compression) ++ db->options.compression_enabled = g_conf->mon_leveldb_compression; ++ if (g_conf->mon_leveldb_max_open_files) ++ db->options.max_open_files = g_conf->mon_leveldb_max_open_files; ++ if (g_conf->mon_leveldb_paranoid) ++ db->options.paranoid_checks = g_conf->mon_leveldb_paranoid; ++ if (g_conf->mon_leveldb_log.length()) ++ db->options.log_file = g_conf->mon_leveldb_log; ++} +diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h +index 88c4f93..741d6ec 100644 +--- a/src/mon/MonitorDBStore.h ++++ b/src/mon/MonitorDBStore.h +@@ -486,25 +486,7 @@ class MonitorDBStore + db->submit_transaction_sync(dbt); + } + +- void init_options() { +- db->init(); +- if (g_conf->mon_leveldb_write_buffer_size) +- db->options.write_buffer_size = g_conf->mon_leveldb_write_buffer_size; +- if (g_conf->mon_leveldb_cache_size) +- db->options.cache_size = g_conf->mon_leveldb_cache_size; +- if (g_conf->mon_leveldb_block_size) +- db->options.block_size = g_conf->mon_leveldb_block_size; +- if (g_conf->mon_leveldb_bloom_size) +- db->options.bloom_size = g_conf->mon_leveldb_bloom_size; +- if (g_conf->mon_leveldb_compression) +- db->options.compression_enabled = g_conf->mon_leveldb_compression; +- if (g_conf->mon_leveldb_max_open_files) +- db->options.max_open_files = g_conf->mon_leveldb_max_open_files; +- if (g_conf->mon_leveldb_paranoid) +- db->options.paranoid_checks = g_conf->mon_leveldb_paranoid; +- if (g_conf->mon_leveldb_log.length()) +- db->options.log_file = g_conf->mon_leveldb_log; +- } ++ void init_options(); + + int open(ostream &out) { + init_options(); +-- +1.9.3 + diff --git a/SOURCES/0008-mon-MonitorDBStore-use-generic-KeyValueDB-create.patch b/SOURCES/0008-mon-MonitorDBStore-use-generic-KeyValueDB-create.patch new file mode 100644 index 0000000..7cf6273 --- /dev/null +++ b/SOURCES/0008-mon-MonitorDBStore-use-generic-KeyValueDB-create.patch @@ -0,0 +1,76 @@ +From 239e095275500e82cfe143db83f79a9b84c2014a Mon Sep 17 00:00:00 2001 +From: Sage Weil +Date: Mon, 31 Mar 2014 18:04:35 -0700 +Subject: [PATCH] mon/MonitorDBStore: use generic KeyValueDB::create() + +Signed-off-by: Sage Weil +(cherry picked from commit a2a36192c28e4961b92c576172185a915daef366) +--- + src/common/config_opts.h | 1 + + src/mon/MonitorDBStore.h | 16 +++++++++------- + 2 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/src/common/config_opts.h b/src/common/config_opts.h +index f8dd5f0..bb6e1f3 100644 +--- a/src/common/config_opts.h ++++ b/src/common/config_opts.h +@@ -221,6 +221,7 @@ OPTION(mon_leveldb_paranoid, OPT_BOOL, false) // monitor's leveldb paranoid fl + OPTION(mon_leveldb_log, OPT_STR, "") + OPTION(mon_leveldb_size_warn, OPT_U64, 40*1024*1024*1024) // issue a warning when the monitor's leveldb goes over 40GB (in bytes) + OPTION(mon_force_quorum_join, OPT_BOOL, false) // force monitor to join quorum even if it has been previously removed from the map ++OPTION(mon_keyvaluedb, OPT_STR, "leveldb") // type of keyvaluedb backend + OPTION(paxos_stash_full_interval, OPT_INT, 25) // how often (in commits) to stash a full copy of the PaxosService state + OPTION(paxos_max_join_drift, OPT_INT, 10) // max paxos iterations before we must first sync the monitor stores + OPTION(paxos_propose_interval, OPT_DOUBLE, 1.0) // gather updates for this long before proposing a map update +diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h +index 741d6ec..1ee3070 100644 +--- a/src/mon/MonitorDBStore.h ++++ b/src/mon/MonitorDBStore.h +@@ -21,7 +21,6 @@ + #include + #include + #include "os/KeyValueDB.h" +-#include "os/LevelDBStore.h" + + #include "include/assert.h" + #include "common/Formatter.h" +@@ -29,7 +28,7 @@ + + class MonitorDBStore + { +- boost::scoped_ptr db; ++ boost::scoped_ptr db; + bool do_dump; + int dump_fd; + +@@ -522,11 +521,14 @@ class MonitorDBStore + os << path.substr(0, path.size() - pos) << "/store.db"; + string full_path = os.str(); + +- LevelDBStore *db_ptr = new LevelDBStore(g_ceph_context, full_path); ++ KeyValueDB *db_ptr = KeyValueDB::create(g_ceph_context, ++ g_conf->mon_keyvaluedb, ++ full_path); + if (!db_ptr) { +- derr << __func__ << " error initializing level db back storage in " +- << full_path << dendl; +- assert(0 != "MonitorDBStore: error initializing level db back storage"); ++ derr << __func__ << " error initializing " ++ << g_conf->mon_keyvaluedb << " db back storage in " ++ << full_path << dendl; ++ assert(0 != "MonitorDBStore: error initializing keyvaluedb back storage"); + } + db.reset(db_ptr); + +@@ -542,7 +544,7 @@ class MonitorDBStore + } + } + } +- MonitorDBStore(LevelDBStore *db_ptr) : ++ MonitorDBStore(KeyValueDB *db_ptr) : + db(0), do_dump(false), dump_fd(-1) { + db.reset(db_ptr); + } +-- +1.9.3 + diff --git a/SOURCES/0009-config-allow-unsafe-setting-of-config-values.patch b/SOURCES/0009-config-allow-unsafe-setting-of-config-values.patch new file mode 100644 index 0000000..8be140b --- /dev/null +++ b/SOURCES/0009-config-allow-unsafe-setting-of-config-values.patch @@ -0,0 +1,55 @@ +From 6f77c4d846a7b1f798139fb92c9d385545c74a02 Mon Sep 17 00:00:00 2001 +From: Sage Weil +Date: Mon, 31 Mar 2014 15:36:26 -0700 +Subject: [PATCH] config: allow unsafe setting of config values + +Allow callers to set config values even when there is no observer. + +Signed-off-by: Sage Weil +(cherry picked from commit e1418724a0da3979b1e706ccb54112d35c18f1eb) +--- + src/common/config.cc | 4 ++-- + src/common/config.h | 5 ++++- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/common/config.cc b/src/common/config.cc +index 23bfe35..7952aaf 100644 +--- a/src/common/config.cc ++++ b/src/common/config.cc +@@ -659,7 +659,7 @@ void md_config_t::set_val_or_die(const char *key, const char *val) + assert(ret == 0); + } + +-int md_config_t::set_val(const char *key, const char *val, bool meta) ++int md_config_t::set_val(const char *key, const char *val, bool meta, bool safe) + { + Mutex::Locker l(lock); + if (!key) +@@ -696,7 +696,7 @@ int md_config_t::set_val(const char *key, const char *val, bool meta) + for (int i = 0; i < NUM_CONFIG_OPTIONS; ++i) { + config_option *opt = &config_optionsp[i]; + if (strcmp(opt->name, k.c_str()) == 0) { +- if (internal_safe_to_start_threads) { ++ if (safe && internal_safe_to_start_threads) { + // If threads have been started... + if ((opt->type == OPT_STR) || (opt->type == OPT_ADDR) || + (opt->type == OPT_UUID)) { +diff --git a/src/common/config.h b/src/common/config.h +index 242b467..9911543 100644 +--- a/src/common/config.h ++++ b/src/common/config.h +@@ -130,7 +130,10 @@ public: + + // Set a configuration value. + // Metavariables will be expanded. +- int set_val(const char *key, const char *val, bool meta=true); ++ int set_val(const char *key, const char *val, bool meta=true, bool safe=true); ++ int set_val(const char *key, const string& s, bool meta=true, bool safe=true) { ++ return set_val(key, s.c_str(), meta, safe); ++ } + + // Get a configuration value. + // No metavariables will be returned (they will have already been expanded) +-- +1.9.3 + diff --git a/SPECS/ceph-common.spec b/SPECS/ceph-common.spec new file mode 100644 index 0000000..92fa026 --- /dev/null +++ b/SPECS/ceph-common.spec @@ -0,0 +1,640 @@ +%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%endif + +################################################################################# +# common +################################################################################# +Name: ceph-common +Version: 0.80.7 +Release: 2%{?dist} +Epoch: 1 +Summary: Ceph Common +License: GPLv2 +Group: System Environment/Base +URL: http://ceph.com/ +# We are interested in x86_64 and aarch64 only +ExclusiveArch: x86_64 aarch64 +Source0: http://ceph.com/download/ceph-%{version}.tar.bz2 +Patch1: 0001-google-.h-gperftools-header-files-were-deprecated-in.patch +Patch2: 0002-ceph_test_librbd_fsx-no-longer-need-Wno-format-remov.patch +Patch3: 0003-Limit-the-include-scope-do-not-indirectly-include-le.patch +Patch4: 0004-Introduce-enable-disable-server-option.patch +Patch5: 0005-os-KeyValueDB-generic-create-test_init.patch +Patch6: 0006-os-KeyValueDB-make-compaction-interface-generic.patch +Patch7: 0007-mon-MonitorDBStore-uninline-init_options.patch +Patch8: 0008-mon-MonitorDBStore-use-generic-KeyValueDB-create.patch +Patch9: 0009-config-allow-unsafe-setting-of-config-values.patch +Requires: librbd1 = %{epoch}:%{version}-%{release} +Requires: librados2 = %{epoch}:%{version}-%{release} +Requires: python-rbd = %{epoch}:%{version}-%{release} +Requires: python-rados = %{epoch}:%{version}-%{release} +Requires: python +Requires: python-argparse +Requires: python-requests +%if ! ( 0%{?rhel} && 0%{?rhel} <= 6 ) +Requires: xfsprogs +%endif +Requires: cryptsetup +Requires: parted +Requires: util-linux +%ifnarch s390 s390x +Requires: hdparm +%endif +# For initscript +Requires: redhat-lsb-core +Requires(post): binutils +BuildRequires: make +BuildRequires: gcc-c++ +BuildRequires: libtool +BuildRequires: boost-devel +BuildRequires: bzip2-devel +BuildRequires: libedit-devel +BuildRequires: perl +BuildRequires: gdbm +BuildRequires: pkgconfig +BuildRequires: python +BuildRequires: python-nose +BuildRequires: python-argparse +BuildRequires: libaio-devel +BuildRequires: libcurl-devel +BuildRequires: libxml2-devel +BuildRequires: libuuid-devel +BuildRequires: libblkid-devel >= 2.17 +BuildRequires: libudev-devel +%if ! ( 0%{?rhel} && 0%{?rhel} <= 6 ) +BuildRequires: xfsprogs-devel +%endif +# No yasm dependency for now, it causes selinux issues +#BuildRequires: yasm + +################################################################################# +# specific +################################################################################# +%if ! 0%{?rhel} +BuildRequires: sharutils +%endif + +Requires: gdisk +BuildRequires: nss-devel +BuildRequires: keyutils-libs-devel +Requires: gdisk +Requires(post): chkconfig +Requires(preun):chkconfig +Requires(preun):initscripts + +################################################################################# +# obsoletes +################################################################################# +# We need to obsolete and provide python-ceph with this package +# We moved ceph_argparse.py from python-ceph to ceph-common when +# we split python-ceph, ceph-common needs to obsolete python-ceph +# as well, it also provides python-ceph via dependencies +Obsoletes: python-ceph +Provides: python-ceph + +%description +Common utilities to mount and interact with a ceph storage cluster. + + +################################################################################# +# packages +################################################################################# +%package -n librados2 +Summary: RADOS distributed object store client library +Group: System Environment/Libraries +License: LGPL-2.0 +Obsoletes: ceph-libs +%description -n librados2 +RADOS is a reliable, autonomic distributed object storage cluster +developed as part of the Ceph distributed storage system. This is a +shared library allowing applications to access the distributed object +store using a simple file-like interface. + +%package -n librados2-devel +Summary: RADOS headers +Group: Development/Libraries +License: LGPL-2.0 +Requires: librados2 = %{epoch}:%{version}-%{release} +Obsoletes: ceph-devel +%description -n librados2-devel +This package contains libraries and headers needed to develop programs +that use RADOS object store. + +%package -n python-rados +Summary: Python libraries for the RADOS object store +Group: System Environment/Libraries +License: LGPL-2.0 +Requires: librados2 = %{epoch}:%{version}-%{release} +Obsoletes: python-ceph +%description -n python-rados +This package contains Python libraries for interacting with Cephs RADOS +object store. + +%package -n librbd1 +Summary: RADOS block device client library +Group: System Environment/Libraries +License: LGPL-2.0 +Requires: librados2 = %{epoch}:%{version}-%{release} +Obsoletes: ceph-libs +%description -n librbd1 +RBD is a block device striped across multiple distributed objects in +RADOS, a reliable, autonomic distributed object storage cluster +developed as part of the Ceph distributed storage system. This is a +shared library allowing applications to manage these block devices. + +%package -n librbd1-devel +Summary: RADOS block device headers +Group: Development/Libraries +License: LGPL-2.0 +Requires: librbd1 = %{epoch}:%{version}-%{release} +Requires: librados2-devel = %{epoch}:%{version}-%{release} +Obsoletes: ceph-devel +%description -n librbd1-devel +This package contains libraries and headers needed to develop programs +that use RADOS block device. + +%package -n python-rbd +Summary: Python libraries for the RADOS block device +Group: System Environment/Libraries +License: LGPL-2.0 +Requires: librbd1 = %{epoch}:%{version}-%{release} +Requires: python-rados = %{epoch}:%{version}-%{release} +Obsoletes: python-ceph +%description -n python-rbd +This package contains Python libraries for interacting with Cephs RADOS +block device. + +################################################################################# +# common +################################################################################# +%prep +%setup -q -n ceph-%{version} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 + +%build +./autogen.sh + +%if ( 0%{?rhel} && 0%{?rhel} <= 6) +MY_CONF_OPT="--without-libxfs" +%else +MY_CONF_OPT="" +%endif + +# Do not build server part of the project +# Do not use gperftools (tcmalloc) on rhel +# No need to build fuse, rest-bench radosgw and ocf pkgs so far +# Use nss instead of cryptopp library +MY_CONF_OPT="$MY_CONF_OPT --disable-server --without-libatomic-ops --without-tcmalloc --without-radosgw --without-rest-bench --without-fuse --without-ocf --without-cryptopp --with-nss" + +export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'` + +%{configure} --prefix=/usr \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --docdir=%{_docdir}/ceph \ + $MY_CONF_OPT \ + CFLAGS="$RPM_OPT_FLAGS $EXTRA_CFLAGS" \ + CXXFLAGS="$RPM_OPT_FLAGS $EXTRA_CFLAGS" \ + LDFLAGS="$EXTRA_LDFLAGS" + +make %{_smp_mflags} + +%install +make DESTDIR=$RPM_BUILD_ROOT install +find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' +find $RPM_BUILD_ROOT -type f -name "*.a" -exec rm -f {} ';' +install -D src/init-rbdmap $RPM_BUILD_ROOT%{_initrddir}/rbdmap +install -D src/rbdmap $RPM_BUILD_ROOT%{_sysconfdir}/ceph/rbdmap +rm -f $RPM_BUILD_ROOT%{_docdir}/ceph/sample.ceph.conf +rm -f $RPM_BUILD_ROOT%{_docdir}/ceph/sample.fetch_config +rm -f $RPM_BUILD_ROOT%{python_sitelib}/cephfs.py* +rm -rf $RPM_BUILD_ROOT%{_includedir}/cephfs +rm -f $RPM_BUILD_ROOT%{_libdir}/libcephfs.so +rm -f $RPM_BUILD_ROOT%{_libdir}/libcephfs.so.* + +# udev rules +%if 0%{?rhel} >= 7 || 0%{?fedora} +install -m 0644 -D udev/50-rbd.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/50-rbd.rules +%else +install -m 0644 -D udev/50-rbd.rules $RPM_BUILD_ROOT/lib/udev/rules.d/50-rbd.rules +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + + +################################################################################# +# files +################################################################################# +%files +%defattr(-,root,root,-) +%{_bindir}/ceph +%{_bindir}/ceph-authtool +%{_bindir}/ceph-conf +%{_bindir}/ceph-dencoder +%{_bindir}/ceph-syn +%{_bindir}/ceph-crush-location +%{_bindir}/rados +%{_bindir}/rbd +%{_bindir}/ceph-post-file +%{_bindir}/ceph-brag +%{_mandir}/man8/ceph.8* +%{_mandir}/man8/ceph-authtool.8* +%{_mandir}/man8/ceph-conf.8* +%{_mandir}/man8/ceph-dencoder.8* +%{_mandir}/man8/ceph-syn.8* +%{_mandir}/man8/rados.8* +%{_mandir}/man8/rbd.8* +%{_mandir}/man8/ceph-post-file.8* +%{_datadir}/ceph/known_hosts_drop.ceph.com +%{_datadir}/ceph/id_dsa_drop.ceph.com +%{_datadir}/ceph/id_dsa_drop.ceph.com.pub +%dir %{_sysconfdir}/ceph/ +%dir %{_localstatedir}/log/ceph/ +%config %{_sysconfdir}/bash_completion.d/ceph +%config %{_sysconfdir}/bash_completion.d/rados +%config %{_sysconfdir}/bash_completion.d/rbd +%config(noreplace) %{_sysconfdir}/ceph/rbdmap +%{_initrddir}/rbdmap +%{python_sitelib}/ceph_argparse.py* + +%postun +# Package removal cleanup +if [ "$1" -eq "0" ] ; then + rm -rf /var/log/ceph + rm -rf /etc/ceph +fi + +################################################################################# +%files -n librados2 +%defattr(-,root,root,-) +%{_libdir}/librados.so.* + +%post -n librados2 +/sbin/ldconfig + +%postun -n librados2 +/sbin/ldconfig + +################################################################################# +%files -n librados2-devel +%defattr(-,root,root,-) +%dir %{_includedir}/rados +%{_includedir}/rados/librados.h +%{_includedir}/rados/librados.hpp +%{_includedir}/rados/buffer.h +%{_includedir}/rados/page.h +%{_includedir}/rados/crc32c.h +%{_includedir}/rados/rados_types.h +%{_includedir}/rados/rados_types.hpp +%{_includedir}/rados/memory.h +%{_libdir}/librados.so + +################################################################################# +%files -n librbd1 +%defattr(-,root,root,-) +%{_libdir}/librbd.so.* +%if 0%{?rhel} >= 7 || 0%{?fedora} +/usr/lib/udev/rules.d/50-rbd.rules +%else +/lib/udev/rules.d/50-rbd.rules +%endif + +%post -n librbd1 +/sbin/ldconfig + +%postun -n librbd1 +/sbin/ldconfig + +################################################################################# +%files -n librbd1-devel +%defattr(-,root,root,-) +%dir %{_includedir}/rbd +%{_includedir}/rbd/librbd.h +%{_includedir}/rbd/librbd.hpp +%{_includedir}/rbd/features.h +%{_libdir}/librbd.so + +################################################################################# +%files -n python-rados +%defattr(-,root,root,-) +%{python_sitelib}/rados.py* + +################################################################################# +%files -n python-rbd +%defattr(-,root,root,-) +%{python_sitelib}/rbd.py* + +%changelog +* Fri Nov 21 2014 Boris Ranto - 1:0.80.7-2 +- We need to obsolete and provide python-ceph by ceph-common + +* Thu Oct 16 2014 Boris Ranto - 1:0.80.7-1 +- Rebase to latest upstream version + +* Mon Oct 13 2014 Boris Ranto - 1:0.80.6-4 +- fix the typo in librados-devel vs librados2-devel dependency + +* Thu Oct 9 2014 Boris Ranto - 1:0.80.6-3 +- split the python-ceph and ceph-devel packages to properly fix the + 'disable cephfs' issue + +* Wed Oct 8 2014 Boris Ranto - 1:0.80.6-2 +- Do not package cephfs files + +* Tue Oct 7 2014 Boris Ranto - 1:0.80.6-1 +- Rebase to latest stable upstream version +- Remove libatomic_ops dependency + +* Wed Oct 1 2014 Boris Ranto - 1:0.80.5-13 +- Remove python-flask dependency + +* Wed Sep 24 2014 Boris Ranto - 1:0.80.5-12 +- Fix the license field + +* Wed Sep 24 2014 Boris Ranto - 1:0.80.5-11 +- First attempt to build rhel 7 ceph packages + +* Tue Sep 9 2014 Dan Horák - 1:0.80.5-10 +- update Requires for s390(x) + +* Wed Sep 3 2014 Boris Ranto - 1:0.80.5-9 +- Symlink librd.so.1 to /usr/lib64/qemu only on rhel6+ x86_64 (1136811) + +* Thu Aug 21 2014 Boris Ranto - 1:0.80.5-8 +- Revert the previous change +- Fix bz 1118504, second attempt (yasm appears to be the package that caused this + +* Wed Aug 20 2014 Boris Ranto - 1:0.80.5-7 +- Several more merges from file to try to fix the selinux issue (1118504) + +* Sun Aug 17 2014 Kalev Lember - 1:0.80.5-6 +- Obsolete ceph-libcephfs + +* Sat Aug 16 2014 Boris Ranto - 1:0.80.5-5 +- Do not require xfsprogs/xfsprogs-devel for el6 +- Require gperftools-devel for non-ppc*/s390* architectures only +- Do not require junit -- no need to build libcephfs-test.jar +- Build without libxfs for el6 +- Build without tcmalloc for ppc*/s390* architectures +- Location of mkcephfs must depend on a rhel release +- Use epoch in the Requires fields [1130700] + +* Sat Aug 16 2014 Boris Ranto - 1:0.80.5-4 +- Use the proper version name in Obsoletes + +* Fri Aug 15 2014 Fedora Release Engineering - 1:0.80.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Boris Ranto - 1:0.80.5-2 +- Add the arm pthread hack + +* Fri Aug 15 2014 Boris Ranto - 1:0.80.5-1 +- Bump the Epoch, we need to keep the latest stable, not development, + ceph version in fedora +- Use the upstream spec file with the ceph-libs split +- Add libs-compat subpackage [1116546] +- use fedora in rhel 7 checks +- obsolete libcephfs [1116614] +- depend on redhat-lsb-core for the initscript [1108696] + +* Wed Aug 13 2014 Kalev Lember - 0.81.0-6 +- Add obsoletes to keep the upgrade path working (#1118510) + +* Mon Jul 7 2014 Kaleb S. KEITHLEY - 0.81.0-5 +- revert to old spec until after f21 branch + +* Fri Jul 4 2014 Kaleb S. KEITHLEY +- temporary exclude f21/armv7hl. N.B. it builds fine on f20/armv7hl. + +* Fri Jul 4 2014 Kaleb S. KEITHLEY - 0.81.0-4 +- upstream ceph.spec file + +* Tue Jul 1 2014 Kaleb S. KEITHLEY - 0.81.0-3 +- upstream ceph.spec file + +* Sat Jun 07 2014 Fedora Release Engineering - 0.81.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Jun 5 2014 Kaleb S. KEITHLEY +- el6 ppc64 likewise for tcmalloc, merge from origin/el6 + +* Thu Jun 5 2014 Kaleb S. KEITHLEY +- el6 ppc64 does not have gperftools, merge from origin/el6 + +* Thu Jun 5 2014 Kaleb S. KEITHLEY - 0.81.0-1 +- ceph-0.81.0 + +* Wed Jun 4 2014 Peter Robinson 0.80.1-5 +- gperftools now available on aarch64/ppc64 + +* Fri May 23 2014 Petr Machata - 0.80.1-4 +- Rebuild for boost 1.55.0 + +* Fri May 23 2014 David Tardon - 0.80.1-3 +- rebuild for boost 1.55.0 + +* Wed May 14 2014 Kaleb S. KEITHLEY - 0.80.1-2 +- build epel-6 +- exclude %%{_libdir}/ceph/erasure-code in base package + +* Tue May 13 2014 Kaleb S. KEITHLEY - 0.80.1-1 +- Update to latest stable upstream release, BZ 1095201 +- PIE, _hardened_build, BZ 955174 + +* Thu Feb 06 2014 Ken Dreyer - 0.72.2-2 +- Move plugins from -devel into -libs package (#891993). Thanks Michael + Schwendt. + +* Mon Jan 06 2014 Ken Dreyer 0.72.2-1 +- Update to latest stable upstream release +- Use HTTPS for URLs +- Submit Automake 1.12 patch upstream +- Move unversioned shared libs from ceph-libs into ceph-devel + +* Wed Dec 18 2013 Marcin Juszkiewicz 0.67.3-4 +- build without tcmalloc on aarch64 (no gperftools) + +* Sat Nov 30 2013 Peter Robinson 0.67.3-3 +- gperftools not currently available on aarch64 + +* Mon Oct 07 2013 Dan Horák - 0.67.3-2 +- fix build on non-x86_64 64-bit arches + +* Wed Sep 11 2013 Josef Bacik - 0.67.3-1 +- update to 0.67.3 + +* Wed Sep 11 2013 Michael Schwendt - 0.61.7-3 +- let base package include all its documentation files via %%doc magic, + so for Fedora 20 Unversioned Docdirs no files are included accidentally +- include the sample config files again (instead of just an empty docdir + that has been added for #846735) +- don't include librbd.so.1 also in -devel package (#1003202) +- move one misplaced rados plugin from -devel into -libs package (#891993) +- include missing directories in -devel and -libs packages +- move librados-config into the -devel pkg where its manual page is, too +- add %%_isa to subpackage dependencies +- don't use %%defattr anymore +- add V=1 to make invocation for verbose build output + +* Wed Jul 31 2013 Peter Robinson 0.61.7-2 +- re-enable tmalloc on arm now gperftools is fixed + +* Mon Jul 29 2013 Josef Bacik - 0.61.7-1 +- Update to 0.61.7 + +* Sat Jul 27 2013 pmachata@redhat.com - 0.56.4-2 +- Rebuild for boost 1.54.0 + +* Fri Mar 29 2013 Josef Bacik - 0.56.4-1 +- Update to 0.56.4 +- Add upstream d02340d90c9d30d44c962bea7171db3fe3bfba8e to fix logrotate + +* Wed Feb 20 2013 Josef Bacik - 0.56.3-1 +- Update to 0.56.3 + +* Mon Feb 11 2013 Richard W.M. Jones - 0.53-2 +- Rebuilt to try to fix boost dependency problem in Rawhide. + +* Thu Nov 1 2012 Josef Bacik - 0.53-1 +- Update to 0.53 + +* Mon Sep 24 2012 Jonathan Dieter - 0.51-3 +- Fix automake 1.12 error +- Rebuild after buildroot was messed up + +* Tue Sep 18 2012 Jonathan Dieter - 0.51-2 +- Use system leveldb + +* Fri Sep 07 2012 David Nalley - 0.51-1 +- Updating to 0.51 +- Updated url and source url. + +* Wed Jul 18 2012 Fedora Release Engineering - 0.46-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed May 9 2012 Josef Bacik - 0.46-1 +- updated to upstream 0.46 +- broke out libcephfs (rhbz# 812975) + +* Mon Apr 23 2012 Dan Horák - 0.45-2 +- fix detection of C++11 atomic header + +* Thu Apr 12 2012 Josef Bacik - 0.45-1 +- updating to upstream 0.45 + +* Wed Apr 4 2012 Niels de Vos - 0.44-5 +- Add LDFLAGS=-lpthread on any ARM architecture +- Add CFLAGS=-DAO_USE_PTHREAD_DEFS on ARMv5tel + +* Mon Mar 26 2012 Dan Horák 0.44-4 +- gperftools not available also on ppc + +* Mon Mar 26 2012 Jonathan Dieter - 0.44-3 +- Remove unneeded patch + +* Sun Mar 25 2012 Jonathan Dieter - 0.44-2 +- Update to 0.44 +- Fix build problems + +* Mon Mar 5 2012 Jonathan Dieter - 0.43-1 +- Update to 0.43 +- Remove upstreamed compile fixes patch +- Remove obsoleted dump_pop patch + +* Tue Feb 28 2012 Fedora Release Engineering - 0.41-2 +- Rebuilt for c++ ABI breakage + +* Thu Feb 16 2012 Tom Callaway 0.41-1 +- update to 0.41 +- fix issues preventing build +- rebuild against gperftools + +* Sat Dec 03 2011 David Nalley 0.38-1 +- updating to upstream 0.39 + +* Sat Nov 05 2011 David Nalley 0.37-1 +- create /etc/ceph - bug 745462 +- upgrading to 0.37, fixing 745460, 691033 +- fixing various logrotate bugs 748930, 747101 + +* Fri Aug 19 2011 Dan Horák 0.31-4 +- google-perftools not available also on s390(x) + +* Mon Jul 25 2011 Karsten Hopp 0.31-3 +- build without tcmalloc on ppc64, BR google-perftools is not available there + +* Tue Jul 12 2011 Josef Bacik 0.31-2 +- Remove curl/types.h include since we don't use it anymore + +* Tue Jul 12 2011 Josef Bacik 0.31-1 +- Update to 0.31 + +* Tue Apr 5 2011 Josef Bacik 0.26-2 +- Add the compile fix patch + +* Tue Apr 5 2011 Josef Bacik 0.26 +- Update to 0.26 + +* Tue Mar 22 2011 Josef Bacik 0.25.1-1 +- Update to 0.25.1 + +* Tue Feb 08 2011 Fedora Release Engineering - 0.21.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Sep 29 2010 Steven Pritchard 0.21.3-1 +- Update to 0.21.3. + +* Mon Aug 30 2010 Steven Pritchard 0.21.2-1 +- Update to 0.21.2. + +* Thu Aug 26 2010 Steven Pritchard 0.21.1-1 +- Update to 0.21.1. +- Sample configs moved to /usr/share/doc/ceph/. +- Added cclass, rbd, and cclsinfo. +- Dropped mkmonfs and rbdtool. +- mkcephfs moved to /sbin. +- Add libcls_rbd.so. + +* Tue Jul 6 2010 Josef Bacik 0.20.2-1 +- update to 0.20.2 + +* Wed May 5 2010 Josef Bacik 0.20-1 +- update to 0.20 +- disable hadoop building +- remove all the test binaries properly + +* Fri Apr 30 2010 Sage Weil 0.19.1-5 +- Remove java deps (no need to build hadoop by default) +- Include all required librados helpers +- Include fetch_config sample +- Include rbdtool +- Remove misc debugging, test binaries + +* Fri Apr 30 2010 Josef Bacik 0.19.1-4 +- Add java-devel and java tricks to get hadoop to build + +* Mon Apr 26 2010 Josef Bacik 0.19.1-3 +- Move the rados and cauthtool man pages into the base package + +* Sun Apr 25 2010 Jonathan Dieter 0.19.1-2 +- Add missing libhadoopcephfs.so* to file list +- Add COPYING to all subpackages +- Fix ownership of /usr/lib[64]/ceph +- Enhance description of fuse client + +* Tue Apr 20 2010 Josef Bacik 0.19.1-1 +- Update to 0.19.1 + +* Mon Feb 8 2010 Josef Bacik 0.18-1 +- Initial spec file creation, based on the template provided in the ceph src