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: qt5_add_translations.patch
BuildRequires: cmake
BuildRequires: libqt5-qtbase-devel
BuildRequires: libqt5-qttools-devel
BuildRequires: enchant-devel
BuildRequires: doxygen
%if 0%{?suse_version} > 1310
BuildRequires: libqt5-qttranslations
%endif
Requires: iso-codes
%description
QtSpell adds spell-checking functionality to Qt's text widgets, using the
enchant spell-checking library.
%package -n lib%{name}-qt5-%{so_ver}
Summary: Spell checking for Qt5 text widgets
Group: System Environment/Libraries
%description -n lib%{name}-qt5-%{so_ver}
QtSpell adds spell-checking functionality to Qt5's text widgets, using the
enchant spell-checking library.
%package qt5-devel
Group: Development/Libraries
Summary: Development files for %{name}-qt5
Requires: lib%{name}-qt5-%{so_ver}%{?_isa} = %{version}-%{release}
%description qt5-devel
The %{name}-qt5-devel package contains libraries and header files for
developing applications that use %{name}-qt5.
%package qt5-translations
Summary: Translations for %{name}-qt5
Group: System/Localization
BuildArch: noarch
Requires: lib%{name}-qt5-%{so_ver} = %{version}-%{release}
%if 0%{?suse_version} > 1310
Requires: libqt5-qttranslations
%endif
%description qt5-translations
The %{name}-qt5-translations contains translations for %{name}-qt5.
%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}
%patch -P 0 -p1
%build
mkdir build-qt5
pushd build-qt5
%cmake ../..
make %{?_smp_mflags}
make doc
popd
%install
%make_install -C build-qt5/build
%post -n lib%{name}-qt5-%{so_ver} -p /sbin/ldconfig
%postun -n lib%{name}-qt5-%{so_ver} -p /sbin/ldconfig
%files -n lib%{name}-qt5-%{so_ver}
%defattr (-, root, root)
%doc COPYING
%{_libdir}/libqtspell-qt5.so.*
%files qt5-devel
%defattr (-, root, root)
%{_includedir}/QtSpell-qt5/
%{_libdir}/libqtspell-qt5.so
%{_libdir}/pkgconfig/QtSpell-qt5.pc
%files qt5-translations
%defattr (-, root, root)
%if 0%{?suse_version} <= 1310
%dir /usr/share/qt5/translations/
%endif
/usr/share/qt5/translations/QtSpell_*.qm
%files doc
%defattr (-, root, root)
%doc COPYING
%doc build-qt5/build/doc/html
%changelog