Blame SPECS/marisa.spec

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