File languagetool.spec of Package languagetool

#
# spec file for package languagetool
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           languagetool
Version:        6.6+20250930.gca4f4b1c193
Release:        0
Summary:        Style and Grammar Checker
License:        LGPL-2.1-or-later
URL:            https://languagetool.org
Source0:        %{name}-%{version}.tar.zst
Source1:        vendor.tar.zst
BuildRequires:  maven
BuildRequires:  maven-local
BuildRequires:  mvn(kr.motd.maven:os-maven-plugin)
BuildRequires:  mvn(org.apache.maven.plugins:maven-assembly-plugin)
Recommends:     fasttext
%javadoc_package

%description
LanguageTool is a proofreading software for English, Spanish,
French, German, Portuguese, Polish, Dutch, and more than 20 other
languages. It finds many errors that a simple spell checker cannot
detect.

%package common
Summary:        Common files for LanguageTool packages
BuildArch:      noarch

%description common
LanguageTool is a proofreading software for English, Spanish,
French, German, Portuguese, Polish, Dutch, and more than 20 other
languages. It finds many errors that a simple spell checker cannot
detect.

This package contains common files used by other LanguageTool
packages.

%package http-client
Summary:        LanguageTool HTTP API client
Requires:       %{name}-common = %{version}
BuildArch:      noarch

%description http-client
LanguageTool is a proofreading software for English, Spanish,
French, German, Portuguese, Polish, Dutch, and more than 20 other
languages. It finds many errors that a simple spell checker cannot
detect.

This package contains the HTTP API client.

%package server
Summary:        LanguageTool HTTP API server
Requires:       %{name}-common = %{version}

%description server
LanguageTool is a proofreading software for English, Spanish,
French, German, Portuguese, Polish, Dutch, and more than 20 other
languages. It finds many errors that a simple spell checker cannot
detect.

This package contains the HTTP API server.

%prep
%autosetup
tar -xf %{SOURCE1}

%build
mvn -o -Dmaven.repo.local=vendor versions:set -DnewVersion=%{version}
mvn -o -Dmaven.repo.local=vendor versions:commit

%{mvn_build} -- \
    -Dmaven.repo.local=vendor \
    -Dmaven.gitcommitid.skip=true \
    -P fat-jar \
    --projects languagetool-http-client,languagetool-server \
    --also-make clean package -DskipTests

%install
%mvn_install

# Remove everything that doesn’t bundle its dependencies, as per
# README.packaging
rm %{buildroot}%{_javadir}/%{name}/language-*.jar
rm %{buildroot}%{_datadir}/maven-poms/%{name}/language-*.pom
rm %{buildroot}%{_datadir}/maven-metadata/%{name}.xml
rm %{buildroot}%{_javadir}/%{name}/%{name}-core.jar
rm %{buildroot}%{_datadir}/maven-poms/%{name}/%{name}-core.pom
rm %{buildroot}%{_datadir}/maven-poms/%{name}/%{name}-parent.pom
rm %{buildroot}%{_javadir}/%{name}/%{name}-gui-commons.jar
rm %{buildroot}%{_datadir}/maven-poms/%{name}/%{name}-gui-commons.pom

# Cannot run tests due to xmvn compatibility problems
# %%check

%files common
%license COPYING.txt
%dir %{_javadir}/%{name}
%dir %{_datadir}/maven-poms/%{name}

%files http-client
%{_javadir}/%{name}/%{name}-http-client.jar
%{_datadir}/maven-poms/%{name}/%{name}-http-client.pom

%files server
%dir %{_jnidir}/%{name}
%{_jnidir}/%{name}/%{name}-server.jar
%{_datadir}/maven-poms/%{name}/%{name}-server.pom

%changelog
openSUSE Build Service is sponsored by