Package a patched openssl which creates certificates with
authorCarl Hetherington <cth@carlh.net>
Tue, 3 Dec 2019 20:47:27 +0000 (21:47 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 4 Dec 2019 21:49:40 +0000 (22:49 +0100)
a validity period starting a week before now; fixes #1422.

cscript
debian/rules
platform/osx/make_dmg.sh
platform/windows/wscript
src/lib/cross.cc

diff --git a/cscript b/cscript
index 09695b85461005e3eb9dc6432e8016684dd55aed..1845cc7d0154cd12cb79c70e175e818e662ed1bd 100644 (file)
--- a/cscript
+++ b/cscript
@@ -271,6 +271,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('%{_bindir}/dcpomatic2_kdm_cli', file=f)
     print('%{_bindir}/dcpomatic2_player', file=f)
     print('%{_bindir}/dcpomatic2_playlist', file=f)
+    print('%{_bindir}/dcpomatic2_openssl', file=f)
     if options['variant'] == 'swaroop-studio':
         print('%{_bindir}/dcpomatic2_ecinema', file=f)
         print('%{_bindir}/dcpomatic2_uuid', file=f)
@@ -312,13 +313,13 @@ def make_spec(filename, version, target, options, requires=None):
     print('%build', file=f)
     print('cd dcpomatic-%s' % version, file=f)
     print('export PKG_CONFIG_PATH=%s/lib/pkgconfig:%s/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig' % (target.directory, target.directory), file=f)
-
     print('CXXFLAGS="-I%s/include" LDFLAGS="-L%s/lib" ./waf configure --prefix=%%{buildroot}/usr --install-prefix=/usr %s' %
           (target.directory, target.directory, configure_options(target, options)), file=f)
     print('./waf', file=f)
     print('%install', file=f)
     print('cd dcpomatic-%s' % version, file=f)
     print('./waf install', file=f)
+    print('/bin/cp %s/src/openssl/apps/openssl %%{buildroot}/usr/bin/dcpomatic2_openssl' % target.directory, file=f)
     print('', file=f)
     print('%post', file=f)
     print('/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
@@ -350,6 +351,11 @@ def dependencies(target):
     deps.append(('libdcp', None))
     deps.append(('libsub', None))
     deps.append(('rtaudio', 'carl'))
+    # We get our OpenSSL libraries from the environment, but we
+    # also need a patched openssl binary to make certificates.
+    # This dependency is to get that binary, which is added into
+    # the appropriate place later
+    deps.append(('openssl', 'carl'))
 
     return deps
 
@@ -546,6 +552,7 @@ def package_debian(target, cpu, version, options):
     target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS'))
     target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS'))
     target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH'))
+    target.set('CDIST_DIRECTORY', target.directory)
 
     target.set('CDIST_CONFIGURE', '"' + configure_options(target, options) + '"')
     if target.debug:
@@ -596,6 +603,7 @@ def make_appimage(target, nice_name, internal_name, version):
     nice_filename = nice_name.replace(' ', '_')
     os.makedirs('build/%s.AppDir/usr/bin' % nice_filename)
     target.command('cp %s/bin/%s build/%s.AppDir/usr/bin' % (target.directory, internal_name, nice_filename))
+    target.command('cp %s/src/openssl/apps/openssl build/%s.AppDir/usr/bin/dcpomatic2_openssl' % (target.directory, nice_filename))
     with open('build/%s.AppDir/AppRun' % nice_filename, 'w') as f:
         print('#!/bin/bash', file=f)
         print('export APPDIR="$(dirname "$(readlink -f "$0")")"', file=f)
index c84a78453bf5a82bc33b9fa6fa98f4b0f8fe22dc..6a8c156f1e5d47b7abd8c968c40d53a9ff733f9c 100755 (executable)
@@ -37,6 +37,7 @@ override_dh_auto_install:
        cp -a /usr/share/locale/pl/LC_MESSAGES/wxstd.mo debian/dcpomatic/usr/share/locale/pl/LC_MESSAGES/dcpomatic2-wxstd.mo
        mkdir -p debian/dcpomatic/usr/share/locale/ru/LC_MESSAGES/
        cp -a /usr/share/locale/ru/LC_MESSAGES/wxstd.mo debian/dcpomatic/usr/share/locale/ru/LC_MESSAGES/dcpomatic2-wxstd.mo
+       cp -a $(CDIST_DIRECTORY)/src/openssl/apps/openssl debian/dcpomatic/usr/bin/dcpomatic2_openssl
 
 .PHONY: override_dh_strip
 override_dh_strip:
index ab5dd3934fd2b3f3c37b54ef14bf03f1246e05b4..95e8f8db04cead5d7422f850c4d9bb6b679959e2 100644 (file)
@@ -383,6 +383,7 @@ copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2 "$approot/MacOS"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_cli "$approot/MacOS"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_create "$approot/MacOS"
 copy $ROOT bin/ffprobe "$approot/MacOS"
+copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
 cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2.Info.plist "$approot/Info.plist"
 rl=("$approot/MacOS/dcpomatic2" "$approot/MacOS/dcpomatic2_cli" "$approot/MacOS/dcpomatic2_create" "$approot/MacOS/ffprobe" "$approot/Frameworks/"*.dylib)
 relink "${rl[@]}"
@@ -392,6 +393,7 @@ make_dmg "$appdir" "DCP-o-matic" com.dcpomatic
 setup "DCP-o-matic 2 KDM Creator.app"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_kdm "$approot/MacOS"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_kdm_cli "$approot/MacOS"
+copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
 cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_kdm.Info.plist "$approot/Info.plist"
 rl=("$approot/MacOS/dcpomatic2_kdm" "$approot/MacOS/dcpomatic2_kdm_cli" "$approot/Frameworks/"*.dylib)
 relink "${rl[@]}"
@@ -401,6 +403,7 @@ make_dmg "$appdir" "DCP-o-matic KDM Creator" com.dcpomatic.kdm
 setup "DCP-o-matic 2 Encode Server.app"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_server "$approot/MacOS"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_server_cli "$approot/MacOS"
+copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
 cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_server.Info.plist "$approot/Info.plist"
 rl=("$approot/MacOS/dcpomatic2_server" "$approot/MacOS/dcpomatic2_server_cli" "$approot/Frameworks/"*.dylib)
 relink "${rl[@]}"
@@ -409,6 +412,7 @@ make_dmg "$appdir" "DCP-o-matic Encode Server" com.dcpomatic.server
 # DCP-o-matic Batch Converter
 setup "DCP-o-matic 2 Batch converter.app"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_batch "$approot/MacOS"
+copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
 cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_batch.Info.plist "$approot/Info.plist"
 rl=("$approot/MacOS/dcpomatic2_batch" "$approot/Frameworks/"*.dylib)
 relink "${rl[@]}"
@@ -417,6 +421,7 @@ make_dmg "$appdir" "DCP-o-matic Batch Converter" com.dcpomatic.batch
 # DCP-o-matic Player
 setup "DCP-o-matic 2 Player.app"
 copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_player "$approot/MacOS"
+copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
 cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_player.Info.plist "$approot/Info.plist"
 rl=("$approot/MacOS/dcpomatic2_player" "$approot/Frameworks/"*.dylib)
 relink "${rl[@]}"
index 933c4078f9ab1e960de8427284a204c930298037..b5dde858d2f5fc70efe6d51513ac5fced4502f0a 100644 (file)
@@ -194,6 +194,7 @@ File "%cdist_deps%/bin/dcp-1.0.dll"
 File "%cdist_deps%/bin/cxml-0.dll"
 File "%cdist_deps%/bin/sub-1.0.dll"
 File "%cdist_deps%/bin/ffprobe.exe"
+File "%cdist_deps%/src/openssl/apps/openssl.exe"
     """, file=f)
 
     if windows_version == 'xp':
index dcd4ddfd884b695ee2af4360605f4952702b2fce..8d82f7a51bcde1a17ea077eb32060ad85a305e38 100644 (file)
@@ -300,9 +300,17 @@ openssl_path ()
        boost::filesystem::path path = dir;
        path /= "openssl.exe";
        return path;
-#else
-       /* We assume that it's on the path for Linux and OS X */
-       return "openssl";
+#endif
+
+#ifdef DCPOMATIC_OSX
+       boost::filesystem::path path = app_contents();
+       path /= "MacOS";
+       path /= "openssl";
+       return path;
+#endif
+
+#ifdef DCPOMATIC_LINUX
+       return "dcpomatic2_openssl";
 #endif
 
 }