summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-05-26 00:52:08 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-26 16:04:04 +0200
commit12b8695cac964fb57adceb751126c199f8d0fe0f (patch)
tree3fba353e40ba978d5aa16cafd492272f84392c3c
parent62f9b78a2eb5f0fc6b9028264bac6ad501d83309 (diff)
Use setcap for privileges on Debian 10 and Ubuntu (#2001).
-rw-r--r--cscript5
-rwxr-xr-xdebian/rules6
2 files changed, 5 insertions, 6 deletions
diff --git a/cscript b/cscript
index 896d8b3f8..4c24b511d 100644
--- 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)
diff --git a/debian/rules b/debian/rules
index a4aa5b8cd..aac2dacaa 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,9 +48,3 @@ override_dh_strip:
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
-DISK := debian/dcpomatic/usr/bin/dcpomatic2_disk_writer
-override_dh_fixperms:
- dh_fixperms
-ifneq ("$(wildcard $(DISK))", "")
- chmod 4755 $(DISK)
-endif