diff options
author | Brent Cook <bcook@openbsd.org> | 2014-12-06 17:47:30 -0600 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2014-12-06 17:47:30 -0600 |
commit | d643bcf4b5fb4a84bd962b35d6b3a9227b49e6f8 (patch) | |
tree | a3f17950147e34e9b20bbb61acb8bb4c79fdba71 /update.sh | |
parent | 13035fa666c546330e9809691374e4fd0415eccc (diff) | |
download | portable-d643bcf4b5fb4a84bd962b35d6b3a9227b49e6f8.tar.gz portable-d643bcf4b5fb4a84bd962b35d6b3a9227b49e6f8.tar.bz2 portable-d643bcf4b5fb4a84bd962b35d6b3a9227b49e6f8.zip |
simplify packaging for libssl.
Follow libtls and derive the file list from the Makefile.am
template itself.
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 75 |
1 files changed, 31 insertions, 44 deletions
@@ -4,6 +4,7 @@ set -e | |||
4 | openbsd_branch=`cat OPENBSD_BRANCH` | 4 | openbsd_branch=`cat OPENBSD_BRANCH` |
5 | libressl_version=`cat VERSION` | 5 | libressl_version=`cat VERSION` |
6 | 6 | ||
7 | # pull in latest upstream code | ||
7 | if [ ! -d openbsd ]; then | 8 | if [ ! -d openbsd ]; then |
8 | if [ -z "$LIBRESSL_GIT" ]; then | 9 | if [ -z "$LIBRESSL_GIT" ]; then |
9 | git clone https://github.com/libressl-portable/openbsd.git | 10 | git clone https://github.com/libressl-portable/openbsd.git |
@@ -15,6 +16,7 @@ fi | |||
15 | git checkout $openbsd_branch | 16 | git checkout $openbsd_branch |
16 | git pull --rebase) | 17 | git pull --rebase) |
17 | 18 | ||
19 | # setup source paths | ||
18 | dir=`pwd` | 20 | dir=`pwd` |
19 | libc_src=$dir/openbsd/src/lib/libc | 21 | libc_src=$dir/openbsd/src/lib/libc |
20 | libc_regress=$dir/openbsd/src/regress/lib/libc | 22 | libc_regress=$dir/openbsd/src/regress/lib/libc |
@@ -25,6 +27,7 @@ libssl_regress=$dir/openbsd/src/regress/lib/libssl | |||
25 | libtls_src=$dir/openbsd/src/lib/libtls | 27 | libtls_src=$dir/openbsd/src/lib/libtls |
26 | openssl_cmd_src=$dir/openbsd/src/usr.bin/openssl | 28 | openssl_cmd_src=$dir/openbsd/src/usr.bin/openssl |
27 | 29 | ||
30 | # load library versions | ||
28 | source $libcrypto_src/crypto/shlib_version | 31 | source $libcrypto_src/crypto/shlib_version |
29 | libcrypto_version=$major:$minor:0 | 32 | libcrypto_version=$major:$minor:0 |
30 | echo "libcrypto version $libcrypto_version" | 33 | echo "libcrypto version $libcrypto_version" |
@@ -103,18 +106,6 @@ copy_hdrs crypto "stack/stack.h lhash/lhash.h stack/safestack.h opensslv.h | |||
103 | 106 | ||
104 | copy_hdrs ssl "srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h" | 107 | copy_hdrs ssl "srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h" |
105 | 108 | ||
106 | for i in ssl/srtp.h ssl/ssl_locl.h; do | ||
107 | $CP $libssl_src/src/$i ssl | ||
108 | done | ||
109 | |||
110 | copy_src ssl $libssl_src \ | ||
111 | "s3_meth.c s3_srvr.c s3_clnt.c s3_lib.c s3_enc.c s3_pkt.c | ||
112 | s3_both.c s23_meth.c s23_srvr.c s23_clnt.c s23_lib.c s23_pkt.c t1_meth.c | ||
113 | t1_srvr.c t1_clnt.c t1_lib.c t1_enc.c d1_meth.c d1_srvr.c d1_clnt.c | ||
114 | d1_lib.c d1_pkt.c d1_both.c d1_enc.c d1_srtp.c ssl_lib.c ssl_err2.c | ||
115 | ssl_cert.c ssl_sess.c ssl_ciph.c ssl_stat.c ssl_rsa.c ssl_asn1.c ssl_txt.c | ||
116 | ssl_algs.c bio_ssl.c ssl_err.c t1_reneg.c s3_cbc.c pqueue.c" | ||
117 | |||
118 | copy_src crypto $libssl_src \ | 109 | copy_src crypto $libssl_src \ |
119 | "cryptlib.h cryptlib.c malloc-wrapper.c mem_clr.c mem_dbg.c cversion.c | 110 | "cryptlib.h cryptlib.c malloc-wrapper.c mem_clr.c mem_dbg.c cversion.c |
120 | ex_data.c cpt_err.c o_time.c o_time.h o_str.c o_init.c md32_common.h" | 111 | ex_data.c cpt_err.c o_time.c o_time.h o_str.c o_init.c md32_common.h" |
@@ -159,9 +150,6 @@ copy_crypto chacha "chacha.c chacha-merged.c" | |||
159 | 150 | ||
160 | copy_crypto cmac "cmac.c cm_ameth.c cm_pmeth.c" | 151 | copy_crypto cmac "cmac.c cm_ameth.c cm_pmeth.c" |
161 | 152 | ||
162 | #copy_crypto cms "cms_lib.c cms_asn1.c cms_att.c cms_io.c cms_smime.c cms_err.c | ||
163 | # cms_sd.c cms_dd.c cms_cd.c cms_env.c cms_enc.c cms_ess.c cms_pwri.c cms.h cms_lcl.h" | ||
164 | |||
165 | copy_crypto comp "comp_lib.c comp_err.c c_rle.c c_zlib.c" | 153 | copy_crypto comp "comp_lib.c comp_err.c c_rle.c c_zlib.c" |
166 | 154 | ||
167 | copy_crypto conf "conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c | 155 | copy_crypto conf "conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c |
@@ -192,7 +180,6 @@ copy_crypto ecdh "ech_lib.c ech_ossl.c ech_key.c ech_err.c ech_locl.h" | |||
192 | copy_crypto ecdsa "ecs_lib.c ecs_asn1.c ecs_ossl.c ecs_sign.c ecs_vrf.c | 180 | copy_crypto ecdsa "ecs_lib.c ecs_asn1.c ecs_ossl.c ecs_sign.c ecs_vrf.c |
193 | ecs_err.c ecs_locl.h" | 181 | ecs_err.c ecs_locl.h" |
194 | 182 | ||
195 | # Engine interface is disabled | ||
196 | copy_crypto engine "eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c | 183 | copy_crypto engine "eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c |
197 | eng_table.c eng_pkey.c eng_fat.c eng_all.c tb_rsa.c tb_dsa.c tb_ecdsa.c | 184 | eng_table.c eng_pkey.c eng_fat.c eng_all.c tb_rsa.c tb_dsa.c tb_ecdsa.c |
198 | tb_dh.c tb_ecdh.c tb_rand.c tb_store.c tb_cipher.c tb_digest.c tb_pkmeth.c | 185 | tb_dh.c tb_ecdh.c tb_rand.c tb_store.c tb_cipher.c tb_digest.c tb_pkmeth.c |
@@ -289,11 +276,29 @@ copy_crypto x509v3 "v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c | |||
289 | pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c | 276 | pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c |
290 | pcy_int.h ext_dat.h" | 277 | pcy_int.h ext_dat.h" |
291 | 278 | ||
279 | # copy libtls source | ||
280 | rm -f tls/*.c tls/*.h | ||
281 | sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am | ||
282 | for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do | ||
283 | cp $libtls_src/$i tls | ||
284 | done | ||
292 | 285 | ||
293 | for i in $openssl_cmd_src/*; do | 286 | # copy openssl(1) source |
294 | cp $i apps | 287 | $CP $libc_src/stdlib/strtonum.c apps |
288 | for i in `awk '/SOURCES|HEADERS/ { print $3 }' apps/Makefile.am` ; do | ||
289 | if [ -e $openssl_app_src/$i ]; then | ||
290 | cp $openssl_app_src/$i apps | ||
291 | fi | ||
295 | done | 292 | done |
296 | 293 | ||
294 | # copy libssl source | ||
295 | rm -f ssl/*.c ssl/*.h | ||
296 | sed -e "s/libssl-version/${libssl_version}/" ssl/Makefile.am.tpl > ssl/Makefile.am | ||
297 | for i in `awk '/SOURCES|HEADERS/ { print $3 }' ssl/Makefile.am` ; do | ||
298 | cp $libssl_src/src/ssl/$i ssl | ||
299 | done | ||
300 | |||
301 | # copy libcrypto tests | ||
297 | rm -f tests/biotest.c | 302 | rm -f tests/biotest.c |
298 | for i in aead/aeadtest.c aeswrap/aes_wrap.c base64/base64test.c bf/bftest.c \ | 303 | for i in aead/aeadtest.c aeswrap/aes_wrap.c base64/base64test.c bf/bftest.c \ |
299 | bn/general/bntest.c bn/mont/mont.c \ | 304 | bn/general/bntest.c bn/mont/mont.c \ |
@@ -307,13 +312,17 @@ for i in aead/aeadtest.c aeswrap/aes_wrap.c base64/base64test.c bf/bftest.c \ | |||
307 | sha256/sha256test.c sha512/sha512test.c utf8/utf8test.c; do | 312 | sha256/sha256test.c sha512/sha512test.c utf8/utf8test.c; do |
308 | $CP $libcrypto_regress/$i tests | 313 | $CP $libcrypto_regress/$i tests |
309 | done | 314 | done |
315 | |||
316 | # copy libc tests | ||
310 | $CP $libc_regress/arc4random-fork/arc4random-fork.c tests/arc4randomforktest.c | 317 | $CP $libc_regress/arc4random-fork/arc4random-fork.c tests/arc4randomforktest.c |
311 | $CP $libc_regress/explicit_bzero/explicit_bzero.c tests | 318 | $CP $libc_regress/explicit_bzero/explicit_bzero.c tests |
312 | $CP $libc_regress/timingsafe/timingsafe.c tests | 319 | $CP $libc_regress/timingsafe/timingsafe.c tests |
313 | 320 | ||
314 | for i in asn1/asn1test.c ssl/ssltest.c ssl/testssl certs/ca.pem certs/server.pem; do | 321 | # copy libssl tests |
315 | $CP $libssl_regress/$i tests | 322 | $CP $libssl_regress/asn1/asn1test.c tests |
316 | done | 323 | $CP $libssl_regress/ssl/testssl tests |
324 | $CP $libssl_regress/certs/ca.pem tests | ||
325 | $CP $libssl_regress/certs/server.pem tests | ||
317 | 326 | ||
318 | # do not directly run all test programs | 327 | # do not directly run all test programs |
319 | test_drivers=( | 328 | test_drivers=( |
@@ -383,29 +392,7 @@ echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am | |||
383 | done | 392 | done |
384 | ) | 393 | ) |
385 | 394 | ||
386 | (cd ssl | 395 | # copy libcrypto |
387 | sed -e "s/libssl-version/${libssl_version}/" Makefile.am.tpl > Makefile.am | ||
388 | for i in `ls -1 *.c|sort`; do | ||
389 | echo "libssl_la_SOURCES += $i" >> Makefile.am | ||
390 | done | ||
391 | for i in `ls -1 *.h|sort`; do | ||
392 | echo "noinst_HEADERS += $i" >> Makefile.am | ||
393 | done | ||
394 | ) | ||
395 | |||
396 | rm -f tls/*.c tls/*.h | ||
397 | sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am | ||
398 | for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do | ||
399 | cp $libtls_src/$i tls | ||
400 | done | ||
401 | |||
402 | # conditional compiles | ||
403 | $CP $libc_src/stdlib/strtonum.c apps | ||
404 | for i in `awk '/SOURCES|HEADERS/ { print $3 }' apps/Makefile.am` ; do | ||
405 | if [ -e $openssl_app_src/$i ]; then | ||
406 | cp $openssl_app_src/$i apps | ||
407 | fi | ||
408 | done | ||
409 | 396 | ||
410 | # do not directly compile C files that are included in other C files | 397 | # do not directly compile C files that are included in other C files |
411 | crypto_excludes=( | 398 | crypto_excludes=( |