summaryrefslogtreecommitdiffstats
path: root/main/openssl/APKBUILD
blob: 87da75d524c64455707500fa9c80ad8c76171955 (plain)
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
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openssl
pkgver=1.0.1i
pkgrel=2
pkgdesc="Toolkit for SSL v2/v3 and TLS v1"
url="http://openssl.org"
depends=
makedepends_build="perl"
makedepends_host="zlib-dev"
makedepends="$makedepends_host $makedepends_build"
depends_dev="zlib-dev"
arch="all"
license="openssl"

subpackages="$pkgname-dev $pkgname-doc libcrypto1.0:libcrypto libssl1.0:libssl"

source="http://www.openssl.org/source/${pkgname}-${pkgver}.tar.gz
	fix-manpages.patch
	openssl-bb-basename.patch
	0001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch
	0002-engines-e_padlock-backport-cvs-head-changes.patch
	0003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
	0004-crypto-engine-autoload-padlock-dynamic-engine.patch
	0005-s_client-ircv3-starttls.patch
	openssl-1.0.1-version-eglibc.patch
	openssl-use-termios.patch
	fix-default-apps-capath.patch
	c_rehash.c
	openssl-1.0.1-parallel-build.patch
	abi-compat-no-freelists.patch
	"

_builddir="$srcdir"/$pkgname-$pkgver

prepare() {
        cd "$_builddir"
        for patch in $source; do
                case $patch in
                # we concider patches with uclibc in its name
                # only usefull on uclibc install
                *uclibc*.patch)
                        if [ "$ALPINE_LIBC" != "eglibc" ]; then
                                msg "Applying patch $patch"
                                patch -p1 -i "$srcdir"/$patch || return 1
                        fi
                        ;;
                # same applied to eglibc
                *eglibc*.patch)
                        if [ "$ALPINE_LIBC" = "eglibc" ]; then
                                msg "Applying patch $patch"
                                patch -p1 -i "$srcdir"/$patch || return 1
                        fi
                        ;;
                *.patch)
                        msg "Applying patch $patch"
                        patch -p1 -i "$srcdir"/$patch || return 1
                        ;;
                esac
        done
}

build() {
	local _target
	cd "$_builddir"

	# openssl will prepend crosscompile always core CC et al
	CC=${CC#${CROSS_COMPILE}}
	CXX=${CXX#${CROSS_COMPILE}}
	CPP=${CPP#${CROSS_COMPILE}}

	# determine target OS for openssl
	case "$CARCH" in
	x86)    _target="linux-elf" ;;
	x86_64) _target="linux-x86_64" ;;
	arm*)   _target="linux-armv4" ;;
	*)	msg "Unable to determine architecture from (CARCH=$CARCH)" ; return 1 ;;
	esac

	# Configure assumes --options are for it, so can't use
	# gcc's --sysroot fake this by overriding CC
	[ -n "$CBUILDROOT" ] && CC="$CC --sysroot=${CBUILDROOT}"

	perl ./Configure $_target --prefix=/usr \
		--libdir=lib \
		--openssldir=/etc/ssl \
		shared zlib enable-montasm enable-md2 \
		-DOPENSSL_NO_BUF_FREELISTS \
		-Wa,--noexecstack \
		|| return 1

	make && make build-shared || return 1

	# replace the c_rehash perl script with our C-version
	$CC $CFLAGS -I include -L . "$srcdir"/c_rehash.c -o tools/c_rehash -lcrypto || return 1
}

package() {
	cd "$_builddir"
	make INSTALL_PREFIX="$pkgdir" MANDIR=/usr/share/man install || return 1

	# rename man pages that conflict with man-pages
	local m
	for m in rand.3 err.3 threads.3 passwd.1; do
		mv "$pkgdir"/usr/share/man/man${m/*.}/$m \
		   "$pkgdir"/usr/share/man/man${m/*.}/openssl-$m \
			|| return 1
	done
}

libcrypto() {
	pkgdesc="Crypto library from openssl"
	replaces="openssl libcrypto"
	mkdir -p "$subpkgdir"/lib "$subpkgdir"/usr/lib
	for i in "$pkgdir"/usr/lib/libcrypto*; do
		mv $i "$subpkgdir"/lib/
		ln -s ../../lib/${i##*/} "$subpkgdir"/usr/lib/${i##*/}
	done
	mv "$pkgdir"/usr/lib/engines "$subpkgdir"/usr/lib/
}

libssl() {
	pkgdesc="SSL shared libraries"
	replaces="openssl"
	mkdir -p "$subpkgdir"/lib "$subpkgdir"/usr/lib
	for i in "$pkgdir"/usr/lib/libssl*; do
		mv $i "$subpkgdir"/lib/
		ln -s ../../lib/${i##*/} "$subpkgdir"/usr/lib/${i##*/}
	done
}

md5sums="c8dc151a671b9b92ff3e4c118b174972  openssl-1.0.1i.tar.gz
f75151bfdd0e1f5191e0d0e7147e1638  fix-manpages.patch
c6a9857a5dbd30cead0404aa7dd73977  openssl-bb-basename.patch
ddb5fc155145d5b852425adaec32234d  0001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch
4a7b9e20beb33a5e262ab64c2b8e5b48  0002-engines-e_padlock-backport-cvs-head-changes.patch
cef4633142031b59960200e87ce3bb18  0003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
c32f42451a07267ee5dfb3781fa40c00  0004-crypto-engine-autoload-padlock-dynamic-engine.patch
c5b1042a3acaf3591f3f5620b7086e12  0005-s_client-ircv3-starttls.patch
d1f3aaad7c36590f21355682983cd14e  openssl-1.0.1-version-eglibc.patch
2681796363085d01db8a81c249cd2d7b  openssl-use-termios.patch
efec1bce615256961b1756e575ee1d0a  fix-default-apps-capath.patch
05ad806219cef6fa5692ac727af7fab6  c_rehash.c
60ca340e32944e4825747e3681ccd553  openssl-1.0.1-parallel-build.patch
b7f2421187ae2b4c7e424cda2022d41d  abi-compat-no-freelists.patch"
sha256sums="3c179f46ca77069a6a0bac70212a9b3b838b2f66129cb52d568837fc79d8fcc7  openssl-1.0.1i.tar.gz
92296c9e121af10ecc1e302695bf2ceacaa9b00702e580504fc0ed04a9fba86e  fix-manpages.patch
82863c2fed659a7186c7f3905a1853b8bd8060350ad101ce159fa7e7d2ba27e8  openssl-bb-basename.patch
18dd81fefb39b3328a444774ed10871ed50348ca171d2da9f826f916127b2dae  0001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch
39c31c2e33cded09543a2d1fd2e3238e9d11c672ba71a14d13095baad3ec9696  0002-engines-e_padlock-backport-cvs-head-changes.patch
cbb2493ec9157e78035e9cc02be17655996ee9cd0a71b79507fc19f3862f452b  0003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
157ec6d17add25b96956abc7c44259c91eebe8a6c1026cdb976b895bf42ec56f  0004-crypto-engine-autoload-padlock-dynamic-engine.patch
44b553d92e33c48f854a8e15b23830375bc400e987505c74956ac196266f0d46  0005-s_client-ircv3-starttls.patch
51146851d8454dcb73138f794ced8bd629658b4a0524c466f61b653fff536c93  openssl-1.0.1-version-eglibc.patch
05266a671143cf17367dee8d409ad6d0857201392c99731d7ebb8f8cdcdc32f7  openssl-use-termios.patch
1e11d6b8cdcdd6957c69d33ab670c5918fc96c12fdb9b76b4287cb8f69c3545d  fix-default-apps-capath.patch
7b0947fd09ad1e8d9cea360b883090025b40193d0fc8a631f2e3bb42db28d76b  c_rehash.c
bd56e5fe1b6fe594ab93f34d25fef0b7372633bad8532f81da998f3e6655d221  openssl-1.0.1-parallel-build.patch
41c7c1e5bea7f7e0ccc59203a48f097948627d72fcf87f943fcfe8c14b4069a2  abi-compat-no-freelists.patch"
sha512sums="6cbcdcec8568236e8f20f0461f93df8a193a0ad88102ff548443e6ec87e2a7f649e314beee1e6bafda693934b4fb142244b61d14bf736828dda09e277b941d93  openssl-1.0.1i.tar.gz
b0eda7e9b53195b0855da68617201c3c7026eb7464ab58f0bc9923013663ec6b826d1868fe88b87118d3134114cbd9ac15d2c8389c85ef9c1bb4d18575b68a5b  fix-manpages.patch
6c4f4b0c1b606b3e5a8175618c4398923392f9c25ad8d3f5b65b0424fe51e104c4f456d2da590d9f572382225ab320278e88db1585790092450cad60a02819a5  openssl-bb-basename.patch
ea282b09d4692a29e5a554e19b0798fa921717d4892decc68cba92cad11e85e4064d8ac78d98f6fa8bb45c65fdd1a5d1a6f6755e53102d520e9d8b807c3a7822  0001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch
96cdd28d1ad5efd3f5836b4c57c9c6ea8e790fbf919e32a8c4acd3883a3531b8d295053a4aa20e6165600153b141ce7b0a3d1d736fdfc325d59862b845aa4d98  0002-engines-e_padlock-backport-cvs-head-changes.patch
b019320869d215014ad46e0b29aa239e31243571c4d45256b3ce6449a67fdc106a381c1cf3abd55ddbfd6a0e9ffa3e3167377317cbc72b254b1f9bcc0e22b8b6  0003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
3bedc326ca3e5945bc4ec4dccfe596042ee87aaeaf90b5063110a99cc8e38584838d68289907e4a3fcdb8e04635052ad0759c94e1d7070bb317c2066e2506bbe  0004-crypto-engine-autoload-padlock-dynamic-engine.patch
70cd257bbd5a86685dc2508399e67746b60ed5d581eb84fe4d4fc6af214f31b71e2a58ad758d572976a61f67bf64c37a935a9788db160f75bced75397b9bcce3  0005-s_client-ircv3-starttls.patch
6db9d9ee62048d27f80e392eda99a46712ee85f1c8fd49f4931be73c880da8b84844a72657f7bceddb7db0026daddd31870d9c5065494f8d359ee8560284fd4a  openssl-1.0.1-version-eglibc.patch
22261ad902ad4826db889fa0e6196b57d6cb389c1707f5827ba48a4630097e590979257f16f4a36fe611199fa33ba32d5f412c8b93beb84001865c2501b288da  openssl-use-termios.patch
f2e737146a473d55b99f27457718ca299a02a0c74009026a30c3d1347c575bc264962b5708995e02ef7d68521b8366ccea7320523efb87b1ab2632d73fec5658  fix-default-apps-capath.patch
17b5ecda9c51a4a6b7a2b5fea65abc90091ae9c8d43527546148769d8fcfd87450075830b874fcff21b9ad0c31366213b4bfb8665e09cbd2559a8f3688b9aebd  c_rehash.c
7255b3315133e415631b2ecadc8f5c50a705b9db507c46efded0190363ce9eb31ffbfe01c500669c060878e5202f858b1d2475c64948426fbf70820b4c798ba1  openssl-1.0.1-parallel-build.patch
38156d183ebf80de0a39c046b1dddaf99ae64286214f3ee9de51d28212933b5f16c23908aef0aa3d71188306b064969b99da2a0a75693b6bba1bc32884c78b31  abi-compat-no-freelists.patch"