File: rules

package info (click to toggle)
ecflow 4.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 28,888 kB
  • sloc: cpp: 198,464; python: 20,825; ansic: 7,518; sh: 2,969; perl: 639; yacc: 261; lex: 215; f90: 195; makefile: 69
file content (86 lines) | stat: -rwxr-xr-x 2,913 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
#!/usr/bin/make -f

export DH_VERBOSE=1

# The magic debhelper  rule
%:
	dh $@  --with python2,python3 --with-buildsystem=cmake


DESTDIR:=`pwd`/debian/tmp/
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
TARGET_ARCH ?= $(shell dpkg-architecture -qDEB_TARGET_ARCH_CPU)

AUTOGENERATED:= ecflow-server.install ecflow-client.install libecflow-view0d.install
PY3VERSIONS:=$(shell py3versions -s)

FPIC:= 
ifeq ($(TARGET_ARCH), hppa)
	FPIC:= -fPIC
endif
ifeq ($(TARGET_ARCH), x32)
	FPIC:= -fPIC
endif
ifeq ($(TARGET_ARCH), i386)
	FPIC:= -fPIC
endif

CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(FPIC) $(CPPFLAGS)  -DNO_REGEXP
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) $(FPIC)
CXXFLAGS:= $(shell dpkg-buildflags --get CXXFLAGS) $(FPIC) # -std=c++11

CMAKE_COMMON_FLAGS = \
                -DCMAKE_BUILD_TYPE=Release \
		-DDISABLE_OS_CHECK=ON \
		-DBOOST_INCLUDEDIR=/usr/include \
		-DBOOSTROOT=$(LIBDIR)	\
		-DENABLE_STATIC_BOOST_LIBS=OFF \
		-DENABLE_SSL=OFF \
		-DCMAKE_C_CFLAGS="${CFLAGS} ${LDFLAGS}"  

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(patsubst %, debian/%, ${AUTOGENERATED}) debian/build-*
	find . -name '*.pyc' -delete
	find . -name '*.job*' -delete

# For the moment set ENABLE_SSL=OFF. Enabling it fails tests

override_dh_auto_configure:
	for f in ${AUTOGENERATED} ; do \
		sed -e 's%@ARCH@%${DEB_HOST_MULTIARCH}%g' < debian/$$f.in  > debian/$$f ; \
                done
	dh_auto_configure --builddirectory=debian/build-py2 -- \
		${CMAKE_COMMON_FLAGS} \
		-DPYTHON_MIN_VERSION=2.7 \
		-DPYTHON_EXECUTABLE=python2.7  \
		-DBoost_PYTHON_LIBRARY_RELEASE=$(LIBDIR)/libboost_python27.so
	for p in ${PY3VERSIONS} ; do \
		PY3AB=`echo $$p | sed -e 's/python3\./python3/' `  ; \
		PY3VER=`echo $$p | sed -e 's/python//' `; \
		dh_auto_configure --builddirectory=debian/build-$$p -- \
			${CMAKE_COMMON_FLAGS} \
			-DPYTHON_MIN_VERSION=$$PY3VER \
			-DPYTHON_EXECUTABLE=$$p  \
			-DBoost_PYTHON_LIBRARY_RELEASE=$(LIBDIR)/libboost_$${PY3AB}.so ; \
		done

override_dh_auto_build:
	dh_auto_build  --builddirectory=debian/build-py2
	for p in ${PY3VERSIONS} ; do \
		dh_auto_build  --builddirectory=debian/build-$$p ; done

override_dh_auto_install:
	dh_auto_install --builddirectory=debian/build-py2
	for p in ${PY3VERSIONS} ; do \
		dh_auto_install --builddirectory=debian/build-$$p ; \
		done
	#	Drop the suffixes on scripts ...
	mv $(DESTDIR)/usr/bin/ecflow_logserver.sh $(DESTDIR)/usr/bin/ecflow_logserver
	mv $(DESTDIR)/usr/bin/ecflow_start.sh 	$(DESTDIR)/usr/bin/ecflow_start
	mv $(DESTDIR)/usr/bin/ecflow_stop.sh 	$(DESTDIR)/usr/bin/ecflow_stop
	mv $(DESTDIR)/usr/bin/ecflow_test_ui.sh 	$(DESTDIR)/usr/bin/ecflow_test_ui
	mv $(DESTDIR)/usr/bin/ecflow_fuse.py	$(DESTDIR)/usr/bin/ecflow_fuse
	mv $(DESTDIR)/usr/bin/noconnect.sh	$(DESTDIR)/usr/bin/noconnect
	mv $(DESTDIR)/usr/bin/ecflow_logsvr.pl	$(DESTDIR)/usr/bin/ecflow_logsvr