File: rules

package info (click to toggle)
nacl 20110221-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,540 kB
  • sloc: asm: 19,669; ansic: 13,492; cpp: 1,125; sh: 987; makefile: 37
file content (50 lines) | stat: -rwxr-xr-x 2,168 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

# ar/ranlib don't work with LTO objects -> optimize=-lto
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
export DEB_CFLAGS_MAINT_APPEND = -fPIC

override_dh_auto_configure:
	# backup files
	[ -f okcompilers/c.orig ] || cp okcompilers/c okcompilers/c.orig
	[ -f okcompilers/cpp.orig ] || cp okcompilers/cpp okcompilers/cpp.orig
	[ -f okcompilers/archivers.orig ] || cp okcompilers/archivers okcompilers/archivers.orig
	# reproducible build - workaround: disable duplicit implementation
	[ -f crypto_core/hsalsa20/ref2/api.h ] && mv -f crypto_core/hsalsa20/ref2/api.h crypto_core/hsalsa20/ref2/api.h.orig
	[ -f crypto_hashblocks/sha256/ref/api.h ] && mv -f crypto_hashblocks/sha256/ref/api.h crypto_hashblocks/sha256/ref/api.h.orig
	[ -f crypto_hashblocks/sha512/ref/api.h ] && mv -f crypto_hashblocks/sha512/ref/api.h crypto_hashblocks/sha512/ref/api.h.orig
	# configure compiler, disable c++ compiler, configure ar
	echo '$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)' > okcompilers/c
	true > okcompilers/cpp
	echo '$(AR)' > okcompilers/archivers

override_dh_auto_build:
	./do
	echo 'log'
	echo '==='
	cat build/debianbuildhost/log
	echo 'data'
	echo '===='
	cat build/debianbuildhost/data | grep -v 'cycles' | grep -v 'bytes'

override_dh_install:
	dh_install -plibnacl-dev build/debianbuildhost/lib/*/libnacl.a '/usr/lib/$(DEB_HOST_MULTIARCH)'
	dh_install -plibnacl-dev build/debianbuildhost/lib/*/librandombytes.a '/usr/lib/$(DEB_HOST_MULTIARCH)'
	dh_install -plibnacl-dev build/debianbuildhost/include/*/crypto_*.h '/usr/include/nacl'
	dh_install -plibnacl-dev build/debianbuildhost/include/*/randombytes.h '/usr/include/nacl'
	dh_install

%:
	dh $@

override_dh_auto_clean:
	mv -f okcompilers/c.orig okcompilers/c || :
	mv -f okcompilers/cpp.orig okcompilers/cpp || :
	mv -f okcompilers/archivers.orig okcompilers/archivers || :
	mv -f crypto_core/hsalsa20/ref2/api.h.orig crypto_core/hsalsa20/ref2/api.h || :
	mv -f crypto_hashblocks/sha256/ref/api.h.orig crypto_hashblocks/sha256/ref/api.h || :
	mv -f crypto_hashblocks/sha512/ref/api.h.orig crypto_hashblocks/sha512/ref/api.h || :
	rm -rf build
	dh_auto_clean