├── .gitignore ├── README.md └── ceph-client.rb /.gitignore: -------------------------------------------------------------------------------- 1 | # Bottle files 2 | *.tar.gz 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ceph client libraries for Homebrew 2 | 3 | This is a [Ceph][] tap for [Homebrew][]. 4 | 5 | Mac users can use these formulae to easily install and update Ceph libraries. 6 | 7 | ## Initial setup 8 | 9 | If you don't have Homebrew, install it from their [homepage][homebrew]. 10 | 11 | Then, add this tap: 12 | 13 | ``` 14 | brew tap mulbc/ceph-client 15 | ``` 16 | 17 | ## Installing 18 | 19 | To install the Ceph client libraries: 20 | 21 | ``` 22 | brew install ceph-client 23 | ``` 24 | 25 | ## Updating 26 | 27 | Simply run: 28 | 29 | ``` 30 | brew update 31 | brew upgrade ceph-client 32 | ``` 33 | 34 | [homebrew]: http://brew.sh/ 35 | [ceph]: https://ceph.com/ 36 | -------------------------------------------------------------------------------- /ceph-client.rb: -------------------------------------------------------------------------------- 1 | class CephClient < Formula 2 | desc "Ceph client tools and libraries" 3 | homepage "https://ceph.com" 4 | url "https://download.ceph.com/tarballs/ceph-17.2.5.tar.gz" 5 | sha256 "362269c147913af874b2249a46846b0e6f82d2ceb50af46222b6ddec9991b29a" 6 | revision 1 7 | 8 | bottle do 9 | rebuild 1 10 | root_url "https://github.com/mulbc/homebrew-ceph-client/releases/download/quincy-17.2.5-1" 11 | sha256 cellar: :any, arm64_ventura: "b6e30275e0c5012874b73130fd0119b7f40f8180f1c6b54e3abb1f8bf8680ed5" 12 | end 13 | 14 | # depends_on "osxfuse" 15 | depends_on "boost@1.76" 16 | depends_on "openssl" => :build 17 | depends_on "cmake" => :build 18 | depends_on "ninja" => :build 19 | depends_on "cython" => :build 20 | depends_on "leveldb" => :build 21 | depends_on "nss" 22 | depends_on "pkg-config" => :build 23 | depends_on "python@3.11" 24 | depends_on "sphinx-doc" => :build 25 | depends_on "yasm" 26 | def caveats 27 | <<-EOS.undent 28 | macFUSE must be installed prior to building this formula. macFUSE is also necessary 29 | if you plan to use the FUSE support of CephFS. You can either install macFUSE from 30 | https://osxfuse.github.io or use the following command: 31 | 32 | brew install --cask macfuse 33 | EOS 34 | end 35 | 36 | resource "prettytable" do 37 | url "https://files.pythonhosted.org/packages/cb/7d/7e6bc4bd4abc49e9f4f5c4773bb43d1615e4b476d108d1b527318b9c6521/prettytable-3.2.0.tar.gz" 38 | sha256 "ae7d96c64100543dc61662b40a28f3b03c0f94a503ed121c6fca2782c5816f81" 39 | end 40 | 41 | resource "PyYAML" do 42 | url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz" 43 | sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" 44 | end 45 | 46 | resource "wcwidth" do 47 | url "https://files.pythonhosted.org/packages/89/38/459b727c381504f361832b9e5ace19966de1a235d73cdbdea91c771a1155/wcwidth-0.2.5.tar.gz" 48 | sha256 "c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83" 49 | end 50 | 51 | patch :DATA 52 | 53 | def install 54 | ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["nss"].opt_lib}/pkgconfig" 55 | ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["openssl"].opt_lib}/pkgconfig" 56 | ENV.prepend_path "PKG_CONFIG_PATH", "/usr/local/lib/pkgconfig" 57 | xy = Language::Python.major_minor_version "python3" 58 | ENV.prepend_create_path "PYTHONPATH", "#{Formula["cython"].opt_libexec}/lib/python#{xy}/site-packages" 59 | ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" 60 | resources.each do |r| 61 | r.stage do 62 | system "python3", *Language::Python.setup_install_args(libexec/"vendor") 63 | end 64 | end 65 | 66 | args = %W[ 67 | -DDIAGNOSTICS_COLOR=always 68 | -DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix} 69 | -DWITH_BABELTRACE=OFF 70 | -DWITH_BLUESTORE=OFF 71 | -DWITH_CCACHE=OFF 72 | -DWITH_CEPHFS=OFF 73 | -DWITH_KRBD=OFF 74 | -DWITH_LIBCEPHFS=ON 75 | -DWITH_LTTNG=OFF 76 | -DWITH_LZ4=OFF 77 | -DWITH_MANPAGE=ON 78 | -DWITH_MGR=OFF 79 | -DWITH_MGR_DASHBOARD_FRONTEND=OFF 80 | -DWITH_PYTHON3=3.11 81 | -DWITH_RADOSGW=OFF 82 | -DWITH_RDMA=OFF 83 | -DWITH_SPDK=OFF 84 | -DWITH_SYSTEM_BOOST=ON 85 | -DWITH_SYSTEMD=OFF 86 | -DWITH_TESTS=OFF 87 | -DWITH_XFS=OFF 88 | ] 89 | targets = %w[ 90 | rados 91 | rbd 92 | cephfs 93 | ceph-conf 94 | ceph-fuse 95 | manpages 96 | cython_rados 97 | cython_rbd 98 | ] 99 | mkdir "build" do 100 | system "cmake", "-G", "Ninja", "..", *args, *std_cmake_args 101 | system "ninja", *targets 102 | executables = %w[ 103 | bin/rados 104 | bin/rbd 105 | bin/ceph-fuse 106 | ] 107 | executables.each do |file| 108 | MachO.open(file).linked_dylibs.each do |dylib| 109 | unless dylib.start_with?("/tmp/") 110 | next 111 | end 112 | MachO::Tools.change_install_name(file, dylib, "#{lib}/#{dylib.split('/')[-1]}") 113 | end 114 | end 115 | %w[ 116 | ceph 117 | ceph-conf 118 | ceph-fuse 119 | rados 120 | rbd 121 | ].each do |file| 122 | bin.install "bin/#{file}" 123 | end 124 | %w[ 125 | ceph-common.2 126 | ceph-common 127 | rados.2.0.0 128 | rados.2 129 | rados 130 | radosstriper.1.0.0 131 | radosstriper.1 132 | radosstriper 133 | rbd.1.17.0 134 | rbd.1 135 | rbd 136 | cephfs.2.0.0 137 | cephfs.2 138 | cephfs 139 | ].each do |name| 140 | lib.install "lib/lib#{name}.dylib" 141 | end 142 | %w[ 143 | ceph-conf 144 | ceph-fuse 145 | ceph 146 | librados-config 147 | rados 148 | rbd 149 | ].each do |name| 150 | man8.install "doc/man/#{name}.8" 151 | end 152 | system "ninja", "src/pybind/install", "src/include/install" 153 | end 154 | 155 | bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) 156 | %w[ 157 | ceph-conf 158 | ceph-fuse 159 | rados 160 | rbd 161 | ].each do |name| 162 | system "install_name_tool", "-add_rpath", "/opt/homebrew/lib", "#{libexec}/bin/#{name}" 163 | end 164 | end 165 | 166 | def caveats; <<~EOS 167 | The fuse version shipped with osxfuse is too old to access the 168 | supplementary group IDs in cephfs. 169 | Thus you need to add this to your ceph.conf to avoid errors: 170 | 171 | [client] 172 | fuse_set_user_groups = false 173 | 174 | EOS 175 | end 176 | 177 | test do 178 | system "#{bin}/ceph", "--version" 179 | system "#{bin}/ceph-fuse", "--version" 180 | system "#{bin}/rbd", "--version" 181 | system "#{bin}/rados", "--version" 182 | system "python", "-c", "import rados" 183 | system "python", "-c", "import rbd" 184 | end 185 | end 186 | 187 | __END__ 188 | diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake 189 | index 9d66ae979a6..eabf22bf174 100644 190 | --- a/cmake/modules/Distutils.cmake 191 | +++ b/cmake/modules/Distutils.cmake 192 | @@ -93,11 +93,9 @@ function(distutils_add_cython_module target name src) 193 | OUTPUT ${output_dir}/${name}${ext_suffix} 194 | COMMAND 195 | env 196 | - CC="${PY_CC}" 197 | CFLAGS="${PY_CFLAGS}" 198 | CPPFLAGS="${PY_CPPFLAGS}" 199 | CXX="${PY_CXX}" 200 | - LDSHARED="${PY_LDSHARED}" 201 | OPT=\"-DNDEBUG -g -fwrapv -O2 -w\" 202 | LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} 203 | CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR} 204 | @@ -125,8 +123,6 @@ function(distutils_install_cython_module name) 205 | set(maybe_verbose --verbose) 206 | endif() 207 | install(CODE " 208 | - set(ENV{CC} \"${PY_CC}\") 209 | - set(ENV{LDSHARED} \"${PY_LDSHARED}\") 210 | set(ENV{CPPFLAGS} \"-iquote${CMAKE_SOURCE_DIR}/src/include 211 | -D'void0=dead_function\(void\)' \ 212 | -D'__Pyx_check_single_interpreter\(ARG\)=ARG\#\#0' \ 213 | @@ -135,7 +131,7 @@ function(distutils_install_cython_module name) 214 | set(ENV{CYTHON_BUILD_DIR} \"${CMAKE_CURRENT_BINARY_DIR}\") 215 | set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\") 216 | 217 | - set(options --prefix=${CMAKE_INSTALL_PREFIX}) 218 | + set(options --prefix=${CMAKE_INSTALL_PREFIX} --install-lib=${CMAKE_INSTALL_PREFIX}/lib/python3.11/site-packages) 219 | if(DEFINED ENV{DESTDIR}) 220 | if(EXISTS /etc/debian_version) 221 | list(APPEND options --install-layout=deb) 222 | --------------------------------------------------------------------------------