ac9e63
#
ac9e63
%global mydocs __tmp_docdir
ac9e63
734648
# Build -pythonN subpackage
734648
%bcond_without python3
ac9e63
ac9e63
# See also http://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering#Private_Libraries
0ab855
%if %{with python3}
ac9e63
%global _privatelibs libpy%{name}[.]so.*
ac9e63
%global __provides_exclude ^(%{_privatelibs})$
ac9e63
%global __requires_exclude ^(%{_privatelibs})$
ac9e63
%endif
ac9e63
ac9e63
#
ac9e63
Name:           opentrep
da2946
Version:        0.07.4
e04263
Release:        4%{?dist}
ac9e63
ac9e63
Summary:        C++ library providing a clean API for parsing travel-focused requests
ac9e63
ac9e63
# The entire source code is LGPLv2+ except opentrep/basic/float_utils_google.hpp,
ac9e63
# which is BSD
ac9e63
License:        LGPLv2+ and BSD
ac9e63
URL:            http://github.com/trep/%{name}
ac9e63
Source0:        %{url}/archive/%{name}-%{version}.tar.gz
ac9e63
9e86c0
# For some reason, as of November 2019, it does not compile on ARMv7hl
9e86c0
# See https://koji.fedoraproject.org/koji/taskinfo?taskID=38562666
9e86c0
ExcludeArch:    armv7hl
9e86c0
ac9e63
BuildRequires:  gcc-c++
0ab855
%if 0%{?fedora} || 0%{?rhel} > 7
0ab855
BuildRequires:  cmake
0ab855
%else
0ab855
BuildRequires:  cmake3
734648
%endif
0ab855
BuildRequires:  boost-devel
734648
%if %{with python3}
da5ed8
BuildRequires:  python3-setuptools
0ab855
BuildRequires:  python3-devel
0ab855
BuildRequires:  boost-python3-devel
734648
%endif
ac9e63
BuildRequires:  readline-devel
ac9e63
BuildRequires:  soci-mysql-devel
ac9e63
BuildRequires:  soci-sqlite3-devel
ac9e63
BuildRequires:  xapian-core-devel
ac9e63
BuildRequires:  sqlite-devel
2d395b
BuildRequires:  mysql-devel
ac9e63
BuildRequires:  libicu-devel
ac9e63
BuildRequires:  protobuf-devel
ac9e63
BuildRequires:  protobuf-compiler
ac9e63
ac9e63
%description
ac9e63
%{name} aims at providing a clean API, and the corresponding C++
ac9e63
implementation, for parsing travel-focused requests.
14f371
It powers the https://transport-search.org Web site.
ac9e63
0ee007
%{name} uses Xapian (https://www.xapian.org) for the Information Retrieval
0ee007
part, on freely available travel-related data (e.g., country names and codes,
ac9e63
city names and codes, airline names and codes, etc.), mainly to be found in
14f371
the OpenTravelData project (https://github.com/opentraveldata/opentraveldata):
14f371
https://github.com/opentraveldata/opentraveldata/tree/master/opentraveldata
14f371
14f371
The data files are available from https://transport-search.org/data/optd/por/
ac9e63
ac9e63
%{name} exposes a simple, clean and object-oriented, API. For instance,
ac9e63
the OPENTREP::interpretTravelRequest() method takes, as input, a string
ac9e63
containing the travel request, and yields, as output, the list of the
ac9e63
recognized terms as well as their corresponding types.
ac9e63
As an example, the travel request
ac9e63
'Washington DC Beijing Monday a/r +AA -UA 1 week 2 adults 1 dog' would give
ac9e63
the following list:
ac9e63
 * Origin airport: Washington, DC, USA
ac9e63
 * Destination airport: Beijing, China
ac9e63
 * Date of travel: next Monday
ac9e63
 * Date of return: 1 week after next Monday
ac9e63
 * Preferred airline: American Airlines; non-preferred airline: United Airlines
ac9e63
 * Number of travelers: 2 adults and a dog
ac9e63
ac9e63
The output can then be used by other systems, for instance to book the
ac9e63
corresponding travel or to visualize it on a map and calendar and to
ac9e63
share it with others.
ac9e63
ac9e63
%{name} makes an extensive use of existing open-source libraries for
ac9e63
increased functionality, speed and accuracy. In particular the
ac9e63
Boost (C++ Standard Extensions: http://www.boost.org) and
ac9e63
SOCI (http://soci.sourceforge.net) libraries are used.
ac9e63
ac9e63
Note that %{name} currently only recognizes points of reference (POR),
ac9e63
as to be found in the following file: http://bit.ly/1DXIjWE
ac9e63
A good complementary tool is GeoBase (http://opentraveldata.github.io/geobases),
ac9e63
a Python-based software able to access to any travel-related data source.
ac9e63
ac9e63
ac9e63
%package        devel
ac9e63
Summary:        Header files, libraries and development helper tools for %{name}
ac9e63
Requires:       %{name}%{?_isa} = %{version}-%{release}
ac9e63
Requires:       pkgconfig
ac9e63
ac9e63
%description    devel
ac9e63
This package contains the header files, shared libraries and
ac9e63
development helper tools for %{name}. If you would like to develop
ac9e63
programs using %{name}, you will need to install %{name}-devel.
ac9e63
734648
%if %{with python3}
734648
734648
%package    -n python3-%{name}
734648
Summary:    Python bindings for %{name}
734648
Group:      System Environment/Libraries
734648
Requires:   %{name}%{?_isa} = %{version}-%{release}
734648
734648
%description -n python3-%{name}
734648
This package contains Python libraries for %{name}
734648
734648
%package -n python3-%{name}-devel
734648
Summary: Shared object symbolic links for OpenTREP Python 3
0ab855
Requires: python3-%{name}%{?_isa} = %{version}-%{release}
734648
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
734648
734648
%description -n python3-%{name}-devel
734648
734648
Shared object symbolic links for Python 3 variant of OpenTREP.
734648
734648
%endif
734648
ac9e63
%package        doc
ac9e63
Summary:        HTML documentation for the %{name} library
ac9e63
BuildArch:      noarch
ac9e63
BuildRequires:  tex(latex), tex(sectsty.sty), tex(tocloft.sty), tex(xtab.sty)
792bd9
#BuildRequires:  texlive-collection-langcyrillic, texlive-cyrillic
ac9e63
BuildRequires:  doxygen
ac9e63
BuildRequires:  ghostscript
ac9e63
ac9e63
%description    doc
ac9e63
This package contains HTML pages for %{name}. All that documentation
ac9e63
is generated thanks to Doxygen (http://doxygen.org). The content is
ac9e63
the same as what can be browsed online (http://opentrep.sourceforge.net).
ac9e63
Note that the PDF form of the reference manual is mainly available online
ac9e63
(http://opentrep.sourceforge.net/refman.pdf), as the one present in that
ac9e63
package is usually corrupted: it depends on the building conditions,
ac9e63
and it is therefore not reliable.
ac9e63
ac9e63
%prep
ac9e63
%setup -q -n %{name}-%{name}-%{version}
ac9e63
ac9e63
ac9e63
%build
11322a
mkdir tmpbuild
11322a
pushd tmpbuild
11322a
%if 0%{?fedora} || 0%{?rhel} > 7
11322a
%cmake ..
11322a
%else
11322a
%cmake3 ..
11322a
%endif
11322a
ac9e63
%make_build
11322a
popd
ac9e63
ac9e63
%install
11322a
pushd tmpbuild
ac9e63
%make_install
11322a
popd
ac9e63
ac9e63
# From rpm version > 4.9.1, it may no longer be necessary to move the
ac9e63
# documentation out of the docdir path, as the %%doc macro no longer
ac9e63
# deletes the full directory before installing files into it.
ac9e63
mkdir -p %{mydocs}
ac9e63
mv %{buildroot}%{_docdir}/%{name}/html %{mydocs}
ac9e63
rm -f %{mydocs}/html/installdox
ac9e63
ac9e63
# Remove additional documentation files (those files are already available
ac9e63
# in the project top directory)
ac9e63
rm -f %{buildroot}%{_docdir}/%{name}/{NEWS,README.md,AUTHORS}
ac9e63
734648
%if %{with python3}
ac9e63
# (Pure) Python OpenTREP executable
ac9e63
install -d %{buildroot}%{python3_sitearch}/py%{name}
ac9e63
install -pm 0755 %{buildroot}%{_bindir}/py%{name} %{buildroot}%{python3_sitearch}/py%{name}/
ac9e63
rm -f %{buildroot}%{_bindir}/py%{name}
ac9e63
chmod a-x %{buildroot}%{python3_sitearch}/py%{name}/Travel_pb2.py
ac9e63
%endif
ac9e63
ac9e63
ac9e63
#check
ac9e63
#ctest
ac9e63
0ab855
%if 0%{?rhel} <= 7
734648
%post -p /sbin/ldconfig
734648
734648
%postun -p /sbin/ldconfig
734648
%endif
734648
734648
%if %{with python3}
ac9e63
%post -n python3-%{name}
ac9e63
ln -s -f %{python3_sitearch}/py%{name}/py%{name} %{_bindir}/py%{name}
ac9e63
ac9e63
%postun -n python3-%{name}
ac9e63
rm -f %{_bindir}/py%{name}
ac9e63
%endif
ac9e63
ac9e63
%files
ac9e63
%license COPYING
ac9e63
%doc AUTHORS ChangeLog NEWS README.md
ac9e63
%{_bindir}/%{name}-indexer
ac9e63
%{_bindir}/%{name}-searcher
ac9e63
%{_bindir}/%{name}-dbmgr
ac9e63
%{_libdir}/lib%{name}.so.0.*
ac9e63
%{_mandir}/man1/%{name}-indexer.1.*
ac9e63
%{_mandir}/man1/%{name}-searcher.1.*
ac9e63
%{_mandir}/man1/%{name}-dbmgr.1.*
ac9e63
%dir %{_datadir}/%{name}
ac9e63
%dir %{_datadir}/%{name}/data
ac9e63
%dir %{_datadir}/%{name}/data/por
67de1f
%{_datadir}/%{name}/data/por/README.md
ac9e63
%{_datadir}/%{name}/data/por/create_trep_user_and_db.sql
ac9e63
%{_datadir}/%{name}/data/por/create_trep_tables_sqlite3.sql
ac9e63
%{_datadir}/%{name}/data/por/create_trep_tables_mysql.sql
ac9e63
%{_datadir}/%{name}/data/por/test_optd_por_public.csv
ac9e63
%{_datadir}/%{name}/data/por/test_optd_por_public_schema.sql
ac9e63
%{_datadir}/%{name}/data/por/test_world_schedule.csv
ac9e63
ac9e63
%files devel
ac9e63
%{_includedir}/%{name}
ac9e63
%{_bindir}/%{name}-config
ac9e63
%{_libdir}/lib%{name}.so
ac9e63
%{_libdir}/pkgconfig/%{name}.pc
ac9e63
%{_datadir}/aclocal/%{name}.m4
ac9e63
%{_datadir}/%{name}/CMake
ac9e63
%{_mandir}/man1/%{name}-config.1.*
ac9e63
%{_mandir}/man3/%{name}-library.3.*
ac9e63
ac9e63
%files doc
ac9e63
%doc %{mydocs}/html
ac9e63
%license COPYING
ac9e63
734648
%if %{with python3}
ac9e63
%files -n python3-%{name}
ac9e63
%{python3_sitearch}/py%{name}/
ac9e63
%{_mandir}/man1/py%{name}.1.*
ac9e63
%endif
ac9e63
ac9e63
%changelog
e04263
* Thu Dec 19 2019 Orion Poplawski <orion@nwra.com> - 0.07.4-4
e04263
- Rebuild for protobuf 3.11
e04263
eec276
* Sun Nov 24 2019 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-3
eec276
- Fixed a few typos in Pythn dependencies
0ab855
eec276
* Fri Nov 15 2019 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-2
eec276
- Fixed the too long description line
ac9e63
eec276
* Mon Nov 11 2019 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-1
eec276
- Upstream update to 0.07.4
ac9e63