2002-04-21 17:54:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This script configures, builds and packs the binary package for
|
|
|
|
# the Cygwin net distribution version of OpenSSL
|
|
|
|
#
|
|
|
|
|
|
|
|
# Uncomment when debugging
|
|
|
|
#set -x
|
|
|
|
|
2009-11-11 19:05:20 +00:00
|
|
|
CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5"
|
2016-02-12 20:14:03 +00:00
|
|
|
DESTDIR=/tmp/install/INSTALL
|
2002-04-21 17:54:03 +00:00
|
|
|
|
|
|
|
VERSION=
|
2012-03-31 11:06:46 +00:00
|
|
|
SHLIB_VERSION_NUMBER=
|
2002-04-21 17:54:03 +00:00
|
|
|
SUBVERSION=$1
|
|
|
|
|
|
|
|
function cleanup()
|
|
|
|
{
|
2016-02-12 20:14:03 +00:00
|
|
|
rm -rf ${DESTDIR}/etc
|
|
|
|
rm -rf ${DESTDIR}/usr
|
2002-04-21 17:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function get_openssl_version()
|
|
|
|
{
|
2005-04-27 08:56:15 +00:00
|
|
|
eval `grep '^VERSION=' Makefile`
|
2002-04-21 17:54:03 +00:00
|
|
|
if [ -z "${VERSION}" ]
|
|
|
|
then
|
2005-04-27 08:56:15 +00:00
|
|
|
echo "Error: Couldn't retrieve OpenSSL version from Makefile."
|
|
|
|
echo " Check value of variable VERSION in Makefile."
|
2002-04-21 17:54:03 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2012-03-31 11:06:46 +00:00
|
|
|
eval `grep '^SHLIB_VERSION_NUMBER=' Makefile`
|
|
|
|
if [ -z "${SHLIB_VERSION_NUMBER}" ]
|
|
|
|
then
|
|
|
|
echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile."
|
|
|
|
echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile."
|
|
|
|
exit 1
|
|
|
|
fi
|
2002-04-21 17:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function base_install()
|
|
|
|
{
|
2016-02-12 20:14:03 +00:00
|
|
|
mkdir -p ${DESTDIR}
|
2002-04-21 17:54:03 +00:00
|
|
|
cleanup
|
2016-02-12 20:14:03 +00:00
|
|
|
make install DESTDIR="${DESTDIR}"
|
2002-04-21 17:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function doc_install()
|
|
|
|
{
|
2016-02-12 20:14:03 +00:00
|
|
|
DOC_DIR=${DESTDIR}/usr/share/doc/openssl
|
2002-04-21 17:54:03 +00:00
|
|
|
|
|
|
|
mkdir -p ${DOC_DIR}
|
|
|
|
cp CHANGES CHANGES.SSLeay INSTALL LICENSE NEWS README ${DOC_DIR}
|
|
|
|
|
|
|
|
create_cygwin_readme
|
|
|
|
}
|
|
|
|
|
2005-05-21 16:41:34 +00:00
|
|
|
function certs_install()
|
|
|
|
{
|
2016-02-12 20:14:03 +00:00
|
|
|
CERTS_DIR=${DESTDIR}/usr/ssl/certs
|
2005-05-21 16:41:34 +00:00
|
|
|
|
|
|
|
mkdir -p ${CERTS_DIR}
|
|
|
|
cp -rp certs/* ${CERTS_DIR}
|
|
|
|
}
|
|
|
|
|
2002-04-21 17:54:03 +00:00
|
|
|
function create_cygwin_readme()
|
|
|
|
{
|
2016-02-12 20:14:03 +00:00
|
|
|
README_DIR=${DESTDIR}/usr/share/doc/Cygwin
|
2002-04-21 17:54:03 +00:00
|
|
|
README_FILE=${README_DIR}/openssl-${VERSION}.README
|
|
|
|
|
|
|
|
mkdir -p ${README_DIR}
|
|
|
|
cat > ${README_FILE} <<- EOF
|
|
|
|
The Cygwin version has been built using the following configure:
|
|
|
|
|
|
|
|
./config ${CONFIG_OPTIONS}
|
|
|
|
|
2009-11-11 19:05:20 +00:00
|
|
|
The IDEA and RC5 algorithms are disabled due to patent and/or
|
2002-04-21 17:54:03 +00:00
|
|
|
licensing issues.
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
function create_profile_files()
|
|
|
|
{
|
2016-02-12 20:14:03 +00:00
|
|
|
PROFILE_DIR=${DESTDIR}/etc/profile.d
|
2002-04-21 17:54:03 +00:00
|
|
|
|
|
|
|
mkdir -p $PROFILE_DIR
|
|
|
|
cat > ${PROFILE_DIR}/openssl.sh <<- "EOF"
|
|
|
|
export MANPATH="${MANPATH}:/usr/ssl/man"
|
|
|
|
EOF
|
|
|
|
cat > ${PROFILE_DIR}/openssl.csh <<- "EOF"
|
|
|
|
if ( $?MANPATH ) then
|
|
|
|
setenv MANPATH "${MANPATH}:/usr/ssl/man"
|
|
|
|
else
|
|
|
|
setenv MANPATH ":/usr/ssl/man"
|
|
|
|
endif
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -z "${SUBVERSION}" ]
|
|
|
|
then
|
|
|
|
echo "Usage: $0 subversion"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f config ]
|
|
|
|
then
|
|
|
|
echo "You must start this script in the OpenSSL toplevel source dir."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
./config ${CONFIG_OPTIONS}
|
|
|
|
|
|
|
|
get_openssl_version
|
|
|
|
|
2002-11-14 12:39:39 +00:00
|
|
|
make depend || exit 1
|
|
|
|
|
2002-04-21 17:54:03 +00:00
|
|
|
make || exit 1
|
|
|
|
|
|
|
|
base_install
|
|
|
|
|
|
|
|
doc_install
|
|
|
|
|
2005-05-21 16:41:34 +00:00
|
|
|
certs_install
|
|
|
|
|
2002-04-21 17:54:03 +00:00
|
|
|
create_cygwin_readme
|
|
|
|
|
|
|
|
create_profile_files
|
|
|
|
|
2016-02-12 20:14:03 +00:00
|
|
|
cd ${DESTDIR}
|
2005-06-23 20:55:38 +00:00
|
|
|
chmod u+w usr/lib/engines/*.so
|
|
|
|
strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so
|
|
|
|
chmod u-w usr/lib/engines/*.so
|
2002-04-21 17:54:03 +00:00
|
|
|
|
|
|
|
# Runtime package
|
2012-03-31 11:06:46 +00:00
|
|
|
tar cjf libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \
|
2010-08-24 21:51:08 +00:00
|
|
|
usr/bin/cyg*dll
|
|
|
|
# Base package
|
|
|
|
find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \
|
|
|
|
usr/ssl/certs usr/ssl/man/man[157] usr/ssl/misc usr/ssl/openssl.cnf \
|
|
|
|
usr/ssl/private \
|
2005-05-21 16:41:34 +00:00
|
|
|
-empty -o \! -type d |
|
2003-01-13 14:47:52 +00:00
|
|
|
tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 -
|
2002-04-21 17:54:03 +00:00
|
|
|
# Development package
|
2005-05-21 16:41:34 +00:00
|
|
|
find usr/include usr/lib/*.a usr/lib/pkgconfig usr/ssl/man/man3 \
|
|
|
|
-empty -o \! -type d |
|
2003-01-13 14:47:52 +00:00
|
|
|
tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 -
|
2002-04-21 17:54:03 +00:00
|
|
|
|
2003-01-13 14:47:52 +00:00
|
|
|
ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2
|
|
|
|
ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2
|
2012-03-31 11:06:46 +00:00
|
|
|
ls -l libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2
|
2002-04-21 17:54:03 +00:00
|
|
|
|
|
|
|
cleanup
|
|
|
|
|
|
|
|
exit 0
|