1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
# Reduce size of debug symbols to fix FTBFS due to the
# 2GB/3GB address space limits on 32bit
DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
ifeq (32,$(DEB_HOST_ARCH_BITS))
export DEB_CFLAGS_MAINT_APPEND = -g1
export DEB_CXXFLAGS_MAINT_APPEND = -g1
endif
# Limit parallel builds to 2 for now
# minimise needless linking and link to libatomic
# The last is needed because long long atomic operations are not directly
# supported by all processor architectures
export DEB_LDFLAGS_MAINT_APPEND= -Wl,--as-needed -latomic
# Enable hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
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 += --disable-silent-rules
extraopts += --with-ocf --with-nss
extraopts += --with-debug
extraopts += --enable-cephfs-java
extraopts += --with-babeltrace
## do not build with lttng just yet, see #765842.
extraopts += --without-lttng
# rocksdb is not packaged by anyone. build it if we can.
extraopts += --with-librocksdb-static=check
ifeq ($(DEB_HOST_ARCH), armel)
# armel supports ARMv4t or above instructions sets.
# libatomic-ops is only usable with Ceph for ARMv6 or above.
extraopts += --without-libatomic-ops
endif
# Only selected architectures support gperftools
gperftools_archs = i386 amd64 powerpc armhf ppc64el arm64
ifneq (,$(filter $(DEB_HOST_ARCH), $(gperftools_archs)))
extraopts += --with-tcmalloc
else
extraopts += --without-tcmalloc
endif
# Setup max parallel builds based on architecture
ifeq ($(DEB_HOST_ARCH), arm64)
maxparallel=1
else ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
maxparallel=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
maxparallel=2
endif
# Use system provided libs3
extraopts += --with-system-libs3
# Set _FILE_OFFSET_BITS=64 globally. While this is set by the build system
# through an automake variable, configure does not know about this and thus
# fails when testing xfs.h on 32bit systems.
export DEB_CPPFLAGS_MAINT_APPEND=-D_FILE_OFFSET_BITS=64
# Build fix for mips/mipsel
# The first two variables work around a compiler bug which leads to virtual
# memory exhaustion while compiling the testsuite. See Debian bug #849657 and
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79030
ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
export DEB_CFLAGS_MAINT_APPEND= --param ggc-min-expand=5
export DEB_CXXFLAGS_MAINT_APPEND= --param ggc-min-expand=5
endif
%:
dh $@ --with javahelper,python2,autoreconf,systemd --parallel --max-parallel=$(maxparallel)
override_dh_autoreconf:
dh_autoreconf --as-needed
override_dh_auto_configure:
dh_auto_configure -- $(extraopts)
override_dh_auto_install:
# At least on armel installation of the Python modules fails in weird ways
# when run in parallel. As this is probably not specific to armel but just only
# triggered there because the architecture is too slow, run without parallelism
# everywhere.
dh_auto_install --no-parallel
override_dh_install:
# remove .la files, we don't want to install these in Debian,
# see Policy 10.2
find debian/tmp -name '*.la' -delete
# NOTE: manually install python modules to avoid virtualenvs
# during the package build process.
set -e; for comp in ceph-detect-init ceph-disk; do \
(set -e; cd src/$$comp; python setup.py install --root=$(CURDIR)/debian/tmp \
--install-script=/usr/sbin --install-layout=deb); \
done
# 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 || :
install -D -m 644 src/etc-rbdmap $(CURDIR)/debian/tmp/etc/ceph/rbdmap
dh_install --list-missing
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
override_dh_installinit:
dh_installinit --no-start
dh_installinit -pceph-common --no-start --name=rbdmap
# 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/lib/systemd/system
install -m0644 systemd/ceph.target debian/ceph-common/lib/systemd/system
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
# systemd:ceph-base
install -d -m0755 debian/ceph-base/lib/systemd/system
install -m0644 systemd/ceph-create-keys@.service debian/ceph-base/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-base/lib/systemd/system/ceph-create-keys@.service
# systemd:ceph-mon
install -d -m0755 debian/ceph-mon/lib/systemd/system
install -m0644 systemd/ceph-mon@.service debian/ceph-mon/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mon/lib/systemd/system/ceph-mon@.service
install -m0644 systemd/ceph-mon.target debian/ceph-mon/lib/systemd/system
# systemd:ceph-osd
install -d -m0755 debian/ceph-osd/lib/systemd/system
install -m0644 systemd/ceph-osd@.service debian/ceph-osd/lib/systemd/system
install -m0644 systemd/ceph-disk@.service debian/ceph-osd/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-osd/lib/systemd/system/ceph-osd@.service
sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-osd/lib/systemd/system/ceph-disk@.service
install -m0644 systemd/ceph-osd.target debian/ceph-osd/lib/systemd/system
# systemd:ceph-mds
install -d -m0755 debian/ceph-mds/lib/systemd/system
install -m0644 systemd/ceph-mds@.service debian/ceph-mds/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mds/lib/systemd/system/ceph-mds@.service
install -m0644 systemd/ceph-mds.target debian/ceph-mds/lib/systemd/system
# systemd:radosgw
install -d -m0755 debian/radosgw/lib/systemd/system
install -m0644 systemd/ceph-radosgw@.service debian/radosgw/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/radosgw/lib/systemd/system/ceph-radosgw@.service
install -m0644 systemd/ceph-radosgw.target debian/radosgw/lib/systemd/system
# disable SysV init file for systemd
ln -s /dev/null debian/radosgw/lib/systemd/system/radosgw.service
# systemd:rbd-mirror
install -d -m0755 debian/rbd-mirror/lib/systemd/system
install -m0644 systemd/ceph-rbd-mirror@.service debian/rbd-mirror/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/rbd-mirror/lib/systemd/system/ceph-rbd-mirror@.service
install -m0644 systemd/ceph-rbd-mirror.target debian/rbd-mirror/lib/systemd/system
override_dh_systemd_enable:
## Do not enable services to match `dh_installinit --no-start`
## behaviour.
## Users are expected to "systemctl enable" services once their
## configuration is correct.
override_dh_systemd_start:
## Do not start services to match `dh_installinit --no-start`
## behaviour.
## Users are expected to "systemctl start" services once their
## configuration is correct or after package updates.
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:
-dh_auto_test -v || cat src/test-suite.log
.PHONY: override_dh_auto_configure override_dh_installinit override_dh_makeshlibs override_dh_auto_test
|