File: rules

package info (click to toggle)
pyferret 7.6.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 142,020 kB
  • sloc: fortran: 240,450; ansic: 25,233; python: 24,025; sh: 1,627; makefile: 1,132; pascal: 569; csh: 307; awk: 18
file content (90 lines) | stat: -rwxr-xr-x 3,399 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
84
85
86
87
88
89
90
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# magic debhelper rule
%:
	dh $@ 

# To aid reproducible builds
LC_ALL=C
export LC_ALL

ARCH:=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(ARCH)
INSTALLDIR:=$(CURDIR)/debian/tmp

# FC set to f77 by default in make
# Read default compiler name unless FC is actually set
ifeq ($(FC),f77)
  FC:=$(shell basename $(shell readlink /etc/alternatives/f95))
endif

# Version of Fortran compiler
FORT_VER:=$(shell basename $(shell readlink /usr/bin/$(FC)))

PY3:=$(shell py3versions -s)

override_dh_auto_build:
	# Missing files from 7.6.3; taken from git HEAD
	cp debian/missing/load_dsg_mask_ftrset_var.F  fer/gnl
	cp debian/missing/reload_dsg_ftrmaskvar.F  fer/gnl
	cp debian/missing/disp_data_set_up.F   fer/plt
	cp debian/missing/dsg_traj_alongxy_setup.F fer/plt
	cp debian/missing/plot_vs_set_up.F  fer/plt
	cp debian/missing/tm_dsg_ftrset_facts.F fmt/src
	cp debian/missing/make_dsg_ftrset_mask.F fer/utl
	cp debian/missing/make_dsg_feature_mask_dirs.F  fer/utl
	cp debian/missing/dsg_pltalong_setup.F fer/plt
	cp debian/platform_specific.mk.debian.$(FORT_VER) platform_specific.mk.debian
	cp debian/ef_utility/platform_specific.mk.debian.$(FORT_VER) external_functions/ef_utility/platform_specific.mk.debian
	sed -e 's%@ARCH@%${ARCH}%' \
                -e 's%@LIBDIR@%${LIBDIR}%' \
		-e 's%@CURDIR@%${CURDIR}%' \
                -e 's%@INSTALLDIR@%${INSTALLDIR}%' \
                < debian/site_specific.mk.in > site_specific.mk
	cp site_specific.mk external_functions/ef_utility

override_dh_auto_install:
	# Build and install 
	# Horrible hack breaks The Debian Way. I'm doing the build in the 'install' phase, as i'm installing into debian/tmp
	# Doing it any earlier, and dh_prep will remove debian/tmp. 
	# This means I'm also doing 'test' after the Install, not between during make & install. gack.
	for p in $(PY3) ; do \
		mkdir -p $(INSTALLDIR)/lib/$$p ; \
		cp $(CURDIR)/install/lib/$$p/site-packages//pyferret/libpyferret.cpython-$$l-$(ARCH).so \
			$(INSTALLDIR)/lib/$$p ; \
		n=`echo $$p | tr -d 'python' | tr -d '.' ` ; \
                ln -s  $(CURDIR)/install/lib/$$p/site-packages//pyferret/libpyferret.cpython-$$n-$(ARCH).so \
                   $(INSTALLDIR)/lib/$$p/libpyferret.so ; \
		mkdir -p debian/tmp-$$p ; \
		$(MAKE) HOSTTYPE=debian PYTHON_EXE=$$p INSTALLDIR=debian/tmp-$$p clean all install ; \
		done
	find debian \( -name '*.pyo' -o -name '*.pyc' \) -delete
	find debian -type d -name __pycache__ -delete
	dh_numpy3
	@echo "Now doing bench tests"
	ln -s debian/pyferret3  $(INSTALLDIR)/lib/$(shell py3versions -d)/pyferret
	# First build necessary files
	for p in  $(PY3) ; do \
		sed -e 's%@ARCH@%${ARCH}%' \
                -e 's%@LIBDIR@%${LIBDIR}%' \
		-e 's%@CURDIR@%${CURDIR}%' \
                -e "s%@PYTHON@%$$p%" \
                < debian/site_specific.mk.in > site_specific.mk ; \
		PATH=$(INSTALLDIR)/lib/$$p:$(PATH) PYTHONPATH=$(INSTALLDIR)/lib/$$p/site-packages \
		echo "IGNORING TESTS" ;  \
		done

override_dh_auto_test:
	@echo "Dummy test, to avoid calling make. Do test later"

override_dh_auto_clean:
	# use system xpm.h, not supplied ones
	rm -f fer/gui/xpm*.h
	rm -rf ./build ./install
	find . -type l  -delete 
	find . -name '*.o' -o -name '*.so'  -delete
	[ ! -f platform_specific_flags.mk.debian ]  || $(MAKE)  clean HOSTTYPE=debian