Compare commits

...

1 Commits

Author SHA1 Message Date
Michael Kirk
8f872c38d4 Update to 1.1.0f
- Tried to make bash a little more readable
- Assert that libs are created
- OpenSSL 1.1 requires you also specify --prefix whenever specifying --openssldir
2017-08-17 15:12:12 -04:00
5 changed files with 126 additions and 101 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
file.tgz

110
1.1.006/OpenSSL.podspec Normal file
View File

@ -0,0 +1,110 @@
Pod::Spec.new do |s|
s.name = "OpenSSL"
s.version = "1.1.006"
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.homepage = "https://github.com/FredericJacobs/OpenSSL-Pod"
s.source = { :http => "https://openssl.org/source/openssl-1.1.0f.tar.gz", :sha256 => "12f746f3f2493b2f39da7ecf63d7ee19c6ac9ec6a4fcd8c229da8a522cb12765"}
s.source_files = "opensslIncludes/openssl/*.h"
s.header_dir = "openssl"
s.license = { :type => 'OpenSSL (OpenSSL/SSLeay)', :file => 'LICENSE' }
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="1.1.0f"
SDKVERSION=`xcrun --sdk iphoneos --show-sdk-version 2> /dev/null`
MIN_SDK_VERSION_FLAG="-miphoneos-version-min=8.0"
BASEPATH="${PWD}"
BUILD_ROOT="/tmp/openssl-pod"
ARCHS="i386 x86_64 armv7 armv7s arm64"
DEVELOPER=`xcode-select -print-path`
OUTPUT_DIR="${BUILD_ROOT}/output"
mkdir -p "${OUTPUT_DIR}"
cp "file.tgz" "${BUILD_ROOT}/file.tgz"
cd "${BUILD_ROOT}"
tar -xzf file.tgz
SRC_DIR="openssl-${OPENSSL_VERSION}"
cd $SRC_DIR
echo "Building OpenSSL. This will take a while..."
for ARCH in ${ARCHS}
do
CONFIGURE_FOR="iphoneos-cross"
if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ;
then
PLATFORM="iPhoneSimulator"
if [ "${ARCH}" == "x86_64" ] ;
then
CONFIGURE_FOR="darwin64-x86_64-cc"
fi
else
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
PLATFORM="iPhoneOS"
fi
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"
echo "Building openssl-${OPENSSL_VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"
echo "Please stand by..."
export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} ${MIN_SDK_VERSION_FLAG}"
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"
./Configure ${CONFIGURE_FOR} --prefix="${ARCH_OUTPUT_DIR}" --openssldir="${ARCH_OUTPUT_DIR}" > "${SSL_BUILD_LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"
make build_libs >> "${SSL_BUILD_LOG}" 2>&1
make install >> "${SSL_BUILD_LOG}" 2>&1
make clean >> "${SSL_BUILD_LOG}" 2>&1
if [ !-e "${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 [ !-e "${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"
done
echo "Creating fat 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"
echo "Copying headers..."
rm -rf "${BASEPATH}/opensslIncludes/"
mkdir -p "${BASEPATH}/opensslIncludes/"
cp -RL "${BUILD_ROOT}/${SRC_DIR}/include/openssl" "${BASEPATH}/opensslIncludes/"
cd "${BASEPATH}"
echo "Building done."
echo "Cleaning up..."
rm -rf "${BUILD_ROOT}"
echo "Done."
CMD
end

View File

@ -1,95 +0,0 @@
Pod::Spec.new do |s|
s.name = "OpenSSL"
s.version = "1.0.109"
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.homepage = "https://github.com/FredericJacobs/OpenSSL-Pod"
s.license = 'BSD-style Open Source'
s.source = { :http => "https://www.openssl.org/source/openssl-1.0.1i.tar.gz", :sha1 => "74eed314fa2c93006df8d26cd9fc630a101abd76"}
s.source_files = "opensslIncludes/openssl/*.h"
s.header_dir = "openssl"
s.license = { :type => 'OpenSSL (OpenSSL/SSLeay)', :file => 'LICENSE' }
s.prepare_command = <<-CMD
VERSION="1.0.1i"
SDKVERSION=`xcrun --sdk iphoneos --show-sdk-version 2> /dev/null`
BASEPATH="${PWD}"
CURRENTPATH="${TMPDIR}/openssl"
ARCHS="i386 x86_64 armv7 armv7s arm64"
DEVELOPER=`xcode-select -print-path`
mkdir -p "${CURRENTPATH}"
mkdir -p "${CURRENTPATH}/bin"
cp "file.tgz" "${CURRENTPATH}/file.tgz"
cd "${CURRENTPATH}"
tar -xzf file.tgz
cd "openssl-${VERSION}"
for ARCH in ${ARCHS}
do
CONFIGURE_FOR="iphoneos-cross"
if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ;
then
PLATFORM="iPhoneSimulator"
if [ "${ARCH}" == "x86_64" ] ;
then
CONFIGURE_FOR="darwin64-x86_64-cc"
fi
else
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
PLATFORM="iPhoneOS"
fi
export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"
echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}"
echo "Please stand by..."
export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} -miphoneos-version-min=${SDKVERSION}"
mkdir -p "${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-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"
./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 >> "${LOG}" 2>&1
make all install_sw >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
done
echo "Build library..."
rm -rf "${BASEPATH}/lib/"
mkdir -p "${BASEPATH}/lib/"
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 "${CURRENTPATH}"
echo "Done."
CMD
s.ios.platform = :ios
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

1
OpenSSL.podspec Symbolic link
View File

@ -0,0 +1 @@
1.1.006/OpenSSL.podspec

View File

@ -1,16 +1,24 @@
OpenSSL-Pod
===========
### Version numbering
### 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 alphabeth.
OpenSSL version: `A.B.CD` will become `A.B.C*100 + place of D in the alphabet` (indexed from 1).
Example: OpenSSL 1.0.1h => OpenSSL 1.0.108
Example: OpenSSL 1.1.0a => OpenSSL 1.1.001
### Keeping the pod up-to-date
### Note for Development Podders
With the new Cocoapods "trunk" system, a Pod has a maintainer. Being the maintainer of the OpenSSL pod, I will try my best to keep it updated. If however, you see that the Pod is way behind, please submit a pull request with the changes and I'll submit it to Trunk after review.
If you are referencing this as a development pod, e.g. if your Podfile
looks like:
pod 'OpenSSL', path: '../OpenSSL-Pod/1.1.006'
You cannot simply run `pod install`. You will have to manually download
and compare the source.
curl https://openssl.org/source/openssl-1.1.0f.tar.gz
shasum -a256 openssl-1.1.0f.tar.gz