3 # This script configures, builds and packs the binary package for
4 # the Cygwin net distribution version of OpenSSL
7 # Uncomment when debugging
10 CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5"
11 INSTALL_PREFIX=/tmp/install
18 rm -rf ${INSTALL_PREFIX}/etc
19 rm -rf ${INSTALL_PREFIX}/usr
22 function get_openssl_version()
24 eval `grep '^VERSION=' Makefile`
25 if [ -z "${VERSION}" ]
27 echo "Error: Couldn't retrieve OpenSSL version from Makefile."
28 echo " Check value of variable VERSION in Makefile."
33 function base_install()
35 mkdir -p ${INSTALL_PREFIX}
37 make install INSTALL_PREFIX="${INSTALL_PREFIX}"
40 function doc_install()
42 DOC_DIR=${INSTALL_PREFIX}/usr/share/doc/openssl
45 cp CHANGES CHANGES.SSLeay INSTALL LICENSE NEWS README ${DOC_DIR}
50 function certs_install()
52 CERTS_DIR=${INSTALL_PREFIX}/usr/ssl/certs
55 cp -rp certs/* ${CERTS_DIR}
58 function create_cygwin_readme()
60 README_DIR=${INSTALL_PREFIX}/usr/share/doc/Cygwin
61 README_FILE=${README_DIR}/openssl-${VERSION}.README
63 mkdir -p ${README_DIR}
64 cat > ${README_FILE} <<- EOF
65 The Cygwin version has been built using the following configure:
67 ./config ${CONFIG_OPTIONS}
69 The IDEA and RC5 algorithms are disabled due to patent and/or
74 function create_profile_files()
76 PROFILE_DIR=${INSTALL_PREFIX}/etc/profile.d
79 cat > ${PROFILE_DIR}/openssl.sh <<- "EOF"
80 export MANPATH="${MANPATH}:/usr/ssl/man"
82 cat > ${PROFILE_DIR}/openssl.csh <<- "EOF"
84 setenv MANPATH "${MANPATH}:/usr/ssl/man"
86 setenv MANPATH ":/usr/ssl/man"
91 if [ -z "${SUBVERSION}" ]
93 echo "Usage: $0 subversion"
99 echo "You must start this script in the OpenSSL toplevel source dir."
103 ./config ${CONFIG_OPTIONS}
107 make depend || exit 1
122 chmod u+w usr/lib/engines/*.so
123 strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so
124 chmod u-w usr/lib/engines/*.so
127 find etc usr/bin usr/lib/engines usr/share/doc usr/ssl/certs \
128 usr/ssl/man/man[157] usr/ssl/misc usr/ssl/openssl.cnf usr/ssl/private \
129 -empty -o \! -type d |
130 tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 -
131 # Development package
132 find usr/include usr/lib/*.a usr/lib/pkgconfig usr/ssl/man/man3 \
133 -empty -o \! -type d |
134 tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 -
136 ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2
137 ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2