2018-07-18 21:13:32 +08:00
|
|
|
Pod::Spec.new do |s|
|
|
|
|
|
|
|
|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
s.name = "OpenVPNAdapter"
|
|
|
|
s.version = "0.1.0"
|
|
|
|
s.summary = "Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS."
|
|
|
|
s.description = <<-DESC
|
|
|
|
OpenVPNAdapter is an Objective-C framework that allows to easily configure and establish VPN connection using OpenVPN protocol.
|
|
|
|
It is based on the original openvpn3 library so it has every feature the library has. The framework is designed to use in conjunction
|
|
|
|
with NetworkExtension framework and doesn't use any private Apple API. Compatible with iOS and macOS and also Swift friendly.
|
2018-10-18 16:11:35 +08:00
|
|
|
DESC
|
2018-07-18 21:13:32 +08:00
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
s.homepage = "https://github.com/ss-abramchuk/OpenVPNAdapter"
|
2018-07-18 21:13:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
s.license = "AGPLv3"
|
2018-07-18 21:13:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
s.author = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" }
|
2018-07-18 21:13:32 +08:00
|
|
|
|
2018-10-18 22:43:26 +08:00
|
|
|
|
2018-07-18 21:13:32 +08:00
|
|
|
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-18 16:11:35 +08:00
|
|
|
s.ios.deployment_target = "9.0"
|
|
|
|
s.osx.deployment_target = "10.11"
|
2018-07-18 21:13:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter.git", :branch => "feature/cocoapods" }
|
2018-07-18 21:13:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
framework_path = "Sources/OpenVPNAdapter"
|
|
|
|
vendors_path = "#{framework_path}/Libraries/Vendors"
|
2018-07-18 21:13:32 +08:00
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
lz4_path = "#{vendors_path}/lz4"
|
|
|
|
mbedtls_path = "#{vendors_path}/mbedtls"
|
|
|
|
asio_path = "#{vendors_path}/asio"
|
|
|
|
openvpn_path = "#{vendors_path}/openvpn"
|
|
|
|
|
|
|
|
s.source_files = "#{framework_path}/*.{h,m,mm}", "#{openvpn_path}/client/*.{hpp,cpp}"
|
|
|
|
|
|
|
|
s.public_header_files = "#{framework_path}/*.h"
|
2018-10-18 16:57:20 +08:00
|
|
|
s.private_header_files = [
|
2018-10-19 16:44:37 +08:00
|
|
|
"#{framework_path}/*+Internal.h",
|
|
|
|
"#{framework_path}/OpenVPNReachabilityTracker.h",
|
|
|
|
"#{framework_path}/OpenVPNClient.h",
|
|
|
|
"#{framework_path}/OpenVPNNetworkSettingsBuilder.h",
|
|
|
|
"#{framework_path}/OpenVPNPacket.h",
|
|
|
|
"#{framework_path}/OpenVPNPacketFlowBridge.h",
|
|
|
|
"#{framework_path}/NSError+OpenVPNError.h",
|
|
|
|
"#{framework_path}/NSArray+OpenVPNAdditions.h",
|
|
|
|
"#{openvpn_path}/openvpn/**/*.hpp",
|
|
|
|
"#{openvpn_path}/client/*.hpp"
|
|
|
|
]
|
|
|
|
|
|
|
|
s.preserve_paths = [
|
|
|
|
"#{lz4_path}/include/*.h",
|
|
|
|
"#{mbedtls_path}/include/**/*.h",
|
|
|
|
"#{asio_path}/asio/include/**/*.{hpp,ipp}",
|
|
|
|
"#{openvpn_path}/openvpn/**/*.hpp"
|
2018-10-18 16:57:20 +08:00
|
|
|
]
|
2018-07-18 21:13:32 +08:00
|
|
|
|
2018-10-18 16:11:35 +08:00
|
|
|
s.module_map = "Configuration/OpenVPNAdapter.modulemap"
|
2018-07-18 21:13:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
# ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-18 21:49:30 +08:00
|
|
|
s.ios.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration", "UIKit"
|
|
|
|
s.osx.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration"
|
2018-07-18 21:13:32 +08:00
|
|
|
|
2018-10-19 16:44:37 +08:00
|
|
|
s.ios.vendored_libraries = [
|
|
|
|
"#{lz4_path}/lib/ios/liblz4.a",
|
|
|
|
"#{mbedtls_path}/lib/ios/libmbedcrypto.a",
|
|
|
|
"#{mbedtls_path}/lib/ios/libmbedtls.a",
|
|
|
|
"#{mbedtls_path}/lib/ios/libmbedx509.a"
|
|
|
|
]
|
|
|
|
|
|
|
|
s.osx.vendored_libraries = [
|
|
|
|
"#{lz4_path}/lib/macos/liblz4.a",
|
|
|
|
"#{mbedtls_path}/lib/macos/libmbedcrypto.a",
|
|
|
|
"#{mbedtls_path}/lib/macos/libmbedtls.a",
|
|
|
|
"#{mbedtls_path}/lib/macos/libmbedx509.a"
|
|
|
|
]
|
|
|
|
|
|
|
|
s.libraries = "lz4", "mbedcrypto", "mbedtls", "mbedx509"
|
|
|
|
|
2018-10-18 22:09:19 +08:00
|
|
|
|
2018-07-18 21:13:32 +08:00
|
|
|
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
|
|
|
|
2018-10-18 16:11:35 +08:00
|
|
|
s.requires_arc = true
|
2018-10-19 16:44:37 +08:00
|
|
|
s.prefix_header_file = false
|
2018-10-18 16:11:35 +08:00
|
|
|
|
2018-10-18 20:52:25 +08:00
|
|
|
s.xcconfig = {
|
2018-10-18 22:36:36 +08:00
|
|
|
"APPLICATION_EXTENSION_API_ONLY" => "YES",
|
|
|
|
"CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14",
|
|
|
|
"CLANG_CXX_LIBRARY" => "libc++",
|
2018-10-19 16:44:37 +08:00
|
|
|
"HEADER_SEARCH_PATHS" => "\"${PODS_TARGET_SRCROOT}/#{lz4_path}/include/**\" \"${PODS_TARGET_SRCROOT}/#{mbedtls_path}/include/**\" \"${PODS_TARGET_SRCROOT}/#{asio_path}/asio/include/**\" \"${PODS_TARGET_SRCROOT}/#{openvpn_path}/**\"",
|
2018-10-18 22:36:36 +08:00
|
|
|
"GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO",
|
2018-10-19 16:44:37 +08:00
|
|
|
"CLANG_WARN_DOCUMENTATION_COMMENTS" => "NO",
|
2018-10-18 22:36:36 +08:00
|
|
|
"OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER"
|
2018-10-18 20:52:25 +08:00
|
|
|
}
|
2018-10-18 16:11:35 +08:00
|
|
|
|
2018-07-18 21:13:32 +08:00
|
|
|
end
|