Add mingw subpackages

This commit is contained in:
Sandro Mani 2022-02-24 10:55:56 +01:00
parent 73bf604530
commit 482bfbc1e4

View File

@ -1,6 +1,6 @@
Name: enchant2
Version: 2.3.2
Release: 3%{?snap}%{?dist}
Release: 4%{?snap}%{?dist}
Summary: An Enchanting Spell Checking Library
License: LGPLv2+
@ -23,6 +23,20 @@ BuildRequires: nuspell-devel >= 4.1.0
%endif
BuildRequires: make
BuildRequires: mingw32-filesystem >= 131
BuildRequires: mingw32-gcc
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw32-binutils
BuildRequires: mingw32-glib2
BuildRequires: mingw32-hunspell
BuildRequires: mingw64-filesystem >= 131
BuildRequires: mingw64-gcc
BuildRequires: mingw64-gcc-c++
BuildRequires: mingw64-binutils
BuildRequires: mingw64-glib2
BuildRequires: mingw64-hunspell
Provides: bundled(gnulib)
@ -67,6 +81,23 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package -n mingw32-%{name}
Summary: MinGW Windows %{name} library
%description -n mingw32-%{name}
MinGW Windows %{pkgname} library.
%package -n mingw64-%{name}
Summary: MinGW Windows %{name} library
%description -n mingw64-%{name}
MinGW Windows %{name} library.
%{?mingw_debug_package}
%prep
%autosetup -p1 -n enchant-%{version}
@ -75,6 +106,10 @@ autoreconf -ifv
%build
# Native build
mkdir build_native
pushd build_native
%define _configure ../configure
%configure \
--with-aspell \
--with-hunspell-dir=%{_datadir}/hunspell \
@ -86,14 +121,33 @@ autoreconf -ifv
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g;
s|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build pkgdatadir=%{_datadir}/enchant-2
popd
# MinGW build
MINGW32_CONFIGURE_ARGS="--with-hunspell-dir=%{mingw32_datadir}/hunspell" \
MINGW64_CONFIGURE_ARGS="--with-hunspell-dir=%{mingw64_datadir}/hunspell" \
%mingw_configure --disable-static --without-hspell --enable-relocatable
MINGW32_MAKE_ARGS="pkgdatadir=%{mingw32_datadir}/enchant-2" \
MINGW64_MAKE_ARGS="pkgdatadir=%{mingw64_datadir}/enchant-2" \
%mingw_make_build
%install
%make_install pkgdatadir=%{_datadir}/enchant-2
# Native build
%make_install -C build_native pkgdatadir=%{_datadir}/enchant-2
# MinGW build
MINGW32_MAKE_ARGS="pkgdatadir=%{mingw32_datadir}/enchant-2" \
MINGW64_MAKE_ARGS="pkgdatadir=%{mingw64_datadir}/enchant-2" \
%mingw_make_install
rm -rf %{buildroot}%{mingw32_datadir}/man
rm -rf %{buildroot}%{mingw64_datadir}/man
find %{buildroot} -name '*.la' -delete
%ldconfig_scriptlets
%mingw_debug_install_post
%files
@ -123,8 +177,37 @@ find %{buildroot} -name '*.la' -delete
%{_libdir}/pkgconfig/enchant-2.pc
%{_includedir}/enchant-2
%files -n mingw32-%{name}
%license COPYING.LIB
%{mingw32_bindir}/enchant-lsmod-2.exe
%{mingw32_bindir}/enchant-2.exe
%{mingw32_bindir}/libenchant-2.dll
%{mingw32_includedir}/enchant-2/
%dir %{mingw32_libdir}/enchant-2/
%{mingw32_libdir}/enchant-2/enchant_hunspell.dll
%{mingw32_libdir}/enchant-2/enchant_hunspell.dll.a
%{mingw32_libdir}/libenchant-2.dll.a
%{mingw32_libdir}/pkgconfig/enchant-2.pc
%{mingw32_datadir}/enchant-2/
%files -n mingw64-%{name}
%license COPYING.LIB
%{mingw64_bindir}/enchant-lsmod-2.exe
%{mingw64_bindir}/enchant-2.exe
%{mingw64_bindir}/libenchant-2.dll
%{mingw64_includedir}/enchant-2/
%dir %{mingw64_libdir}/enchant-2/
%{mingw64_libdir}/enchant-2/enchant_hunspell.dll
%{mingw64_libdir}/enchant-2/enchant_hunspell.dll.a
%{mingw64_libdir}/libenchant-2.dll.a
%{mingw64_libdir}/pkgconfig/enchant-2.pc
%{mingw64_datadir}/enchant-2/
%changelog
* Thu Feb 24 2022 Sandro Mani <manisandro@gmail.com> - 2.3.2-4
- Add mingw subpackages
* Tue Jan 25 2022 Parag Nemade <pnemade AT redhat DOT com> - 2.3.2-3
- Update hunspell-dir path
F36 Change https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change