40c0f8a
%global win32_dir %{_builddir}/mingw32-%{name}-%{version}-%{release}
40c0f8a
%global win64_dir %{_builddir}/mingw64-%{name}-%{version}-%{release}
40c0f8a
%global win32_host_dir %{_builddir}/mingw32-host-%{name}-%{version}-%{release}
40c0f8a
%global win64_host_dir %{_builddir}/mingw64-host-%{name}-%{version}-%{release}
40c0f8a
40c0f8a
# Disable debuginfo subpackages and debugsource packages for now to use old logic
40c0f8a
%undefine _debugsource_packages
40c0f8a
%undefine _debuginfo_subpackages
40c0f8a
40c0f8a
# Override the __debug_install_post argument as this package
40c0f8a
# contains both native as well as cross compiled binaries
40c0f8a
%global __debug_install_post %%{mingw_debug_install_post}; %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%%{?buildsubdir}" %{nil}
40c0f8a
40c0f8a
%global pkgname sip
40c0f8a
40c0f8a
Name:           mingw-%{pkgname}
40c0f8a
Summary:        MinGW Windows SIP
b39500a
Version:        4.19.7
e4d7d28
Release:        2%{?dist}
40c0f8a
40c0f8a
# sipgen/parser.{c.h} is GPLv3+ with exceptions (bison)
40c0f8a
License:        GPLv2 or GPLv3 and (GPLv3+ with exceptions)
40c0f8a
Url:            http://www.riverbankcomputing.com/software/sip/intro
40c0f8a
Source0:        http://downloads.sourceforge.net/pyqt/sip-%{version}.tar.gz
40c0f8a
Source1:        mingw-win32-host-pyconfig
40c0f8a
Source2:        mingw-win64-host-pyconfig
40c0f8a
Source3:        mingw-win32-pyconfig
40c0f8a
Source4:        mingw-win64-pyconfig
40c0f8a
Source5:        mingw-win32-g++
40c0f8a
Source6:        mingw-win64-g++
40c0f8a
40c0f8a
# make install should not strip (by default), kills -debuginfo
40c0f8a
Patch0:         sip-4.16.3-no_strip.patch
40c0f8a
# try not to rpath the world
40c0f8a
Patch1:         sip-4.16.3-no_rpath.patch
fee5098
# Fix some config paths, add -lpythonX.Y to linker flags
40c0f8a
Patch2:         sip-4.19-config.patch
40c0f8a
40c0f8a
BuildRequires:  gcc-c++
40c0f8a
BuildRequires:  python2-devel
40c0f8a
a7c14b6
BuildRequires:  mingw32-filesystem >= 102
40c0f8a
BuildRequires:  mingw32-python2
40c0f8a
BuildRequires:  mingw32-qt5-qtbase
40c0f8a
a7c14b6
BuildRequires:  mingw64-filesystem >= 102
40c0f8a
BuildRequires:  mingw64-python2
40c0f8a
BuildRequires:  mingw64-qt5-qtbase
40c0f8a
40c0f8a
40c0f8a
%description
40c0f8a
MinGW Windows SIP.
40c0f8a
40c0f8a
%package -n mingw32-%{pkgname}
40c0f8a
Summary:       MinGW Windows SIP
40c0f8a
Requires:      mingw32-python2
40c0f8a
40c0f8a
%description -n mingw32-%{pkgname}
40c0f8a
MinGW Windows SIP.
40c0f8a
40c0f8a
40c0f8a
%package -n mingw64-%{pkgname}
40c0f8a
Summary:       MinGW Windows SIP
40c0f8a
Requires:      mingw64-python2
40c0f8a
40c0f8a
%description -n mingw64-%{pkgname}
40c0f8a
MinGW Windows SIP.
40c0f8a
40c0f8a
40c0f8a
%{?mingw_debug_package}
40c0f8a
40c0f8a
40c0f8a
%prep
40c0f8a
%autosetup -p1 -n %{pkgname}-%{version}
40c0f8a
cp -a %{SOURCE5} specs/mingw-win32-g++
40c0f8a
cp -a %{SOURCE6} specs/mingw-win64-g++
40c0f8a
40c0f8a
rm -rf %{win32_dir}
40c0f8a
rm -rf %{win64_dir}
40c0f8a
rm -rf %{win32_host_dir}
40c0f8a
rm -rf %{win64_host_dir}
40c0f8a
cp -a . %{win32_dir}
40c0f8a
cp -a . %{win64_dir}
40c0f8a
cp -a . %{win32_host_dir}
40c0f8a
cp -a . %{win64_host_dir}
40c0f8a
40c0f8a
40c0f8a
%build
40c0f8a
pushd %{win32_host_dir}
40c0f8a
%{__python2} configure.py --configuration=%{SOURCE1} \
b39500a
    CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags} -lpython2.7"
40c0f8a
%make_build
40c0f8a
popd
40c0f8a
40c0f8a
pushd %{win64_host_dir}
40c0f8a
%{__python2} configure.py --configuration=%{SOURCE2} \
b39500a
    CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags} -lpython2.7"
40c0f8a
%make_build
40c0f8a
popd
40c0f8a
40c0f8a
pushd %{win32_dir}
40c0f8a
mingw32-python configure.py --configuration=%{SOURCE3} --use-qmake -p mingw-win32-g++ \
40c0f8a
    CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}"
40c0f8a
%mingw32_qmake_qt5 sip.pro
40c0f8a
%mingw32_make %{?_smp_mflags}
40c0f8a
popd
40c0f8a
40c0f8a
pushd %{win64_dir}
40c0f8a
mingw64-python configure.py --configuration=%{SOURCE4} --use-qmake -p mingw-win64-g++ \
40c0f8a
    CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}"
40c0f8a
%mingw64_qmake_qt5 sip.pro
40c0f8a
%mingw64_make %{?_smp_mflags}
40c0f8a
popd
40c0f8a
40c0f8a
40c0f8a
%install
40c0f8a
%make_install -C %{win32_host_dir}
40c0f8a
%make_install -C %{win64_host_dir}
40c0f8a
%mingw32_make INSTALL_ROOT=%{buildroot} -C %{win32_dir} install
40c0f8a
%mingw64_make INSTALL_ROOT=%{buildroot} -C %{win64_dir} install
40c0f8a
40c0f8a
mkdir -p %{buildroot}%{mingw32_datadir}/sip
40c0f8a
mkdir -p %{buildroot}%{mingw64_datadir}/sip
40c0f8a
40c0f8a
mkdir -p %{buildroot}%{_bindir}
40c0f8a
ln -s %{_prefix}/%{mingw32_target}/bin/sip %{buildroot}%{_bindir}/mingw32-sip
40c0f8a
ln -s %{_prefix}/%{mingw64_target}/bin/sip %{buildroot}%{_bindir}/mingw64-sip
40c0f8a
3a809a3
# Exclude debug files from the main files (note: the debug files are only created after %%install, so we can't search for them directly)
3a809a3
find %{buildroot}%{mingw32_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw32-%{pkgname}.debugfiles
3a809a3
find %{buildroot}%{mingw64_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw64-%{pkgname}.debugfiles
40c0f8a
3a809a3
3a809a3
%files -n mingw32-%{pkgname} -f mingw32-%{pkgname}.debugfiles
40c0f8a
%license LICENSE LICENSE-GPL2 LICENSE-GPL3
40c0f8a
%{_prefix}/%{mingw32_target}/bin/sip
40c0f8a
%{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/*
40c0f8a
%{_bindir}/mingw32-sip
40c0f8a
%{mingw32_bindir}/sip.exe
40c0f8a
%{mingw32_python2_sitearch}/*
a7c14b6
%exclude %{mingw32_python2_sitearch}/*.debug
40c0f8a
%{mingw32_includedir}/python2.7/sip.h
40c0f8a
%dir %{mingw32_datadir}/sip
40c0f8a
3a809a3
%files -n mingw64-%{pkgname} -f mingw64-%{pkgname}.debugfiles
40c0f8a
%license LICENSE LICENSE-GPL2 LICENSE-GPL3
40c0f8a
%{_prefix}/%{mingw64_target}/bin/sip
40c0f8a
%{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/*
40c0f8a
%{_bindir}/mingw64-sip
40c0f8a
%{mingw64_bindir}/sip.exe
40c0f8a
%{mingw64_python2_sitearch}/*
a7c14b6
%exclude %{mingw64_python2_sitearch}/*.debug
40c0f8a
%{mingw64_includedir}/python2.7/sip.h
40c0f8a
%dir %{mingw64_datadir}/sip
40c0f8a
40c0f8a
40c0f8a
%changelog
e4d7d28
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.19.7-2
e4d7d28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e4d7d28
b39500a
* Wed Jan 24 2018 Sandro Mani <manisandro@gmail.com> - 4.19.7-1
b39500a
- Update to 4.19.7
b39500a
1da306a
* Sat Nov 25 2017 Sandro Mani <manisandro@gmail.com> - 4.19.6-1
1da306a
- Update to 4.19.6
1da306a
fee5098
* Tue Nov 07 2017 Sandro Mani <manisandro@gmail.com> - 4.19.5-1
fee5098
- Update to 4.19.5
fee5098
e1e01af
* Sat Nov 04 2017 Sandro Mani <manisandro@gmail.com> - 4.19.4-1
e1e01af
- Update to 4.19.4
e1e01af
3a809a3
* Sat Sep 09 2017 Sandro Mani <manisandro@gmail.com> - 4.19.3-4
3a809a3
- More robust debug file filtering
3a809a3
a7c14b6
* Sat Sep 09 2017 Sandro Mani <manisandro@gmail.com> - 4.19.3-3
a7c14b6
- Rebuild for mingw-filesystem
a7c14b6
40c0f8a
* Mon Sep 04 2017 Sandro Mani <manisandro@gmail.com> - 4.19.3-2
40c0f8a
- Build against Qt5
40c0f8a
40c0f8a
* Tue Jul 11 2017 Sandro Mani <manisandro@gmail.com> - 4.19.3-1
40c0f8a
- Update to 4.19.3
40c0f8a
40c0f8a
* Tue Apr 25 2017 Sandro Mani <manisandro@gmail.com> - 4.19.2-1
40c0f8a
- Update to 4.19.2
40c0f8a
40c0f8a
* Mon Jan 16 2017 Sandro Mani <manisandro@gmail.com> - 4.19-1
40c0f8a
- Update to 4.19.0
40c0f8a
40c0f8a
* Fri Jan 22 2016 Sandro Mani <manisandro@gmail.com> - 4.17-1
40c0f8a
- Update to 4.17.0
40c0f8a
40c0f8a
* Mon Aug 10 2015 Sandro Mani <manisandro@gmail.com> - 4.16.9-1
40c0f8a
- Initial package