summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util/cygwin.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/util/cygwin.sh')
-rw-r--r--src/lib/libcrypto/util/cygwin.sh127
1 files changed, 127 insertions, 0 deletions
diff --git a/src/lib/libcrypto/util/cygwin.sh b/src/lib/libcrypto/util/cygwin.sh
new file mode 100644
index 0000000000..7f791d47f4
--- /dev/null
+++ b/src/lib/libcrypto/util/cygwin.sh
@@ -0,0 +1,127 @@
1#!/bin/bash
2#
3# This script configures, builds and packs the binary package for
4# the Cygwin net distribution version of OpenSSL
5#
6
7# Uncomment when debugging
8#set -x
9
10CONFIG_OPTIONS="--prefix=/usr shared no-idea no-rc5 no-mdc2"
11INSTALL_PREFIX=/tmp/install
12
13VERSION=
14SUBVERSION=$1
15
16function cleanup()
17{
18 rm -rf ${INSTALL_PREFIX}/etc
19 rm -rf ${INSTALL_PREFIX}/usr
20}
21
22function get_openssl_version()
23{
24 eval `grep '^VERSION=' Makefile`
25 if [ -z "${VERSION}" ]
26 then
27 echo "Error: Couldn't retrieve OpenSSL version from Makefile."
28 echo " Check value of variable VERSION in Makefile."
29 exit 1
30 fi
31}
32
33function base_install()
34{
35 mkdir -p ${INSTALL_PREFIX}
36 cleanup
37 make install INSTALL_PREFIX="${INSTALL_PREFIX}"
38}
39
40function doc_install()
41{
42 DOC_DIR=${INSTALL_PREFIX}/usr/share/doc/openssl
43
44 mkdir -p ${DOC_DIR}
45 cp CHANGES CHANGES.SSLeay INSTALL LICENSE NEWS README ${DOC_DIR}
46
47 create_cygwin_readme
48}
49
50function create_cygwin_readme()
51{
52 README_DIR=${INSTALL_PREFIX}/usr/share/doc/Cygwin
53 README_FILE=${README_DIR}/openssl-${VERSION}.README
54
55 mkdir -p ${README_DIR}
56 cat > ${README_FILE} <<- EOF
57 The Cygwin version has been built using the following configure:
58
59 ./config ${CONFIG_OPTIONS}
60
61 The IDEA, RC5 and MDC2 algorithms are disabled due to patent and/or
62 licensing issues.
63 EOF
64}
65
66function create_profile_files()
67{
68 PROFILE_DIR=${INSTALL_PREFIX}/etc/profile.d
69
70 mkdir -p $PROFILE_DIR
71 cat > ${PROFILE_DIR}/openssl.sh <<- "EOF"
72 export MANPATH="${MANPATH}:/usr/ssl/man"
73 EOF
74 cat > ${PROFILE_DIR}/openssl.csh <<- "EOF"
75 if ( $?MANPATH ) then
76 setenv MANPATH "${MANPATH}:/usr/ssl/man"
77 else
78 setenv MANPATH ":/usr/ssl/man"
79 endif
80 EOF
81}
82
83if [ -z "${SUBVERSION}" ]
84then
85 echo "Usage: $0 subversion"
86 exit 1
87fi
88
89if [ ! -f config ]
90then
91 echo "You must start this script in the OpenSSL toplevel source dir."
92 exit 1
93fi
94
95./config ${CONFIG_OPTIONS}
96
97get_openssl_version
98
99make depend || exit 1
100
101make || exit 1
102
103base_install
104
105doc_install
106
107create_cygwin_readme
108
109create_profile_files
110
111cd ${INSTALL_PREFIX}
112strip usr/bin/*.exe usr/bin/*.dll
113
114# Runtime package
115find etc usr/bin usr/share/doc usr/ssl/certs usr/ssl/man/man[157] \
116 usr/ssl/misc usr/ssl/openssl.cnf usr/ssl/private -empty -o \! -type d |
117tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 -
118# Development package
119find usr/include usr/lib usr/ssl/man/man3 -empty -o \! -type d |
120tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 -
121
122ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2
123ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2
124
125cleanup
126
127exit 0