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
|
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 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)
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
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
ifeq ($(DEB_HOST_GNU_TYPE), i486-linux-gnu)
TYPE_FLAGS += --with-boinc-platform=i686-pc-linux-gnu
endif
ifeq ($(DEB_HOST_GNU_TYPE), x86_64-linux-gnu)
TYPE_FLAGS += --with-boinc-platform=x86_64-pc-linux-gnu
TYPE_FLAGS += --with-boinc-alt-platform=x86_64-linux-gnu
endif
ifeq ($(DEB_HOST_GNU_TYPE), i486-kfreebsd-gnu)
TYPE_FLAGS += --with-boinc-platform=i686-pc-kfreebsd-gnu
endif
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
ifeq ($(DEB_HOST_GNU_TYPE), ia64-linux-gnu)
TYPE_FLAGS += --with-boinc-platform=ia64-linux-gnu
endif
ifeq ($(DEB_HOST_GNU_TYPE), powerpc-linux-gnu)
TYPE_FLAGS += --with-boinc-platform=powerpc-linux-gnu
endif
ifeq ($(DEB_HOST_GNU_TYPE), powerpc64-linux-gnu)
TYPE_FLAGS += --with-boinc-platform=ppc64-linux-gnu \
--with-boinc-alt-platform=powerpc-linux-gnu
endif
ifeq ($(DEB_HOST_GNU_TYPE), sparc-linux-gnu)
TYPE_FLAGS += --with-boinc-platform=sparc-sun-linux-gnu
endif
ifeq ($(DEB_HOST_GNU_TYPE), i486-gnu)
CFLAGS += -DMAXPATHLEN=4096
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)
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
$(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)
endif
ENABLE_CLIENT := --enable-client --enable-manager --enable-dynamic-client-linkage
$(shell sed 's/^@//' -i debian/control)
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
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
rm -f debian/boinc-screensaver.substvars debian/boinc-amd-opencl.substvars
rm -f debian/boinc-cgi-stripchart.substvars
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
override_dh_auto_test:
LDFLAGS+=$(CFLAGS)
override_dh_auto_configure-indep:
override_dh_auto_configure-arch:
debconf-updatepo
@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
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
$(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)"
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
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%
done
override_dh_install:
rm -rf debian/boinc-manager/usr/share/locale/en_US/
if [ -d debian/boinc-manager/usr/share/locale ] ; then find debian/boinc-manager/usr/share/locale -type d -empty -delete; fi
find $(CURDIR)/debian -name "*.la" | xargs -r rm -f
dh_install
override_dh_fixperms:
dh_fixperms
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 --
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
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
|