| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
VIM_ADIR = $(CURDIR)/debian/tmp/usr/share/vim/addons |
| 4 |
VIM_RDIR = $(CURDIR)/debian/tmp/usr/share/vim/registry |
| 5 |
|
| 6 |
EMACS_ADIR = $(CURDIR)/debian/tmp/usr/share/emacs/site-lisp/systemtap-common |
| 7 |
|
| 8 |
CONF_FLAGS = --enable-sqlite --disable-crash --disable-pie \ |
| 9 |
--enable-docs --enable-htmldocs --enable-refdocs \ |
| 10 |
--enable-server --without-rpm --disable-silent-rules \ |
| 11 |
--enable-translator --disable-publican --with-python3 \ |
| 12 |
--libexecdir=/usr/lib $(shell dpkg-buildflags --export=configure) |
| 13 |
|
| 14 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 15 |
|
| 16 |
# Building of man pages takes A LOT of time |
| 17 |
ifeq (,$(filter stap_disable_refdocs,$(DEB_BUILD_OPTIONS))) |
| 18 |
CONF_FLAGS += --enable-refdocs |
| 19 |
else |
| 20 |
CONF_FLAGS += --disable-refdocs |
| 21 |
endif |
| 22 |
|
| 23 |
ifeq (,$(filter systemtap-runtime,$(shell dh_listpackages -a))) |
| 24 |
sdt_only := yes |
| 25 |
endif |
| 26 |
|
| 27 |
export FORCE_SOURCE_DATE=1 |
| 28 |
|
| 29 |
%: |
| 30 |
dh $@ --with autoreconf |
| 31 |
|
| 32 |
override_dh_auto_test: |
| 33 |
# Tests cannot be run during build, see #526957 |
| 34 |
|
| 35 |
override_dh_auto_configure: |
| 36 |
dh_auto_configure -- $(CONF_FLAGS) |
| 37 |
|
| 38 |
override_dh_auto_install: |
| 39 |
dh_auto_install |
| 40 |
|
| 41 |
# Install vim files |
| 42 |
install -m 644 -D vim/ftdetect/stp.vim $(VIM_ADIR)/ftdetect/stp.vim |
| 43 |
install -m 644 -D vim/ftplugin/stp.vim $(VIM_ADIR)/ftplugin/stp.vim |
| 44 |
install -m 644 -D vim/indent/stp.vim $(VIM_ADIR)/indent/stp.vim |
| 45 |
install -m 644 -D vim/syntax/stp.vim $(VIM_ADIR)/syntax/stp.vim |
| 46 |
install -m 644 -D $(CURDIR)/debian/systemtap.yaml $(VIM_RDIR)/systemtap.yaml |
| 47 |
|
| 48 |
# Install emacs files |
| 49 |
install -m 644 -D emacs/systemtap-init.el $(EMACS_ADIR)/systemtap-init.el |
| 50 |
install -m 644 -D emacs/systemtap-mode.el $(EMACS_ADIR)/systemtap-mode.el |
| 51 |
|
| 52 |
# Install stap-prep |
| 53 |
install -D stap-prep $(CURDIR)/debian/tmp/usr/bin/stap-prep |
| 54 |
|
| 55 |
# Install man page for stap-profile-annotate |
| 56 |
install -m 644 -D man/stap-profile-annotate.1.in debian/tmp/usr/share/man/man1/stap-profile-annotate.1 |
| 57 |
|
| 58 |
# Make all examples not executable. Some of them could be, but |
| 59 |
# this is not consistently enforced. |
| 60 |
find debian/tmp/usr/share/doc/systemtap*/examples/ -type f -executable | xargs --no-run-if-empty chmod -x |
| 61 |
|
| 62 |
# Remove empty file to make lintian happy, patch sent to xmlto upstream |
| 63 |
rm -f debian/tmp/usr/share/doc/systemtap/tapsets/tapsets.proc |
| 64 |
|
| 65 |
# Don't ship jupyter files |
| 66 |
rm -rf debian/tmp/usr/bin/stap-jupyter-container debian/tmp/usr/bin/stap-jupyter-install debian/tmp/usr/share/systemtap/interactive-notebook/ |
| 67 |
|
| 68 |
override_dh_install: |
| 69 |
dh_install |
| 70 |
ifeq ($(sdt_only),yes) |
| 71 |
install -m 755 -D dtrace debian/systemtap-sdt-dev/usr/bin/dtrace |
| 72 |
install -m 644 -D man/dtrace.1 debian/systemtap-sdt-dev/usr/share/man/man1/dtrace.1 |
| 73 |
mkdir -p debian/systemtap-sdt-dev/usr/include/$(DEB_HOST_MULTIARCH)/sys |
| 74 |
install -m 644 includes/sys/*.h \ |
| 75 |
debian/systemtap-sdt-dev/usr/include/$(DEB_HOST_MULTIARCH)/sys/. |
| 76 |
else |
| 77 |
mkdir -p debian/systemtap-sdt-dev/usr/include/$(DEB_HOST_MULTIARCH) |
| 78 |
mv debian/systemtap-sdt-dev/usr/include/sys \ |
| 79 |
debian/systemtap-sdt-dev/usr/include/$(DEB_HOST_MULTIARCH)/. |
| 80 |
endif |
| 81 |
|
| 82 |
override_dh_compress: |
| 83 |
dh_compress -X.stp -X.wav -Xsocktop -Xsyscalltimes -X.pdf |
| 84 |
|
| 85 |
override_dh_fixperms: |
| 86 |
dh_fixperms |
| 87 |
ifneq ($(sdt_only),yes) |
| 88 |
chmod 4754 debian/systemtap-runtime/usr/bin/staprun |
| 89 |
endif |