# Build -python subpackage
%bcond_without python
#
Name: trademgen
Version: 1.00.10
Release: %autorelease
Summary: C++ Simulated Travel Demand Generation Library
License: LGPL-2.1-or-later
URL: https://github.com/airsim/%{name}
Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: boost-devel
BuildRequires: pkgconfig(readline)
BuildRequires: soci-mysql-devel
BuildRequires: soci-sqlite3-devel
BuildRequires: pkgconfig(stdair)
BuildRequires: pkgconfig(sevmgr)
%description
%{name} aims at providing a clean API, and the corresponding C++
implementation, able to generate demand for travel solutions (e.g.,
from JFK to PEK on 25-05-2009) according to characteristics (e.g.,
Willingness-To-Pay, preferred airline, etc).
%{name} makes an extensive use of existing open-source libraries for
increased functionality, speed and accuracy. In particular the
Boost (C++ Standard Extensions: https://www.boost.org) library is used.
Install the %{name} package if you need a library of basic C++ objects
for travel-related demand generation, mainly for simulation purpose.
%package devel
Summary: Header files, libraries and development helper tools for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
This package contains the header files, shared libraries and
development helper tools for %{name}. If you would like to develop
programs using %{name}, you will need to install %{name}-devel.
%package doc
Summary: HTML documentation for the %{name} library
BuildArch: noarch
BuildRequires: tex(latex)
BuildRequires: texlive-epstopdf
BuildRequires: doxygen
BuildRequires: ghostscript
%description doc
This package contains HTML pages, as well as a PDF reference manual,
for %{name}. All that documentation is generated thanks to Doxygen
(https://doxygen.org). The content is the same as what can be browsed
online (https://github.com/airsim/%{name}).
%if %{with python}
%package -n python3-%{name}
Summary: Python bindings for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: boost-python3-devel
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name}
This package contains Python libraries for %{name}
%endif
%prep
%autosetup
%build
%cmake
%cmake_build
%install
%cmake_install
# Remove extra libraries, which are generated only for the tests
rm -f %{buildroot}%{_libdir}/libsequential_generation*.so*
# Remove the Doxygen installer
rm -f %{buildroot}%{_docdir}/%{name}/html/installdox
# Remove additional documentation files (those files are already available
# in the project top directory)
rm -f %{buildroot}%{_docdir}/%{name}/{NEWS,README,AUTHORS}
%check
#ctest
%if %{with python3}
%post -n python3-%{name}
ln -s -f %{python3_sitearch}/py%{name}/py%{name} %{_bindir}/py%{name}
%postun -n python3-%{name}
rm -f %{_bindir}/py%{name}
%endif
%files
%doc AUTHORS ChangeLog COPYING NEWS README.md
%{_bindir}/%{name}
%{_bindir}/%{name}_with_db
%{_bindir}/%{name}_generateDemand
%{_bindir}/%{name}_extractBookingRequests
%{_bindir}/%{name}_drawBookingArrivals
%{_libdir}/lib%{name}.so.*
%{_mandir}/man1/%{name}.1.*
%{_mandir}/man1/%{name}_with_db.1.*
%{_mandir}/man1/%{name}_generateDemand.1.*
%{_mandir}/man1/%{name}_extractBookingRequests.1.*
%{_mandir}/man1/%{name}_drawBookingArrivals.1.*
%files devel
%{_includedir}/%{name}/
%{_bindir}/%{name}-config
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/aclocal/%{name}.m4
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/CMake/%{name}-config-version.cmake
%{_datadir}/%{name}/CMake/%{name}-config.cmake
%{_datadir}/%{name}/CMake/%{name}-library-depends.cmake
%{_datadir}/%{name}/CMake/%{name}-library-depends-debug.cmake
%{_mandir}/man1/%{name}-config.1.*
%{_mandir}/man3/%{name}-library.3.*
%files doc
%doc %{_docdir}/%{name}/
%license COPYING
%if %{with python}
%files -n python3-%{name}
%{python3_sitearch}/py%{name}/
%{_mandir}/man1/py%{name}.1.*
%{_datadir}/%{name}/CMake/%{name}-config-python.cmake
%{_datadir}/%{name}/CMake/%{name}-python-library-depends-debug.cmake
%{_datadir}/%{name}/CMake/%{name}-python-library-depends.cmake
%endif
%changelog
%autochangelog