File qtspell.spec of Package qtspell

%define so_ver 1

Name:           qtspell
Version:        1.0.1
Release:        1%{?dist}
Summary:        Spell checking for Qt text widgets

License:        GPL-3.0+
URL:            https://github.com/manisandro/qtspell
Source0:        https://github.com/manisandro/qtspell/archive/%{version}/%{name}-%{version}.tar.gz
Patch0:         qt6_add_translations.patch
Patch1:         qtspell-qt6.patch


BuildRequires:  cmake
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6Tools)
BuildRequires:  cmake(Qt6Widgets)
BuildRequires:  cmake(Qt6Linguist)
BuildRequires:  enchant-devel
BuildRequires:  doxygen

Requires:       iso-codes

%description
QtSpell adds spell-checking functionality to Qt's text widgets, using the
enchant spell-checking library.

%package -n     lib%{name}-qt6-%{so_ver}
Summary:        Spell checking for Qt6 text widgets
Group:          System Environment/Libraries

%description -n lib%{name}-qt6-%{so_ver}
QtSpell adds spell-checking functionality to Qt6's text widgets, using the
enchant spell-checking library.


%package        qt6-devel
Group:          Development/Libraries
Summary:        Development files for %{name}-qt6
Requires:       lib%{name}-qt6-%{so_ver}%{?_isa} = %{version}-%{release}

%description    qt6-devel
The %{name}-qt6-devel package contains libraries and header files for
developing applications that use %{name}-qt6.


%package        qt6-translations
Summary:        Translations for %{name}-qt6
Group:          System/Localization
BuildArch:      noarch
Requires:       lib%{name}-qt6-%{so_ver} = %{version}-%{release}
%if 0%{?suse_version} > 1310
Requires:       qt6-translations
%endif

%description    qt6-translations
The %{name}-qt6-translations contains translations for %{name}-qt6.


%package        doc
Summary:        Developer documentation for %{name}
Group:          Documentation
BuildArch:      noarch

%description    doc
The %{name}-doc package contains the documentation for developing applications
that use %{name}.


%prep
%setup -q -n %{name}-%{version}
%autopatch -p1


%build
mkdir build-qt6
pushd build-qt6
%cmake ../..
make %{?_smp_mflags}
make doc
popd


%install
%make_install -C build-qt6/build


%post -n lib%{name}-qt6-%{so_ver} -p /sbin/ldconfig

%postun -n lib%{name}-qt6-%{so_ver} -p /sbin/ldconfig


%files -n lib%{name}-qt6-%{so_ver}
%defattr (-, root, root)
%doc COPYING
%{_libdir}/libqtspell-qt6.so.*

%files qt6-devel
%defattr (-, root, root)
%{_includedir}/QtSpell-qt6/
%{_libdir}/libqtspell-qt6.so
%{_libdir}/pkgconfig/QtSpell-qt6.pc

%files qt6-translations
%defattr (-, root, root)
%if 0%{?suse_version} <= 1310
%dir /usr/share/qt6/translations/
%endif
/usr/share/qt6/translations/QtSpell_*.qm

%files doc
%defattr (-, root, root)
%doc COPYING
%doc build-qt6/build/doc/html


%changelog
openSUSE Build Service is sponsored by