# Original project: https://github.com/RusNor/StartWine-Launcher %global debug_package %{nil} Name: startwine Version: 422 Release: 1%{?dist} Summary: Windows application launcher for Linux License: GPL-3.0-or-later URL: https://github.com/RusNor/StartWine-Launcher Source0: StartWine_v%{version}.tar.gz Source1: ru.launcher.StartWine.desktop ExclusiveArch: x86_64 BuildRequires: cargo BuildRequires: rust BuildRequires: gcc BuildRequires: gettext-devel BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gio-2.0) BuildRequires: python3-devel BuildRequires: make BuildRequires: cmake BuildRequires: libepoxy-devel BuildRequires: LibRaw-devel BuildRequires: openssl-devel Requires: python3 Requires: python3-psutil Requires: python3-gobject Requires: python3-dbus Requires: python3-pillow Requires: python3-requests Requires: gtk4 Requires: fuse Requires: curl Requires: yad Requires: zenity %description StartWine is a Windows application launcher for GNU/Linux operating systems. It includes many features, extensions, and fixes to improve performance, visuals, and usability. %prep %autosetup -n StartWine-Launcher-StartWine_v%{version} ln -sf data/img img rm -f Cargo.lock %build # Отключаем встроенную сборку gettext - используем системную export GETTEXT_SYSTEM=1 export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 # Указываем Rust использовать системную библиотеку export RUSTFLAGS=$(pkg-config --libs libintl | sed 's/ / -C link-arg=/g' | sed 's/^-C link-arg=//') # Патчим пути для работы в Fedora sed -i 's|sw_path = Path.*|sw_path = Path("%{_datadir}/startwine")|' data/scripts/sw_data.py sed -i 's|START_WINE_PATH=.*|START_WINE_PATH="%{_localstatedir}/share/StartWine"|' data/scripts/sw_runlib # Собираем через cargo cargo build --release # Проверяем бинарник ls -la target/release/ if [ ! -f target/release/sw_start ]; then echo "ERROR: sw_start not found!" find target/release -type f -executable 2>/dev/null || true exit 1 fi %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_datadir}/startwine mkdir -p %{buildroot}%{_localstatedir}/share/StartWine mkdir -p %{buildroot}%{_localstatedir}/share/StartWine/Shortcuts mkdir -p %{buildroot}%{_datadir}/pixmaps mkdir -p %{buildroot}%{_datadir}/applications # Устанавливаем Rust-бинарник install -Dm755 target/release/sw_start %{buildroot}%{_bindir}/startwine # Копируем все скрипты и данные if [ -d data ]; then cp -r data/* %{buildroot}%{_datadir}/startwine/ 2>/dev/null || true fi # Создаём символические ссылки на Python-скрипты в /usr/bin for script in sw_menu.py sw_func.py sw_data.py sw_widget.py sw_cast.py sw_crier.py sw_dlm.py sw_input.py sw_opengl.py sw_pacurl.py sw_shaders.py sw_term.py; do if [ -f %{buildroot}%{_datadir}/startwine/scripts/$script ]; then ln -sf %{_datadir}/startwine/scripts/$script %{buildroot}%{_bindir}/$script fi done # Иконка if [ -f data/img/gui_icons/sw_icon.png ]; then install -Dm644 data/img/gui_icons/sw_icon.png %{buildroot}%{_datadir}/pixmaps/startwine.png fi # .desktop файл install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/applications/ru.launcher.StartWine.desktop # Делаем скрипты исполняемыми find %{buildroot}%{_datadir}/startwine -name "*.sh" -exec chmod +x {} \; 2>/dev/null || true find %{buildroot}%{_datadir}/startwine -name "*.py" -exec chmod +x {} \; 2>/dev/null || true # Устанавливаем правильные права на директорию Shortcuts chmod 755 %{buildroot}%{_localstatedir}/share/StartWine/Shortcuts %post # Создаём ссылки на исполняемые файлы, если их нет for script in sw_menu.py sw_func.py sw_data.py sw_widget.py sw_cast.py sw_crier.py sw_dlm.py sw_input.py sw_opengl.py sw_pacurl.py sw_shaders.py sw_term.py; do if [ ! -e %{_bindir}/$script ] && [ -f %{_datadir}/startwine/scripts/$script ]; then ln -sf %{_datadir}/startwine/scripts/$script %{_bindir}/$script fi done # Создаём директорию для данных, если её нет if [ ! -d %{_localstatedir}/share/StartWine ]; then mkdir -p %{_localstatedir}/share/StartWine/Shortcuts fi # Устанавливаем правильные права chmod 755 %{_localstatedir}/share/StartWine 2>/dev/null || true chmod 755 %{_localstatedir}/share/StartWine/Shortcuts 2>/dev/null || true %postun # При удалении пакета удаляем символические ссылки if [ $1 -eq 0 ]; then for script in sw_menu.py sw_func.py sw_data.py sw_widget.py sw_cast.py sw_crier.py sw_dlm.py sw_input.py sw_opengl.py sw_pacurl.py sw_shaders.py sw_term.py; do if [ -L %{_bindir}/$script ]; then rm -f %{_bindir}/$script fi done fi %files %{_bindir}/startwine %{_bindir}/sw_menu.py %{_bindir}/sw_func.py %{_bindir}/sw_data.py %{_bindir}/sw_widget.py %{_bindir}/sw_cast.py %{_bindir}/sw_crier.py %{_bindir}/sw_dlm.py %{_bindir}/sw_input.py %{_bindir}/sw_opengl.py %{_bindir}/sw_pacurl.py %{_bindir}/sw_shaders.py %{_bindir}/sw_term.py %{_datadir}/startwine/ %{_localstatedir}/share/StartWine/ %{_datadir}/pixmaps/startwine.png %{_datadir}/applications/ru.launcher.StartWine.desktop %license LICENSE %doc README.md %changelog * Sun Jun 07 2026 Wik217 - 422-1 - Initial RPM release for Fedora - Built from source code (x86_64 only) - Added symlinks for Python scripts to /usr/bin - Added system data directory /var/share/StartWine - Added proper Requires for Python modules