From: Loic Dachary Date: Tue, 25 Nov 2014 16:25:26 +0000 (+0100) Subject: documentation: replace deps.{deb,rpm}.txt with scripts X-Git-Tag: v0.90~20^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=06593813af2302584828bb743049164e70c6f67b;p=ceph.git documentation: replace deps.{deb,rpm}.txt with scripts install-deps.sh installs the dependencies based on the content of debian/control (if apt-get is found) or ceph.spec.in (if yum is found). The manually maintained list of dependencies for deb based operating systems (deps.deb.txt) and rpm based operating systems (deps.rpm.txt) are deprecated. http://tracker.ceph.com/issues/10175 Fixes: #10175 Signed-off-by: Loic Dachary --- diff --git a/Makefile.am b/Makefile.am index 30ceaf43cfd1..621fd59b5c39 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = gnu ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = autogen.sh ceph.spec.in ceph.spec +EXTRA_DIST = autogen.sh ceph.spec.in ceph.spec install-deps.sh # the "." here makes sure check-local builds gtest before it is used SUBDIRS = . src man @@ -54,11 +54,7 @@ clean-local: # autoconf to be happy. These commands should be run manually to # bootstrap. install-deps: - if test -x /usr/bin/apt-get; then \ - sudo apt-get -y --no-install-recommends install `cat deps.deb.txt`; \ - else \ - sudo yum -y install `cat deps.rpm.txt`; \ - fi + ./install-deps.sh dist-hook: # Generates the full list of contributors diff --git a/README.md b/README.md index 76a190cf8efc..3661d0964fd4 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ Build Prerequisites debian-based ------------ -The list of debian package dependencies can be found in deps.deb.txt: +The list of debian packages dependencies can be installed with: - sudo apt-get install `cat deps.deb.txt` + ./install-deps.sh Note: libsnappy-dev and libleveldb-dev are not available upstream for natty, oneiric, and squeeze. Backports for Ceph can be found at @@ -40,9 +40,9 @@ ceph.com/debian-leveldb. rpm-based --------- -The list of RPM package dependencies can be found in deps.rpm.txt: +The list of RPM packages dependencies can be installed with: - sudo yum install `cat deps.rpm.txt` + ./install-deps.sh Building Ceph ============= diff --git a/deps.deb.txt b/deps.deb.txt deleted file mode 100644 index e671569e6bcc..000000000000 --- a/deps.deb.txt +++ /dev/null @@ -1,41 +0,0 @@ -autoconf -automake -autotools-dev -debhelper -default-jdk -g++ -gcc -git -javahelper -junit4 -libaio-dev -libatomic-ops-dev -libblkid-dev -libboost-dev -libboost-program-options-dev -libboost-system-dev -libboost-thread-dev -libbz2-dev -libcurl4-gnutls-dev -libedit-dev -libexpat1-dev -libfcgi-dev -libfuse-dev -libgoogle-perftools-dev -libkeyutils-dev -libleveldb-dev -libnss3-dev -libsnappy-dev -libtool -libudev-dev -libxml2-dev -make -pkg-config -python -python-argparse -python-flask -python-nose -uuid-dev -uuid-runtime -xfslibs-dev -yasm diff --git a/deps.rpm.txt b/deps.rpm.txt deleted file mode 100644 index dcfb51557e85..000000000000 --- a/deps.rpm.txt +++ /dev/null @@ -1,31 +0,0 @@ -autoconf -automake -boost-devel -bzip2-devel -cryptopp-devel -expat-devel -fcgi-devel -fuse-devel -gcc -gcc-c++ -gperftools-devel -keyutils-libs-devel -leveldb-devel -libaio-devel -libatomic_ops-devel -libblkid-devel -libbz2-devel -libcurl-devel -libedit-devel -libtool -libuuid-devel -make -nss-devel -python-argparse -python-flask -python-nose -python-virtualenv -snappy-devel -systemd-devel -xfsprogs-devel -yasm diff --git a/doc/install/build-ceph.rst b/doc/install/build-ceph.rst index 285fd9504599..d5bcae283d1c 100644 --- a/doc/install/build-ceph.rst +++ b/doc/install/build-ceph.rst @@ -14,93 +14,12 @@ Build Prerequisites Linux/Unix distribution. Before you can build Ceph source code, you need to install several libraries -and tools. Ceph provides ``autoconf`` and ``automake`` scripts to get you -started quickly. Ceph build scripts depend on the following: - -- ``autotools-dev`` -- ``autoconf`` -- ``automake`` -- ``cdbs`` -- ``gcc`` -- ``g++`` -- ``git`` -- ``libboost-dev`` -- ``libedit-dev`` -- ``libssl-dev`` -- ``libtool`` -- ``libfcgi`` -- ``libfcgi-dev`` -- ``libfuse-dev`` -- ``linux-kernel-headers`` -- ``libcrypto++-dev`` -- ``libcrypto++`` -- ``libexpat1-dev`` -- ``pkg-config`` -- ``libcurl4-gnutls-dev`` - -On Ubuntu, execute ``sudo apt-get install`` for each dependency that isn't -installed on your host. :: - - sudo apt-get install autoconf automake autotools-dev libbz2-dev debhelper default-jdk git javahelper junit4 libaio-dev libatomic-ops-dev libbabeltrace-ctf-dev libbabeltrace-dev libblkid-dev libboost-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libcurl4-gnutls-dev libedit-dev libexpat1-dev libfcgi-dev libfuse-dev libgoogle-perftools-dev libkeyutils-dev libleveldb-dev libnss3-dev libsnappy-dev liblttng-ust-dev libtool libudev-dev libxml2-dev pkg-config python python-argparse python-nose uuid-dev uuid-runtime xfslibs-dev yasm - -On Debian, execute ``aptitude install`` for each dependency that isn't -installed on your host. :: - - aptitude install autoconf automake autotools-dev libbz2-dev debhelper default-jdk git javahelper junit4 libaio-dev libatomic-ops-dev libbabeltrace-ctf-dev libbabeltrace-dev libblkid-dev libboost-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libcurl4-gnutls-dev libedit-dev libexpat1-dev libfcgi-dev libfuse-dev libgoogle-perftools-dev libkeyutils-dev libleveldb-dev libnss3-dev libsnappy-dev liblttng-ust-dev libtool libudev-dev libxml2-dev pkg-config python python-argparse python-nose uuid-dev uuid-runtime xfslibs-dev yasm - -.. note:: Some distributions that support Google's memory profiler tool may use - a different package name (e.g., ``libgoogle-perftools4``). - -Ubuntu ------- - -- ``uuid-dev`` -- ``libkeyutils-dev`` -- ``libgoogle-perftools-dev`` -- ``libatomic-ops-dev`` -- ``libaio-dev`` -- ``libgdata-common`` -- ``libgdata13`` -- ``libsnappy-dev`` -- ``libleveldb-dev`` - -Execute ``sudo apt-get install`` for each dependency that isn't installed on -your host. :: - - sudo apt-get install uuid-dev libkeyutils-dev libgoogle-perftools-dev libatomic-ops-dev libaio-dev libgdata-common libgdata13 libsnappy-dev libleveldb-dev - - -Debian ------- - -Alternatively, you may also install:: - - aptitude install fakeroot dpkg-dev - aptitude install debhelper cdbs libexpat1-dev libatomic-ops-dev +and tools:: -openSUSE 11.2 (and later) -------------------------- - -- ``boost-devel`` -- ``gcc-c++`` -- ``libedit-devel`` -- ``libopenssl-devel`` -- ``fuse-devel`` (optional) - -Execute ``zypper install`` for each dependency that isn't installed on your -host. :: - - zypper install boost-devel gcc-c++ libedit-devel libopenssl-devel fuse-devel - -Fedora 20 ---------- - -As root, run: - -:: - - yum install make automake autoconf boost-devel fuse-devel gcc-c++ libtool libuuid-devel libblkid-devel keyutils-libs-devel cryptopp-devel fcgi-devel libcurl-devel expat-devel gperftools-devel libedit-devel libatomic_ops-devel snappy-devel leveldb-devel libaio-devel xfsprogs-devel git libudev-devel + ./install-deps.sh +.. note:: Some distributions that support Google's memory profiler tool may use + a different package name (e.g., ``libgoogle-perftools4``). Build Ceph ========== diff --git a/install-deps.sh b/install-deps.sh new file mode 100755 index 000000000000..4785d0050137 --- /dev/null +++ b/install-deps.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Ceph distributed storage system +# +# Copyright (C) 2014 Red Hat +# +# Author: Loic Dachary +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +DIR=/tmp/install-deps.$$ +trap "rm -fr $DIR" EXIT +mkdir -p $DIR + +case $(lsb_release -si) in +Ubuntu|Debian|Devuan) + sudo apt-get install -y dpkg-dev + touch $DIR/status + packages=$(dpkg-checkbuilddeps --admindir=$DIR debian/control 2>&1 | \ + perl -p -e 's/.*Unmet build dependencies: *//;' \ + -e 's/build-essential:native/build-essential/;' \ + -e 's/\(.*?\)//g;' \ + -e 's/ +/\n/g;' | sort) + case $(lsb_release -sc) in + squeeze) + packages=$(echo $packages | perl -pe 's/\w*babeltrace\w*//g') + ;; + esac + sudo apt-get install -y $packages + ;; +CentOS|Fedora|SUSE*|RedHatEnterpriseServer) + case $(lsb_release -si) in + SUSE*) + sudo zypper -y yum-utils + ;; + *) + sudo yum install -y yum-utils + ;; + esac + sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec + sudo yum-builddep -y $DIR/ceph.spec + ;; +*) + echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually." + ;; +esac