summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdebian/rules238
1 files changed, 238 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 000000000..1f851aaa1
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,238 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+#export DH_VERBOSE=1
+export DESTDIR=$(CURDIR)/debian/tmp
+
+DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
+export DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
+# support ccache for faster build
+# cmake uses /usr/bin/c*
+ifeq (yes,$(findstring yes,$(shell test -L /usr/lib/ccache/c++ && test -L /usr/lib/ccache/cc && echo -n yes)))
+ extraopts += -DWITH_CCACHE=ON
+endif
+
+# try to save even more memory on some architectures
+# see #849657 for hints.
+# Reduce size of debug symbols to fix FTBFS due to the
+# 2GB/3GB address space limits on 32bit
+ifeq (32,$(DEB_HOST_ARCH_BITS))
+export DEB_CFLAGS_MAINT_APPEND = -g1 -Os
+export DEB_CXXFLAGS_MAINT_APPEND = -g1 -Os
+endif
+
+# we don't have NEON on armel.
+ifeq ($(DEB_HOST_ARCH),armel)
+ extraopts += -DHAVE_ARM_NEON=0
+endif
+
+# disable ceph-dencoder on 32bit except i386 to avoid g++ oom
+ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf hppa m68k mips mipsel powerpc sh4 x32))
+ extraopts += -DDISABLE_DENCODER=1
+endif
+
+ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes) $(DEB_HOST_ARCH), yes i386)
+ skip_packages = -Nceph -Nceph-base -Nceph-mds -Nceph-mgr -Nceph-mon -Nceph-osd
+endif
+
+# minimise needless linking and link to libatomic
+# The last is needed because long long atomic operations are not directly
+# supported by all processor architectures
+# The -Wl,--no-keep-memory should save memory but then will go slower. No choice,
+# as mipsel FTBFS.
+ifeq (32,$(DEB_HOST_ARCH_BITS))
+export DEB_LDFLAGS_MAINT_APPEND= -Wl,--as-needed -latomic -Wl,--no-keep-memory
+endif
+
+# Fix build with fmt 9
+export DEB_CXXFLAGS_MAINT_APPEND += -DFMT_DEPRECATED_OSTREAM
+
+# Enable hardening
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
+
+export DESTDIR=$(CURDIR)/debian/tmp
+
+export JAVA_HOME=/usr/lib/jvm/default-java
+## Set JAVAC to prevent FTBFS due to incorrect use of 'gcj' if found (see "m4/ac_prog_javac.m4").
+export JAVAC=javac
+
+extraopts += -DWITH_OCF=ON -DWITH_NSS=ON -DWITH_PYTHON3=ON -DWITH_DEBUG=ON
+extraopts += -DWITH_PYTHON2=OFF -DMGR_PYTHON_VERSION=3
+extraopts += -DWITH_PYTHON3=3
+extraopts += -DWITH_CEPHFS_JAVA=ON
+extraopts += -DWITH_CEPHFS_SHELL=ON
+extraopts += -DWITH_TESTS=OFF
+extraopts += -DWITH_SYSTEM_BOOST=ON
+extraopts += -DWITH_SYSTEM_LIBURING=ON
+extraopts += -DWITH_LTTNG=OFF -DWITH_EMBEDDED=OFF
+extraopts += -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib
+extraopts += -DWITH_MGR_DASHBOARD_FRONTEND=OFF
+extraopts += -DWITH_SYSTEMD=ON -DCEPH_SYSTEMD_ENV_DIR=/etc/default
+extraopts += -DCMAKE_INSTALL_SYSCONFDIR=/etc
+extraopts += -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR=/lib/systemd/system
+extraopts += -DWITH_RADOSGW_KAFKA_ENDPOINT=OFF
+extraopts += -DCMAKE_BUILD_TYPE=RelWithDebInfo
+extraopts += -DWITH_GRAFANA=ON
+extraopts += -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(CFLAGS)"
+extraopts += -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(CXXFLAGS)"
+
+ifneq (,$(findstring $(DEB_HOST_ARCH),amd64 arm64 ppc64el))
+extraopts += -DWITH_RBD_RWL=ON
+extraopts += -DWITH_RBD_SSD_CACHE=ON
+extraopts += -DWITH_SYSTEM_PMDK=ON
+extraopts += -DWITH_BLUESTORE_PMEM=ON
+extraopts += -DWITH_SPDK=ON
+else
+# Disable SPDK as it generates a build which is no compatible
+# with older CPU's which are still supported by Ubuntu.
+extraopts += -DWITH_SPDK=OFF
+endif
+
+# Enable crimson build on supported architectures
+ifneq (,$(findstring $(DEB_HOST_ARCH),amd64 arm64 ppc64el s390x))
+extraopts += -DWITH_SEASTAR=ON -DSeastar_CXX_FLAGS=-DSEASTAR_DEFAULT_ALLOCATOR
+endif
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ extraopts += -DBOOST_J=$(NUMJOBS)
+endif
+
+ifneq (,$(filter $(DEB_HOST_ARCH),ia64 m68k ppc64 sh4 sparc64 x32 alpha))
+ # beast depends on libboost_{context,coroutine} which is not supported on s390x
+ extraopts += -DWITH_BOOST_CONTEXT=OFF
+else
+ extraopts += -DWITH_BOOST_CONTEXT=ON
+endif
+
+# Disable SPDK as it generates a build which is no compatible
+# with older CPU's which are still supported by Ubuntu.
+extraopts += -DWITH_SPDK=OFF
+
+MAX_PARALLEL ?= $(shell ./debian/calc-max-parallel.sh)
+
+%:
+ dh $@ --buildsystem=cmake --with javahelper,python3 $(MAX_PARALLEL)
+
+override_dh_auto_configure:
+ env | sort
+ dh_auto_configure --buildsystem=cmake -- $(extraopts)
+# after trying to patch the various places where HAVE_ARM_NEON is used
+# the easiest way to get rid of it on armel seems to be to patch the cmake
+# cache file.
+ifeq ($(DEB_HOST_ARCH),armel)
+ sed 's,^HAVE_ARM_NEON.*,HAVE_ARM_NEON:INTERNAL=0,' -i obj-arm-linux-gnueabi/CMakeCache.txt
+endif
+
+override_dh_auto_install:
+ dh_auto_install --buildsystem=cmake --destdir=$(DESTDIR)
+ if [ ! -f $(DESTDIR)/usr/bin/ceph-dencoder ]; then \
+ cp debian/workarounds/ceph-dencoder-oom $(DESTDIR)/usr/bin/ceph-dencoder ;\
+ chmod 755 $(DESTDIR)/usr/bin/ceph-dencoder ;\
+ fi
+ install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules
+ install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap
+ install -D -m 644 etc/sysctl/90-ceph-osd.conf $(DESTDIR)/etc/sysctl.d/30-ceph-osd.conf
+ install -D -m 440 sudoers.d/ceph-smartctl $(DESTDIR)/etc/sudoers.d/ceph-smartctl
+ install -D -m 755 src/tools/rbd_nbd/rbd-nbd_quiesce $(DESTDIR)/usr/libexec/rbd-nbd/rbd-nbd_quiesce
+
+ install -m 755 src/cephadm/cephadm $(DESTDIR)/usr/sbin/cephadm
+
+ install -m 644 -D monitoring/ceph-mixin/prometheus_alerts.yml $(DESTDIR)/etc/prometheus/ceph/ceph_default_alerts.yml
+
+ # NOTE: ensure that any versioned erasure coding test code is dropped
+ # from the package install - package ships unversioned modules.
+ rm -f $(CURDIR)/debian/tmp/usr/lib/*/ceph/erasure-code/libec_*.so.*
+ find $(CURDIR)/debian/tmp/usr/lib/*/ceph/erasure-code -type l -delete || :
+ # avoid running out of disk space
+ rm -rf $(CURDIR)/obj-*-linux-gnu
+
+# doc/changelog is a directory, which confuses dh_installchangelogs
+override_dh_installchangelogs:
+ dh_installchangelogs --exclude doc/changelog
+
+override_dh_installlogrotate:
+ cp src/logrotate.conf debian/ceph-common.logrotate
+ dh_installlogrotate -pceph-common
+
+override_dh_installinit:
+ cp src/init-radosgw debian/radosgw.init
+ dh_installinit --no-start
+ dh_installinit -pceph-common --name=rbdmap --no-start
+ dh_installinit -pceph-base --name ceph --no-start
+ # install the systemd stuff manually since we have funny service names
+ # and need to update the paths in all of the files post install
+ # systemd:ceph-common
+ install -d -m0755 debian/ceph-common/usr/lib/tmpfiles.d
+ install -m 0644 -D systemd/ceph.tmpfiles.d debian/ceph-common/usr/lib/tmpfiles.d/ceph.conf
+ # NOTE(jamespage): Install previous ceph-mon service from packaging for upgrades
+ install -d -m0755 debian/ceph-mon/lib/systemd/system
+ install -m0644 debian/lib-systemd/system/ceph-mon.service debian/ceph-mon/lib/systemd/system
+
+override_dh_installsystemd:
+ # Ensure Debian/Ubuntu specific systemd units are NOT automatically enabled and started
+ # Enable systemd targets only
+ # Start systemd targets only
+ dh_installsystemd --no-stop-on-upgrade --no-restart-after-upgrade -Xceph-mon.service -Xceph-osd.service -X ceph-mds.service
+
+override_dh_strip:
+ dh_strip -pceph-mds --dbg-package=ceph-mds-dbg
+ dh_strip -pceph-fuse
+ dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg
+ dh_strip -pceph-mon --dbg-package=ceph-mon-dbg
+ dh_strip -pceph-osd --dbg-package=ceph-osd-dbg
+ dh_strip -pceph-base --dbg-package=ceph-base-dbg
+ dh_strip -pcephfs-mirror --dbg-package=cephfs-mirror-dbg
+ dh_strip -prbd-fuse --dbg-package=rbd-fuse-dbg
+ dh_strip -prbd-mirror --dbg-package=rbd-mirror-dbg
+ dh_strip -pceph-immutable-object-cache --dbg-package=ceph-immutable-object-cache-dbg
+ dh_strip -prbd-nbd --dbg-package=rbd-nbd-dbg
+ dh_strip -pceph-common --dbg-package=ceph-common-dbg
+ dh_strip -plibrados2 --dbg-package=librados2-dbg
+ dh_strip -plibsqlite3-mod-ceph --dbg-package=libsqlite3-mod-ceph-dbg
+ dh_strip -plibradosstriper1 --dbg-package=libradosstriper1-dbg
+ dh_strip -plibrbd1 --dbg-package=librbd1-dbg
+ dh_strip -plibcephfs2 --dbg-package=libcephfs2-dbg
+ dh_strip -plibrgw2 --dbg-package=librgw2-dbg
+ dh_strip -pradosgw --dbg-package=radosgw-dbg
+ dh_strip -pceph-test
+
+ # No -dbg packages for python3 bindings.
+ dh_strip -ppython3-cephfs
+ dh_strip -ppython3-rados
+ dh_strip -ppython3-rbd
+ dh_strip -ppython3-rgw
+
+ dh_strip -plibcephfs-jni
+ dh_strip -plibrados-dev
+
+override_dh_makeshlibs:
+ # exclude jni libraries in libcephfs-jni to avoid pointless ldconfig
+ # calls in maintainer scripts; exclude private erasure-code plugins.
+ dh_makeshlibs -V -X/usr/lib/jni -X/usr/lib/$(DEB_HOST_MULTIARCH)/ceph/erasure-code
+
+override_dh_auto_test:
+ # do not run tests
+
+override_dh_shlibdeps:
+ dh_shlibdeps -a --exclude=erasure-code --exclude=rados-classes --exclude=compressor
+
+override_dh_python3:
+ for binding in ceph ceph-argparse cephfs ceph-common rados rbd rgw; do \
+ dh_python3 -p python3-$$binding --shebang=/usr/bin/python3; \
+ done
+ dh_python3 -p ceph-common --shebang=/usr/bin/python3
+ dh_python3 -p ceph-base --shebang=/usr/bin/python3
+ dh_python3 -p ceph-osd --shebang=/usr/bin/python3
+ dh_python3 -p ceph-mgr --shebang=/usr/bin/python3
+ dh_python3 -p cephfs-shell --shebang=/usr/bin/python3
+ dh_python3 -p cephfs-top --shebang=/usr/bin/python3
+ dh_python3 -p cephadm --shebang=/usr/bin/python3
+
+override_dh_builddeb:
+ dh_builddeb ${skip_packages}
+
+override_dh_gencontrol:
+ dh_gencontrol ${skip_packages}
+