File woeusb-ng.spec of Package woeusb-ng

#
# spec file for package WoeUSB-ng
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           WoeUSB-ng
Summary:        Create a Windows USB stick installer from a real Windows DVD or image
Version:        0.2.12
Release:        0
URL:            https://github.com/WoeUSB/WoeUSB-ng
Source0:        https://github.com/WoeUSB/WoeUSB-ng/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         fix-shebangs.patch
Patch1:         policy.patch
License:        GPL-3.0-only
Group:          System/GUI/Other
BuildRequires:  fdupes
BuildRequires:  polkit
Buildrequires:  python-rpm-macros
BuildRequires:  %{python_module numpy}
BuildRequires:  %{python_module Pillow}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module termcolor}
BuildRequires:  %{python_module wxPython}
BuildRequires:  update-desktop-files
Requires:       polkit
Requires:       python3-numpy
Requires:       python3-Pillow
Requires:       python3-termcolor
Requires:       python3-wxPython
Recommends:     %{name}-lang
BuildArch:      noarch

%description
A Linux program to create a Windows USB stick installer from a real Windows DVD or image.

This package contains two programs:
- woeusb: A command-line utility that enables you to create your own bootable Windows
          installation USB storage device from an existing Windows Installation disc or
          disk image
- woeusbgui: Graphic version of woeusb

Supported images:
- Windows Vista, Windows 7, Window 8.x, Windows 10.
- All languages and any version (home, pro...) and Windows PE are supported.

Supported bootmodes:
- Legacy/MBR-style/IBM PC compatible bootmode
- Native UEFI booting is supported for Windows 7 and later images (limited to the
  FAT filesystem as the target)
- This project rewrite of original WoeUSB

%lang_package

%prep
%autosetup -p1

%build
%python3_build

%install
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_datadir}/applications
install -d %{buildroot}%{_datadir}/polkit-1/actions
install -d %{buildroot}%{_datadir}/icons/%{name}
# fix setup.py install directories
sed -i 's@/usr/local/bin/woeusbgui@%{buildroot}%{_bindir}/woeusbgui@g' setup.py
sed -i 's@/usr/share/polkit-1/actions@%{buildroot}%{_datadir}/polkit-1/actions@g' setup.py
sed -i 's@/usr/share/icons/WoeUSB-ng@%{buildroot}%{_datadir}/icons/%{name}@g' setup.py
sed -i 's@/usr/share/applications@%{buildroot}%{_datadir}/applications@g' setup.py
python3 setup.py install --root %{buildroot} --prefix %{_prefix}
%fdupes %{buildroot}%{python_sitelib}/Woe*

%find_lang woeusb %{name}.lang

%files
%license COPYING
%doc README.md CONTRIBUTING.md
%{_bindir}/woeusb
%{_bindir}/woeusbgui
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/%{name}
%{_datadir}/polkit-1/actions/com.github.woeusb.woeusb-ng.policy
%{python_sitelib}/WoeUSB*
%exclude %{python3_sitelib}/WoeUSB/locale

%files lang -f %{name}.lang
%dir %{python3_sitelib}/WoeUSB/locale/
%dir %{python3_sitelib}/WoeUSB/locale/*
%dir %{python3_sitelib}/WoeUSB/locale/*/LC_MESSAGES

%changelog
openSUSE Build Service is sponsored by