File: rules

package info (click to toggle)
nlopt 2.4.2%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,368 kB
  • sloc: ansic: 22,387; cpp: 20,233; sh: 11,475; python: 323; makefile: 244; fortran: 108
file content (88 lines) | stat: -rwxr-xr-x 2,254 bytes parent folder | download
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
#!/usr/bin/make -f

BUILDDIR = $(CURDIR)/debian/build

PYVERS := $(shell pyversions -vr debian/control)

# The directories below are versioned.  We only support the packages for the
# stable version of Octave
mpath = $(shell octave-config -p LOCALFCNFILEDIR)/nlopt
bpath = $(shell octave-config -p LOCALOCTFILEDIR)/nlopt

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@  --buildsystem=autoconf --builddirectory=$(BUILDDIR) --with python2

override_dh_auto_configure:
	for v in $(PYVERS); do \
	   dh_auto_configure --builddirectory=$(BUILDDIR)$$v \
	        -- $(extra_flags) \
		--prefix=/usr \
		--srcdir=$(CURDIR) \
		--enable-shared \
		PYTHON=/usr/bin/python$$v \
		OCT_INSTALL_DIR=$(bpath) M_INSTALL_DIR=$(mpath) \
		GUILE=guile GUILE_CONFIG=guile-config; \
	done

override_dh_auto_build:
	for v in $(PYVERS); do \
	   dh_auto_build --builddirectory=$(BUILDDIR)$$v; \
	done
	# Now configure and build again for C++
	dh_auto_configure --builddirectory=$(BUILDDIR)$$v \
	        -- $(extra_flags) \
		--prefix=/usr \
		--srcdir=$(CURDIR) \
		--enable-shared \
		--with-cxx
	dh_auto_build --builddirectory=$(BUILDDIR)$$v; \

override_dh_clean:
	dh_clean --exclude='*.orig'

override_dh_auto_clean:
	for v in $(PYVERS); do \
	   rm -rf $(BUILDDIR)$$v; \
	done

override_dh_strip:
	dh_strip
	find debian/octave-nlopt/usr/lib -name *.oct | \
		xargs strip --strip-unneeded --remove-section=.comment

override_dh_makeshlibs:
	dh_makeshlibs $(shell for v in $(PYVERS); do printf -- "-X/usr/lib/python$$v/dist-packages "; done)

override_dh_shlibdeps:
	dh_shlibdeps
	dh_octave_substvar

override_dh_auto_install:
	for v in $(PYVERS); do \
	  dh_auto_install --builddirectory=$(BUILDDIR)$$v; \
	done

	dh_numpy
	find debian/tmp/usr/lib/python* \
		-name '*.pyc' -o -name '*.pyo' \
		-o -name '*.la' -o -name '*.a' | xargs rm

override_dh_install:
	dh_install
	# Remove C++ header from C interface
	find debian/libnlopt-dev -name nlopt.hpp -delete

override_dh_link:
	for package in libnlopt-dev libnlopt-guile0 octave-nlopt python-nlopt; do \
		rm -rf debian/$$package/usr/share/doc/$$package; \
	done
	dh_link


override_dh_auto_test:
	for v in $(PYVERS); do \
	   dh_auto_test --builddirectory=$(BUILDDIR)$$v \
	        -- $(extra_flags); \
	done