Commit 717adcb5 authored by Guillaume Roguez's avatar Guillaume Roguez

packaging: remove source code from packaging

No sources in this branch, only packaging configuration ressources.

Issue: #80006
Change-Id: I21956c73ec3abb948288d5b0cc625882ee3ad364
parent 7d4c669a
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
Sparkle.framework
# Qt-es
*.user
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
qrc_*.cpp
ui_*.h
Makefile*
*-build-*
# QtCreator
*.autosave
#QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*
build/
lib
.DS_Store
[submodule "sparkle/Sparkle"]
path = sparkle/Sparkle
url = https://github.com/sparkle-project/Sparkle.git
This diff is collapsed.
This diff is collapsed.
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\qc
\f0\i\fs24 \cf0 \
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\qc
{\field{\*\fldinst{HYPERLINK "http://ring.cx/"}}{\fldrslt \cf0 http://ring.cx/}}\
\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\qc
\i0\b \cf0 Authors
\i\b0 \
Adrien B\'e9raud\
Alexandre Lision\
\'c9dric Ladent-Milaret\
Eloi Bail\
Emmanuel Lepage-Vall\'e9e\
Guillaume Roguez\
Marianne Forget\
Stepan Salenikovich\
\
Based on SFLphone's project\
}
Ring Mac OSX
**********
This is the official Mac port of Ring.
Requirements
=============
- Ring daemon
- libRingClient (Qt5 version)
- Qt5 Core
- Cocoa framework
Build instructions
==================
Build Sparkle framework (optional)
----------------------------------
Ring can ship with the Sparkle framework to allow automatic app updates.
This can be disabled for your custom build by specifying -DENABLE_SPARKLE=false
in the cmake phase.
1. cd sparkle/
2. git submodule update
3. cd Sparkle/
4. make release
5. A Finder window will popup in the directory where Sparkle has been built.
Copy-paste the Sparkle.framework in sparkle/ in our project, or in
/Library/Frameworks on your system.
Build Client
------------
1. mkdir build && cd build
2. export CMAKE_PREFIX_PATH=<dir_to_qt5>
Now generate an Xcode project with CMake:
3. cmake ../ -DCMAKE_INSTALL_PREFIX=<libringclient_install_path> -G Xcode
4. open Ring.xcodeproj/
5. Build and run it from Xcode. You can also generate the final Ring.app bundle.
You can also build it from the command line:
3. cmake ../ -DCMAKE_INSTALL_PREFIX=<libringclient_install_path>
4. make
5. open Ring.app/
If you want to create the final app (self-containing .dmg):
4. make install
5. cpack -G DragNDrop Ring
Notes:
By default the client version is specified in CMakeLists.txt but it can be
overriden by specifying -DRING_VERSION=<num> in the cmake command line.
Debugging
==================
For now, the build type of the client is "Debug" by default, however it is
useful to also have the debug symbols of libRingClient. To do this, specify this
when compiling libRingClient with '-DCMAKE_BUILD_TYPE=Debug' in the cmake
options.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
<key>SUFeedURL</key>
<string>http://gpl.savoirfairelinux.net/ring-download/mac_osx/sparkle-ring.xml</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>NSMainNibFile</key>
<string>${MACOSX_BUNDLE_NSMAIN_NIB_FILE}</string>
<key>NSPrincipalClass</key>
<string>${MACOSX_BUNDLE_NSPRINCIPAL_CLASS}</string>
</dict>
</plist>
Copyright (c) 2006-2013 Andy Matuschak.
Copyright (c) 2009-2013 Elgato Systems GmbH.
Copyright (c) 2011-2014 Kornel Lesiński.
Copyright (c) 2014 C.W. Betts.
Copyright (c) 2014 Petroules Corporation.
Copyright (c) 2014 Big Nerd Ranch.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=================
EXTERNAL LICENSES
=================
bspatch.c and bsdiff.c, from bsdiff 4.3 <http://www.daemonology.net/bsdiff/>:
Copyright (c) 2003-2005 Colin Percival.
sais.c and sais.c, from sais-lite (2010/08/07) <https://sites.google.com/site/yuta256/sais>:
Copyright (c) 2008-2010 Yuta Mori.
SUDSAVerifier.m:
Copyright (c) 2011 Mark Hamlin.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted providing that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE US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/A0+
gSPE436MLSYPVeGr1RdIxFudZcoGZ2gG6V1aqZfNNlVO++UQ0wNTecFMPhdaC4O/
mnufQC8fSX9qBdnuWfkQQk8bE0kvqz4WSZ+B9Q7bEr7XeOcWibscCslIM2Rs68DK
ZnO5P9x/rPIJLCXY4xQYBryQCMu6JC5ibWzP
-----END PUBLIC KEY-----
#!/bin/bash
set -e
set -o pipefail
if [ "$#" -ne 2 ]; then
echo "Usage: $0 update_archive private_key"
exit 1
fi
openssl=/usr/bin/openssl
$openssl dgst -sha1 -binary < "$1" | $openssl dgst -dss1 -sign "$2" | base64 --wrap=0
#!/bin/bash
# Take the package to add as argument ./sparkle-xml-updater.sh ring.dmg
REPO_FOLDER=<dir>
SPARKLE_FILE=<xml_filename>
REPO_URL=<url>
PACKAGE=$1
DSA_KEY=<path_to_key_file>
if [ ! -f ${PACKAGE} -o ! -f ${DSA_KEY} ]; then
echo "Can't find package or dsa key, aborting..."
exit 1
fi
if [ -f ${REPO_FOLDER}/${SPARKLE_FILE} ]; then
ITEMS=$(sed -n "/<item>/,/<\/item>/p" ${REPO_FOLDER}/${SPARKLE_FILE})
fi
cat << EOFILE > ${REPO_FOLDER}/${SPARKLE_FILE}
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Ring - nightly</title>
<link>${REPO_URL}/${SPARKLE_FILE}</link>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Ring nightly $(date "+%Y/%m/%d %H:%M")</title>
<pubDate>$(date -R)</pubDate>
<enclosure url="${REPO_URL}/$(basename ${PACKAGE})" sparkle:version="$(date +%Y%m%d%H%M)" sparkle:shortVersionString="nightly-$(date "+%Y%m%d")" length="$(stat -c %s ${PACKAGE})" type="application/octet-stream" sparkle:dsaSignature="$(/opt/joulupukki/mac_keys/sign_update.sh ${PACKAGE} ${DSA_KEY})" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
$(echo -e "${ITEMS}")
</channel>
</rss>
EOFILE
/*
* Copyright (C) 2004-2015 Savoir-Faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#import <Cocoa/Cocoa.h>
#import <account.h>
@interface AccAdvancedVC : NSViewController <NSTextFieldDelegate>
@end
/*
* Copyright (C) 2004-2015 Savoir-Faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#define REGISTRATION_TAG 0
#define LOCALPORT_TAG 1
#define STUNURL_TAG 2
#define PUBLICADDR_TAG 3
#define PUBLICPORT_TAG 4
#define MINAUDIO_TAG 5
#define MAXAUDIO_TAG 6
#define MINVIDEO_TAG 7
#define MAXVIDEO_TAG 8
#import "AccAdvancedVC.h"
#import <accountmodel.h>
#import <qitemselectionmodel.h>
@interface AccAdvancedVC ()
@property (assign) IBOutlet NSTextField *registrationField;
@property (assign) IBOutlet NSTextField *localPortField;
@property (assign) IBOutlet NSButton *isUsingSTUN;
@property (assign) IBOutlet NSTextField *STUNserverURLField;
@property (assign) IBOutlet NSTextField *minAudioRTPRange;
@property (assign) IBOutlet NSTextField *maxAudioRTPRange;
@property (assign) IBOutlet NSTextField *minVideoRTPRange;
@property (assign) IBOutlet NSTextField *maxVideoRTPRange;
@property (assign) IBOutlet NSStepper *registrationStepper;
@property (assign) IBOutlet NSStepper *localPortStepper;
@property (assign) IBOutlet NSStepper *minAudioPortStepper;
@property (assign) IBOutlet NSStepper *maxAudioPortStepper;
@property (assign) IBOutlet NSStepper *minVideoPortStepper;
@property (assign) IBOutlet NSStepper *maxVideoPortStepper;
@property (assign) IBOutlet NSMatrix *publishAddrAndPortRadioGroup;
@property (assign) IBOutlet NSTextField *publishedAddrField;
@property (assign) IBOutlet NSTextField *publishedPortField;
@end
@implementation AccAdvancedVC
@synthesize registrationField;
@synthesize localPortField;
@synthesize isUsingSTUN;
@synthesize STUNserverURLField;
@synthesize minAudioRTPRange;
@synthesize maxAudioRTPRange;
@synthesize minVideoRTPRange;
@synthesize maxVideoRTPRange;
@synthesize registrationStepper;
@synthesize localPortStepper;
@synthesize minAudioPortStepper;
@synthesize maxAudioPortStepper;
@synthesize minVideoPortStepper;
@synthesize maxVideoPortStepper;
@synthesize publishAddrAndPortRadioGroup;
@synthesize publishedAddrField;
@synthesize publishedPortField;
- (void)awakeFromNib
{
NSLog(@"INIT Advanced VC");
[registrationStepper setTag:REGISTRATION_TAG];
[localPortStepper setTag:LOCALPORT_TAG];
[minAudioPortStepper setTag:MINAUDIO_TAG];
[maxAudioPortStepper setTag:MAXAUDIO_TAG];
[minVideoPortStepper setTag:MINVIDEO_TAG];
[maxVideoPortStepper setTag:MAXVIDEO_TAG];
[registrationField setTag:REGISTRATION_TAG];
[localPortField setTag:LOCALPORT_TAG];
[minAudioRTPRange setTag:MINAUDIO_TAG];
[maxAudioRTPRange setTag:MAXAUDIO_TAG];
[minVideoRTPRange setTag:MINVIDEO_TAG];
[maxVideoRTPRange setTag:MAXVIDEO_TAG];
[STUNserverURLField setTag:STUNURL_TAG];
[publishedPortField setTag:PUBLICPORT_TAG];
[publishedAddrField setTag:PUBLICADDR_TAG];
QObject::connect(AccountModel::instance()->selectionModel(),
&QItemSelectionModel::currentChanged,
[=](const QModelIndex &current, const QModelIndex &previous) {
if(!current.isValid())
return;
[self loadAccount];
});
}
- (Account*) currentAccount
{
auto accIdx = AccountModel::instance()->selectionModel()->currentIndex();
return AccountModel::instance()->getAccountByModelIndex(accIdx);
}
- (void)loadAccount
{
auto account = [self currentAccount];
[self updateControlsWithTag:REGISTRATION_TAG];
[self updateControlsWithTag:LOCALPORT_TAG];
[self updateControlsWithTag:MINAUDIO_TAG];
[self updateControlsWithTag:MAXAUDIO_TAG];
[self updateControlsWithTag:MINVIDEO_TAG];
[self updateControlsWithTag:MAXVIDEO_TAG];
[STUNserverURLField setStringValue:account->sipStunServer().toNSString()];
[isUsingSTUN setState:account->isSipStunEnabled()?NSOnState:NSOffState];
[STUNserverURLField setEnabled:account->isSipStunEnabled()];
if(account->isPublishedSameAsLocal())
[publishAddrAndPortRadioGroup selectCellAtRow:0 column:0];
else {
[publishAddrAndPortRadioGroup selectCellAtRow:1 column:0];
}
[publishedAddrField setStringValue:account->publishedAddress().toNSString()];
[publishedPortField setIntValue:account->publishedPort()];
[publishedAddrField setEnabled:!account->isPublishedSameAsLocal()];
[publishedPortField setEnabled:!account->isPublishedSameAsLocal()];
}
#pragma mark - NSTextFieldDelegate methods
-(void)controlTextDidChange:(NSNotification *)notif
{
NSTextField *textField = [notif object];
NSRange test = [[textField currentEditor] selectedRange];
[self valueDidChange:textField];
//FIXME: saving account lose focus because in NSTreeController we remove and reinsert row so View selction change
[textField.window makeFirstResponder:textField];
[[textField currentEditor] setSelectedRange:test];
}
- (IBAction) valueDidChange: (id) sender
{
switch ([sender tag]) {
case REGISTRATION_TAG:
[self currentAccount]->setRegistrationExpire([sender integerValue]);
break;
case LOCALPORT_TAG:
[self currentAccount]->setLocalPort([sender integerValue]);
break;
case STUNURL_TAG:
[self currentAccount]->setSipStunServer([[sender stringValue] UTF8String]);
break;
case PUBLICADDR_TAG:
[self currentAccount]->setPublishedAddress([[sender stringValue] UTF8String]);
break;
case PUBLICPORT_TAG:
[self currentAccount]->setPublishedPort([sender integerValue]);
break;
case MINAUDIO_TAG:
[self currentAccount]->setAudioPortMin([sender integerValue]);
break;
case MAXAUDIO_TAG:
[self currentAccount]->setAudioPortMax([sender integerValue]);
break;
case MINVIDEO_TAG:
[self currentAccount]->setVideoPortMin([sender integerValue]);
break;
case MAXVIDEO_TAG:
[self currentAccount]->setVideoPortMax([sender integerValue]);
break;
default:
break;
}
[self updateControlsWithTag:[sender tag]];
}
- (IBAction)toggleSTUN:(NSButton *)sender
{
[self currentAccount]->setSipStunEnabled([sender state]==NSOnState);
[STUNserverURLField setEnabled:[self currentAccount]->isSipStunEnabled()];
}
- (IBAction)didSwitchPublishedAddress:(NSMatrix *)matrix
{
NSInteger row = [matrix selectedRow];
if(row == 0) {
[self currentAccount]->setPublishedSameAsLocal(YES);
} else {
[self currentAccount]->setPublishedSameAsLocal(NO);
}
[publishedAddrField setEnabled:![self currentAccount]->isPublishedSameAsLocal()];
[publishedPortField setEnabled:![self currentAccount]->isPublishedSameAsLocal()];
}
- (void) updateControlsWithTag:(NSInteger) tag
{
switch (tag) {
case REGISTRATION_TAG:
[registrationStepper setIntegerValue:[self currentAccount]->registrationExpire()];
[registrationField setIntegerValue:[self currentAccount]->registrationExpire()];
break;
case LOCALPORT_TAG:
[localPortStepper setIntegerValue:[self currentAccount]->localPort()];
[localPortField setIntegerValue:[self currentAccount]->localPort()];
break;
case MINAUDIO_TAG:
[minAudioPortStepper setIntegerValue:[self currentAccount]->audioPortMin()];
[minAudioRTPRange setIntegerValue:[self currentAccount]->audioPortMin()];
break;
case MAXAUDIO_TAG:
[maxAudioPortStepper setIntegerValue:[self currentAccount]->audioPortMax()];
[maxAudioRTPRange setIntegerValue:[self currentAccount]->audioPortMax()];
break;
case MINVIDEO_TAG:
[minVideoPortStepper setIntegerValue:[self currentAccount]->videoPortMin()];
[minVideoRTPRange setIntegerValue:[self currentAccount]->videoPortMin()];
break;
case MAXVIDEO_TAG:
[maxVideoPortStepper setIntegerValue:[self currentAccount]->videoPortMax()];
[maxVideoRTPRange setIntegerValue:[self currentAccount]->videoPortMax()];
break;
default:
break;
}
}
@end
/*
* Copyright (C) 2004-2015 Savoir-Faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination