diff --git a/trademgen.spec b/trademgen.spec index 5128492..7500f21 100644 --- a/trademgen.spec +++ b/trademgen.spec @@ -3,12 +3,7 @@ # Build -python subpackage %bcond_without python -%if %{with python} -%if 0%{?rhel} && 0%{?rhel} <= 6 -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%endif + # See also http://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering#Private_Libraries %global _privatelibs libpy%{name}[.]so.* %global __provides_exclude ^(%{_privatelibs})$ @@ -21,18 +16,20 @@ Version: 1.00.3 Release: 1%{?dist} Summary: C++ Simulated Travel Demand Generation Library - -Group: System Environment/Libraries License: LGPLv2+ URL: http://github.com/airsim/%{name} -Source0: https://github.com/airsim/%{name}/archive/%{name}-%{version}.tar.gz +Source0: %{url}/archive/%{name}-%{version}.tar.gz -BuildRequires: gcc-c++ -BuildRequires: cmake, python3-devel -BuildRequires: boost-devel, soci-mysql-devel, soci-sqlite3-devel +BuildRequires: boost-devel BuildRequires: boost-python3-devel +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: python3-devel BuildRequires: readline-devel -BuildRequires: stdair-devel, sevmgr-devel +BuildRequires: sevmgr-devel +BuildRequires: soci-mysql-devel +BuildRequires: soci-sqlite3-devel +BuildRequires: stdair-devel %description @@ -50,7 +47,6 @@ for travel-related demand generation, mainly for simulation purpose. %package devel Summary: Header files, libraries and development helper tools for %{name} -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -61,12 +57,10 @@ programs using %{name}, you will need to install %{name}-devel. %package doc Summary: HTML documentation for the %{name} library -Group: Documentation -%if 0%{?fedora} || 0%{?rhel} > 5 BuildArch: noarch -%endif BuildRequires: tex(latex) -BuildRequires: doxygen, ghostscript +BuildRequires: doxygen +BuildRequires: ghostscript %description doc This package contains HTML pages, as well as a PDF reference manual, @@ -76,16 +70,11 @@ online (http://%{name}.org). %if %{with python} %package -n python3-trademgen -%{?python_provide:%python_provide python3-trademgen} -# Remove before F30 -Provides: %{name}-python = %{version}-%{release} -Provides: %{name}-python%{?_isa} = %{version}-%{release} -Obsoletes: %{name}-python < %{version}-%{release} Summary: Python bindings for %{name} -Group: Development/Languages Requires: %{name}%{?_isa} = %{version}-%{release} BuildRequires: python3-devel -BuildRequires: python-setuptools +BuildRequires: python3-setuptools +%{?python_provide:%python_provide python3-trademgen} %description -n python3-trademgen This package contains Python libraries for %{name} @@ -101,36 +90,31 @@ This package contains Python libraries for %{name} make %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=%{buildroot} # Remove extra libraries, which are generated only for the tests -rm -f $RPM_BUILD_ROOT%{_libdir}/libsequential_generation*.so* +rm -f %{buildroot}%{_libdir}/libsequential_generation*.so* # mkdir -p %{mydocs} -mv $RPM_BUILD_ROOT%{_docdir}/%{name}/html %{mydocs} +mv %{buildroot}%{_docdir}/%{name}/html %{mydocs} rm -f %{mydocs}/html/installdox # Remove additional documentation files (those files are already available # in the project top directory) -rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}/{NEWS,README,AUTHORS} +rm -f %{buildroot}%{_docdir}/%{name}/{NEWS,README,AUTHORS} %if %{with python} # (Pure) Python TraDemGen executable -install -d $RPM_BUILD_ROOT%{python3_sitearch}/py%{name} -install -pm 0755 $RPM_BUILD_ROOT%{_bindir}/py%{name} $RPM_BUILD_ROOT%{python3_sitearch}/py%{name}/ -install -pm 0755 $RPM_BUILD_ROOT%{_bindir}/%{name}_drawBookingArrivals $RPM_BUILD_ROOT%{python3_sitearch}/py%{name}/ -rm -f $RPM_BUILD_ROOT%{_bindir}/py%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}_drawBookingArrivals +install -d %{buildroot}%{python3_sitearch}/py%{name} +install -pm 0755 %{buildroot}%{_bindir}/py%{name} %{buildroot}%{python3_sitearch}/py%{name}/ +install -pm 0755 %{buildroot}%{_bindir}/%{name}_drawBookingArrivals %{buildroot}%{python3_sitearch}/py%{name}/ +rm -f %{buildroot}%{_bindir}/py%{name} %{buildroot}%{_bindir}/%{name}_drawBookingArrivals %endif -%check +#check #ctest -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - %files %doc AUTHORS ChangeLog COPYING NEWS README.md