2017-04-26 12:58:21 +02:00
|
|
|
#
|
|
|
|
# spec file for package foma
|
|
|
|
#
|
2024-05-14 08:41:56 +02:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-04-26 12:58:21 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-09-27 09:41:36 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-04-26 12:58:21 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2021-05-19 17:15:07 +02:00
|
|
|
%{!?make_build:%global make_build make %{?_smp_mflags}}
|
2017-04-26 12:58:21 +02:00
|
|
|
%define libname libfoma0
|
|
|
|
Name: foma
|
2024-05-17 11:23:04 +02:00
|
|
|
Version: 0.10.0+git22
|
2017-04-26 13:07:08 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Finite-state compiler and C library
|
2017-04-26 12:58:21 +02:00
|
|
|
License: Apache-2.0
|
2018-09-27 09:41:36 +02:00
|
|
|
URL: https://fomafst.github.io/
|
2024-05-17 11:23:04 +02:00
|
|
|
Source: foma-%version.tar.xz
|
|
|
|
Patch1: foma-harden-build.patch
|
2018-09-27 09:41:36 +02:00
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: flex
|
2017-04-26 12:58:21 +02:00
|
|
|
BuildRequires: ncurses-devel
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: readline-devel
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
|
|
|
|
|
|
|
%description
|
|
|
|
Foma is a compiler, programming language, and C library for constructing
|
2024-05-17 11:23:04 +02:00
|
|
|
finite-state automata and transducers for various uses. It has specific support
|
|
|
|
for many natural language processing applications such as producing
|
|
|
|
morphological analyzers. Although NLP applications are probably the main use of
|
|
|
|
foma, it is sufficiently generic to use for a large number of purposes.
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%package -n %{libname}
|
2017-04-26 13:07:08 +02:00
|
|
|
Summary: Finite-state C library
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%description -n %{libname}
|
|
|
|
The library contains efficient implementations of all classical
|
2024-05-17 11:23:04 +02:00
|
|
|
automata/transducer algorithms: determinization, minimization, epsilon-removal,
|
|
|
|
composition, boolean operations. Also, more advanced construction methods are
|
|
|
|
available: context restriction, quotients, first-order regular logic,
|
|
|
|
transducers from replacement rules, etc.
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%package devel
|
2017-04-26 13:07:08 +02:00
|
|
|
Summary: Finite-state C library development files and headers
|
|
|
|
Requires: %{libname} = %{version}
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%description devel
|
2017-04-26 13:07:08 +02:00
|
|
|
Finite-state C library development files and headers for %{name}.
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%prep
|
2021-08-15 08:23:45 +02:00
|
|
|
%autosetup -p2 -n %{name}-%{version}/%{name}
|
|
|
|
|
2020-03-02 13:10:34 +01:00
|
|
|
sed -i '/^CFLAGS/c\CFLAGS = %{optflags} -fcommon -Wl,--as-needed -D_GNU_SOURCE -std=c99 -fvisibility=hidden -fPIC' Makefile
|
2018-09-27 09:41:36 +02:00
|
|
|
sed -i '/^LDFLAGS/c\LDFLAGS = -lreadline -lz -lreadline -fpic' Makefile
|
|
|
|
sed -i '/^FLOOKUPLDFLAGS/c\FLOOKUPLDFLAGS = libfoma.a -lz -fpic' Makefile
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%build
|
2017-05-17 11:32:38 +02:00
|
|
|
# hand written Makefile that gets to be quite PITA
|
2020-03-02 13:10:34 +01:00
|
|
|
%make_build -j1
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
%make_install \
|
2024-05-17 11:23:04 +02:00
|
|
|
prefix="%{buildroot}/%{_prefix}" \
|
|
|
|
libdir="%{buildroot}/%{_libdir}"
|
|
|
|
rm -Rf "%{buildroot}/%{_libdir}"/*.a
|
2021-08-15 08:23:45 +02:00
|
|
|
# github.com/mhulden/foma/issues/127
|
|
|
|
perl -i -pe 's{\Q%{buildroot}\E}{}' "%{buildroot}/%{_libdir}/pkgconfig"/*.pc
|
|
|
|
cat "%{buildroot}/%{_libdir}/pkgconfig"/*.pc
|
2017-04-26 12:58:21 +02:00
|
|
|
|
2024-05-17 11:23:04 +02:00
|
|
|
%ldconfig_scriptlets -n %libname
|
2017-04-26 13:07:08 +02:00
|
|
|
|
2017-04-26 12:58:21 +02:00
|
|
|
%files
|
|
|
|
%{_bindir}/cgflookup
|
|
|
|
%{_bindir}/flookup
|
|
|
|
%{_bindir}/foma
|
|
|
|
|
2017-04-26 13:07:08 +02:00
|
|
|
%files devel
|
2017-04-26 12:58:21 +02:00
|
|
|
%{_includedir}/fomalib.h
|
|
|
|
%{_includedir}/fomalibconf.h
|
|
|
|
%{_libdir}/libfoma.so
|
2021-08-15 08:23:45 +02:00
|
|
|
%{_libdir}/pkgconfig/libfoma.pc
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%files -n %{libname}
|
2018-09-27 09:41:36 +02:00
|
|
|
%license COPYING
|
2017-04-26 13:07:08 +02:00
|
|
|
%{_libdir}/libfoma.so.*
|
2017-04-26 12:58:21 +02:00
|
|
|
|
|
|
|
%changelog
|