summaryrefslogtreecommitdiff
path: root/meson_post_install.py
blob: d8c3dd1ff81ab4c34fbba4a46d5904e56f7fec11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python3

import os
import sys

destdir = os.environ.get('DESTDIR', '')
localstatedir = os.path.normpath(destdir + os.sep + sys.argv[1])

# FIXME: meson will not track the creation of these directories
#        https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
dst_dirs = [
  (os.path.join(localstatedir, 'lib'), 0o755),
  (os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'), 0o775),
  (os.path.join(localstatedir, 'lib', 'AccountsService', 'users'), 0o700),
]

for (dst_dir, dst_dir_mode) in dst_dirs:
  if not os.path.exists(dst_dir):
    os.umask(0o777 & ~dst_dir_mode)
    os.makedirs(dst_dir, mode=dst_dir_mode)