Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # License: GNU General Public License (GPL)
3
4 # Enable hardening
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6 DPKG_EXPORT_BUILDFLAGS = 1
7 include /usr/share/dpkg/buildflags.mk
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 cfg := PING=/bin/ping IFCONFIG=/sbin/ifconfig IP2UTIL=/sbin/ip \
13 PYTHON=/usr/bin/python3 \
14 --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
15 --libexecdir=/usr/libexec \
16 --mandir=/usr/share/man --disable-crm \
17 --with-group-name=haclient --with-ccmuser-name=hacluster \
18 --enable-libc-malloc --disable-fatal-warnings
19
20 # drbd is not built on kfreebsd
21 ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
22 DH_INSTALL_EXCLUDE=-Xdopd -Xdrbd
23 endif
24
25 export systemd_system_unit_dir=$(shell pkgconf --variable=systemd_system_unit_dir systemd | sed 's,^/,,' )
26
27 %:
28 dh $@ --with python3
29
30 override_dh_auto_configure:
31 if test -e ./configure -a ! -x ./configure; then \
32 chmod u+x ./configure; \
33 fi
34 if test -e ./py-compile -a ! -x ./py-compile; then \
35 chmod u+x ./py-compile; \
36 fi
37 test ! -x ./configure || /bin/bash ./configure $(cfg)
38 test -x ./configure || /bin/bash ./bootstrap $(cfg)
39
40 override_dh_auto_install:
41 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
42 MAKE=make \
43 docdir=/usr/share/doc/heartbeat
44 mv debian/tmp/usr/share/heartbeat/cts/README \
45 debian/tmp/usr/share/doc/heartbeat/README.cts
46 install -c -m 755 heartbeat/init.d/heartbeat \
47 debian/tmp/etc/init.d/heartbeat
48 cd debian/tmp/etc/ && ln -s ha.d heartbeat
49 sed -i "/dependency_libs/ s/'.*'/''/" $$(find debian/tmp -name '*.la')
50 rm -rf ./debian/tmp/usr/share/doc/heartbeat/COPYING*
51 rm -rf ./debian/tmp/usr/share/doc/heartbeat/ChangeLog
52 rm -rf ./debian/tmp/usr/share/heartbeat/cts/__pycache__
53
54 override_dh_install:
55 dh_install $(DH_INSTALL_EXCLUDE)
56 rm -rf ./debian/heartbeat-dev/usr/include/
57 rm -rf ./debian/heartbeat/etc/ha.d/conf
58 rm -rf ./debian/heartbeat/etc/ha.d/cts
59 rm -rf ./debian/heartbeat/usr/lib/stonith
60 rm -rf ./debian/heartbeat/usr/lib/pils
61 rm -rf ./debian/heartbeat/usr/include/
62 rm -rf ./debian/heartbeat/usr/lib/heartbeat/plugins/AppHBNotification/
63
64 override_dh_auto_clean:
65 [ ! -f Makefile ] || $(MAKE) distclean
66 rm -f tools/ccdv
67 rm -f libltdl.tar autoconf automake autoheader
68 rm -f debian/init config.log config.status libltdl/config.log libltdl/config.status
69
70 override_dh_installinit:
71 dh_installinit -n -u 'defaults 20 32'
72
73 override_dh_installchangelogs:
74 dh_installchangelogs $(CURDIR)/doc/ChangeLog
75
76 override_dh_strip:
77 dh_strip
78 find $(CURDIR)/debian/heartbeat-dev/ -name '*.a' \
79 | xargs strip --strip-debug --remove-section=.comment \
80 --remove-section=.note --enable-deterministic-archives
81
82 override_dh_makeshlibs:
83 dh_makeshlibs -V
84
85 override_dh_python3:
86 dh_python3 --no-guessing-deps --no-ext-rename