File apertium.spec of Package apertium

#
# spec file for package apertium
#
# Copyright (c) 2025 SUSE LLC
#
# 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 http://bugs.opensuse.org/
#


Name:           apertium
%define lname   libapertium3
Version:        3.9.12
Release:        0
Summary:        Linguistic Translation Platform
# tmx_aligner_tool.cc and other files by D.Varga are from hunalign which is LGPL
License:        GPL-2.0+ and LGPL-2.1+
Group:          Productivity/Scientific/Other
URL:            https://apertium.org/

Source:         https://github.com/apertium/apertium/archive/v%version.tar.gz
Patch1:         apertium-deps.diff
BuildRequires:  apertium-get
BuildRequires:  autoconf >= 2.52
BuildRequires:  automake
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  libxml2-tools
BuildRequires:  libxslt-tools
BuildRequires:  libzip-tools
BuildRequires:  python3-base >= 3.4
BuildRequires:  python3-lxml
BuildRequires:  unzip
BuildRequires:  zip
BuildRequires:  utfcpp-devel
BuildRequires:  pkgconfig(libpcre) >= 6.4
BuildRequires:  pkgconfig(libxml-2.0) >= 2.6.17
BuildRequires:  pkgconfig(lttoolbox) >= 3.7.2
BuildRequires:  pkgconfig(icu-i18n) >= 50
BuildRequires:  pkgconfig(icu-io)
BuildRequires:  pkgconfig(icu-uc)
Requires:       apertium-get
Requires:       awk
Requires:       coreutils
Requires:       file
Requires:       findutils
Requires:       grep
Requires:       libxml2-tools
Requires:       libxslt-tools
Requires:       lttoolbox
Requires:       unzip
Requires:       util-linux
Requires:       which
Requires:       zip

%description
Apertium is a rule-based machine translation toolchain and ecosystem.
It facilitates the creation of consistent and transparent machine
translation systems by relying on deterministic linguistic rules
rather than statistical or neural models.

%package -n %lname
Summary:        Development files for the Apertium machine translation platform
Group:          System/Libraries
License:        GPL-2.0+

%description -n %lname
Apertium is a rule-based machine translation toolchain and ecosystem.
It facilitates the creation of consistent and transparent machine
translation systems by relying on deterministic linguistic rules
rather than statistical or neural models.

This subpackage contains a library to embed the Apertium functionality
into other programs.

%package devel
Summary:        Development files for the Apertium machine translation platform
Group:          Development/Libraries/C and C++
License:        GPL-2.0+
Requires:       %lname = %version-%release
Requires:       awk
Requires:       c++_compiler
Requires:       coreutils
Requires:       flex
Requires:       gcc-c++
Requires:       libxml2-tools
Requires:       libxslt-tools
Requires:       lttoolbox
Requires:       sed
Requires:       pkgconfig(libpcre)
Requires:       pkgconfig(libxml-2.0)
Requires:       pkgconfig(lttoolbox)
# Deps for apertium-unformat (undecided %%files)
Requires:       apertium = %version-%release
Requires:       findutils
Requires:       gawk
Requires:       grep
Requires:       unzip
Requires:       util-linux
Requires:       zip

%description devel
Apertium is a machine translation platform, focused at
related-language pairs but expanded to deal with more divergent
language pairs (such as English-Catalan). The platform provides

This subpackage contains the files necessary to build programs that
want to make use of the Apertium library, or build Apertium
dictionaries.

%prep
%autosetup -p1

%build
autoreconf -fi
# includedir intentional, cf. bugzilla.opensuse.org/795968
%configure --disable-static --includedir="%_includedir/%name"
mkdir -p apertium/apertium-get
cp -a /usr/bin/apertium-get apertium/apertium-get/
%make_build

%install
%make_install
rm -f "%buildroot/%_libdir"/*.la
rm -f "%buildroot/%_bindir/apertium-get"

%check
if ! %make_build check; then
	cat tests/test-suite.log
	exit 1
fi

%ldconfig_scriptlets -n %lname

%files
%_bindir/apertium
%_bindir/apertium-adapt-docx
%_bindir/apertium-cleanstream
%_bindir/apertium-des*
%_bindir/apertium-extract-caps
%_bindir/apertium-interchunk
%_bindir/apertium-multiple-translations
%_bindir/apertium-postchunk
%_bindir/apertium-postlatex
%_bindir/apertium-postlatex-raw
%_bindir/apertium-posttransfer
%_bindir/apertium-prelatex
%_bindir/apertium-preprocess-transfer
%_bindir/apertium-pretransfer
%_bindir/apertium-re*
%_bindir/apertium-tagger
%_bindir/apertium-tmxbuild
%_bindir/apertium-transfer
%_bindir/apertium-unformat
%_bindir/apertium-utils-fixlatex
%_bindir/apertium-wblank-*
%_mandir/man1/apertium.1*
%_mandir/man1/apertium-des*.1*
%_mandir/man1/apertium-extract-caps.1*
%_mandir/man1/apertium-interchunk.1*
%_mandir/man1/apertium-multiple-translations.1*
%_mandir/man1/apertium-postchunk.1*
%_mandir/man1/apertium-postlatex.1*
%_mandir/man1/apertium-postlatex-raw.1*
%_mandir/man1/apertium-prelatex.1*
%_mandir/man1/apertium-preprocess-transfer.1*
%_mandir/man1/apertium-pretransfer.1*
%_mandir/man1/apertium-re*.1*
%_mandir/man1/apertium-tagger.1*
%_mandir/man1/apertium-transfer.1*
%_mandir/man1/apertium-unformat.1*
%_mandir/man1/apertium-utils-fixlatex.1*
%_datadir/%name/
%license COPYING*
%doc README*

%files -n %lname
%_libdir/libapertium.so.*

%files devel
%_libdir/libapertium.so
%_libdir/pkgconfig/*.pc
%_datadir/aclocal/
%_includedir/%name/
%_bindir/apertium-compile-caps
%_bindir/apertium-editdist
%_bindir/apertium-filter-ambiguity
%_bindir/apertium-filter-dix
%_bindir/apertium-filter-rules
%_bindir/apertium-filter-xml
%_bindir/apertium-gen-*
%_bindir/apertium-genvdix
%_bindir/apertium-genvldix
%_bindir/apertium-genvrdix
%_bindir/apertium-metalrx
%_bindir/apertium-metalrx-to-lrx
%_bindir/apertium-perceptron-trace
%_bindir/apertium-tagger-apply-new-rules
%_bindir/apertium-tagger-readwords
%_bindir/apertium-translate-to-default-equivalent
%_bindir/apertium-validate-*
%_mandir/man1/apertium-compile-caps.1*
%_mandir/man1/apertium-filter-ambiguity.1*
%_mandir/man1/apertium-gen-*.1*
%_mandir/man1/apertium-tagger-apply-new-rules.1*
%_mandir/man1/apertium-validate-*.1*

%changelog
openSUSE Build Service is sponsored by