# No tests: rpmbuild -ba --without dotests *.spec %bcond_without dotests %define _libdir64 %{_prefix}/lib64 %global curl_version 7.79.0 # Python 3 only %bcond_without with_python3 # With Python tests %bcond_without with_pythontests %bcond_without zchunk %global dnf_conflict 2.8.8 Name: librepo Version: 1.11.0 #Release: 0.2beta_static Release: 101 Summary: Repodata downloading library License: LGPLv2+ URL: https://github.com/rpm-software-management/librepo Source0: %{url}/archive/%{version}/%{name}-%{version}.zip # Replace Linux-specific stuff by compatible AIX stuff Patch0: %{name}-1.11.0-ea.patch # Do NOT require libcrypto openssl and zck Patch1: %{name}-1.11.0-CMakeLists.patch # Build a Python MODULE _librepo.so instead of a SHARED _librepos.a #Patch2: %{name}-1.11.0-python.patch # Fix the issue with open(ReadOnly) and fsync() #Patch3: %{name}-1.14.2-fsync.patch BuildRequires: cmake >= 3.22.0 BuildRequires: gcc >= 8.3.0 BuildRequires: check-devel >= 0.13.0 BuildRequires: sed >= 4.8 #BuildRequires: doxygen BuildRequires: glib2-devel >= 2.56.1 BuildRequires: gpgme-devel >= 1.13.1 #BuildRequires: libattr-devel BuildRequires: curl-devel >= %{curl_version} BuildRequires: libxml2-devel >= 2.9.11 BuildRequires: zlib-devel >= 1.2.11 %if %{with zchunk} BuildRequires: zchunk-devel >= 1.1.4 %endif Requires: zchunk-libs >= 1.1.4-100 Requires: glib2 >= 2.56.1 Requires: libxml2 >= 2.9.11 Requires: curl >= %{curl_version} Requires: gpgme >= 1.13.1 Requires: libgpg-error >= 1.42 #Requires: libassuan >= 2.4.3 #Requires: libgcc >= 8.3.0 Requires: libiconv >= 1.16 Requires: gettext >= 0.20.2 %description A library providing C and Python (libcURL like) API to downloading repository metadata. %package devel Summary: Repodata downloading library Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files for librepo. %if %{with with_python3} %package -n python3-%{name} Summary: Python 3 bindings for the librepo library %{?python_provide:%python_provide python3-%{name}} #Provides: python3-%{name} BuildRequires: python3-devel >= 3.7.12 %if %{with with_pythontests} # Install by pip instead #BuildRequires: python3-gpg #BuildRequires: python3-flask #BuildRequires: python3-nose #BuildRequires: python3-pyxattr #BuildRequires: python3-requests %endif #BuildRequires: python3-sphinx Requires: %{name}%{?_isa} = %{version}-%{release} Requires: python3 >= 3.7.12 # Obsoletes Fedora 27 package Obsoletes: platform-python-%{name} < %{version}-%{release} Conflicts: python3-dnf < %{dnf_conflict} %description -n python3-%{name} Python 3 bindings for the librepo library. %endif %define is_python %(test -e /opt/freeware/bin/python3 && echo 1 || echo 0) %if %{is_python} # Same as BullFreeware: python3_sitearch64 & python3_sitearch32 %global python_sitelib_64 %(/opt/freeware/bin/python3_64 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %global python_sitelib_32 %(/opt/freeware/bin/python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %global python3_minor_version %(/opt/freeware/bin/python3 -c "import sys; print(sys.version.split('.')[1])") %endif %prep %autosetup -p1 # Duplicate source for 32 & 64 bits rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -rf ..?* .[!.]* * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit for dir in 32bit 64bit do mkdir $dir/build-py3 done %build export OPTIM=-O2 #export OPTIM="-O0 -gdwarf" export CC=gcc export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash build_librepo() { set -x export OBJECT_MODE=$1 LIB3264=$2 %if %{with with_python3} ( cd ${OBJECT_MODE}bit cd build-py3 export LDFLAGS="-L/opt/freeware/${LIB3264} -L/opt/freeware/lib /usr/lib/libcrypto.a /usr/lib/libssl.a -Wl,-brtl -Wl,-blibpath:/opt/freeware/${LIB3264}:/opt/freeware/lib:/usr/lib:/lib -lz -liconv -lzck" export CFLAGS="-maix${OBJECT_MODE} ${OPTIM} -fPIC -D_ALL_SOURCE -D_LARGE_FILES -static-libgcc -static-libstdc++ -lm -I/opt/freeware/include" export CXXFLAGS="-maix${OBJECT_MODE} ${OPTIM} -fPIC -D_ALL_SOURCE -D_LARGE_FILES -static-libgcc -static-libstdc++ -lm -I/opt/freeware/include" # export C_INCLUDES=/opt/freeware/include cmake .. \ -DPYTHON_EXECUTABLE=/opt/freeware/bin/python3_$1 \ -DPYTHON_INCLUDE_DIR=/opt/freeware/include/python3.%{python3_minor_version}m \ -DPYTHON_LIBRARY=/opt/freeware/${LIB3264}/libpython3.%{python3_minor_version}m.so \ -DENABLE_DOCS=OFF \ -DCMAKE_INSTALL_PREFIX:PATH=/opt/freeware \ -DCMAKE_INSTALL_LIBDIR=/opt/freeware/${LIB3264} \ -DPYTHON_DESIRED="3" \ -DENABLE_TESTS=OFF \ -DENABLE_PYTHON_TESTS=%{?with_pythontests:ON}%{!?with_pythontests:OFF} # -DCMAKE_INCLUDE_DIRECTORIES=/opt/freeware/include # -DCMAKE_INCLUDE_PATH=/opt/freeware/include \ # -DCMAKE_INSTALL_INCLUDEDIR=/opt/freeware/include \ # -DCMAKE_SYSTEM_INCLUDE_PATH=/opt/freeware/include # %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} -DENABLE_PYTHON_TESTS=%{?with_pythontests:ON}%{!?with_pythontests:OFF} .. # %make_build gmake --trace VERBOSE=1 ) %endif } build_librepo 64 lib64 build_librepo 32 lib %check %if %{without dotests} echo "*** Skipping tests" exit 0 %endif # without dotests check_librepo() { set -x export OBJECT_MODE=$1 %if %{with with_python3} ( cd ${OBJECT_MODE}bit cd build-py3 # Parameters used by Fedora: --output-on-failure --force-new-ctest-process -j16 ( ctest -VV --debug || true ) #make ARGS="-V" test ?????????? ) %endif } check_librepo 64 check_librepo 32 %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %install echo "python_sitelib_64: %{python_sitelib_64}" echo "python_sitelib_32: %{python_sitelib_32}" export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash # setup environment for 32-bit and 64-bit builds export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" install_librepo() { set -x %if %{with with_python3} export OBJECT_MODE=$1 ( cd ${OBJECT_MODE}bit cd build-py3 if [ ${OBJECT_MODE} -eq 32 ] then /opt/freeware/bin/sed -i -e "s/lib64/lib/g" librepo/python/cmake_install.cmake fi gmake install DESTDIR=${RPM_BUILD_ROOT} ) %endif } install_librepo 64 install_librepo 32 # Add the 64-bit shared objects to the shared library containing already the 32-bit shared objects # Create a symlink between 32 & 64bit versions ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in lib*.a do lib=`basename $f .a` ${AR} -x ${f} ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/${f} ${lib}.so.0 rm ${f} ln -s ../lib/${f} ${f} done ) %files %defattr(-,root,system,-) %license 32bit/COPYING %doc 32bit/README.md #%{_libdir}/%{name}.so.* %{_libdir}/%{name}.a %{_libdir64}/%{name}.a %files devel %defattr(-,root,system,-) #%{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc %{_libdir64}/pkgconfig/%{name}.pc %{_includedir}/%{name}/ %if %{with with_python3} %files -n python3-%{name} %defattr(-,root,system,-) %{python_sitelib_64}/%{name}/ %{python_sitelib_32}/%{name}/ %endif %changelog * Thu Dec 15 2022 Sangamesh Mallayya - 1.11.0-101 - Rebuild with openssl 1.1.2. * Tue Mar 1 2022 Sangamesh Mallayya - 1.11.0-100 - Use Release as 100 so that 32 & 64-bit static dependencies can be - update to this dynamic version. * Tue Feb 07 2022 Sangamesh Mallayya - 1.11.0 - Rebuild for distributing it in AIX Toolbox. * Tue Jan 04 2022 Tony Reix - 1.14.2-2 - Fix testing issue with open(ReadOnly) and fsync() * Tue Sep 28 2021 Tony Reix - 1.14.2-1 - Move to latest version - Only Python3 - 32&64bit * Mon Jul 12 2021 Sangamesh Mallayya - 1.11.0-32_1 - Rebuild with 32_ release to differentiate between 64-bit rpm. - Add check if old version is installed. This check to be removed in next update. * Tue Jan 21 2020 Sangamesh Mallayya - 1.11.0-1 - Initial port to AIX. * Mon Dec 09 2019 Pavla Kratochvilova - 1.11.1-1 - Update to 1.11.1 - Create a directory for gpg sockets in /run/user/ (RhBug:1769831,1771012) * Wed Nov 06 2019 Pavla Kratochvilova - 1.11.0-1 - Update to 1.11.0 - Retry mirrorlist/metalink downloads several times (RhBug:1741931) - Improve variable substitutions in URLs and add ${variable} support * Tue Oct 01 2019 Ales Matej - 1.10.6-1 - Update to 1.10.6 - Imporove handling of xattr to re-download damadged files (RhBug:1690894) - Rephrase repository GPG check error message (RhBug:1741442) - Add sleep before next try when all mirrors were tried (RhBug:1741931) - Raise logging level of error messages (RhBug:1737709) * Sun Aug 18 2019 Miro Hrončok - 1.10.5-2 - Rebuilt for Python 3.8 * Mon Jul 29 2019 Pavla Kratochvilova - 1.10.5-1 - Update to 1.10.5 - Exit gpg-agent after repokey import (RhBug:1650266) - Handle webservers that don't support ranges when downloading zck - Define LRO_SUPPORTS_CACHEDIR only with zchunk (RhBug:1726141) - Allow to use mirrors multiple times for a target (RhBug:1678588) - Allow to try baseurl multiple times (RhBug:1678588) * Thu Jul 25 2019 Fedora Release Engineering - 1.10.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Thu May 23 2019 Jonathan Dieter - 1.10.2-2 - Add upstream patch to make sure to check next transfer if current zck transfer already exists * Mon May 20 2019 Pavla Kratochvilova - 1.10.2-1 - Update to 1.10.2 - Add an option to preserve timestamps of the downloaded files (RhBug:1688537) - librepo: append the '?' part of repo URL after the path - Fix librepo isn't able to load zchunk files from next server on failure * Tue Apr 02 2019 Pavla Kratochvilova - 1.9.6-2 - Backport patch to fix segfault when using zchunk metadata * Wed Mar 27 2019 Pavla Kratochvilova - 1.9.6-1 - Update to 1.9.6 - Fix memory leaks - Fix CPU usage when downloading packages (RhBug:1691856) * Mon Mar 11 2019 Pavla Kratochvilova - 1.9.5-1 - Update to 1.9.5 - Reduce download delays * Wed Feb 13 2019 Pavla Kratochvilova - 1.9.4-1 - Update to 1.9.4-1 - Add zchunk support * Fri Feb 01 2019 Fedora Release Engineering - 1.9.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Mon Jan 28 2019 Miro Hrončok - 1.9.2-2 - Subpackage python2-librepo has been removed See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal * Tue Sep 25 2018 Jaroslav Mracek - 1.9.2-1 - Update to 1.9.2 - Fix major performance regression with libcurl-7.61.1 * Mon Aug 13 2018 Daniel Mach - 1.9.1-1 - Update to 1.9.1 * Fri Jul 13 2018 Fedora Release Engineering - 1.9.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Fri Jun 29 2018 Jaroslav Mracek - 1.9.0-3 - Rebuilt for Python 3.7 * Tue Jun 26 2018 Igor Gnatenko - 1.9.0-2 - Fix ldconfig_scriptlets once more * Tue Jun 26 2018 Jaroslav Mracek - 1.9.0-1 - Update to 1.9.0 * Mon Jun 18 2018 Miro Hrončok - 1.8.1-9 - Rebuilt for Python 3.7 * Fri Jun 15 2018 Miro Hrončok - 1.8.1-8 - Bootstrap for Python 3.7 * Thu Feb 08 2018 Igor Gnatenko - 1.8.1-7 - Add if conditionals around pyxattr * Wed Feb 07 2018 Iryna Shcherbina - 1.8.1-6 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) * Wed Jan 31 2018 Igor Gnatenko - 1.8.1-5 - Switch to %%ldconfig_scriptlets * Tue Nov 07 2017 Igor Gnatenko - 1.8.1-4 - Use better Obsoletes for platform-python * Sat Nov 04 2017 Igor Gnatenko - 1.8.1-3 - Fix typo in Obsoletes * Fri Nov 03 2017 Igor Gnatenko - 1.8.1-2 - Remove platform-python subpackage * Fri Sep 15 2017 Igor Gnatenko - 1.8.1-1 - Update to 1.8.1 * Fri Sep 01 2017 Igor Gnatenko - 1.8.0-2 - Disable platform python on old releases * Wed Aug 23 2017 Igor Gnatenko - 1.8.0-1 - Update to 1.8.0 * Fri Aug 18 2017 Tomas Orsava - 1.7.20-9 - Added Patch 0 to fix a tearDown failure in the test suite * Thu Aug 10 2017 Petr Viktorin - 1.7.20-8 - Add subpackage for platform-python (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack) * Thu Aug 03 2017 Fedora Release Engineering - 1.7.20-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 1.7.20-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 1.7.20-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Tue Dec 13 2016 Charalampos Stratakis - 1.7.20-4 - Enable tests * Tue Dec 13 2016 Charalampos Stratakis - 1.7.20-3 - Rebuild for Python 3.6 - Disable tests for now * Sat Dec 10 2016 Igor Gnatenko - 1.7.20-2 - Rebuild for gpgme 1.18 * Thu Aug 25 2016 Tomas Mlcoch - 1.7.20-1 - Tests: Disable test_download_packages_with_resume_02 test - Update build utils to match new fedora spec schema * Wed Aug 24 2016 Tomas Mlcoch - 1.7.19-1 - Add yumrecord substitution mechanism (mluscon) - Fix a memory leak in signature verification (cwalters) * Tue Aug 09 2016 Igor Gnatenko - 1.7.18-4 - Add %%{?system_python_abi} - Trim ton of changelog * Tue Jul 19 2016 Fedora Release Engineering - 1.7.18-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Thu Apr 07 2016 Igor Gnatenko - 1.7.18-2 - Adopt to new packaging guidelines - Cleanups in spec file * Fri Mar 4 2016 Tomas Mlcoch - 1.7.18-1 - Add new option LRO_FTPUSEEPSV - Update AUTHORS - downloader prepare_next_transfer(): simplify long line - downloader prepare_next_transfer(): add missing error check - downloader prepare_next_transfer(): cleanup error path - downloader prepare_next_transfer() - fix memory leak on error path (Alan Jenkins) - handle: Don't use proxy cache for downloads of metalink/mirrorlist - handle: Don't set CURLOPT_HTTPHEADER into curl handle immediately when specified - downloader: Implement logic for no_cache param in LrDownloadTarget (RhBug: 1297762) - Add no_cache param to LrDownloadTarget and lr_downloadtarget_new() - New test: always try to download from the fastest mirror (Alexander Todorov) - Doc: Fixed minor doc typo (Philippe Ombredanne) - Doc: Other updates - Doc: Update default values in doc to reflect reality