]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/make -f |
2 | # -*- makefile -*- | |
3 | export DH_VERBOSE=1 | |
4 | export DESTDIR=$(CURDIR)/debian/tmp | |
5 | ||
6 | export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) | |
11fdf7f2 TL |
7 | ifneq (,$(findstring WITH_STATIC_LIBSTDCXX,$(CEPH_EXTRA_CMAKE_ARGS))) |
8 | # dh_auto_build sets LDFLAGS with `dpkg-buildflags --get LDFLAGS` on ubuntu, | |
9 | # which makes the application aborts when the shared library throws | |
10 | # exception, so strip this linker option, | |
11 | # see http://tracker.ceph.com/issues/25209 | |
12 | export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions | |
13 | endif | |
9f95a23c TL |
14 | ifeq (,$(findstring WITH_SEASTAR,$(CEPH_EXTRA_CMAKE_ARGS))) |
15 | export CEPH_OSD_BASENAME = ceph-osd | |
16 | else | |
17 | export CEPH_OSD_BASENAME = crimson-osd | |
18 | endif | |
7c673cae | 19 | |
11fdf7f2 | 20 | extraopts += -DWITH_OCF=ON -DWITH_LTTNG=ON |
9f95a23c TL |
21 | extraopts += -DWITH_MGR_DASHBOARD_FRONTEND=OFF |
22 | extraopts += -DWITH_PYTHON3=3 | |
7c673cae | 23 | extraopts += -DWITH_CEPHFS_JAVA=ON |
11fdf7f2 TL |
24 | extraopts += -DWITH_CEPHFS_SHELL=ON |
25 | extraopts += -DWITH_SYSTEMD=ON -DCEPH_SYSTEMD_ENV_DIR=/etc/default | |
801d1391 | 26 | extraopts += -DWITH_GRAFANA=ON |
7c673cae FG |
27 | # assumes that ceph is exmpt from multiarch support, so we override the libdir. |
28 | extraopts += -DCMAKE_INSTALL_LIBDIR=/usr/lib | |
29 | extraopts += -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib | |
30 | extraopts += -DCMAKE_INSTALL_SYSCONFDIR=/etc | |
11fdf7f2 | 31 | extraopts += -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR=/lib/systemd/system |
7c673cae FG |
32 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
33 | NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | |
34 | extraopts += -DBOOST_J=$(NUMJOBS) | |
35 | endif | |
36 | ||
31f18b77 | 37 | ifneq (,$(filter $(DEB_HOST_ARCH), arm armel armhf arm64 i386 amd64 mips mipsel powerpc ppc64)) |
b32b8144 FG |
38 | # libboost_context only support the archs above |
39 | extraopts += -DWITH_BOOST_CONTEXT=ON | |
31f18b77 | 40 | else |
b32b8144 | 41 | extraopts += -DWITH_BOOST_CONTEXT=OFF |
31f18b77 FG |
42 | endif |
43 | ||
7c673cae | 44 | %: |
9f95a23c | 45 | dh $@ --buildsystem=cmake --with javahelper,python3,systemd --parallel |
7c673cae FG |
46 | |
47 | override_dh_auto_configure: | |
48 | env | sort | |
49 | dh_auto_configure --buildsystem=cmake -- $(extraopts) $(CEPH_EXTRA_CMAKE_ARGS) | |
50 | ||
51 | override_dh_auto_build: | |
52 | dh_auto_build --buildsystem=cmake | |
53 | cp src/init-radosgw debian/radosgw.init | |
54 | ||
55 | override_dh_auto_clean: | |
56 | dh_auto_clean --buildsystem=cmake | |
57 | rm -f debian/radosgw.init debian/ceph.logrotate | |
58 | ||
59 | override_dh_auto_install: | |
60 | dh_auto_install --buildsystem=cmake --destdir=$(DESTDIR) | |
61 | install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules | |
7c673cae | 62 | install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap |
b32b8144 | 63 | install -D -m 644 etc/sysctl/90-ceph-osd.conf $(DESTDIR)/etc/sysctl.d/30-ceph-osd.conf |
11fdf7f2 | 64 | install -D -m 600 sudoers.d/ceph-osd-smartctl $(DESTDIR)/etc/sudoers.d/ceph-osd-smartctl |
9f95a23c TL |
65 | install -D -m 600 sudoers.d/cephadm $(DESTDIR)/etc/sudoers.d/cephadm |
66 | ||
67 | install -m 755 src/cephadm/cephadm $(DESTDIR)/usr/sbin/cephadm | |
7c673cae | 68 | |
801d1391 TL |
69 | install -m 644 -D monitoring/prometheus/alerts/ceph_default_alerts.yml $(DESTDIR)/etc/prometheus/ceph/ceph_default_alerts.yml |
70 | ||
7c673cae FG |
71 | # doc/changelog is a directory, which confuses dh_installchangelogs |
72 | override_dh_installchangelogs: | |
73 | dh_installchangelogs --exclude doc/changelog | |
74 | ||
75 | override_dh_installdocs: | |
7c673cae FG |
76 | |
77 | override_dh_installlogrotate: | |
31f18b77 FG |
78 | cp src/logrotate.conf debian/ceph-common.logrotate |
79 | dh_installlogrotate -pceph-common | |
7c673cae FG |
80 | |
81 | override_dh_installinit: | |
7c673cae | 82 | # install the systemd stuff manually since we have funny service names |
7c673cae FG |
83 | install -d -m0755 debian/ceph-common/etc/default |
84 | install -m0644 etc/default/ceph debian/ceph-common/etc/default/ | |
85 | install -d -m0755 debian/ceph-common/usr/lib/tmpfiles.d | |
86 | install -m 0644 -D systemd/ceph.tmpfiles.d debian/ceph-common/usr/lib/tmpfiles.d/ceph.conf | |
87 | ||
7c673cae FG |
88 | dh_installinit -p ceph-base --name ceph --no-start |
89 | dh_installinit -p radosgw --no-start | |
90 | ||
224ce89b WB |
91 | # NOTE: execute systemd helpers so they pickup dh_install'ed units and targets |
92 | dh_systemd_enable | |
7c673cae FG |
93 | dh_systemd_start --no-restart-on-upgrade |
94 | ||
224ce89b WB |
95 | override_dh_systemd_enable: |
96 | # systemd enable done as part of dh_installinit | |
97 | ||
98 | override_dh_systemd_start: | |
99 | # systemd start done as part of dh_installinit | |
100 | ||
7c673cae FG |
101 | override_dh_strip: |
102 | dh_strip -pceph-mds --dbg-package=ceph-mds-dbg | |
103 | dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg | |
104 | dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg | |
105 | dh_strip -pceph-mon --dbg-package=ceph-mon-dbg | |
106 | dh_strip -pceph-osd --dbg-package=ceph-osd-dbg | |
b32b8144 | 107 | dh_strip -pceph-base --dbg-package=ceph-base-dbg |
7c673cae FG |
108 | dh_strip -prbd-fuse --dbg-package=rbd-fuse-dbg |
109 | dh_strip -prbd-mirror --dbg-package=rbd-mirror-dbg | |
9f95a23c | 110 | dh_strip -pceph-immutable-object-cache --dbg-package=ceph-immutable-object-cache-dbg |
7c673cae FG |
111 | dh_strip -prbd-nbd --dbg-package=rbd-nbd-dbg |
112 | dh_strip -pceph-common --dbg-package=ceph-common-dbg | |
113 | dh_strip -plibrados2 --dbg-package=librados2-dbg | |
114 | dh_strip -plibradosstriper1 --dbg-package=libradosstriper1-dbg | |
115 | dh_strip -plibrbd1 --dbg-package=librbd1-dbg | |
116 | dh_strip -plibcephfs2 --dbg-package=libcephfs2-dbg | |
117 | dh_strip -plibrgw2 --dbg-package=librgw2-dbg | |
118 | dh_strip -pradosgw --dbg-package=radosgw-dbg | |
119 | dh_strip -pceph-test --dbg-package=ceph-test-dbg | |
b32b8144 | 120 | dh_strip -ppython3-rados --dbg-package=python3-rados-dbg |
b32b8144 | 121 | dh_strip -ppython3-rbd --dbg-package=python3-rbd-dbg |
b32b8144 | 122 | dh_strip -ppython3-rgw --dbg-package=python3-rgw-dbg |
b32b8144 | 123 | dh_strip -ppython3-cephfs --dbg-package=python3-cephfs-dbg |
7c673cae FG |
124 | |
125 | override_dh_shlibdeps: | |
126 | dh_shlibdeps -a --exclude=erasure-code --exclude=rados-classes --exclude=compressor | |
127 | ||
7c673cae FG |
128 | override_dh_python3: |
129 | for binding in rados cephfs rbd rgw; do \ | |
130 | dh_python3 -p python3-$$binding; \ | |
131 | done | |
132 | dh_python3 -p python3-ceph-argparse | |
9f95a23c | 133 | dh_python3 -p python3-ceph-common |
11fdf7f2 | 134 | dh_python3 -p cephfs-shell |
9f95a23c | 135 | dh_python3 -p cephadm |
7c673cae FG |
136 | |
137 | # do not run tests | |
138 | override_dh_auto_test: | |
139 | ||
140 | .PHONY: override_dh_autoreconf override_dh_auto_configure override_dh_auto_build override_dh_auto_clean override_dh_auto_install override_dh_installdocs override_dh_installlogrotate override_dh_installinit override_dh_systemd_start override_dh_strip override_dh_auto_test |