#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
import src.version as version

APP_NAME = "eta-kisit"
APP_ID = "tr.org.eta.kisit"


# compile_pam()

data_files = [
    # Sources
    (
        f"/usr/share/eta/{APP_NAME}/src",
        [
            "src/Main.py",
            "src/ETAKisitActivator.py",
            "src/Logger.py",
            "src/UserCheckService.py",
            "src/version.py",
        ],
    ),
    (
        f"/usr/share/eta/{APP_NAME}/src/managers",
        [
            "src/managers/ApplicationManager.py",
            "src/managers/BrowserManager.py",
            "src/managers/FileRestrictionManager.py",
            "src/managers/LinuxUserManager.py",
            "src/managers/MalcontentManager.py",
            "src/managers/NetworkFilterManager.py",
            "src/managers/NotificationManager.py",
            "src/managers/ProfileManager.py",
            "src/managers/SmartdnsManager.py",
            "src/managers/SnapManager.py",
        ],
    ),
    (
        f"/usr/share/eta/{APP_NAME}/src/ui_gtk3",
        [
            "src/ui_gtk3/ApplicationChooserWindow.py",
            "src/ui_gtk3/Dialogs.py",
            "src/ui_gtk3/MainWindow.py",
            "src/ui_gtk3/PActionRow.py",
            "src/ui_gtk3/PreferencesWindow.py",
            "src/ui_gtk3/ProfileChooserWindow.py",
        ],
    ),
    # Data
    (f"/usr/share/eta/{APP_NAME}/data", ["data/style_gtk3.css"]),
    (f"/usr/share/eta/{APP_NAME}/data/img", ["data/img/eta-kisit.svg"]),
    # Executable
    ("/usr/bin/", [f"{APP_NAME}"]),
    # Icon
    (f"/usr/share/eta/{APP_NAME}/", [f"{APP_NAME}.svg"]),
    ("/usr/share/icons/hicolor/scalable/apps/", [f"{APP_NAME}.svg"]),
    # Desktop
    ("/usr/share/applications/", [f"{APP_ID}.desktop"]),
    # Polkit
    ("/usr/share/polkit-1/actions", ["polkit/tr.org.pardus.pkexec.eta-kisit.policy"]),
]

setup(
    name=f"{APP_NAME}",
    version=version.VERSION,
    packages=find_packages(),
    scripts=[f"{APP_NAME}"],
    install_requires=["PyGObject"],
    data_files=data_files,
    author="Emin Fedar",
    author_email="emin.fedar@pardus.org.tr",
    description="Restriction application for ETA",
    license="GPLv3",
    keywords="",
    url="https://github.com/pardus/eta-kisit",
)
