%define with_python2 0 %define with_python3 1 Name: libbytesize Version: 1.4 Release: 6 Summary: A library for working with sizes in bytes License: LGPLv2+ URL: https://github.com/storaged-project/libbytesize Source0: https://github.com/storaged-project/libbytesize/releases/download/%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc gmp-devel mpfr-devel pcre-devel gettext-devel libxslt %if %{with_python2} BuildRequires: python2-devel %endif %if %{with_python3} BuildRequires: python3-devel %endif BuildRequires: gtk-doc %description The goal of this project is to provide a tiny library that would facilitate the common operations with sizes in bytes. %package devel Summary: Files for %{name} development Requires: %{name} = %{version}-%{release} %description devel Files for %{name} development %if %{with_python3} %package -n python3-bytesize Summary: Python 3 bindings for libbytesize Requires: %{name} = %{version}-%{release} Requires: python3-six %description -n python3-bytesize Python 3 bindings for libbytesize. %endif %if %{with_python2} %package -n python2-bytesize Summary: Python 2 bindings for libbytesize Requires: %{name} = %{version}-%{release} Requires: python2-six %description -n python2-bytesize Python 2 bindings for libbytesize. %endif %package_help %prep %autosetup -n %{name}-%{version} -p1 %build %configure %make_build %install %make_install find %{buildroot} -type f -name "*.la" -delete %find_lang %{name} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -f %{name}.lang %defattr(-,root,root) %license LICENSE %{_libdir}/*.so.* %files devel %defattr(-,root,root) %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %if %{with_python2} %files -n python2-bytesize %defattr(-,root,root) %{_libdir}/python2*/site-packages/* %endif %if %{with_python3} %files -n python3-bytesize %defattr(-,root,root) %{_libdir}/python3*/site-packages/* %endif %files help %doc ABOUT-NLS README.md %{_datadir}/gtk-doc/html/* %changelog * Sat Feb 22 2020 openEuler Buildteam - 1.4-6 - Type:bugfix - ID:NA - SUG:NA - DESC:remove python2 support for package * Fri Feb 21 2020 openEuler Buildteam - 1.4-5 - Type:bugfix - ID:NA - SUG:NA - DESC:add build requires of python2-devel if with python2 * Wed Nov 20 2019 fangyufa - 1.4-4 - Type:bugfix - ID:NA - SUG:NA - DESC:fix build problem for x86_64 * Tue Sep 24 2019 shenyangyang - 1.4-3 - Type:enhancement - ID:NA - SUG:NA - DESC:revise help package * Wed Aug 21 2019 openEuler Buildteam - 1.4-2 - Package init