File: rules

package info (click to toggle)
openems 0.0.35+dfsg.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,288 kB
  • sloc: cpp: 40,259; yacc: 580; lex: 350; makefile: 258; sh: 169; ruby: 19
file content (64 lines) | stat: -rwxr-xr-x 3,091 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
CHANGELOG_DATE ?= $(shell LC_ALL=C date -u -d @$(SOURCE_DATE_EPOCH) +"%d %B %Y")

DEBIAN_VERSION_SUFFIX = $(shell echo $(DEB_VERSION) | sed 's,.*\+\([0-9][0-9]*\).*,\1,')

OCTAVE_BPATH = usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/octave/packages
OCTAVE_HOSTTYPE = $(shell octave-config -p CANONICAL_HOST_TYPE)
OCTAVE_API_VERSION = $(shell octave-config -p API_VERSION)
OCTAVE_FULLBPATH = $(OCTAVE_BPATH)/openems-0.0.35/$(OCTAVE_HOSTTYPE)-$(OCTAVE_API_VERSION)

export CXXFLAGS := $(CXXFLAGS) -DSSE_CORRECT_DENORMALS=0

%:
	dh $@


# Since some sub-folders depend on other sub-folders to be installed before
# they can be configured, dh_auto_configure and dh_auto_build cannot be use for
# configuration and build:
override_dh_auto_configure:

override_dh_auto_build:

override_dh_auto_install:
	cd CSXCAD && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) .. && make && make install DESTDIR=../../debian/tmp
	cd QCSXCAD && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCSXCAD_ROOT_DIR=../debian/tmp/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) .. && make && make install DESTDIR=../../debian/tmp
	cd openEMS && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCSXCAD_ROOT_DIR=../debian/tmp/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) ..
	cd openEMS/build && make
	cd openEMS/build && make install DESTDIR=../../debian/tmp
	cd AppCSXCAD && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCSXCAD_ROOT_DIR=../debian/tmp/usr -DQCSXCAD_ROOT_DIR=../debian/tmp/usr -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) ..
	cd AppCSXCAD/build && make
	cd AppCSXCAD/build && make install DESTDIR=../../debian/tmp
	cd debian/tmp/usr/share/openEMS/matlab && CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" mkoctfile -lhdf5_cpp -DH5_USE_16_API -I/usr/include/hdf5/serial h5readatt_octave.cc
	mkdir -p debian/tmp/$(OCTAVE_FULLBPATH)
	mv debian/tmp/usr/share/openEMS/matlab/h5readatt_octave.oct debian/tmp/$(OCTAVE_FULLBPATH)/
	rm debian/tmp/usr/share/openEMS/matlab/h5readatt_octave.o
	rm debian/tmp/usr/share/openEMS/matlab/h5readatt_octave.cc
	chrpath -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so*
	chrpath -d debian/tmp/usr/bin/AppCSXCAD
	chrpath -d debian/tmp/usr/bin/nf2ff
	chrpath -d debian/tmp/usr/bin/openEMS


override_dh_auto_clean:
	dh_auto_clean
	$(RM) -r CSXCAD/build || true
	$(RM) -r QCSXCAD/build || true
	$(RM) -r openEMS/build || true
	$(RM) -r AppCSXCAD/build || true
	$(RM) debian/man/*.1

override_dh_installman:
	cd debian/man ; CHANGELOG_DATE="$(CHANGELOG_DATE)" ./genmanpages.sh
	dh_installman