7346484
# Build -pythonN subpackage
7346484
%bcond_without python3
ac9e636
ac9e636
#
ac9e636
Name:           opentrep
b2fce33
Version:        0.07.7
1f006d1
Release:        8%{?dist}
ac9e636
ac9e636
Summary:        C++ library providing a clean API for parsing travel-focused requests
ac9e636
ac9e636
# The entire source code is LGPLv2+ except opentrep/basic/float_utils_google.hpp,
ac9e636
# which is BSD
ac9e636
License:        LGPLv2+ and BSD
b2fce33
URL:            https://github.com/trep/%{name}
ac9e636
Source0:        %{url}/archive/%{name}-%{version}.tar.gz
ac9e636
ac9e636
BuildRequires:  gcc-c++
0ab855f
%if 0%{?fedora} || 0%{?rhel} > 7
0ab855f
BuildRequires:  cmake
0ab855f
%else
0ab855f
BuildRequires:  cmake3
7346484
%endif
0ab855f
BuildRequires:  boost-devel
ac9e636
BuildRequires:  readline-devel
ac9e636
BuildRequires:  soci-mysql-devel
ac9e636
BuildRequires:  soci-sqlite3-devel
ac9e636
BuildRequires:  xapian-core-devel
ac9e636
BuildRequires:  sqlite-devel
2d395b8
BuildRequires:  mysql-devel
ac9e636
BuildRequires:  libicu-devel
ac9e636
BuildRequires:  protobuf-devel
ac9e636
BuildRequires:  protobuf-compiler
ac9e636
ac9e636
%description
ac9e636
%{name} aims at providing a clean API, and the corresponding C++
ac9e636
implementation, for parsing travel-focused requests.
14f371d
It powers the https://transport-search.org Web site.
ac9e636
0ee007a
%{name} uses Xapian (https://www.xapian.org) for the Information Retrieval
0ee007a
part, on freely available travel-related data (e.g., country names and codes,
ac9e636
city names and codes, airline names and codes, etc.), mainly to be found in
b2fce33
the OpenTravelData project (https://github.com/opentraveldata/opentraveldata).
14f371d
14f371d
The data files are available from https://transport-search.org/data/optd/por/
ac9e636
ac9e636
%{name} exposes a simple, clean and object-oriented, API. For instance,
ac9e636
the OPENTREP::interpretTravelRequest() method takes, as input, a string
ac9e636
containing the travel request, and yields, as output, the list of the
ac9e636
recognized terms as well as their corresponding types.
ac9e636
As an example, the travel request
ac9e636
'Washington DC Beijing Monday a/r +AA -UA 1 week 2 adults 1 dog' would give
ac9e636
the following list:
ac9e636
 * Origin airport: Washington, DC, USA
ac9e636
 * Destination airport: Beijing, China
ac9e636
 * Date of travel: next Monday
ac9e636
 * Date of return: 1 week after next Monday
ac9e636
 * Preferred airline: American Airlines; non-preferred airline: United Airlines
ac9e636
 * Number of travelers: 2 adults and a dog
ac9e636
ac9e636
The output can then be used by other systems, for instance to book the
ac9e636
corresponding travel or to visualize it on a map and calendar and to
ac9e636
share it with others.
ac9e636
ac9e636
%{name} makes an extensive use of existing open-source libraries for
ac9e636
increased functionality, speed and accuracy. In particular the
b2fce33
Boost (C++ Standard Extensions: https://www.boost.org) and
b2fce33
SOCI (https://github.com/SOCI) libraries are used.
ac9e636
ac9e636
Note that %{name} currently only recognizes points of reference (POR),
8e31adf
as to be found in the following file: https://bit.ly/3fQaddv
b2fce33
A good complementary tool is GeoBase
b2fce33
(https://opentraveldata.github.io/geobases), a Python-based software
b2fce33
able to access to any travel-related data source.
ac9e636
ac9e636
%package        devel
ac9e636
Summary:        Header files, libraries and development helper tools for %{name}
ac9e636
Requires:       %{name}%{?_isa} = %{version}-%{release}
ac9e636
Requires:       pkgconfig
ac9e636
ac9e636
%description    devel
ac9e636
This package contains the header files, shared libraries and
ac9e636
development helper tools for %{name}. If you would like to develop
ac9e636
programs using %{name}, you will need to install %{name}-devel.
ac9e636
7346484
%if %{with python3}
7346484
7346484
%package    -n python3-%{name}
7346484
Summary:    Python bindings for %{name}
7346484
Group:      System Environment/Libraries
7346484
Requires:   %{name}%{?_isa} = %{version}-%{release}
b2fce33
BuildRequires:  python3-setuptools
b2fce33
BuildRequires:  python3-devel
b2fce33
BuildRequires:  boost-python3-devel
7346484
7346484
%description -n python3-%{name}
7346484
This package contains Python libraries for %{name}
7346484
7346484
%endif
7346484
ac9e636
%package        doc
ac9e636
Summary:        HTML documentation for the %{name} library
ac9e636
BuildArch:      noarch
ac9e636
BuildRequires:  tex(latex), tex(sectsty.sty), tex(tocloft.sty), tex(xtab.sty)
b2fce33
BuildRequires:  texlive-epstopdf
ac9e636
BuildRequires:  doxygen
ac9e636
BuildRequires:  ghostscript
ac9e636
ac9e636
%description    doc
ac9e636
This package contains HTML pages for %{name}. All that documentation
b2fce33
is generated thanks to Doxygen (https://doxygen.org). The content is
b2fce33
the same as what can be browsed online (https://opentrep.sourceforge.net).
ac9e636
Note that the PDF form of the reference manual is mainly available online
b2fce33
(https://opentrep.sourceforge.net/refman.pdf), as the one present in that
ac9e636
package is usually corrupted: it depends on the building conditions,
ac9e636
and it is therefore not reliable.
ac9e636
ac9e636
%prep
ac9e636
%setup -q -n %{name}-%{name}-%{version}
ac9e636
ac9e636
ac9e636
%build
7fac29d
%cmake
11322ac
7fac29d
%cmake_build
ac9e636
ac9e636
%install
7fac29d
%cmake_install
ac9e636
8e31adf
# Remove the Doxygen installer
8e31adf
rm -f %{buildroot}%{_docdir}/%{name}/html/installdox
ac9e636
ac9e636
# Remove additional documentation files (those files are already available
ac9e636
# in the project top directory)
ac9e636
rm -f %{buildroot}%{_docdir}/%{name}/{NEWS,README.md,AUTHORS}
ac9e636
7346484
%if %{with python3}
ac9e636
# (Pure) Python OpenTREP executable
ac9e636
chmod a-x %{buildroot}%{python3_sitearch}/py%{name}/Travel_pb2.py
ac9e636
%endif
ac9e636
ac9e636
ac9e636
#check
ac9e636
#ctest
ac9e636
0ab855f
%if 0%{?rhel} <= 7
7346484
%post -p /sbin/ldconfig
7346484
7346484
%postun -p /sbin/ldconfig
7346484
%endif
7346484
7346484
%if %{with python3}
ac9e636
%post -n python3-%{name}
ac9e636
ln -s -f %{python3_sitearch}/py%{name}/py%{name} %{_bindir}/py%{name}
ac9e636
ac9e636
%postun -n python3-%{name}
ac9e636
rm -f %{_bindir}/py%{name}
ac9e636
%endif
ac9e636
ac9e636
%files
ac9e636
%doc AUTHORS ChangeLog NEWS README.md
8e31adf
%license COPYING
ac9e636
%{_bindir}/%{name}-indexer
ac9e636
%{_bindir}/%{name}-searcher
ac9e636
%{_bindir}/%{name}-dbmgr
ac9e636
%{_libdir}/lib%{name}.so.0.*
ac9e636
%{_mandir}/man1/%{name}-indexer.1.*
ac9e636
%{_mandir}/man1/%{name}-searcher.1.*
ac9e636
%{_mandir}/man1/%{name}-dbmgr.1.*
ac9e636
%dir %{_datadir}/%{name}
ac9e636
%dir %{_datadir}/%{name}/data
ac9e636
%dir %{_datadir}/%{name}/data/por
67de1f6
%{_datadir}/%{name}/data/por/README.md
ac9e636
%{_datadir}/%{name}/data/por/create_trep_user_and_db.sql
ac9e636
%{_datadir}/%{name}/data/por/create_trep_tables_sqlite3.sql
ac9e636
%{_datadir}/%{name}/data/por/create_trep_tables_mysql.sql
ac9e636
%{_datadir}/%{name}/data/por/test_optd_por_public.csv
ac9e636
%{_datadir}/%{name}/data/por/test_optd_por_public_schema.sql
ac9e636
%{_datadir}/%{name}/data/por/test_world_schedule.csv
ac9e636
ac9e636
%files devel
ac9e636
%{_includedir}/%{name}
ac9e636
%{_bindir}/%{name}-config
ac9e636
%{_libdir}/lib%{name}.so
ac9e636
%{_libdir}/pkgconfig/%{name}.pc
ac9e636
%{_datadir}/aclocal/%{name}.m4
ac9e636
%{_datadir}/%{name}/CMake
ac9e636
%{_mandir}/man1/%{name}-config.1.*
ac9e636
%{_mandir}/man3/%{name}-library.3.*
ac9e636
ac9e636
%files doc
8e31adf
%doc %{_docdir}/%{name}/html
ac9e636
%license COPYING
ac9e636
7346484
%if %{with python3}
ac9e636
%files -n python3-%{name}
ac9e636
%{python3_sitearch}/py%{name}/
ac9e636
%{_mandir}/man1/py%{name}.1.*
ac9e636
%endif
ac9e636
ac9e636
%changelog
1f006d1
* Wed Jan 13 16:40:07 CET 2021 Adrian Reber <adrian@lisas.de> - 0.07.7-8
1f006d1
- Rebuilt for protobuf 3.14
1f006d1
11f8b7e
* Thu Sep 24 2020 Adrian Reber <adrian@lisas.de> - 0.07.7-7
11f8b7e
- Rebuilt for protobuf 3.13
11f8b7e
fc954ca
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.07.7-6
fc954ca
- Second attempt - Rebuilt for
fc954ca
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
fc954ca
611a81b
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.07.7-5
611a81b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
611a81b
0e9d77d
* Sun Jun 21 2020 Adrian Reber <adrian@lisas.de> - 0.07.7-4
0e9d77d
- Rebuilt for protobuf 3.12
0e9d77d
f9a8f92
* Tue Jun 16 2020 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.7-3
f9a8f92
- Rebuilt for library dependency inconsistency
f9a8f92
87209ca
* Sun Jun 07 2020 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.7-2
87209ca
- Rebuilt for SOCI 4.0.1-alpha2
87209ca
b2fce33
* Mon Jun 01 2020 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.7-1
b2fce33
- Upstream update
b2fce33
a75db5f
* Sat May 30 2020 Jonathan Wakely <jwakely@redhat.com> - 0.07.4-7
a75db5f
- Rebuilt for Boost 1.73
a75db5f
d902bc5
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.07.4-6
d902bc5
- Rebuilt for Python 3.9
d902bc5
1f325e2
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.07.4-5
1f325e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
1f325e2
e04263c
* Thu Dec 19 2019 Orion Poplawski <orion@nwra.com> - 0.07.4-4
e04263c
- Rebuild for protobuf 3.11
e04263c
eec276f
* Sun Nov 24 2019 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-3
eec276f
- Fixed a few typos in Pythn dependencies
0ab855f
eec276f
* Fri Nov 15 2019 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-2
eec276f
- Fixed the too long description line
ac9e636
eec276f
* Mon Nov 11 2019 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-1
eec276f
- Upstream update to 0.07.4
ac9e636