Use setcap for privileges on Debian 10 and Ubuntu (#2001).
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index 896d8b3f8045d35b6591048560a3958a884d0e40..4c24b511d28478ab4c6b83bd631ed0ead32f7c91 100644 (file)
--- a/cscript
+++ b/cscript
@@ -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 /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)