#!/usr/bin/env python3
"""
Setup script for PortProtonQt
Debian package build configuration
"""

from setuptools import setup, find_packages
from pathlib import Path
import re

# Читаем версию из pyproject.toml простым regex
pyproject_file = Path(__file__).parent / "pyproject.toml"
version_match = re.search(r'^version\s*=\s*"([^"]+)"', pyproject_file.read_text(), re.MULTILINE)
version = version_match.group(1) if version_match else "0.0.0"

# Читаем README для long_description
readme_file = Path(__file__).parent / "README.md"
long_description = readme_file.read_text(encoding="utf-8") if readme_file.exists() else ""

setup(
    name="portprotonqt",
    version=version,
    description="A project to rewrite PortProton (PortWINE) using PySide",
    long_description=long_description,
    long_description_content_type="text/markdown",
    author="Boria138, BlackSnaker, Mikhail Tergoev(Castro-Fidel)",
    author_email="",
    url="https://github.com/Castro-Fidel/PortProton",
    license="GPL-3.0",

    # Классификаторы PyPI
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Programming Language :: Python :: 3.13",
        "Operating System :: POSIX :: Linux",
        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
        "Intended Audience :: End Users/Desktop",
        "Topic :: Games/Entertainment",
    ],
    keywords=["portproton", "wine", "game", "steam", "proton", "linux"],

    # Python версия
    python_requires=">=3.10",

    # Пакеты
    packages=find_packages(exclude=["build-aux", "dev-scripts", "documentation", "data"]),

    # Включаемые файлы пакета
    package_data={
        "portprotonqt": [
            "themes/**/*",
            "themes/**/fonts/*",
            "themes/**/images/*",
            "themes/**/images/icons/*",
            "themes/**/images/screenshots/*",
            "locales/**/*",
            "locales/**/*.po",
            "locales/**/*.mo",
        ],
    },

    # Точка входа - исполняемый скрипт
    entry_points={
        "console_scripts": [
            "portprotonqt=portprotonqt.app:main",
        ],
    },

    # Дополнительные опции
    include_package_data=True,
    zip_safe=False,
)
