File: rules

package info (click to toggle)
phyml 3%3A3.3.20220408-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,856 kB
  • sloc: ansic: 73,812; makefile: 491; xml: 418; sh: 45
file content (83 lines) | stat: -rwxr-xr-x 2,870 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# debian/rules for phyml

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

BUILDARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)

include /usr/share/dpkg/default.mk

PKGBEAGLE=$(DEB_SOURCE)-beagle

%:
	dh $@

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
override_dh_auto_build:
	# According to README you need different configure options to get different executables
	# Here we hack in a full build process for phyml executable
	# The hack includes saving the documentation from beeing cleaned up
	mv doc/phyml-manual.pdf .
	dh_auto_configure
	dh_auto_build -- LDFLAGS="$(LDFLAGS)"
	# move phyml binary to temporary dir inside debian/
	mkdir -p $(CURDIR)/debian/bin
	mv src/phyml $(CURDIR)/debian/bin/phyml
ifeq ($(BUILDARCH),$(filter $(BUILDARCH), do_not_build_this)) # amd64 i386 arm64 armhf)) # upstream confirmed that beagle support is to weak
	$(MAKE) distclean
	dh_auto_configure -- --enable-beagle
	dh_auto_build -- CFLAGS="$(CFLAGS) -I/usr/include/libhmsbeagle-1 -DBEAGLE" LDFLAGS="$(LDFLAGS)"
	# move phyml binary to temporary dir inside debian/
	mkdir -p $(CURDIR)/debian/$(PKGBEAGLE)/usr/lib/phyml/bin
	mv src/phyml-beagle $(CURDIR)/debian/$(PKGBEAGLE)/usr/lib/phyml/bin
endif
	$(MAKE) distclean
	dh_auto_configure -- --enable-phyml-mpi
	dh_auto_build -- LDFLAGS="$(LDFLAGS)"
	# move phyml binary to temporary dir inside debian/
	# mkdir -p $(CURDIR)/debian/bin
	mv src/phyml-mpi $(CURDIR)/debian/bin/phyml-mpi
ifeq ($(BUILDPHYTIME), 'yes')
	$(MAKE) distclean
	dh_auto_configure -- --enable-phytime
	dh_auto_build -- LDFLAGS="$(LDFLAGS)" CPPFLAGS="-DPHYREX $(CPPFLAGS)"
endif
	mv phyml-manual.pdf doc

override_dh_auto_install:
	dh_auto_install
	# install phyml binary we have kept safe above
	mkdir -p $(CURDIR)/debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin
	mv $(CURDIR)/debian/bin/* $(CURDIR)/debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin
	chrpath --delete debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin/phyml*

override_dh_auto_clean:
	# save pdf from cleaning
	mv doc/phyml-manual.pdf .
	dh_auto_clean
	mv phyml-manual.pdf doc
	# remove temporary bin dir for phyml (see above hack)
	rm -rf debian/bin
	rm -rf doc/Makefile

override_dh_installdocs:
	dh_installdocs
	mv $(CURDIR)/debian/phyml/usr/share/doc/phyml/phyml-manual.pdf $(CURDIR)/debian/phyml/usr/share/doc/phyml/phyml_manual.pdf

override_dh_compress:
	dh_compress --exclude=.pdf

override_dh_fixperms:
	dh_fixperms
	find debian/*/usr/share/doc -name "*.nxs" -exec chmod -x \{\} \;
	find debian/*/usr/share/doc -name "*.xml" -exec chmod -x \{\} \;
	find debian/*/usr/share/doc -name "*.mat" -exec chmod -x \{\} \;
	find debian/*/usr/share/doc -name "*.txt" -exec chmod -x \{\} \;
	chmod -x debian/*/usr/share/doc/phyml/examples/nucleic
	chmod -x debian/*/usr/share/doc/phyml/examples/proteic

override_dh_dwz:
	echo "Do not run dh_dwz"