File woeusb-ng.spec of Package woeusb-ng

#
# spec file for package woeusb-ng
#
# Copyright (c) 2021 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
Version:        0.2.10
Release:        1
Summary:        Windows USB installation media creator
License:        GPL-3.0-or-later
URL:            https://github.com/WoeUSB/WoeUSB-ng
Source:         %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  update-desktop-files
Requires:       python3-wxPython
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

%prep
%autosetup -n WoeUSB-ng-%{version}

%build
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
sed -i '1!b;s@/usr/bin/env python@/usr/bin/python@' %{buildroot}%{python_sitelib}/WoeUSB/woeusb \
 %{buildroot}%{python_sitelib}/WoeUSB/woeusbgui
mkdir -p %{buildroot}/%{_datadir}/pixmaps/
install -m 0644 WoeUSB/data/woeusb-logo.png %{buildroot}/%{_datadir}/pixmaps/woeusb-logo.png
%suse_update_desktop_file -c %{name} WoeUSB WoeUSB woeusbgui woeusb-logo "System;HardwareSettings;"
%fdupes %{buildroot}%{$python_sitelib}

%files
%license COPYING
%doc README.md
%{_bindir}/woeusb
%{_bindir}/woeusbgui
%{python_sitelib}/*
%{_datadir}/pixmaps/woeusb-logo.png
%{_datadir}/applications/*.desktop

%changelog
openSUSE Build Service is sponsored by