File pmbootstrap.spec of Package pmbootstrap2

# spec file for package pmbootstrap
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2024 Jianhua Lu <>
# Copyright (c) 2024 Zhang Bingwu <>
# Copyright (c) 2023, Tomáš Čech <>
# Copyright (c) 2021, Martin Hauke <>
# 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

%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%bcond_with libalternatives

Name:           pmbootstrap
Version:        2.3.1
Release:        0
Summary:        Sophisticated chroot/build/flash tool to develop and install postmarketOS
License:        GPL-3.0-only
Source0:        pmbootstrap-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module setuptools >= 61}
BuildRequires:  %{python_module setuptools_scm >= 6.2}
%if %{with libalternatives}
Requires:       alts
BuildRequires:  alts
Requires(post): update-alternatives
BuildArch:      noarch

Sophisticated chroot/build/flash tool to develop and install postmarketOS

%setup -q
sed -i "/def setup_appstream(args)/a\    return" pmb/install/ 


# Prepare for libalternatives/update-alternatives usage
%python_clone -a %{buildroot}%{_bindir}/pmbootstrap
%python_expand %fdupes %{buildroot}%{$python_sitelib}

# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative pmbootstrap

%python_install_alternative pmbootstrap

%python_uninstall_alternative pmbootstrap

%files %{python_files}
%license LICENSE
%python_alternative %{_bindir}/pmbootstrap

openSUSE Build Service is sponsored by