e7a4efb
%global pypi_name sip
40c0f8a
e7a4efb
Name:           mingw-%{pypi_name}
e7a4efb
Summary:        MinGW Windows SIP6
256d53b
Version:        6.5.1
256d53b
Release:        1%{?dist}
40c0f8a
40c0f8a
# sipgen/parser.{c.h} is GPLv3+ with exceptions (bison)
e7a4efb
License:        (GPLv2 or GPLv3) and (GPLv3+ with exceptions)
40c0f8a
Url:            http://www.riverbankcomputing.com/software/sip/intro
e7a4efb
Source0:        %{pypi_source}
40c0f8a
e7a4efb
BuildRequires:  gcc
99455f7
BuildRequires:  python3-devel
e7a4efb
BuildRequires:  python3-setuptools
40c0f8a
a7c14b6
BuildRequires:  mingw32-filesystem >= 102
99455f7
BuildRequires:  mingw32-python3
d3d5016
BuildRequires:  mingw32-python3-setuptools
40c0f8a
a7c14b6
BuildRequires:  mingw64-filesystem >= 102
99455f7
BuildRequires:  mingw64-python3
d3d5016
BuildRequires:  mingw64-python3-setuptools
40c0f8a
40c0f8a
40c0f8a
%description
e7a4efb
MinGW Windows SIP6.
99455f7
99455f7
e7a4efb
%package -n mingw32-%{pypi_name}
e7a4efb
Summary:       MinGW Windows SIP6
99455f7
e7a4efb
%description -n mingw32-%{pypi_name}
e7a4efb
MinGW Windows SIP6.
99455f7
99455f7
e7a4efb
%package -n mingw64-%{pypi_name}
e7a4efb
Summary:       MinGW Windows SIP6
99455f7
e7a4efb
%description -n mingw64-%{pypi_name}
e7a4efb
MinGW Windows SIP6.
40c0f8a
40c0f8a
40c0f8a
%prep
e7a4efb
%autosetup -p1 -n %{pypi_name}-%{version}
40c0f8a
40c0f8a
40c0f8a
%build
f469ac7
# Target build
f469ac7
%{mingw32_py3_build}
f469ac7
%{mingw64_py3_build}
f469ac7
f469ac7
# Host build
f469ac7
%{py3_build -- -b build_native}
99455f7
99455f7
e7a4efb
%install
f469ac7
# Target build
f469ac7
%{mingw32_py3_install}
f469ac7
%{mingw64_py3_install}
f469ac7
f469ac7
# Host build
f469ac7
ln -s build_native build
e7a4efb
%{py3_install -- --prefix=%{_prefix}/%{mingw32_target}}
e7a4efb
%{py3_install -- --prefix=%{_prefix}/%{mingw64_target}}
f469ac7
rm build
99455f7
e7a4efb
# Don't use lib64 in mingw host prefix
e7a4efb
if [ "%_lib" != "lib" ]; then
e7a4efb
    mv %{buildroot}%{_prefix}/%{mingw32_target}/%_lib/ %{buildroot}%{_prefix}/%{mingw32_target}/lib/
e7a4efb
    mv %{buildroot}%{_prefix}/%{mingw64_target}/%_lib/ %{buildroot}%{_prefix}/%{mingw64_target}/lib/
99455f7
fi
99455f7
e7a4efb
# Wrappers
e7a4efb
mkdir -p %{buildroot}%{_bindir}
40c0f8a
e7a4efb
for file in %{buildroot}%{_prefix}/%{mingw32_target}/bin/sip-*; do
e7a4efb
mv $file $file.py
e7a4efb
cat << EOF > $file
e7a4efb
#!/bin/sh
e7a4efb
%mingw32_python3 %{_prefix}/%{mingw32_target}/bin/`basename $file`.py "\$@"
e7a4efb
EOF
e7a4efb
chmod +x $file
e7a4efb
ln -s %{_prefix}/%{mingw32_target}/bin/`basename $file` %{buildroot}%{_bindir}/mingw32-`basename $file`
99455f7
done
99455f7
e7a4efb
for file in %{buildroot}%{_prefix}/%{mingw64_target}/bin/sip-*; do
e7a4efb
mv $file $file.py
e7a4efb
cat << EOF > $file
e7a4efb
#!/bin/sh
e7a4efb
%mingw64_python3 %{_prefix}/%{mingw64_target}/bin/`basename $file`.py "\$@"
e7a4efb
EOF
e7a4efb
chmod +x $file
e7a4efb
ln -s %{_prefix}/%{mingw64_target}/bin/`basename $file` %{buildroot}%{_bindir}/mingw64-`basename $file`
99455f7
done
99455f7
40c0f8a
e7a4efb
%files -n mingw32-%{pypi_name}
99455f7
%license LICENSE LICENSE-GPL2 LICENSE-GPL3
e7a4efb
%{_bindir}/mingw32-sip-*
e7a4efb
%{_prefix}/%{mingw32_target}/bin/sip-*
e7a4efb
%{_prefix}/%{mingw32_target}/lib/python%{python3_version}/site-packages/sipbuild/
e7a4efb
%{_prefix}/%{mingw32_target}/lib/python%{python3_version}/site-packages/sip-%{version}*-py%{python3_version}.egg-info/
f469ac7
%{mingw32_bindir}/sip-*
f469ac7
%{mingw32_python3_sitearch}/sipbuild/
f469ac7
%{mingw32_python3_sitearch}/sip-%{version}*-py%{python3_version}.egg-info/
99455f7
e7a4efb
%files -n mingw64-%{pypi_name}
99455f7
%license LICENSE LICENSE-GPL2 LICENSE-GPL3
e7a4efb
%{_bindir}/mingw64-sip-*
e7a4efb
%{_prefix}/%{mingw64_target}/bin/sip-*
e7a4efb
%{_prefix}/%{mingw64_target}/lib/python%{python3_version}/site-packages/sipbuild/
f469ac7
%{_prefix}/%{mingw64_target}/lib/python%{python3_version}/site-packages/sip-%{version}*-py%{mingw32_python3_version}.egg-info/
f469ac7
%{mingw64_bindir}/sip-*
f469ac7
%{mingw64_python3_sitearch}/sipbuild/
f469ac7
%{mingw64_python3_sitearch}/sip-%{version}*-py%{mingw64_python3_version}.egg-info/
99455f7
99455f7
40c0f8a
%changelog
256d53b
* Fri Feb 18 2022 Sandro Mani <manisandro@gmail.com> - 6.5.1-1
256d53b
- Update to 6.5.1
256d53b
f469ac7
* Fri Feb 11 2022 Sandro Mani <manisandro@gmail.com> - 6.5.0-4
f469ac7
- Also build/install target build, drop manually specified requires
f469ac7
e073060
* Fri Feb 11 2022 Sandro Mani <manisandro@gmail.com> - 6.5.0-3
e073060
- Rebuild for new python dependency generator
e073060
99ffa22
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.5.0-2
99ffa22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
99ffa22
7c3c5d3
* Thu Dec 23 2021 Sandro Mani <manisandro@gmail.com> - 6.5.0-1
7c3c5d3
- Update to 6.5.0
7c3c5d3
3663196
* Mon Nov 01 2021 Sandro Mani <manisandro@gmail.com> - 6.4.0-1
3663196
- Update to 6.4.0
3663196
5cdef11
* Wed Oct 13 2021 Sandro Mani <manisandro@gmail.com> - 6.3.1-1
5cdef11
- Update to 6.3.1
5cdef11
c11ac7a
* Wed Oct 13 2021 Sandro Mani <manisandro@gmail.com> - 6.3.0-1
c11ac7a
- Update to 6.3.0
c11ac7a
c4a2d53
* Tue Oct 05 2021 Sandro Mani <manisandro@gmail.com> - 6.2.0-2
c4a2d53
- Require mingw-python-setuptools
c4a2d53
aadfdae
* Tue Oct 05 2021 Sandro Mani <manisandro@gmail.com> - 6.2.0-1
aadfdae
- Update to 6.2.0
aadfdae
e7a4efb
* Tue Sep 14 2021 Sandro Mani <manisandro@gmail.com> - 6.1.1-1
40c0f8a
- Initial package