Fix typo if -> of (thanks to Uwe Dittes)
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index 896d8b3f8045d35b6591048560a3958a884d0e40..ee483094577e4fd6497df6732ac4b882a3ee4a0c 100644 (file)
--- a/cscript
+++ b/cscript
@@ -208,15 +208,15 @@ def can_build_disk(target):
     if target.platform == 'osx':
         return True
     if target.platform == 'linux':
-        if target.distro == 'ubuntu' and target.version in ['18.04', '20.04', '20.10', '21.04']:
+        if target.distro == 'ubuntu' and target.version != '16.04':
             return True
-        if target.distro == 'debian' and target.version == '10':
+        if target.distro == 'debian' and target.version != '9':
             return True
         if target.detail == 'appimage':
             return True 
         if target.distro == 'fedora' and int(target.version) >= 31:
             return True
-        if target.distro == 'centos' and target.version == '8':
+        if target.distro == 'centos' and target.version != '7':
             return True
         if target.distro == 'mageia':
             return True
@@ -303,7 +303,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('%{_bindir}/dcpomatic2_verify', file=f)
     if os.path.exists(os.path.join(tools, "dcpomatic2_disk")):
         print('%{_bindir}/dcpomatic2_disk', file=f)
-        print('%attr(4755, root, root) %{_bindir}/dcpomatic2_disk_writer', file=f)
+        print('%caps(cap_dac_override=ep) %{_bindir}/dcpomatic2_disk_writer', file=f)
     print('%{_datadir}/applications/dcpomatic2.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_batch.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_server.desktop', file=f)
@@ -388,8 +388,8 @@ def dependencies(target, options):
         # Use distro-provided FFmpeg on Arch
         deps = []
 
-    deps.append(('libdcp', '6384002'))
-    deps.append(('libsub', '55ebde1'))
+    deps.append(('libdcp', 'b3cb9c0'))
+    deps.append(('libsub', '587e475'))
     deps.append(('leqm-nrt', '93ae9e6'))
     deps.append(('rtaudio', 'f619b76'))
     # We get our OpenSSL libraries from the environment, but we
@@ -398,7 +398,7 @@ def dependencies(target, options):
     # the appropriate place later
     deps.append(('openssl', '7f29dd5'))
     if can_build_disk(target):
-        deps.append(('lwext4', '9d20ec5'))
+        deps.append(('lwext4', 'cce3730'))
     deps.append(('ffcmp', '6259cd4'))
 
     return deps
@@ -582,6 +582,11 @@ def package_windows(target):
 
 def package_debian(target, cpu, version, options):
     make_control(target.version, target.bits, 'debian/control', target.debug, options['gui'])
+    if target.version != '9' and target.version != '16.04':
+        with open('debian/postinst', 'w') as f:
+            print('#!/bin/sh', file=f)
+            # Get the required capability to write to disks
+            print('setcap "cap_dac_override+ep cap_sys_admin+ep" /usr/bin/dcpomatic2_disk_writer', file=f)
     target.command('./waf dist')
     f = open('debian/files', 'w')
     print('dcpomatic_%s-1_%s.deb video extra' % (version, cpu), file=f)