Compare commits
2 Commits
master
...
mkirk/1.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d698d9ff84 | ||
|
|
e3aa94cd8c |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
file.tgz
|
||||
*.tar.gz
|
||||
lib
|
||||
opensslIncludes
|
||||
|
||||
147
OpenSSL.podspec
147
OpenSSL.podspec
@ -1,89 +1,33 @@
|
||||
# Configuration
|
||||
# Pod maintainer step 1 of 2. Modify the OPENSSL_VERSION.
|
||||
OPENSSL_VERSION="1.0.2m"
|
||||
|
||||
# Pod maintainer step 2 of 2. Update the checksum file
|
||||
#
|
||||
# shasum -a256 "openssl-${OPENSSL_VERSION}.tar.gz" > checksum
|
||||
#
|
||||
# Verify output with the checksum published on https://www.openssl.org/source/
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "OpenSSL"
|
||||
s.version = "1.0.213"
|
||||
s.version = "1.0.212"
|
||||
s.summary = "OpenSSL is an SSL/TLS and Crypto toolkit. Deprecated in Mac OS and gone in iOS, this spec gives your project non-deprecated OpenSSL support."
|
||||
s.author = "OpenSSL Project <openssl-dev@openssl.org>"
|
||||
s.source = { http: "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz", sha256: "8c6ff15ec6b319b50788f42c7abc2890c08ba5a1cdcd3810eb9092deada37b0f" }
|
||||
|
||||
s.homepage = "https://github.com/WhisperSystems/OpenSSL-Pod"
|
||||
s.source_files = "opensslIncludes/openssl/*.h"
|
||||
s.header_dir = "openssl"
|
||||
s.source = { :http => "https://www.openssl.org/source/openssl-1.0.2l.tar.gz", :sha256 => "ce07195b659e75f4e1db43552860070061f156a98bb37b672b101ba6e3ddf30c"}
|
||||
s.license = { :type => 'OpenSSL (OpenSSL/SSLeay)', :file => 'LICENSE' }
|
||||
s.header_dir = "openssl"
|
||||
|
||||
s.ios.deployment_target = "8.0"
|
||||
s.ios.public_header_files = "opensslIncludes/openssl/*.h"
|
||||
s.ios.vendored_libraries = "lib/libcrypto.a", "lib/libssl.a"
|
||||
|
||||
s.libraries = 'crypto', 'ssl'
|
||||
s.requires_arc = false
|
||||
s.prepare_command = <<-CMD
|
||||
OPENSSL_VERSION="#{OPENSSL_VERSION}"
|
||||
|
||||
CHECKSUM_FILE="checksum"
|
||||
|
||||
SRC_TARBALL="openssl-${OPENSSL_VERSION}.tar.gz"
|
||||
SRC_URL="https://www.openssl.org/source/${SRC_TARBALL}"
|
||||
|
||||
if [ -f file.tgz ]
|
||||
then
|
||||
echo "Using existing file.tgz"
|
||||
mv file.tgz $SRC_TARBALL
|
||||
else
|
||||
echo "Downloading from ${SRC_URL}"
|
||||
curl -O "${SRC_URL}"
|
||||
if [ ! -f $SRC_TARBALL ]
|
||||
then
|
||||
echo "Failed to download ${SRC_URL}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Ensure checksum matches incase we're installing from development pod
|
||||
# (Cocoapods checks for us if we're downloading from source)
|
||||
if [ ! -f $CHECKSUM_FILE ]
|
||||
then
|
||||
echo "Missing checksum file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shasum -c $CHECKSUM_FILE
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "Checksum OK."
|
||||
else
|
||||
echo "Checksum failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION="1.0.2l"
|
||||
SDKVERSION=`xcrun --sdk iphoneos --show-sdk-version 2> /dev/null`
|
||||
MIN_SDK_VERSION_FLAG="-miphoneos-version-min=8.0"
|
||||
MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"
|
||||
|
||||
BASEPATH="${PWD}"
|
||||
BUILD_ROOT="/tmp/openssl-pod"
|
||||
|
||||
# Order of ARCHS is somewhat significant since our pod exposes the headers from the last built arch
|
||||
CURRENTPATH="/tmp/openssl"
|
||||
ARCHS="i386 x86_64 armv7 armv7s arm64"
|
||||
DEVELOPER=`xcode-select -print-path`
|
||||
OUTPUT_DIR="${BUILD_ROOT}/output"
|
||||
|
||||
mkdir -p "${OUTPUT_DIR}"
|
||||
mkdir -p "${CURRENTPATH}"
|
||||
mkdir -p "${CURRENTPATH}/bin"
|
||||
|
||||
cp "${SRC_TARBALL}" "${BUILD_ROOT}/${SRC_TARBALL}"
|
||||
cd "${BUILD_ROOT}"
|
||||
tar -xzf "${SRC_TARBALL}"
|
||||
SRC_DIR="openssl-${OPENSSL_VERSION}"
|
||||
cd $SRC_DIR
|
||||
cp "file.tgz" "${CURRENTPATH}/file.tgz"
|
||||
cd "${CURRENTPATH}"
|
||||
tar -xzf file.tgz
|
||||
cd "openssl-${VERSION}"
|
||||
|
||||
echo "Building OpenSSL. This will take a while..."
|
||||
for ARCH in ${ARCHS}
|
||||
do
|
||||
CONFIGURE_FOR="iphoneos-cross"
|
||||
@ -103,64 +47,49 @@ Pod::Spec.new do |s|
|
||||
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
|
||||
export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"
|
||||
|
||||
echo "Building openssl-${OPENSSL_VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"
|
||||
echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"
|
||||
echo "Please stand by..."
|
||||
|
||||
export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} ${MIN_SDK_VERSION_FLAG}"
|
||||
mkdir -p "${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
|
||||
LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-openssl-${VERSION}.log"
|
||||
|
||||
ARCH_OUTPUT_DIR="${OUTPUT_DIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
|
||||
mkdir -p "${ARCH_OUTPUT_DIR}"
|
||||
SSL_BUILD_LOG="${ARCH_OUTPUT_DIR}/build-openssl-${OPENSSL_VERSION}.log"
|
||||
LIPO_LIBSSL="${LIPO_LIBSSL} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libssl.a"
|
||||
LIPO_LIBCRYPTO="${LIPO_LIBCRYPTO} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libcrypto.a"
|
||||
|
||||
echo "Starting build for ${ARCH} / ${OPENSSL_VERSION}" > $SSL_BUILD_LOG
|
||||
|
||||
./Configure ${CONFIGURE_FOR} --prefix="${ARCH_OUTPUT_DIR}" --openssldir="${ARCH_OUTPUT_DIR}" >> "${SSL_BUILD_LOG}" 2>&1
|
||||
./Configure ${CONFIGURE_FOR} --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1
|
||||
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"
|
||||
|
||||
make -j8 build_libs >> "${SSL_BUILD_LOG}" 2>&1
|
||||
make install >> "${SSL_BUILD_LOG}" 2>&1
|
||||
make clean >> "${SSL_BUILD_LOG}" 2>&1
|
||||
|
||||
if [ ! -f "${ARCH_OUTPUT_DIR}/lib/libssl.a" ]
|
||||
then
|
||||
echo "Failed to build ${ARCH_OUTPUT_DIR}/lib/libssl.a"
|
||||
echo "See ${SSL_BUILD_LOG} for details"
|
||||
exit 1
|
||||
fi
|
||||
LIBSSL_ACCUM="${LIBSSL_ACCUM} ${ARCH_OUTPUT_DIR}/lib/libssl.a"
|
||||
|
||||
if [ ! -f "${ARCH_OUTPUT_DIR}/lib/libcrypto.a" ]
|
||||
then
|
||||
echo "Failed to build ${ARCH_OUTPUT_DIR}/lib/libssl.a"
|
||||
echo "See ${SSL_BUILD_LOG} for details"
|
||||
exit 1
|
||||
fi
|
||||
LIBCRYPTO_ACCUM="${LIBCRYPTO_ACCUM} ${ARCH_OUTPUT_DIR}/lib/libcrypto.a"
|
||||
make >> "${LOG}" 2>&1
|
||||
make all install_sw >> "${LOG}" 2>&1
|
||||
make clean >> "${LOG}" 2>&1
|
||||
done
|
||||
|
||||
echo "Copying headers from last built ARCH..."
|
||||
rm -rf "${BASEPATH}/opensslIncludes/"
|
||||
mkdir -p "${BASEPATH}/opensslIncludes/"
|
||||
if [ ! -d "${ARCH_OUTPUT_DIR}/include/openssl" ]
|
||||
then
|
||||
echo "Failed to find headers ${ARCH_OUTPUT_DIR}/include/openssl"
|
||||
echo "See ${SSL_BUILD_LOG} for details"
|
||||
exit 1
|
||||
fi
|
||||
cp -RL "${ARCH_OUTPUT_DIR}/include/openssl" "${BASEPATH}/opensslIncludes/"
|
||||
|
||||
echo "Creating fat library..."
|
||||
echo "Build library..."
|
||||
rm -rf "${BASEPATH}/lib/"
|
||||
mkdir -p "${BASEPATH}/lib/"
|
||||
lipo -create ${LIBSSL_ACCUM} -output "${BASEPATH}/lib/libssl.a"
|
||||
lipo -create ${LIBCRYPTO_ACCUM} -output "${BASEPATH}/lib/libcrypto.a"
|
||||
lipo -create ${LIPO_LIBSSL} -output "${BASEPATH}/lib/libssl.a"
|
||||
lipo -create ${LIPO_LIBCRYPTO} -output "${BASEPATH}/lib/libcrypto.a"
|
||||
|
||||
echo "Copying headers..."
|
||||
rm -rf "${BASEPATH}/opensslIncludes/"
|
||||
mkdir -p "${BASEPATH}/opensslIncludes/"
|
||||
cp -RL "${CURRENTPATH}/openssl-${VERSION}/include/openssl" "${BASEPATH}/opensslIncludes/"
|
||||
|
||||
cd "${BASEPATH}"
|
||||
echo "Building done."
|
||||
|
||||
echo "Cleaning up..."
|
||||
rm -rf "${BUILD_ROOT}"
|
||||
rm -rf "${CURRENTPATH}"
|
||||
echo "Done."
|
||||
CMD
|
||||
|
||||
s.ios.deployment_target = "8.0"
|
||||
s.ios.public_header_files = "opensslIncludes/openssl/*.h"
|
||||
s.ios.vendored_libraries = "lib/libcrypto.a", "lib/libssl.a"
|
||||
|
||||
s.libraries = 'crypto', 'ssl'
|
||||
s.requires_arc = false
|
||||
|
||||
end
|
||||
|
||||
49
README.md
49
README.md
@ -1 +1,48 @@
|
||||
# Deprecated do not use.
|
||||
OpenSSL-Pod
|
||||
===========
|
||||
|
||||
|
||||
### Version numbering
|
||||
|
||||
Because OpenSSL's version numbers are not compatible with the CocoaPods version numbering, we will agree on the following.
|
||||
|
||||
OpenSSL version: A.B.CD will become A.B.C*100 + place of D in the alphabet (indexed by 1).
|
||||
|
||||
Example: OpenSSL 1.0.1h => OpenSSL 1.0.108
|
||||
|
||||
### Keeping the pod up-to-date
|
||||
|
||||
Update the podspec to reference the latest 1.0.* tarball and sha256
|
||||
checksum from https://www.openssl.org/source/
|
||||
|
||||
**note** the 1.1.\* series has some changed that aren't compatible with
|
||||
our existing build script.
|
||||
|
||||
**note** Most cocoapods podspecs reside within the same repository as
|
||||
the source that they build. The `source` option in your podspec
|
||||
references an external source location; However, using `source` doesn't
|
||||
play nicely with development pods or referencing a pod via git URL.
|
||||
|
||||
In order to test the development pod download, you'll need to fetch and
|
||||
rename the source yourself, before running `pod install`
|
||||
|
||||
cd $MY_PROJECT
|
||||
edit Podfile
|
||||
|
||||
Update Podfile to reference your local podspec with a line like:
|
||||
|
||||
pod 'OpenSSL', path: '~/src/OpenSSL-Pod'
|
||||
|
||||
Then you have to manually fetch the external source:
|
||||
|
||||
cd ~/src/OpenSSL-Pod
|
||||
curl -o file.tgz https://www.openssl.org/source/openssl-1.0.2l.tar.gz
|
||||
|
||||
Now you can run pod install as normal
|
||||
|
||||
cd $MY_PROJECT
|
||||
pod install
|
||||
|
||||
Again, this is only required when building OpenSSL as a development pod,
|
||||
when installing from cocoapods like normal, the external source will be
|
||||
fetched for you.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user