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
|
#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself. (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified
#
# Modified to be a prototype for debmake by Christoph Lameter <clameter@debian.org>
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all future=+lfs
export DEB_CFLAGS_MAINT_APPEND = -DOPENSSL_TLS_SECURITY_LEVEL=2
SHELL=/bin/bash
package=openssl
# For generating the manpages
export VERSION=$(DEB_VERSION_UPSTREAM)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
export CROSS_COMPILE ?= $(DEB_HOST_GNU_TYPE)-
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
CONFARGS = --prefix=/usr --openssldir=/usr/lib/ssl --libdir=lib/$(DEB_HOST_MULTIARCH) no-idea no-mdc2 no-rc5 no-zlib no-ssl3 enable-unit-test no-ssl3-method enable-rfc3779 enable-cms no-capieng
OPT_alpha = ev4 ev5
ARCHOPTS = OPT_$(DEB_HOST_ARCH)
OPTS = $($(ARCHOPTS))
ifeq (,$(findstring terse,$(DEB_BUILD_OPTIONS)))
TESTSUITE_FLAGS = HARNESS_VERBOSE=yes
else
TESTSUITE_FLAGS =
endif
ifneq ($(filter amd64 arm64 ppc64el riscv64,$(DEB_HOST_ARCH_CPU)),)
CONFARGS += enable-ec_nistp_64_gcc_128
endif
%:
dh $@ --without autoreconf
override_dh_auto_configure:
test -z "$(OPTS)" || for opt in $(OPTS); \
do \
set -xe; \
mkdir build_$$opt; \
cd build_$$opt ; \
../Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)-$$opt; \
perl configdata.pm -d; \
cd .. ;\
done
mkdir build_static; cd build_static; ../Configure no-shared $(CONFARGS) debian-$(DEB_HOST_ARCH) ;perl configdata.pm -d
# Debian Perl policy 5.1 (Script Magic)
mkdir build_shared; cd build_shared; HASHBANGPERL=/usr/bin/perl ../Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH) ;perl configdata.pm -d
override_dh_auto_build-indep:
$(MAKE) -C build_shared all
override_dh_auto_build-arch:
$(MAKE) -C build_static all
test -z "$(OPTS)" || for opt in $(OPTS); \
do \
set -xe; \
$(MAKE) -C build_$$opt all; \
done
ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
$(MAKE) -C build_shared all
override_dh_auto_test-indep:
override_dh_auto_test-arch:
ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
@echo Skipping tests
else
test -z "$(OPTS)" || for opt in $(OPTS); \
do \
set -xe; \
$(MAKE) -C build_$$opt test $(TESTSUITE_FLAGS); \
done
$(MAKE) -C build_static test $(TESTSUITE_FLAGS)
$(MAKE) -C build_shared test $(TESTSUITE_FLAGS)
endif
override_dh_auto_clean:
rm -rf build_static build_shared
test -z "$(OPTS)" || for opt in $(OPTS); \
do \
set -xe; \
rm -rf build_$$opt; \
done
rm -f doc/openssl.pod doc/crypto.pod doc/ssl.pod
dh_auto_clean
override_dh_auto_install-indep:
# Install is only required for the -indep only build, that is if
# -arch isn't run as well. Otherwise install will fail because
# usr/lib/ssl/cert is a symlink to a non existing target.
if [ ! -L debian/tmp/usr/lib/ssl/certs ]; then \
$(MAKE) -C build_shared install DESTDIR=`pwd`/debian/tmp ;\
mkdir -p debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl ;\
mv debian/tmp/usr/include/openssl/opensslconf.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl/ ;\
mv debian/tmp/usr/include/openssl/configuration.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl/ ;\
fi
override_dh_auto_install-arch:
# We need the -udeb directories now!
dh_installdirs
$(MAKE) -C build_shared install DESTDIR=`pwd`/debian/tmp
# pic static libraries, nobody should need them
cp -pf build_static/libcrypto.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.a
cp -pf build_static/libssl.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libssl.a
mkdir -p debian/tmp/etc/ssl
mv debian/tmp/usr/lib/ssl/{certs,openssl.cnf,private} debian/tmp/etc/ssl/
ln -s /etc/ssl/{certs,openssl.cnf,private} debian/tmp/usr/lib/ssl/
ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
cp -pf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.so.* debian/libcrypto3-udeb/usr/lib/
cp -pf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ossl-modules/*.so debian/libcrypto3-udeb/usr/lib/ossl-modules
cp -pf debian/tmp/etc/ssl/openssl.cnf debian/libcrypto3-udeb/usr/lib/ssl/openssl.cnf
cp -pf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so.* debian/libssl3-udeb/usr/lib/
endif
cp -auv build_shared/lib*.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
for opt in $(OPTS); \
do set -xe; \
mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/$$opt; \
cp -auv build_$$opt/lib*.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/$$opt/; \
done
mkdir -p debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl
mv debian/tmp/usr/include/openssl/opensslconf.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl/
mv debian/tmp/usr/include/openssl/configuration.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl/
override_dh_installchangelogs:
dh_installchangelogs CHANGES.md
override_dh_fixperms:
if [ -d debian/openssl/etc/ssl/private ] ; then \
chmod 700 debian/openssl/etc/ssl/private ; \
fi
dh_fixperms -a -X etc/ssl/private
override_dh_compress:
dh_compress
# symlink doc files
for p in openssl libssl-dev; do \
for f in changelog.Debian.gz changelog.gz copyright; do \
ln -sf ../libssl3/$$f debian/$$p/usr/share/doc/$$p/$$f; \
done; \
done
override_dh_perl:
dh_perl -d
override_dh_makeshlibs:
dh_makeshlibs -a -V --add-udeb="libcrypto3-udeb" -Xengines -Xossl-modules -- -c4
override_dh_shlibdeps:
sed -i '/^udeb: libssl/s/libcrypto3-udeb/libssl3-udeb/' debian/libssl3/DEBIAN/shlibs
dh_shlibdeps -a -L libssl3
|