-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathrules
More file actions
executable file
·131 lines (114 loc) · 3.83 KB
/
Copy pathrules
File metadata and controls
executable file
·131 lines (114 loc) · 3.83 KB
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
#!/usr/bin/make -f
%:
dh $@
# Multiarch triplet
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
# Destination directory for installation
DESTDIR=$(CURDIR)/debian/tmp
# Grab the base version from debian/changelog
BASEVER := $(shell dpkg-parsechangelog -SVersion)
# Check if FIPS build is requested
WOLFSSL_ISFIPS?=0
# Variant-specific metadata
ifeq ($(WOLFSSL_ISFIPS),1)
VARIANT := fips
VARIANT_DESC := FIPS build
VARIANT_PROVIDES := libwolfprov-fips
VERSION := $(BASEVER)-fips
FIPS_FLAG := --enable-fips
PROVIDER_CONF := provider-fips.conf
else
VARIANT := non-fips
VARIANT_DESC := non-FIPS build
VARIANT_PROVIDES := libwolfprov-nonfips
VERSION := $(BASEVER)
PROVIDER_CONF := provider.conf
FIPS_FLAG :=
endif
# Debug build flag
WOLFPROV_DEBUG?=0
DEBUG_FLAG=
ifeq ($(WOLFPROV_DEBUG),1)
VARIANT := $(VARIANT)-debug
VARIANT_DESC := $(VARIANT_DESC) with debug logs
VERSION := $(VERSION)-debug
DEBUG_FLAG := --enable-debug --enable-debug-silent
endif
ifeq ($(DEB_CFLAGS_APPEND),)
export PKG_CONFIG_LIBDIR # value comes from outer environment
export PKG_CONFIG_DIR :=
export PKG_CONFIG_PATH :=
endif
override_dh_auto_configure:
./autogen.sh
@if [ -n "$(DEB_CFLAGS_APPEND)" ]; then \
printf "DEB_CFLAGS_APPEND: %s\n" $(DEB_CFLAGS_APPEND); \
printf "DEB_CPPFLAGS_APPEND: %s\n" $(DEB_CPPFLAGS_APPEND); \
printf "DEB_CXXFLAGS_APPEND: %s\n" $(DEB_CXXFLAGS_APPEND); \
printf "DEB_LDFLAGS_APPEND: %s\n" $(DEB_LDFLAGS_APPEND); \
@echo "PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR)" \
# ensure only our .pc dirs are searched: \
PKG_CONFIG_DIR= PKG_CONFIG_PATH= \
PKG_CONFIG_LIBDIR="$(PKG_CONFIG_LIBDIR)" \
dh_auto_configure -- $(DEBUG_FLAG) --enable-seed-src; \
else \
./configure $(DEBUG_FLAG) --enable-seed-src; \
fi
override_dh_auto_build:
$(MAKE)
override_dh_auto_install:
install -d $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/ossl-modules
install -m755 ./.libs/libwolfprov.so.0.0.0 \
$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/ossl-modules/
install -d $(DESTDIR)/usr/include/wolfprovider
install -m644 ./include/wolfprovider/*.h \
$(DESTDIR)/usr/include/wolfprovider/
# $(MAKE) DESTDIR=$(DESTDIR) install
# Install provider config file
install -d $(DESTDIR)/etc/ssl/openssl.cnf.d
install -m644 ./$(PROVIDER_CONF) \
$(DESTDIR)/etc/ssl/openssl.cnf.d/wolfprovider.conf
override_dh_makeshlibs:
# libwolfprov is a provider module (no SONAME); skip shlibs
:
override_dh_gencontrol:
# Only set variables for wolfProvider packages
dh_gencontrol -- \
-v$(VERSION) \
-Vvariant=$(VARIANT) \
-Vvariant:desc="$(VARIANT_DESC)" \
-Vvariant:provides="$(VARIANT_PROVIDES)"
override_dh_auto_clean:
dh_auto_clean
rm -rf test/standalone/tests/.libs
override_dh_auto_test:
@REPLACE_DEFAULT=0; \
if command -v openssl >/dev/null 2>&1; then \
OPENSSL_VERSION=$$(openssl version 2>/dev/null || echo ""); \
if echo "$$OPENSSL_VERSION" | grep -qi "wolfProvider"; then \
REPLACE_DEFAULT=1; \
fi; \
fi; \
if [ $$REPLACE_DEFAULT -eq 1 ]; then \
echo "Skipping unit tests (OpenSSL built with replace-default mode)"; \
else \
if [ -n "$(DEB_LDFLAGS_APPEND)" ]; then \
# If DEB_LDFLAGS_APPEND is set, it usually means the \
# build system is using a custom library path, rather \
# than the system path. So let's set up LD_LIBRARY_PATH \
# to use it when running `make test`. \
echo "Setting up LD_LIBRARY_PATH from DEB_LDFLAGS_APPEND"; \
LD_LIBRARY_PATH="$$(echo $(DEB_LDFLAGS_APPEND) | \
grep -oE -- '-L[^ ]+' | sed 's/^-L//' | awk '!seen[$$0]++' | paste -sd: -)" \
$(MAKE) test; \
else \
$(MAKE) test; \
fi; \
fi
override_dh_shlibdeps:
@if [ -n "$(DEB_LDFLAGS_APPEND)" ]; then \
# Skip shlibdeps for now since we're using a custom library path \
: \
else \
dh_shlibdeps; \
fi