885263
# python2 is not available on RHEL > 7 and not needed on Fedora > 28
885263
%if 0%{?rhel} > 7 || 0%{?fedora} > 28
885263
# disable python2 by default
885263
%bcond_with python2
885263
%else
885263
%bcond_without python2
885263
%endif
885263
885263
Name:          marisa
885263
Version:       0.2.4
885263
Release:       36%{?dist}
885263
Summary:       Static and spece-efficient trie data structure library
885263
885263
License:       BSD or LGPLv2+
885263
URL:  https://code.google.com/p/marisa-trie
885263
# Currently the working URL is
885263
# https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/marisa-trie/%%{name}-%%{version}.tar.gz
885263
Source0: https://marisa-trie.googlecode.com/files/%{name}-%{version}.tar.gz
885263
885263
BuildRequires:  gcc
885263
BuildRequires:  gcc-c++
885263
BuildRequires: swig
885263
BuildRequires: perl-devel
885263
BuildRequires: perl-generators
885263
%if %{with python2}
885263
BuildRequires: python2-devel
885263
%endif
885263
BuildRequires: python3-devel
885263
BuildRequires: ruby-devel
885263
885263
%description
885263
Matching Algorithm with Recursively Implemented StorAge (MARISA) is a
885263
static and space-efficient trie data structure. And libmarisa is a C++
885263
library to provide an implementation of MARISA. Also, the package of
885263
libmarisa contains a set of command line tools for building and
885263
operating a MARISA-based dictionary.
885263
885263
A MARISA-based dictionary supports not only lookup but also reverse
885263
lookup, common prefix search and predictive search.
885263
885263
885263
%package devel
885263
Summary:       Development files for %{name}
885263
Requires:      %{name}%{?_isa} = %{version}-%{release}
885263
885263
%description devel
885263
The %{name}-devel package contains libraries and header files for
885263
developing applications that use %{name}.
885263
885263
885263
%package tools
885263
Summary:       Tools for %{name}
885263
Requires:      %{name}%{?_isa} = %{version}-%{release}
885263
885263
%description tools
885263
The %{name}-tools package contains tools for developing applications
885263
that use %{name}.
885263
885263
885263
%package perl
885263
Summary:       Perl language binding for marisa
885263
Requires:      %{name} = %{version}-%{release}
885263
885263
%description perl
885263
Perl language binding for marisa
885263
885263
885263
%if %{with python2}
885263
%package -n python2-%{name}
885263
Summary:       Python language binding for marisa
885263
Requires:      %{name} = %{version}-%{release}
885263
# Remove before F30
885263
Provides:      %{name}-python = %{version}-%{release}
885263
Provides:      %{name}-python%{?_isa} = %{version}-%{release}
885263
Obsoletes:     %{name}-python < %{version}-%{release}
885263
%{?python_provide:%python_provide python2-%{name}}
885263
885263
%description -n python2-%{name}
885263
Python 2 language binding for marisa
885263
%endif
885263
885263
885263
%package -n python3-%{name}
885263
Summary:       Python 3 language binding for marisa
885263
Requires:      %{name} = %{version}-%{release}
885263
%{?python_provide:%python_provide python3-%{name}}
885263
885263
%description -n python3-%{name}
885263
Python 3 language binding for marisa
885263
885263
885263
%package ruby
885263
Summary: Ruby language binding for marisa
885263
Requires:      %{name} = %{version}-%{release}
885263
%if 0%{?fedora} || 0%{?rhel} > 7
885263
Requires:      ruby(release)
885263
%else
885263
Requires:      ruby(abi) = 1.9.1
885263
%endif
885263
885263
%description ruby
885263
Ruby language binding for groonga
885263
885263
885263
%prep
885263
%autosetup
885263
885263
885263
%build
885263
%configure --disable-static
885263
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
885263
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
885263
make %{?_smp_mflags}
885263
885263
# build Perl bindings
885263
pushd bindings/perl
885263
%{__perl} Makefile.PL INC="-I%{_builddir}/%{name}-%{version}/lib" LIBS="-L%{_builddir}/%{name}-%{version}/lib/.libs -lmarisa" INSTALLDIRS=vendor
885263
make %{?_smp_mflags}
885263
popd
885263
885263
# build Python bindings
885263
# Regenerate Python bindings
885263
make --directory=bindings swig-python
885263
885263
pushd bindings/python
885263
%if %{with python2}
885263
%{__python2} setup.py build_ext --include-dirs="%{_builddir}/%{name}-%{version}/lib" --library-dirs="%{_builddir}/%{name}-%{version}/lib/.libs"
885263
%py2_build
885263
%endif
885263
885263
%{__python3} setup.py build_ext --include-dirs="%{_builddir}/%{name}-%{version}/lib" --library-dirs="%{_builddir}/%{name}-%{version}/lib/.libs"
885263
%py3_build
885263
popd
885263
885263
# build Ruby bindings
885263
# Regenerate ruby bindings
885263
pushd bindings
885263
make swig-ruby
885263
popd
885263
885263
pushd bindings/ruby
885263
ruby extconf.rb --with-opt-include="%{_builddir}/%{name}-%{version}/lib" --with-opt-lib="%{_builddir}/%{name}-%{version}/lib/.libs" --vendor
885263
make
885263
popd
885263
885263
%install
885263
%make_install INSTALL="install -p"
885263
885263
# install Perl bindings
885263
pushd bindings/perl
885263
%make_install INSTALL="install -p"
885263
# Remove hidden files
885263
rm -f %{buildroot}%{perl_vendorarch}/auto/marisa/.packlist
885263
%{_fixperms} -c %{buildroot}%{perl_vendorarch}/*
885263
popd
885263
885263
# install Python bindings
885263
pushd bindings/python
885263
%if %{with python2}
885263
%py2_install
885263
%endif
885263
%py3_install
885263
popd
885263
885263
# install Ruby bindings
885263
pushd bindings/ruby
885263
%if 0%{?fedora} || 0%{?rhel} > 7
885263
%make_install INSTALL="install -p"
885263
%else
885263
%make_install INSTALL="install -p" hdrdir=%{_includedir} arch_hdrdir="%{_includedir}/\$(arch)" rubyhdrdir=%{_includedir}
885263
%endif
885263
popd
885263
885263
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
885263
find $RPM_BUILD_ROOT -name 'perllocal.pod' -exec rm -f {} ';'
885263
rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/sample.pl
885263
885263
885263
%post -p /sbin/ldconfig
885263
885263
%postun -p /sbin/ldconfig
885263
885263
885263
%files
885263
%doc docs/style.css AUTHORS README docs/readme.en.html
885263
%lang(ja) %doc docs/readme.ja.html
885263
%license COPYING
885263
%{_libdir}/libmarisa.so.*
885263
885263
%files devel
885263
%{_includedir}/marisa*
885263
%{_libdir}/*.so
885263
%{_libdir}/pkgconfig/*.pc
885263
885263
%files tools
885263
%{_bindir}/marisa-benchmark
885263
%{_bindir}/marisa-build
885263
%{_bindir}/marisa-common-prefix-search
885263
%{_bindir}/marisa-dump
885263
%{_bindir}/marisa-lookup
885263
%{_bindir}/marisa-predictive-search
885263
%{_bindir}/marisa-reverse-lookup
885263
885263
%files perl
885263
%{perl_vendorarch}/marisa.pm
885263
%{perl_vendorarch}/auto/marisa
885263
885263
%if %{with python2}
885263
%files -n python2-%{name}
885263
%{python2_sitearch}/_marisa.so
885263
%{python2_sitearch}/marisa.py*
885263
%{python2_sitearch}/marisa-0.0.0-py2.?.egg-info
885263
%endif
885263
885263
%files -n python3-%{name}
885263
%{python3_sitearch}/__pycache__/marisa*
885263
%{python3_sitearch}/_marisa*.so
885263
%{python3_sitearch}/marisa.py
885263
%{python3_sitearch}/marisa-0.0.0-py3.?.egg-info
885263
885263
%files ruby
885263
%{ruby_vendorarchdir}/marisa.so
885263
885263
%changelog
885263
* Wed Aug 01 2018 Takao Fujiwara <fujiwara@redhat.com> - 0.2.4-36
885263
- disable python2 for RHEL8
885263
885263
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-35
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
885263
885263
* Tue Jul 03 2018 Petr Pisar <ppisar@redhat.com> - 0.2.4-34
885263
- Perl 5.28 rebuild
885263
885263
* Wed Jun 27 2018 Jitka Plesnikova <jplesnik@redhat.com> - 0.2.4-33
885263
- Perl 5.28 rebuild
885263
885263
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.2.4-32
885263
- Rebuilt for Python 3.7
885263
885263
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-31
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
885263
885263
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 0.2.4-30
885263
- Rebuilt for switch to libxcrypt
885263
885263
* Fri Jan 05 2018 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.2.4-29
885263
- F-28: rebuild for ruby25
885263
885263
* Thu Dec 14 2017 Parag Nemade <pnemade AT redhat DOT com> - 0.2.4-28
885263
- Few more cleanups to spec file
885263
885263
* Thu Dec 14 2017 Parag Nemade <pnemade AT redhat DOT com> - 0.2.4-27
885263
- Correct the conditional builds for fedora and rhel
885263
- Remove Group tag as its no longer needed
885263
- added %%license macro for license files
885263
- Correct the license tag
885263
- Added fileslists more verbose for subpackages
885263
885263
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.2.4-26
885263
- Add Provides for the old name without %%_isa
885263
885263
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.2.4-25
885263
- Python 2 binary package renamed to python2-marisa
885263
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
885263
885263
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-24
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
885263
885263
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-23
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
885263
885263
* Sun Jun 04 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.2.4-22
885263
- Perl 5.26 rebuild
885263
885263
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-21
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
885263
885263
* Thu Jan 12 2017 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.2.4-20
885263
- F-26: rebuild for ruby24
885263
885263
* Thu Dec 22 2016 Miro Hrončok <mhroncok@redhat.com> - 0.2.4-19
885263
- Rebuild for Python 3.6
885263
885263
* Fri Nov 11 2016 Iryna Shcherbina <ishcherb@redhat.com> - 0.2.4-18
885263
- Regenerate Python binding files with newer swig
885263
- Provide Python 3 subpackage
885263
885263
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-17
885263
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
885263
885263
* Sat May 14 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.2.4-16
885263
- Perl 5.24 rebuild
885263
885263
* Mon May  9 2016 Yaakov Selkowitz <yselkowi@redhat.com> - 0.2.4-15
885263
- Fix packaging of marisa-perl (#1246698)
885263
885263
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-14
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
885263
885263
* Tue Jan 12 2016 Vít Ondruch <vondruch@redhat.com> - 0.2.4-13
885263
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3
885263
885263
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-12
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
885263
885263
* Wed Jun 03 2015 Jitka Plesnikova <jplesnik@redhat.com> - 0.2.4-11
885263
- Perl 5.22 rebuild
885263
885263
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.2.4-10
885263
- Rebuilt for GCC 5 C++11 ABI change
885263
885263
* Fri Jan 16 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.2.4-9
885263
- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_2.2
885263
885263
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.2.4-8
885263
- Perl 5.20 rebuild
885263
885263
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-7
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
885263
885263
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-6
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
885263
885263
* Sat May  3 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.2.4-5
885263
- Ruby: Rebuild for ruby 2.1 / rubygems 2.2
885263
- Ruby: regenerate binding files with newer swig for -Werror=format-security
885263
- Perl: don't use %%prefix/local, move installation directory to vendor directory
885263
885263
* Tue Aug 13 2013 Daiki Ueno <dueno@redhat.com> - 0.2.4-4
885263
- disable workaround for ruby bindings needed for F19 (Closes:#992166)
885263
885263
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-3
885263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
885263
885263
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.2.4-2
885263
- Perl 5.18 rebuild
885263
885263
* Thu May  2 2013 Daiki Ueno <dueno@redhat.com> - 0.2.4-1
885263
- new upstream release
885263
885263
* Wed Mar 20 2013 Vít Ondruch <vondruch@redhat.com> - 0.2.2-2
885263
- Move Ruby bindings into correct location.
885263
885263
* Thu Mar 14 2013 Daiki Ueno <dueno@redhat.com> - 0.2.2-1
885263
- new upstream release
885263
- for Fedora 19 or later, use 'ruby(release)' instead of 'ruby(abi)',
885263
  and also update the required Ruby ABI/release version to 2.0.0
885263
885263
* Thu Feb  7 2013 Daiki Ueno <dueno@redhat.com> - 0.2.1-3
885263
- add perl, python, ruby bindings
885263
885263
* Fri Feb  1 2013 Daiki Ueno <dueno@redhat.com> - 0.2.1-2
885263
- remove unnesseary BR
885263
- don't embed rpath in executables
885263
- add docs
885263
- drop buildroot cleanup
885263
- preserve timestamp when make install
885263
885263
* Thu Jan 24 2013 Daiki Ueno <dueno@redhat.com> - 0.2.1-1
885263
- initial packaging