File: rules

package info (click to toggle)
boinc 7.6.33%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 81,672 kB
  • sloc: cpp: 158,237; php: 50,629; ansic: 49,101; xml: 16,323; java: 13,347; python: 6,020; sh: 3,385; perl: 1,843; makefile: 1,766; sql: 943; objc: 584; csh: 126; pascal: 62; lisp: 47
file content (432 lines) | stat: -rwxr-xr-x 15,047 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
#!/usr/bin/make -f

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

# Uncomment the following lines to compile with gcc-snapshot.
#export  CC=/usr/lib/gcc-snapshot/bin/gcc
#export CXX=/usr/lib/gcc-snapshot/bin/g++
#export CPP=/usr/lib/gcc-snapshot/bin/cpp

export CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
export CFLAGS   := $(shell dpkg-buildflags --get CFLAGS)
export CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
export LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)

#export CXX=clang++
export AR=ar
export RANLIB=ranlib

DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# Set default flags with dpkg-buildflags
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  TYPE_FLAGS = --build $(DEB_HOST_GNU_TYPE)
else
  TYPE_FLAGS = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# On some architectures it is required to change the BOINC platform of the
# core client (with the --with-boinc-platform configure option) to match the
# official BOINC platform, otherwise it would not download any applications,
# because projects mostly provide applications for official BOINC platforms
# only. See https://boinc.berkeley.edu/trac/wiki/BoincPlatforms for the list
# of official BOINC platforms.
#
# The table of architectures known to dpkg-architecture are listed on
#  /usr/share/dpkg/archtable

# Change BOINC platform alpha-unknown-linux-gnu to alpha-hp-linux-gnu and
# declare alpha-unknown-linux-gnu as alternate platform, because some projects
# offer applications for it.
ifeq ($(DEB_HOST_GNU_TYPE), alpha-linux-gnu)
  TYPE_FLAGS += --with-boinc-platform=alpha-hp-linux-gnu \
    --with-boinc-alt-platform=alpha-unknown-linux-gnu
endif

# Change BOINC platform i486-pc-linux-gnu to i686-pc-linux-gnu.
ifeq ($(DEB_HOST_GNU_TYPE), i486-linux-gnu)
  TYPE_FLAGS += --with-boinc-platform=i686-pc-linux-gnu
endif

# Change BOINC platform x86_64-linux-gnu to x86_64-pc-linux-gnu.
# Keeping the previous name temporarily.
# The 32bit variants shall allow the execution of 32 bit 
# executable in case the scientific application is no available
# for the complete bit size.
ifeq ($(DEB_HOST_GNU_TYPE), x86_64-linux-gnu)
  TYPE_FLAGS += --with-boinc-platform=x86_64-pc-linux-gnu
  # wrong previous name (since regular Debian name)
  TYPE_FLAGS += --with-boinc-alt-platform=x86_64-linux-gnu
  # if we did the following, the the ia32 libs would
  # need to become a dependency - which is not wanted by too many
  #TYPE_FLAGS += --with-boinc-alt-platform=i686-pc-linux-gnu
endif

# Change BOINC platform i486-pc-kfreebsd-gnu to i686-pc-kfreebsd-gnu to be
# consistent with the official BOINC platform i686-pc-linux-gnu.
ifeq ($(DEB_HOST_GNU_TYPE), i486-kfreebsd-gnu)
  TYPE_FLAGS += --with-boinc-platform=i686-pc-kfreebsd-gnu
endif

# Declare i686-pc-kfreebsd-gnu as alternate platform for
# x86_64-pc-kfreebsd-gnu.
ifeq ($(DEB_HOST_GNU_TYPE), x86_64-kfreebsd-gnu)
  TYPE_FLAGS += --with-boinc-platform=x86_64-pc-kfreebsd-gnu
  TYPE_FLAGS += --with-boinc-alt-platform=i686-pc-kfreebsd-gnu
endif

# Change BOINC platform ia64-unknown-linux-gnu to ia64-linux-gnu.
ifeq ($(DEB_HOST_GNU_TYPE), ia64-linux-gnu)
  TYPE_FLAGS += --with-boinc-platform=ia64-linux-gnu
endif

# Change BOINC platform powerpc-unknown-linux-gnu to powerpc-linux-gnu.
ifeq ($(DEB_HOST_GNU_TYPE), powerpc-linux-gnu)
  TYPE_FLAGS += --with-boinc-platform=powerpc-linux-gnu
endif

# Change BOINC platform powerpc64-unknown-linux-gnu to ppc64-linux-gnu and
# declare powerpc-linux-gnu as alternate platform.
ifeq ($(DEB_HOST_GNU_TYPE), powerpc64-linux-gnu)
  TYPE_FLAGS += --with-boinc-platform=ppc64-linux-gnu \
    --with-boinc-alt-platform=powerpc-linux-gnu
endif

# Change BOINC platform sparc-unknown-linux-gnu to sparc-sun-linux-gnu.
ifeq ($(DEB_HOST_GNU_TYPE), sparc-linux-gnu)
  TYPE_FLAGS += --with-boinc-platform=sparc-sun-linux-gnu
endif

# Not touching BOINC platform for hurd for the very moment.
# Manually specify the MAXPATHLEN for GNU where this limit
# is not existing.
ifeq ($(DEB_HOST_GNU_TYPE), i486-gnu)
  # setting it to the regular limit for the other flavours of Debian
  CFLAGS += -DMAXPATHLEN=4096
  #TYPE_FLAGS += --with-boinc-platform=i686-pc-hurd-gnu
endif

ifneq (,$(findstring clang,$(DEB_BUILD_OPTIONS)))
  export CXX=clang
endif

CFLAGS += -Wall
CXXFLAGS += -Wall
LDFLAGS += -Wl,--as-needed

ifeq (,$(DEB_OPT_FLAGS))
   DEB_OPT_FLAGS = -O3 -funroll-loops -fforce-addr -ffast-math
   $(info W: No default DEB_OPT_FLAGS set, adding $(DEB_OPT_FLAGS))
endif

CFLAGS += $(DEB_OPT_FLAGS)
CXXFLAGS += $(DEB_OPT_FLAGS)

CFLAGS_boinc-client := $(CFLAGS)
CXXFLAGS_boinc-client := $(CXXFLAGS)

CCorig := $(CC)
CXXorig := $(CXX)

# Link-time optimisation demands knowledge about all CFLAGS both at
# compile time (as represented by CFLAGS and CXXFLAGS) but also at
# at link time.
ifeq (,$(findstring nolto,$(DEB_BUILD_OPTIONS)))
 $(info I: Activating LinkTimeOptimisation)
 CFLAGS += -flto
 CXXFLAGS += -flto
 LDFLAGS += -flto
 CXX := $(CXX) $(CXXFLAGS)
 CC := $(CC) $(CFLAGS)
 AR := gcc-ar
 RANLIB := gcc-ranlib
endif

#copy the original control.in file
$(shell cp debian/control.in debian/control)
$(shell sed '/^#/d' -i debian/control)

export ENABLE_SERVER_TEST := $(shell dpkg-parsechangelog | egrep '^Distribution:' |egrep -v 'experimental|UNRELEASED')

ifeq (,$(ENABLE_SERVER_TEST))
$(shell sed 's/^%//' -i debian/control)
else
$(shell sed '/^%/d' -i debian/control)
endif

ifeq (,$(ENABLE_SERVER_TEST))
$(info I: Building both the server and the client packages)
ENABLE_SERVER := --enable-server
else
$(info I: Building regular client packages only)
#ENABLE_SERVER := --disable-server
endif

#ENABLE_CLIENT_TEST := $(shell egrep '^Package:.*boinc$$' debian/control debian/control.in)
#ifneq (,$(ENABLE_CLIENT_TEST))
ENABLE_CLIENT := --enable-client --enable-manager --enable-dynamic-client-linkage
$(shell sed 's/^@//' -i debian/control)
#else
#ENABLE_CLIENT := --disable-client --disable-manager
#$(shell sed '/^@/d' -i debian/control)
#endif

# --disable-static
# For debugging, these options are useful:
#   --enable-debug
#   --enable-wx-debug (need to install libwxbase3.0-0-dbg and libwxgtk3.0-0-dbg)
#
CFGFLAGS_boinc-client = \
  $(TYPE_FLAGS) \
  --prefix=/usr \
  $(ENABLE_CLIENT) \
  $(ENABLE_SERVER) \
  --disable-fcgi \
  --enable-libraries \
  --enable-unicode \
  --enable-shared \
  --enable-dynamic-client-linkage \
  --with-ssl \
  --with-x \
  CFLAGS="$(CFLAGS_boinc-client)"

%:
	dh $@ --with python2,systemd,autoreconf # --parallel

override_dh_autoreconf-indep:

override_dh_clean:
	dh_clean
	rm -rf config.log
	rm -rf clientscr/.libs
	rm -rf debian/boinc-app-examples   debian/boinc-app-examples.substvars
	rm -rf debian/boinc-server-maker   debian/boinc-server-maker.substvars
	rm -rf debian/boinc-cgi-stripchart debian/boinc-cgi-stripchart.substvars
	rm -rf debian/boinc-dbg            debian/boinc-dbg.substvars
	rm -rf debian/boinc-server-dbg     debian/boinc-server-dbg.substvars
	rm -rf debian/*.debhelper
	rm -rf debian/tmp autoreconf-stamp build-*-stamp install-*-stamp
	rm -fr debian/boinc-amd-opencl debian/boinc-screensaver # for cases when this is not in debian/control
	rm -f debian/boinc-screensaver.substvars debian/boinc-amd-opencl.substvars # dito
	rm -f debian/boinc-cgi-stripchart.substvars
	# sudden differences yet remaining to be resolved
	rm -f api/libboinc_graphics2.la
	rm -f test-driver
	rm -f sched/adjust_user_priority sched/size_regulator
	rm -f config.status libtool version.h stamp-h1
	find . -name ".libs" | xargs -r rm -r
	find zip -name "*.lo" -delete

# Commands not to execute - empty overrides
override_dh_auto_test:

#test-stamp:
#	dh_testdir
#	xmllint --nonet --noout \
#	  debian/conffiles/cc_config.xml \
#	  debian/conffiles/global_prefs_override.xml
#	touch $@
LDFLAGS+=$(CFLAGS)

override_dh_auto_configure-indep:

override_dh_auto_configure-arch:
	debconf-updatepo
	#./_autosetup
	#if [ ! -r ltmain.sh ]; then libtoolize; fi
	#aclocal -I m4 && autoheader && automake --add-missing && autoconf
	@echo
	@echo "****             *****"
	@echo "**** Configuring *****"
	@echo "****             *****"
	@echo "**** CXX=$(CXX)"
	@echo "**** LD=$(LD)"
	@echo "**** AR=$(AR)"
	@echo "**** RANLIB=$(RANLIB)"
	@echo "****             *****"
	@echo
	dh_auto_configure -- $(CFGFLAGS_boinc-client)

update-boinc-applinks.1: debian/manpages/update-boinc-applinks.xml
	docbook2x-man debian/manpages/update-boinc-applinks.xml

# noopt, not necessary
# CFLAGS_noopt = $(subst -O2,-O0,$(CFLAGS))
# CXXFLAGS_noopt = $(subst -O2,-O0,$(CXXFLAGS))
# noopt and no hardening
CFLAGS_plain = -g -O0 -Wall
CXXFLAGS_plain = $(CFLAGS_plain)

override_dh_auto_build-indep:

override_dh_auto_build-arch: update-boinc-applinks.1
	@echo
	@echo "****            *****"
	@echo "**** Making     *****"
	@echo "****            *****"
	@echo "**** CC=$(CC)"
	@echo "**** CXX=$(CXX)"
	@echo "**** AR=$(AR)"
	@echo "**** RANLIB=$(RANLIB)"
	@echo
	# disable optimization in api/, for SETI to work
	#$(MAKE) -C api CFLAGS="$(CFLAGS_noopt)" CXXFLAGS="$(CXXFLAGS_noopt)"

# we need to build zip because of the libboinc7 reference, until we split the dev packages or we move it in a new package
#ifeq (,$(ENABLE_SERVER_TEST))
	# FIXME For some reasons unzip build fails if hardening flags are enabled.
	$(MAKE) CC=$(CCorig) CXX=$(CXXorig) -C zip CFLAGS="$(CFLAGS_plain) -fPIC" CXXFLAGS="$(CXXFLAGS_plain)"
	$(MAKE) CC=$(CCorig) CXX=$(CXXorig) -C zip/unzip CFLAGS="$(CFLAGS_plain) -fPIC" CXXFLAGS="$(CXXFLAGS_plain)"
#endif

	# Generate binary message catalogs of the BOINC Manager.
#	if [ -d locale ]; then \
#	  for i in `ls locale`; do \
#	    if [ -f "locale/$$i/BOINC-Manager.po" ]; then \
#	     msgfmt -o "locale/$$i/BOINC-Manager.mo" \
#	      "locale/$$i/BOINC-Manager.po"; \
#	    fi; \
#	  done; \
#	fi
	dh_auto_build
ifeq (,$(ENABLE_SERVER_TEST))
	$(MAKE) -C samples/sleeper
	$(MAKE) -C samples/worker
	$(MAKE) -C samples/example_app
	$(MAKE) -C samples/wrapper
endif

BINARIES= sched/census sched/cgi sched/db_dump sched/db_purge \
	sched/delete_file sched/feeder sched/file_deleter \
	sched/file_upload_handler sched/get_file sched/make_work \
	sched/message_handler sched/request_file_list sched/sample_assimilator \
	sched/sample_bitwise_validator sched/sample_dummy_assimilator \
	sched/sample_trivial_validator sched/sample_work_generator \
	sched/sched_driver sched/send_file sched/show_shmem \
	sched/single_job_assimilator sched/transitioner sched/trickle_handler \
	sched/update_stats sched/wu_check \
	clientgui/boincmgr
BINARIES += samples/worker/worker samples/wrapper/wrapper samples/sleeper/sleeper \
	samples/nvcuda/cuda samples/example_app/example_app samples/vm_wrapper/vm_wrapper \
	samples/atiopencl/atiopencl

override_dh_auto_clean: 
	dh_auto_clean
	[ -r samples/sleeper/Makefile     ] && $(MAKE) -C samples/sleeper     clean
	[ -r samples/worker/Makefile      ] && $(MAKE) -C samples/worker      clean
	[ -r samples/example_app/Makefile ] && $(MAKE) -C samples/example_app clean
	[ -r samples/wrapper/Makefile     ] && $(MAKE) -C samples/wrapper     clean
	find . -name Makefile.in -o -name "*.a" -o -name "*.o" | xargs -r rm
	find . -name "Makefile" | grep -v samples | xargs -r rm
	rm -f configure clientscr/boincscr
	rm -rf py/lib.linux-*-2.*
	rm -f client_state.xml gui_rpc_auth.cfg
	rm -rf  py/build py/lib.linux-x86_64-2.6
	find . -name "*.pyc" | xargs -r rm
	rm -f stderr.txt # remnant of application started
	rm -f lib/crypt_prog test/run notices/feeds.xml
	find test -name "run-*" | xargs -r rm -rf
	rm -f $(BINARIES)
	rm -f \
	  boinc_lockfile lockfile \
	  client/boinc.optimized \
	  update-boinc-applinks.1 \
	  aclocal.m4 \
	  config.h \
	  config.h.in \
	  configure \
	  compile \
	  depcomp \
	  doc/manpages/appmgr.8 \
	  install-sh \
	  ltmain.sh \
	  m4/libtool.m4 \
	  m4/ltoptions.m4 \
	  m4/ltsugar.m4 \
	  m4/ltversion.m4 \
	  m4/lt~obsolete.m4 \
	  missing \
	  sched/credit_test \
	  svn_version.h \
	  config.guess \
	  config.sub \
	  client/scripts/Makefile \
	  client/scripts/boinc-client \
	  clientgui/res/Makefile \
	  sea/Makefile   \
	  client/boinc \
	  packages/solaris/CSW/boincclient/pkginfo \
	  packages/solaris/CSW/boincclient/prototype \
	  packages/solaris/CSW/boincdevel/pkginfo \
	  packages/solaris/CSW/boincdevel/prototype \
	  packages/solaris/CSW/boinclibs/pkginfo \
	  packages/solaris/CSW/boinclibs/prototype \
	  packages/solaris/CSW/boincmanager/pkginfo \
	  packages/solaris/CSW/boincmanager/prototype \
	  packages/solaris/CSW/Makefile \
	  packages/generic/sea/Makefile \
	  packages/solaris/CSW/boincclient/Makefile \
	  packages/solaris/CSW/boincdevel/Makefile \
	  packages/solaris/CSW/boinclibs/Makefile \
	  packages/solaris/CSW/boincmanager/Makefile

SAMPLES=samples/sleeper/sleeper samples/worker/worker samples/example_app/uc2 samples/wrapper/wrapper

override_dh_auto_install-indep:

override_dh_auto_install-arch: update-boinc-applinks.1
	dh_auto_install
ifeq (,$(ENABLE_SERVER_TEST))
	echo "I: Installing example scientific applications"
	mkdir -p $(CURDIR)/debian/tmp/samples
	cp $(SAMPLES) $(CURDIR)/debian/tmp/samples || echo "W: Could not install samples ($(SAMPLES))"
endif
	for i in $(CURDIR)/debian/*/usr/bin ; \
	do \
		egrep -l "^#!.*env..*python" $$i/* | xargs -r sed -i '1s%#!.*%#!/usr/bin/python%' ; \
	done

override_dh_install:
	# boinc apps are built only together with the server
	rm -rf debian/boinc-manager/usr/share/locale/en_US/
	# delete empty dirs
	if [ -d debian/boinc-manager/usr/share/locale ] ; then find debian/boinc-manager/usr/share/locale -type d -empty -delete; fi
	# delete .la files (Closes: #621197)
	find $(CURDIR)/debian -name "*.la" | xargs -r rm -f
	dh_install

override_dh_fixperms:
	dh_fixperms
	# some files are not right with 755
	find debian -name "*.php" -o -name "*.php.example" -o -name "*.cpp" | grep -v "update_translations.php" | grep -v "transitioner_catchup.php" | xargs -L 1 -r chmod 644 --
	# some other files are indeed to be executed via the command line
	opsdir=debian/boinc-server-maker/usr/share/boinc-server-maker/html/ops ; \
	if [ -d "$$opsdir" ]; then \
		cd "$$opsdir" ; \
		for i in *.php; do \
			if head -n 1 "$$i" | grep -q "^#!"; then \
				chmod 755 "$$i" ; \
			fi ; \
		done ; \
	fi
	# Correct catalog file perms
	find debian -name "*.mo" -exec chmod 644   {} \;
	[ -d debian/boinc-client ] && chmod 755 \
	  debian/boinc-client/usr/share/boinc-client/udev-cpu_share \
	  debian/boinc-client/usr/share/bug/boinc-client/script \
	  debian/boinc-manager/usr/share/doc/boinc-manager/examples/run-boincmgr || true
	[ -d  debian/boinc-server-maker ] && chmod +x \
	  debian/boinc-server-maker/usr/share/boinc-server-maker/html/ops/delete_job_files || true

override_dh_strip:
	dh_strip --dbgsym-migration='boinc-server-dbg, boinc-dbg'

override_dh_compress:
	dh_compress -Xsamples -X.cpp -X.py -XMakefile

override_dh_installexamples:
	dh_installexamples -X.gz -Xjpeglib -X.o