]> git.proxmox.com Git - ceph.git/blob - ceph/debian/rules
update sources to v12.1.1
[ceph.git] / ceph / debian / rules
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)
7
8 extraopts += -DUSE_CRYPTOPP=OFF -DWITH_OCF=ON -DWITH_LTTNG=ON -DWITH_PYTHON3=ON -DWITH_EMBEDDED=OFF
9 extraopts += -DWITH_CEPHFS_JAVA=ON
10 # assumes that ceph is exmpt from multiarch support, so we override the libdir.
11 extraopts += -DCMAKE_INSTALL_LIBDIR=/usr/lib
12 extraopts += -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib
13 extraopts += -DCMAKE_INSTALL_SYSCONFDIR=/etc
14 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
15 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
16 extraopts += -DBOOST_J=$(NUMJOBS)
17 endif
18
19 ifeq ($(DEB_HOST_ARCH), armel)
20 # armel supports ARMv4t or above instructions sets.
21 # libatomic-ops is only usable with Ceph for ARMv6 or above.
22 extraopts += -DWITH_ATOMIC_OPS=OFF
23 endif
24
25 ifneq (,$(filter $(DEB_HOST_ARCH), arm armel armhf arm64 i386 amd64 mips mipsel powerpc ppc64))
26 # beast depends on libboost_context which only support the archs above
27 extraopts += -DWITH_RADOSGW_BEAST_FRONTEND=ON
28 else
29 extraopts += -DWITH_RADOSGW_BEAST_FRONTEND=OFF
30 endif
31
32 %:
33 dh $@ --buildsystem=cmake --with javahelper,python2,python3,systemd --parallel
34
35 override_dh_auto_configure:
36 env | sort
37 dh_auto_configure --buildsystem=cmake -- $(extraopts) $(CEPH_EXTRA_CMAKE_ARGS)
38
39 override_dh_auto_build:
40 dh_auto_build --buildsystem=cmake
41 cp src/init-radosgw debian/radosgw.init
42
43 override_dh_auto_clean:
44 dh_auto_clean --buildsystem=cmake
45 rm -f debian/radosgw.init debian/ceph.logrotate
46
47 override_dh_auto_install:
48 dh_auto_install --buildsystem=cmake --destdir=$(DESTDIR)
49 install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules
50 install -D -m 644 udev/95-ceph-osd.rules $(DESTDIR)/lib/udev/rules.d/95-ceph-osd.rules
51 install -D -m 644 udev/60-ceph-by-parttypeuuid.rules $(DESTDIR)/lib/udev/rules.d/60-ceph-by-parttypeuuid.rules
52 install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap
53
54 # doc/changelog is a directory, which confuses dh_installchangelogs
55 override_dh_installchangelogs:
56 dh_installchangelogs --exclude doc/changelog
57
58 override_dh_installdocs:
59 dh_installdocs -a --all ChangeLog
60
61 override_dh_installlogrotate:
62 cp src/logrotate.conf debian/ceph-common.logrotate
63 dh_installlogrotate -pceph-common
64
65 override_dh_installinit:
66 # dh_installinit is only set up to handle one upstart script
67 # per package, so do this ourselves
68 install -d -m0755 debian/ceph-base/etc/init
69 install -m0644 src/upstart/ceph-all.conf debian/ceph-base/etc/init
70 install -d -m0755 debian/ceph-osd/etc/init
71 install -m0644 src/upstart/ceph-osd*.conf debian/ceph-osd/etc/init
72 install -m0644 src/upstart/ceph-disk.conf debian/ceph-osd/etc/init
73 install -d -m0755 debian/ceph-mon/etc/init
74 install -m0644 src/upstart/ceph-mon*.conf debian/ceph-mon/etc/init
75 install -d -m0755 debian/ceph-common/etc/init
76 install -m0644 src/upstart/rbdmap.conf debian/ceph-common/etc/init
77 install -d -m0755 debian/ceph-mds/etc/init
78 install -m0644 src/upstart/ceph-mds*.conf debian/ceph-mds/etc/init
79 install -d -m0755 debian/ceph-mgr/etc/init
80 install -m0644 src/upstart/ceph-mgr*.conf debian/ceph-mgr/etc/init
81 install -d -m0755 debian/radosgw/etc/init
82 install -m0644 src/upstart/radosgw*.conf debian/radosgw/etc/init
83 install -d -m0755 debian/rbd-mirror/etc/init
84 install -m0644 src/upstart/ceph-rbd-mirror*.conf debian/rbd-mirror/etc/init
85 # install the systemd stuff manually since we have funny service names
86 install -d -m0755 debian/ceph-common/lib/systemd/system
87 install -m0644 systemd/ceph.target debian/ceph-common/lib/systemd/system
88 install -d -m0755 debian/ceph-common/etc/default
89 install -m0644 etc/default/ceph debian/ceph-common/etc/default/
90 install -d -m0755 debian/ceph-common/usr/lib/tmpfiles.d
91 install -m 0644 -D systemd/ceph.tmpfiles.d debian/ceph-common/usr/lib/tmpfiles.d/ceph.conf
92
93 install -d -m0755 debian/ceph-base/lib/systemd/system
94 install -d -m0755 debian/ceph-mon/lib/systemd/system
95 install -d -m0755 debian/ceph-osd/lib/systemd/system
96 install -m0644 systemd/ceph-mon@.service debian/ceph-mon/lib/systemd/system
97 install -m0644 systemd/ceph-osd@.service debian/ceph-osd/lib/systemd/system
98 install -m0644 systemd/ceph-disk@.service debian/ceph-osd/lib/systemd/system
99 install -m0644 systemd/rbdmap.service debian/ceph-common/lib/systemd/system
100 sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mon/lib/systemd/system/ceph-mon@.service
101 sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-osd/lib/systemd/system/ceph-osd@.service
102 sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-osd/lib/systemd/system/ceph-disk@.service
103 install -m0644 systemd/ceph-mon.target debian/ceph-mon/lib/systemd/system
104 install -m0644 systemd/ceph-osd.target debian/ceph-osd/lib/systemd/system
105
106 install -d -m0755 debian/ceph-mds/lib/systemd/system
107 install -m0644 systemd/ceph-mds@.service debian/ceph-mds/lib/systemd/system
108 sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mds/lib/systemd/system/ceph-mds@.service
109 install -m0644 systemd/ceph-mds.target debian/ceph-mds/lib/systemd/system
110
111 install -d -m0755 debian/ceph-fuse/lib/systemd/system
112 install -m0644 systemd/ceph-fuse@.service debian/ceph-fuse/lib/systemd/system
113 sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-fuse/lib/systemd/system/ceph-fuse@.service
114 install -m0644 systemd/ceph-fuse.target debian/ceph-fuse/lib/systemd/system
115
116 install -d -m0755 debian/ceph-mgr/lib/systemd/system
117 install -m0644 systemd/ceph-mgr@.service debian/ceph-mgr/lib/systemd/system
118 sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mgr/lib/systemd/system/ceph-mgr@.service
119 install -m0644 systemd/ceph-mgr.target debian/ceph-mgr/lib/systemd/system
120
121 install -d -m0755 debian/radosgw/lib/systemd/system
122 install -m0644 systemd/ceph-radosgw@.service debian/radosgw/lib/systemd/system
123 sed -i s./etc/sysconfig/./etc/default/.g debian/radosgw/lib/systemd/system/ceph-radosgw@.service
124 install -m0644 systemd/ceph-radosgw.target debian/radosgw/lib/systemd/system
125
126 install -d -m0755 debian/rbd-mirror/lib/systemd/system
127 install -m0644 systemd/ceph-rbd-mirror@.service debian/rbd-mirror/lib/systemd/system
128 sed -i s./etc/sysconfig/./etc/default/.g debian/rbd-mirror/lib/systemd/system/ceph-rbd-mirror@.service
129 install -m0644 systemd/ceph-rbd-mirror.target debian/rbd-mirror/lib/systemd/system
130
131 dh_installinit -p ceph-base --name ceph --no-start
132 dh_installinit -p radosgw --no-start
133
134 # NOTE: execute systemd helpers so they pickup dh_install'ed units and targets
135 dh_systemd_enable
136 dh_systemd_start --no-restart-on-upgrade
137
138 override_dh_systemd_enable:
139 # systemd enable done as part of dh_installinit
140
141 override_dh_systemd_start:
142 # systemd start done as part of dh_installinit
143
144 override_dh_strip:
145 dh_strip -pceph-mds --dbg-package=ceph-mds-dbg
146 dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg
147 dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg
148 dh_strip -pceph-mon --dbg-package=ceph-mon-dbg
149 dh_strip -pceph-osd --dbg-package=ceph-osd-dbg
150 dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg
151 dh_strip -prbd-fuse --dbg-package=rbd-fuse-dbg
152 dh_strip -prbd-mirror --dbg-package=rbd-mirror-dbg
153 dh_strip -prbd-nbd --dbg-package=rbd-nbd-dbg
154 dh_strip -pceph-common --dbg-package=ceph-common-dbg
155 dh_strip -plibrados2 --dbg-package=librados2-dbg
156 dh_strip -plibradosstriper1 --dbg-package=libradosstriper1-dbg
157 dh_strip -plibrbd1 --dbg-package=librbd1-dbg
158 dh_strip -plibcephfs2 --dbg-package=libcephfs2-dbg
159 dh_strip -plibrgw2 --dbg-package=librgw2-dbg
160 dh_strip -pradosgw --dbg-package=radosgw-dbg
161 dh_strip -pceph-test --dbg-package=ceph-test-dbg
162
163 override_dh_shlibdeps:
164 dh_shlibdeps -a --exclude=erasure-code --exclude=rados-classes --exclude=compressor
165
166 override_dh_python2:
167 for binding in rados cephfs rbd rgw; do \
168 dh_python2 -p python-$$binding; \
169 done
170 dh_python2 -p ceph-common
171 dh_python2 -p ceph-base
172 dh_python2 -p ceph-osd
173 dh_python2 -p ceph-mgr
174
175 override_dh_python3:
176 for binding in rados cephfs rbd rgw; do \
177 dh_python3 -p python3-$$binding; \
178 done
179 dh_python3 -p python3-ceph-argparse
180
181 # do not run tests
182 override_dh_auto_test:
183
184 .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