File: rules

package info (click to toggle)
bearssl 0.6%2Bdfsg.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,484 kB
  • sloc: ansic: 49,044; cs: 3,473; sh: 524; makefile: 40
file content (45 lines) | stat: -rwxr-xr-x 1,411 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# bearssl is designed to be 'small' and
# by default is compiled using -Os
export DEB_CFLAGS_MAINT_APPEND = -Os

# crossbuild
ifneq  ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
include /usr/share/dpkg/buildtools.mk
endif

include /usr/share/dpkg/pkg-info.mk
SOVER =$(shell echo '$(DEB_VERSION_UPSTREAM)' | sed 's/+dfsg\.[[:digit:]]//')
LIBVER =$(shell echo '$(DEB_VERSION_UPSTREAM)' | cut -d. -f1)
LIBDIR = /usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_auto_configure:
	echo '#debian config' > conf/debian.mk
	echo 'include conf/Unix.mk' >> conf/debian.mk
	echo 'BUILD=build' >> conf/debian.mk
	echo 'CC=$(CC)' >> conf/debian.mk
	echo 'AR=$(AR)' >> conf/debian.mk
	echo 'LD=$(CC)' >> conf/debian.mk
	echo 'LDDLL=$(CC)' >> conf/debian.mk
	echo 'D=.so.$(SOVER)' >> conf/debian.mk
	echo 'CFLAGS+=$(CFLAGS) $(CPPFLAGS)' >> conf/debian.mk
	echo 'LDFLAGS+=$(CFLAGS) $(CPPFLAGS) $(LDFLAGS)' >> conf/debian.mk
	echo 'LDDLLFLAGS+=$(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wl,-soname,libbearssl.so.$(LIBVER)' >> conf/debian.mk
	echo 'TOOLS = no' >> conf/debian.mk
	echo 'TESTS = no' >> conf/debian.mk

override_dh_auto_build:
	$(MAKE) CONF=debian
	(cd build; ln -s libbearssl.so.$(SOVER) libbearssl.so.$(LIBVER); ln -s libbearssl.so.$(SOVER) libbearssl.so)

override_dh_auto_clean:
	rm -rf build/* conf/debian.mk
	dh_auto_clean

%:
	dh $@