Blob Blame History Raw
%global pypi_name sip

Name:           mingw-%{pypi_name}
Summary:        MinGW Windows SIP6
Version:        6.5.0
Release:        2%{?dist}

# sipgen/parser.{c.h} is GPLv3+ with exceptions (bison)
License:        (GPLv2 or GPLv3) and (GPLv3+ with exceptions)
Url:            http://www.riverbankcomputing.com/software/sip/intro
Source0:        %{pypi_source}

BuildRequires:  gcc
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

BuildRequires:  mingw32-filesystem >= 102
BuildRequires:  mingw32-python3

BuildRequires:  mingw64-filesystem >= 102
BuildRequires:  mingw64-python3


%description
MinGW Windows SIP6.


%package -n mingw32-%{pypi_name}
Summary:       MinGW Windows SIP6
Requires:      mingw32-python3-packaging
Requires:      mingw32-python3-pyparsing
Requires:      mingw32-python3-setuptools
Requires:      mingw32-python3-toml

%description -n mingw32-%{pypi_name}
MinGW Windows SIP6.


%package -n mingw64-%{pypi_name}
Summary:       MinGW Windows SIP6
Requires:      mingw64-python3-packaging
Requires:      mingw64-python3-pyparsing
Requires:      mingw64-python3-setuptools
Requires:      mingw64-python3-toml

%description -n mingw64-%{pypi_name}
MinGW Windows SIP6.


%prep
%autosetup -p1 -n %{pypi_name}-%{version}


%build
%{py3_build}


%install
%{py3_install -- --prefix=%{_prefix}/%{mingw32_target}}
%{py3_install -- --prefix=%{_prefix}/%{mingw64_target}}

# Don't use lib64 in mingw host prefix
if [ "%_lib" != "lib" ]; then
    mv %{buildroot}%{_prefix}/%{mingw32_target}/%_lib/ %{buildroot}%{_prefix}/%{mingw32_target}/lib/
    mv %{buildroot}%{_prefix}/%{mingw64_target}/%_lib/ %{buildroot}%{_prefix}/%{mingw64_target}/lib/
fi

# Wrappers
mkdir -p %{buildroot}%{_bindir}

for file in %{buildroot}%{_prefix}/%{mingw32_target}/bin/sip-*; do
mv $file $file.py
cat << EOF > $file
#!/bin/sh
%mingw32_python3 %{_prefix}/%{mingw32_target}/bin/`basename $file`.py "\$@"
EOF
chmod +x $file
ln -s %{_prefix}/%{mingw32_target}/bin/`basename $file` %{buildroot}%{_bindir}/mingw32-`basename $file`
done

for file in %{buildroot}%{_prefix}/%{mingw64_target}/bin/sip-*; do
mv $file $file.py
cat << EOF > $file
#!/bin/sh
%mingw64_python3 %{_prefix}/%{mingw64_target}/bin/`basename $file`.py "\$@"
EOF
chmod +x $file
ln -s %{_prefix}/%{mingw64_target}/bin/`basename $file` %{buildroot}%{_bindir}/mingw64-`basename $file`
done


%files -n mingw32-%{pypi_name}
%license LICENSE LICENSE-GPL2 LICENSE-GPL3
%{_bindir}/mingw32-sip-*
%{_prefix}/%{mingw32_target}/bin/sip-*
%{_prefix}/%{mingw32_target}/lib/python%{python3_version}/site-packages/sipbuild/
%{_prefix}/%{mingw32_target}/lib/python%{python3_version}/site-packages/sip-%{version}*-py%{python3_version}.egg-info/

%files -n mingw64-%{pypi_name}
%license LICENSE LICENSE-GPL2 LICENSE-GPL3
%{_bindir}/mingw64-sip-*
%{_prefix}/%{mingw64_target}/bin/sip-*
%{_prefix}/%{mingw64_target}/lib/python%{python3_version}/site-packages/sipbuild/
%{_prefix}/%{mingw64_target}/lib/python%{python3_version}/site-packages/sip-%{version}*-py%{python3_version}.egg-info/


%changelog
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Thu Dec 23 2021 Sandro Mani <manisandro@gmail.com> - 6.5.0-1
- Update to 6.5.0

* Mon Nov 01 2021 Sandro Mani <manisandro@gmail.com> - 6.4.0-1
- Update to 6.4.0

* Wed Oct 13 2021 Sandro Mani <manisandro@gmail.com> - 6.3.1-1
- Update to 6.3.1

* Wed Oct 13 2021 Sandro Mani <manisandro@gmail.com> - 6.3.0-1
- Update to 6.3.0

* Tue Oct 05 2021 Sandro Mani <manisandro@gmail.com> - 6.2.0-2
- Require mingw-python-setuptools

* Tue Oct 05 2021 Sandro Mani <manisandro@gmail.com> - 6.2.0-1
- Update to 6.2.0

* Tue Sep 14 2021 Sandro Mani <manisandro@gmail.com> - 6.1.1-1
- Initial package