File: rules

package info (click to toggle)
ball 1.4.3~beta1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 318,984 kB
  • sloc: cpp: 346,579; ansic: 4,097; python: 2,664; yacc: 1,778; lex: 1,099; xml: 964; sh: 688; sql: 316; awk: 118; makefile: 108
file content (164 lines) | stat: -rwxr-xr-x 7,143 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/usr/bin/make -f 
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

SOVERSION=1.4
BALL_INSTALL_PATH=build
PYTHON_VERSION=2.6
PYTHON_SITE_PATH=$(shell python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0)[4:];")

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=cmake --builddirectory=build --with python2

override_dh_auto_configure:
	mkdir -p build
	cd build && LDFLAGS="$(LDFLAGS)" CXXFLAGS="$(CXXFLAGS)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
	            cmake .. -DCMAKE_SOURCE_DIR=$(CURDIR) -DCMAKE_INSTALL_PREFIX=./usr -DBALL_PATH=/usr -DBALL_DATA_PATH=/usr/share/BALL-$(SOVERSION)/data

# Set BALL_DATA_PATH so that test scripts find it
export BALL_DATA_PATH=$(CURDIR)/data
# Make sure HOME exists (for Directory_test)
export HOME=/tmp

# Disable test for arch-indep builds
override_dh_auto_test-indep:


# The testsuite fails on almost any non-amd64 port.
# Run it, but ignore the return code for now.
#
# TODO: Improve the portability of code and testsuite.
ifndef DEB_HOST_ARCH
$(warning DEB_HOST_ARCH is not defined.  I don't know which \
architecture I'm supposed to build for.  \
Expect "interesting" results.)
else ifneq ($(DEB_HOST_ARCH),amd64)
$(warning Building for $(DEB_HOST_ARCH) which is not amd64.  \
We will run the test suite, but ignore any errors to prevent FTBFS.  \
See Debian bug #830894 for the discussion and how you can help.\
)
override_dh_auto_test-arch:
	-dh_auto_test --
endif


override_dh_auto_build-arch:
	## Fix upstream issue of missing UI files
	uic-qt4 source/VIEW/DIALOGS/assignBondOrderConfigurationDialog.ui > include/BALL/VIEW/UIC/ui_assignBondOrderConfigurationDialog.h
	uic-qt4 source/VIEW/DIALOGS/assignBondOrderResultsDialog.ui       > include/BALL/VIEW/UIC/ui_assignBondOrderResultsDialog.h
	uic-qt4 source/VIEW/DIALOGS/atomOverview.ui                       > include/BALL/VIEW/UIC/ui_atomOverview.h
	## ...
	## Uhmmm, seems we need to do this for all UI files mentioned in
	##   source/VIEW/DIALOGS/sources.cmake
	## but I really hope some cmake expert might be able to find a clue
	## how to trigger cmake to do it as intended by upstream.
	## Somehow the code
	##   ADD_BALL_UIFILES("VIEW/DIALOGS" "${UI_LIST}")
	## needs to be called before the build code below can be started
	make -C build BALL VIEW BALLView build_tests install

override_dh_auto_build-indep:
	make -C build doc doc_tutorial install

override_dh_auto_clean:
	[ -d source ] && cd source ; \
	if [ -f Makefile ] ; \
	then  \
		make clean ; \
		cd PYTHON/EXTENSIONS; \
		make clean; \
		rm -rf ../lib/Linux*; \
		rm -rf ../doc/doxygen/latex/*; \
		rm -f $(CURDIR)/source/config.status 2>/dev/null; \
	fi
	rm -f data/BALLView/translations/BALLView.de_DE.qm
	rm -f data/BALLView/translations/BALLView.zh_TW.qm
	rm -f doc/TUTORIAL/*.aux
	rm -rf $(BALL_INSTALL_PATH)
	find . -name "*.o" | xargs -r rm
	find . -type l | xargs -r rm
	find doc/TUTORIAL/ -name "tutorial.*" | egrep -v ".(tex|bib)$$" |xargs -r rm
	rm -f include/BALL/BALL.doc
	# find . -name "*.doc" -delete
	# Remove self-create UI header file
	rm -f include/BALL/VIEW/UIC/ui_assignBondOrderConfigurationDialog.h \
	      include/BALL/VIEW/UIC/ui_assignBondOrderResultsDialog.h \
	      include/BALL/VIEW/UIC/ui_atomOverview.h


override_dh_auto_install-arch:
	mkdir -p debian/libball$(SOVERSION)/usr/lib \
		debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION) \
		debian/libballview$(SOVERSION)/usr/lib \
		debian/python-ball/usr/share/BALL-$(SOVERSION) \
		debian/python-ball/usr/$(PYTHON_SITE_PATH) \
		debian/python-ballview/usr/$(PYTHON_SITE_PATH)

	mkdir -p debian/ballview/usr/share/BALL-$(SOVERSION)/data/graphics

	cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/BALLView/* debian/ballview/usr/share/doc/ballview/html
	cp    $(BALL_INSTALL_PATH)/usr/bin/BALLView		 debian/ballview/usr/bin/

	find $(BALL_INSTALL_PATH)/usr/lib/ -name libBALL*.so.* | xargs -r cp --target-directory debian/libball$(SOVERSION)/usr/lib/
	find $(BALL_INSTALL_PATH)/usr/lib/ -name libVIEW*.so.* | xargs -r cp --target-directory debian/libballview$(SOVERSION)/usr/lib/

	# debian needs the logo in the ballview - package, not in the libball
	cp $(BALL_INSTALL_PATH)/usr/share/BALL/data/graphics/ballview*.xpm debian/ballview/usr/share/pixmaps/

	cp -r source/EXAMPLES/PYTHON    debian/python-ball/usr/share/BALL-$(SOVERSION)
	cp $(BALL_INSTALL_PATH)/usr/lib/BALL.py       debian/python-ball/usr/$(PYTHON_SITE_PATH)
	cp $(BALL_INSTALL_PATH)/usr/lib/BALLCore.so   debian/python-ball/usr/$(PYTHON_SITE_PATH)
	cp $(BALL_INSTALL_PATH)/usr/lib/VIEW.so       debian/python-ballview/usr/$(PYTHON_SITE_PATH)

	chmod ugo-x debian/python-ball/usr/share/BALL-$(SOVERSION)/PYTHON/UTILITIES/*.py
	chmod ugo-x debian/python-ball/usr/share/BALL-$(SOVERSION)/PYTHON/BALLView/*.py
	chmod ugo-x debian/python-ball/usr/share/BALL-$(SOVERSION)/PYTHON/howtos/*.py

	# -dev packages are arch dependent
	mkdir -p debian/libball$(SOVERSION)-dev/usr/lib \
		debian/libballview$(SOVERSION)-dev/usr/include/BALL \
		debian/libballview$(SOVERSION)-dev/usr/lib \
		debian/libball$(SOVERSION)-dev/usr/include
	# move the cmake configuration files to their final location
	cp -R $(BALL_INSTALL_PATH)/usr/lib/cmake/ debian/libball$(SOVERSION)-dev/usr/lib

	cp -r $(BALL_INSTALL_PATH)/usr/include/BALL       debian/libball$(SOVERSION)-dev/usr/include
	cp -r $(BALL_INSTALL_PATH)/usr/include/BALL/VIEW  debian/libballview$(SOVERSION)-dev/usr/include/BALL

	# get rid of the VIEW includes in libball-dev
	rm -rf debian/libball$(SOVERSION)-dev/usr/include/BALL/VIEW

	# eliminating chrpath settings
	chmod 755 debian/ballview/usr/bin/BALLView
	chrpath -d debian/ballview/usr/bin/BALLView
	find debian -name "*.so" | xargs -r chrpath -d 

override_dh_auto_install-indep:
	mkdir -p debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/html \
		debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc

	cp    $(BALL_INSTALL_PATH)/usr/share/BALL/doc/TUTORIAL/tutorial.pdf   debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/
	cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/classes                 debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc
	cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/internal                debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc
	# we need the BALLView documentation in the data path as well... sorry for that
	cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/BALLView debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc
	cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/BALL     debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/html

	cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/data    debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION) 

override_dh_installdocs:
	dh_installdocs
	find debian/*/usr/share -type d -empty -delete
	find debian/*/usr/share -name jquery.js -delete
	find debian/*/usr/share -name license.txt -delete