From f4efabe687597831dfc4d1ae5b213e988dc244fc Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Jan 16 2019 12:43:58 +0000 Subject: Update to 0.9.0 crawler: Correctly calculate the remaining time https://github.com/fedora-infra/mirrormanager2/pull/244 repomap: more modular repository detection logic https://github.com/fedora-infra/mirrormanager2/pull/243 crawler: correctly handle keep-alive for HTTPS https://github.com/fedora-infra/mirrormanager2/pull/245 crawler: only update directories of the current category https://github.com/fedora-infra/mirrormanager2/pull/250 python3 compatibility https://github.com/fedora-infra/mirrormanager2/pull/185 rpmmd: switch from yum.repoMDObject pyrpmmd https://github.com/fedora-infra/mirrormanager2/pull/254 Migrate to new geoip API https://github.com/fedora-infra/mirrormanager2/pull/253 Use InputRequired() instead of Required() https://github.com/fedora-infra/mirrormanager2/pull/256 Enable MirrorManager2 to be built using Python 3 for Fedora https://github.com/fedora-infra/mirrormanager2/pull/260 Fix tests with python3 https://github.com/fedora-infra/mirrormanager2/pull/261 Toggle private https://github.com/fedora-infra/mirrormanager2/pull/257 --- diff --git a/.gitignore b/.gitignore index 4d2cfb9..efbc125 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /0.8.2.tar.gz /0.8.3.tar.gz /0.8.4.tar.gz +/mirrormanager2-0.9.0.tar.gz diff --git a/mirrormanager2.spec b/mirrormanager2.spec index 909fca1..19b2f3e 100644 --- a/mirrormanager2.spec +++ b/mirrormanager2.spec @@ -2,15 +2,20 @@ # https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 %global _python_bytecompile_extra 1 -%if 0%{?fedora} > 27 || 0%{?rhel} > 7 -%global py2_prefix python2 +%if (0%{?rhel} && 0%{?rhel} <= 7) +# Since the Python 3 stack in EPEL is missing too many dependencies, +# we're sticking with Python 2 there for now. +%global __python %{__python2} +%global python_pkgversion %{nil} %else -%global py2_prefix python +# Default to Python 3 when not EL +%global __python %{__python3} +%global python_pkgversion %{python3_pkgversion} %endif Name: mirrormanager2 -Version: 0.8.4 -Release: 4%{?dist} +Version: 0.9.0 +Release: 1%{?dist} Summary: Mirror management application # Most MirrorManager files are licensed under the MIT license. Some @@ -18,57 +23,57 @@ Summary: Mirror management application # to generate the worldmaps are licensed under GPLv2 and GPLv2+ License: MIT and GPLv2+ and GPLv2 URL: https://github.com/fedora-infra/mirrormanager2/ -Source0: https://github.com/fedora-infra/mirrormanager2/archive/%{version}.tar.gz +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: %{py2_prefix}-devel -BuildRequires: %{py2_prefix}-flask -BuildRequires: %{py2_prefix}-flask-admin -BuildRequires: %{py2_prefix}-flask-xml-rpc -BuildRequires: %{py2_prefix}-flask-wtf -BuildRequires: %{py2_prefix}-wtforms -BuildRequires: %{py2_prefix}-IPy -BuildRequires: %{py2_prefix}-dns -BuildRequires: %{py2_prefix}-fedora >= 0.3.33 -BuildRequires: %{py2_prefix}-fedora-flask >= 0.3.33 -BuildRequires: %{py2_prefix}-setuptools -BuildRequires: %{py2_prefix}-psutil -BuildRequires: %{py2_prefix}-alembic +BuildRequires: python%{python_pkgversion}-devel +BuildRequires: python%{python_pkgversion}-flask +BuildRequires: python%{python_pkgversion}-flask-admin +BuildRequires: python%{python_pkgversion}-flask-xml-rpc +BuildRequires: python%{python_pkgversion}-flask-wtf +BuildRequires: python%{python_pkgversion}-wtforms +BuildRequires: python%{python_pkgversion}-IPy +BuildRequires: python%{python_pkgversion}-dns +BuildRequires: python%{python_pkgversion}-fedora >= 0.3.33 +BuildRequires: python%{python_pkgversion}-fedora-flask >= 0.3.33 +BuildRequires: python%{python_pkgversion}-setuptools +BuildRequires: python%{python_pkgversion}-psutil +BuildRequires: python%{python_pkgversion}-alembic # Mirrorlist -BuildRequires: %{py2_prefix}-GeoIP -BuildRequires: %{py2_prefix}-webob +BuildRequires: python%{python_pkgversion}-geoip2 +BuildRequires: python%{python_pkgversion}-webob BuildRequires: systemd -BuildRequires: %{py2_prefix}-sqlalchemy >= 0.7 +BuildRequires: python%{python_pkgversion}-sqlalchemy >= 0.7 # Testing -BuildRequires: %{py2_prefix}-fedmsg-core -BuildRequires: %{py2_prefix}-mock -BuildRequires: %{py2_prefix}-blinker +BuildRequires: python%{python_pkgversion}-fedmsg-core +BuildRequires: python%{python_pkgversion}-mock +BuildRequires: python%{python_pkgversion}-blinker BuildRequires: rsync -BuildRequires: yum +BuildRequires: python%{python_pkgversion}-pyrpmmd -%if 0%{?fedora} > 27 || 0%{?rhel} > 7 -BuildRequires: %{py2_prefix}-py-radix -Requires: %{py2_prefix}-mod_wsgi -%else +%if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python2-rpm-macros BuildRequires: py-radix Requires: mod_wsgi +%else +BuildRequires: python%{python_pkgversion}-py-radix +Requires: python%{python3_pkgversion}-mod_wsgi %endif # Testing -BuildRequires: %{py2_prefix}-nose -BuildRequires: %{py2_prefix}-coverage - -Requires: %{py2_prefix}-flask -Requires: %{py2_prefix}-flask-admin -Requires: %{py2_prefix}-flask-xml-rpc -Requires: %{py2_prefix}-flask-wtf -Requires: %{py2_prefix}-wtforms -Requires: %{py2_prefix}-fedora >= 0.3.33 -Requires: %{py2_prefix}-fedora-flask >= 0.3.33 -Requires: %{py2_prefix}-setuptools -Requires: %{py2_prefix}-psutil -Requires: %{py2_prefix}-alembic +BuildRequires: python%{python_pkgversion}-nose +BuildRequires: python%{python_pkgversion}-coverage + +Requires: python%{python_pkgversion}-flask +Requires: python%{python_pkgversion}-flask-admin +Requires: python%{python_pkgversion}-flask-xml-rpc +Requires: python%{python_pkgversion}-flask-wtf +Requires: python%{python_pkgversion}-wtforms +Requires: python%{python_pkgversion}-fedora >= 0.3.33 +Requires: python%{python_pkgversion}-fedora-flask >= 0.3.33 +Requires: python%{python_pkgversion}-setuptools +Requires: python%{python_pkgversion}-psutil +Requires: python%{python_pkgversion}-alembic Requires: %{name}-lib = %{version}-%{release} Requires: %{name}-filesystem = %{version}-%{release} @@ -87,9 +92,10 @@ Group: Development/Tools BuildArch: noarch Requires: %{name}-filesystem = %{version}-%{release} -Requires: %{py2_prefix}-IPy -Requires: %{py2_prefix}-dns -Requires: %{py2_prefix}-sqlalchemy >= 0.7 +Requires: python%{python_pkgversion}-IPy +Requires: python%{python_pkgversion}-dns +Requires: python%{python_pkgversion}-sqlalchemy >= 0.7 +Requires: python%{python_pkgversion}-pyrpmmd %description lib Library to interact with MirrorManager's database @@ -101,16 +107,16 @@ Group: Development/Tools BuildArch: noarch Requires: %{name}-filesystem = %{version}-%{release} -Requires: %{py2_prefix}-GeoIP -Requires: %{py2_prefix}-webob -Requires: %{py2_prefix}-IPy +Requires: python%{python_pkgversion}-geoip2 +Requires: python%{python_pkgversion}-webob +Requires: python%{python_pkgversion}-IPy Requires: httpd -%if 0%{?fedora} > 27 || 0%{?rhel} > 7 -Requires: %{py2_prefix}-py-radix -Requires: %{py2_prefix}-mod_wsgi -%else +%if 0%{?rhel} && 0%{?rhel} <= 7 Requires: py-radix Requires: mod_wsgi +%else +Requires: python%{python_pkgversion}-py-radix +Requires: python%{python_pkgversion}-mod_wsgi %endif Requires: systemd Requires(pre): shadow-utils @@ -129,7 +135,7 @@ BuildArch: noarch Requires: %{name}-filesystem = %{version}-%{release} Requires: %{name}-lib = %{version}-%{release} -Requires: %{py2_prefix}-GeoIP +Requires: python%{python_pkgversion}-geoip2 Requires: logrotate Requires(pre): shadow-utils @@ -175,9 +181,9 @@ BuildArch: noarch Requires: %{name}-filesystem = %{version}-%{release} Requires: %{name}-lib = %{version}-%{release} -Requires: %{py2_prefix}-GeoIP -Requires: %{py2_prefix}-matplotlib -Requires: %{py2_prefix}-basemap +Requires: python%{python_pkgversion}-geoip2 +Requires: python%{python_pkgversion}-matplotlib +Requires: python%{python_pkgversion}-basemap %description statistics A collection of different statistics script which are analyzing @@ -200,90 +206,103 @@ Base directories used by multiple subpackages %build -%py2_build +%py_build %install -%py2_install +%py_install # Create directories needed # Apache configuration files -mkdir -p %{buildroot}/%{_sysconfdir}/httpd/conf.d/ +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/ # MirrorManager configuration file -mkdir -p %{buildroot}/%{_sysconfdir}/mirrormanager +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mirrormanager # MirrorManager crawler log rotation -mkdir -p %{buildroot}/%{_sysconfdir}/logrotate.d +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d # for .wsgi files mainly -mkdir -p %{buildroot}/%{_datadir}/mirrormanager2 +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2 # Stores temp files (.sock & co) -mkdir -p %{buildroot}/%{_sharedstatedir}/mirrormanager +mkdir -p $RPM_BUILD_ROOT/%{_sharedstatedir}/mirrormanager # Results and homedir -mkdir -p %{buildroot}/%{_localstatedir}/lib/mirrormanager +mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/mirrormanager # Lock files -mkdir -p %{buildroot}/%{_localstatedir}/lock/mirrormanager +mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lock/mirrormanager # Stores lock and pid info -mkdir -p %{buildroot}/%{_localstatedir}/run/mirrormanager +mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/run/mirrormanager # Log files -mkdir -p %{buildroot}/%{_localstatedir}/log/mirrormanager/crawler +mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/mirrormanager/crawler # Stores the service file for systemd -mkdir -p %{buildroot}/%{_unitdir} +mkdir -p $RPM_BUILD_ROOT/%{_unitdir} # Install apache configuration file install -m 644 mirrorlist/apache/mirrorlist-server.conf \ - %{buildroot}/%{_sysconfdir}/httpd/conf.d/mirrorlist-server.conf + $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/mirrorlist-server.conf install -m 644 utility/mirrormanager.conf.sample \ - %{buildroot}/%{_sysconfdir}/httpd/conf.d/mirrormanager.conf + $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/mirrormanager.conf # Install configuration file install -m 644 utility/mirrormanager2.cfg.sample \ - %{buildroot}/%{_sysconfdir}/mirrormanager/mirrormanager2.cfg + $RPM_BUILD_ROOT/%{_sysconfdir}/mirrormanager/mirrormanager2.cfg # Install crawler logrotate definition install -m 644 utility/mm2_crawler.logrotate \ - %{buildroot}/%{_sysconfdir}/logrotate.d/mm2_crawler + $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/mm2_crawler # Install umdl logrotate definition install -m 644 utility/mm2_umdl.logrotate \ - %{buildroot}/%{_sysconfdir}/logrotate.d/mm2_umdl + $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/mm2_umdl # Install WSGI file install -m 644 utility/mirrormanager2.wsgi \ - %{buildroot}/%{_datadir}/mirrormanager2/mirrormanager2.wsgi + $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/mirrormanager2.wsgi install -m 644 mirrorlist/mirrorlist_client.wsgi \ - %{buildroot}/%{_datadir}/mirrormanager2/mirrorlist_client.wsgi + $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/mirrorlist_client.wsgi # Install the mirrorlist server install -m 644 mirrorlist/mirrorlist_server.py \ - %{buildroot}/%{_datadir}/mirrormanager2/mirrorlist_server.py + $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/mirrorlist_server.py install -m 644 mirrorlist/weighted_shuffle.py \ - %{buildroot}/%{_datadir}/mirrormanager2/weighted_shuffle.py + $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/weighted_shuffle.py # Install the createdb script install -m 644 createdb.py \ - %{buildroot}/%{_datadir}/mirrormanager2/mirrormanager2_createdb.py + $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/mirrormanager2_createdb.py # Install the tmpfile creating the /run/mirrormanager folder upon reboot mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 mirrorlist/systemd/mirrormanager_tempfile.conf \ - %{buildroot}/%{_tmpfilesdir}/%{name}-mirrorlist.conf + $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}-mirrorlist.conf install -m 0644 utility/backend_tempfile.conf \ - %{buildroot}/%{_tmpfilesdir}/%{name}-backend.conf + $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}-backend.conf # Install the systemd service file install -m 644 mirrorlist/systemd/mirrorlist-server.service \ - %{buildroot}/%{_unitdir}/mirrorlist-server.service + $RPM_BUILD_ROOT/%{_unitdir}/mirrorlist-server.service # Install the alembic files -cp -r alembic %{buildroot}/%{_datadir}/mirrormanager2/ -install -m 644 utility/alembic.ini %{buildroot}/%{_sysconfdir}/mirrormanager/alembic.ini +cp -r alembic $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/ +install -m 644 utility/alembic.ini $RPM_BUILD_ROOT/%{_sysconfdir}/mirrormanager/alembic.ini # Install the zebra-dump-parser perl module -cp -r utility/zebra-dump-parser %{buildroot}/%{_datadir}/mirrormanager2/ +cp -r utility/zebra-dump-parser $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/ # Install the client files -mkdir -p %{buildroot}/%{_sysconfdir}/mirrormanager-client +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mirrormanager-client install -m 0644 client/report_mirror.conf \ - %{buildroot}/%{_sysconfdir}/mirrormanager-client/report_mirror.conf + $RPM_BUILD_ROOT/%{_sysconfdir}/mirrormanager-client/report_mirror.conf + +# Install the country_continent file from MaxMind +install -m 0644 utility/country_continent.csv \ + $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/country_continent.csv + +# Fix the shebang for various scripts +sed -e "s|#!/usr/bin/env python|#!%{__python}|" -i \ + $RPM_BUILD_ROOT/%{_bindir}/* \ + $RPM_BUILD_ROOT/%{_datadir}/mirrormanager2/*.py \ + $RPM_BUILD_ROOT/%{python_sitelib}/mirrormanager2/lib/umdl.py + +# Switch interpreter for systemd units +sed -e "s|/usr/bin/python|%{__python}|g" -i $RPM_BUILD_ROOT/%{_unitdir}/*.service %pre mirrorlist @@ -318,7 +337,7 @@ exit 0 %check # Exclude test_ui_app.py as it requires network connectivity -MM2_SKIP_NETWORK_TESTS=1 ./runtests.sh -d -v -I 'test_ui_app.py' +MM2_SKIP_NETWORK_TESTS=1 ./runtests.sh -v %files %doc README.rst doc/ @@ -327,26 +346,42 @@ MM2_SKIP_NETWORK_TESTS=1 ./runtests.sh -d -v -I 'test_ui_app.py' %dir %{_sysconfdir}/mirrormanager/ %dir %{python_sitelib}/%{name}/ +%if ! (0%{?rhel} && 0%{?rhel} <= 7) +%dir %{python_sitelib}/%{name}/__pycache__ +%endif %{_sysconfdir}/mirrormanager/alembic.ini %{_datadir}/mirrormanager2/mirrormanager2.wsgi %{_datadir}/mirrormanager2/mirrormanager2_createdb.py* +%if ! (0%{?rhel} && 0%{?rhel} <= 7) +%{_datadir}/mirrormanager2/__pycache__/mirrormanager2_createdb.*.py* +%endif %{_datadir}/mirrormanager2/alembic/ -%{python2_sitelib}/%{name}/*.py* -%{python2_sitelib}/%{name}/templates/ -%{python2_sitelib}/%{name}/static/ -%{python2_sitelib}/%{name}*.egg-info +%{python_sitelib}/%{name}/*.py* +%if ! (0%{?rhel} && 0%{?rhel} <= 7) +%{python_sitelib}/%{name}/__pycache__/* +%endif +%{python_sitelib}/%{name}/templates/ +%{python_sitelib}/%{name}/static/ +%{python_sitelib}/%{name}*.egg-info %files filesystem %license LICENSE-MIT-X11 LICENSE-GPLv2 -%dir %{python2_sitelib}/%{name} +%dir %{python_sitelib}/%{name} %dir %{_datadir}/mirrormanager2 +%if ! (0%{?rhel} && 0%{?rhel} <= 7) +%dir %{_datadir}/mirrormanager2/__pycache__ +%endif +%{_datadir}/mirrormanager2/country_continent.csv %files lib -%{python2_sitelib}/%{name}/lib/ -%{python2_sitelib}/%{name}/__init__.py* +%{python_sitelib}/%{name}/lib/ +%{python_sitelib}/%{name}/__init__.py* +%if ! (0%{?rhel} && 0%{?rhel} <= 7) +%{python_sitelib}/%{name}/__pycache__/__init__.*.py* +%endif %files mirrorlist @@ -358,6 +393,10 @@ MM2_SKIP_NETWORK_TESTS=1 ./runtests.sh -d -v -I 'test_ui_app.py' %{_datadir}/mirrormanager2/mirrorlist_client.wsgi %{_datadir}/mirrormanager2/mirrorlist_server.py* %{_datadir}/mirrormanager2/weighted_shuffle.py* +%if ! (0%{?rhel} && 0%{?rhel} <= 7) +%{_datadir}/mirrormanager2/__pycache__/mirrorlist_server.*.py* +%{_datadir}/mirrormanager2/__pycache__/weighted_shuffle.*.py* +%endif %files crawler @@ -401,6 +440,31 @@ MM2_SKIP_NETWORK_TESTS=1 ./runtests.sh -d -v -I 'test_ui_app.py' %{_bindir}/mirrorlist_statistics %changelog +* Tue Jan 15 2019 Adrian Reber - 0.9.0-1 +- Update to 0.9.0 +- crawler: Correctly calculate the remaining time + https://github.com/fedora-infra/mirrormanager2/pull/244 +- repomap: more modular repository detection logic + https://github.com/fedora-infra/mirrormanager2/pull/243 +- crawler: correctly handle keep-alive for HTTPS + https://github.com/fedora-infra/mirrormanager2/pull/245 +- crawler: only update directories of the current category + https://github.com/fedora-infra/mirrormanager2/pull/250 +- python3 compatibility + https://github.com/fedora-infra/mirrormanager2/pull/185 +- rpmmd: switch from yum.repoMDObject pyrpmmd + https://github.com/fedora-infra/mirrormanager2/pull/254 +- Migrate to new geoip API + https://github.com/fedora-infra/mirrormanager2/pull/253 +- Use InputRequired() instead of Required() + https://github.com/fedora-infra/mirrormanager2/pull/256 +- Enable MirrorManager2 to be built using Python 3 for Fedora + https://github.com/fedora-infra/mirrormanager2/pull/260 +- Fix tests with python3 + https://github.com/fedora-infra/mirrormanager2/pull/261 +- Toggle private + https://github.com/fedora-infra/mirrormanager2/pull/257 + * Sun Jul 22 2018 Adrian Reber - 0.8.4-4 - Disable tests requiring network access diff --git a/sources b/sources index fca3962..6964fa3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (0.8.4.tar.gz) = d12cb105b2ca5dd30bc32fea3f990a49f05d6834f04604d7fbbd1573e06aaf01b68fee7efd5eb72143605dc217c430cb644e5c4dd6e73d55f84d030ef60586a6 +SHA512 (mirrormanager2-0.9.0.tar.gz) = de73ccc85b0153a90cd1741d1004e5c7f3e6f1886f1c14987d5c97c1ed2d9033854fa5a5dc35aa0019af54020b49b3e63f8c4d6915cc4be7085006b640f4adb0