# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

# Define some paths for some commonly used programs

# All variables that refer to a path should have the `_path` suffix.

# Shells
@{sh_path} = @{bin}/@{sh}
@{shells_path} = @{bin}/@{shells}

# Coreutils programs that should not have dedicated profile
@{coreutils_path} = @{bin}/@{coreutils}



# Python interpreters
@{python_path} = @{bin}/@{python_name}

# ldd (List Dynamic Dependencies) and dynamic linker/loader
@{ldd_path} = @{bin}/ldd
@{ldd_path} += @{lib}/ld-linux-@{arch}.so{,.*}
@{ldd_path} += @{lib}/@{multiarch}/ld-linux-@{arch}.so{,.*} 


# Browsers
@{brave_path} =  @{brave_lib_dirs}/@{brave_name}
@{chrome_path} =  @{opera_lib_dirs}/@{chrome_name}
@{chromium_path} =  @{chromium_lib_dirs}/@{chromium_name}
@{firefox_path} = @{bin}/@{firefox_name} @{firefox_lib_dirs}/@{firefox_name}
@{msedge_path} =  @{msedge_lib_dirs}/@{msedge_name}
@{opera_path} =  @{opera_lib_dirs}/@{opera_name}
@{torbrowser_path} = @{torbrowser_lib_dirs}/firefox{,.real}

@{browsers_path}  = @{bin}/chromium @{bin}/torbrowser
@{browsers_path} += @{brave_path} @{chrome_path} @{chromium_path} @{firefox_path} @{msedge_path} @{opera_path}


# Emails
@{thunderbird_path} = @{bin}/@{thunderbird_name} @{thunderbird_lib_dirs}/@{thunderbird_name}
@{emails_path} = @{thunderbird_path} @{bin}/@{emails_names}

# Open
@{open_path}  = @{bin}/@{open_names}
@{open_path} += @{lib}/gio-launch-desktop
@{open_path} += @{lib}/@{multiarch}/glib-@{version}/gio-launch-desktop

# Editors
@{editor_path} = @{bin}/@{editor_names}
@{editor_ui_path} = @{bin}/@{editor_ui_names}

# Pager
@{pager_path} = @{bin}/@{pager_names}

# File explorers
@{file_explorers_path} = @{bin}/@{file_explorers_names}

# Text editors
@{text_editors_path} = @{bin}/@{text_editors_names} /usr/share/code/{bin/,}code

# Document viewers
@{document_viewers_path} = @{bin}/@{document_viewers_names}

# Image viewers
@{image_viewers_path} = @{bin}/@{image_viewers_names}

# Archive viewers
@{archive_viewers_path} = @{bin}/@{archive_viewers_names}

# Office suites
@{offices_path} = @{bin}/@{offices_names} @{lib}/libreoffice/program/soffice

# Help
@{help_path} = @{bin}/@{help_names}

# Terminal emulator
@{terminal_path} = @{bin}/@{terminal_names}

# Backup
@{backup_path} = @{bin}/@{backup_names} @{lib}/deja-dup/deja-dup-monitor

# Archives
@{archive_path} = @{bin}/@{archive_names} @{lib}/p7zip/7z

# vim:syntax=apparmor
