## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global srcname mirrors-countme %global pkgname mirrors_countme %if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 38 || 0%{?rhel} >= 10 %bcond_without auto_buildrequires %bcond_without poetry_compatible %else # Poetry in Fedora < 38, EL < 10 is too old %bcond_with auto_buildrequires %bcond_with poetry_compatible %endif # EL < 10 needs a non-default Python version and misses the hypothesis package %if 0%{?rhel} && 0%{?rhel} < 10 %bcond_with tests %global python3_pkgversion 3.11 %global __python3 %{_bindir}/python%{python3_pkgversion} %if %{undefined pyproject_files} %global pyproject_files %{_builddir}/%{name}-%{version}-%{release}.%{_arch}-pyproject-files %endif %else %bcond_without tests %endif Name: python-%{srcname} Version: 0.1.4 Release: %autorelease Summary: Parse access_log and count hosts accessing DNF mirrors URL: https://github.com/fedora-infra/mirrors-countme # Automatically converted from old format: GPLv3+ - review is highly recommended. License: GPL-3.0-or-later Source0: https://github.com/fedora-infra/mirrors-countme/releases/download/%{version}/%{pkgname}-%{version}.tar.gz BuildArch: noarch # Not quite sure what minimum sqlite version we need, but scripts use # /usr/bin/sqlite3 and the python module is "sqlite3", so... Requires: sqlite >= 3.0.0 %global _description %{expand: A python module and scripts for parsing httpd access_log to find requests including `countme=N`, parse the data included with those requests, and compile weekly counts of DNF clients broken out by OS name, OS version, system arch, etc.} # This is for the toplevel metapackage. %description %_description # This section defines the python3-mirrors-countme subpackage. %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel %if ! %{with auto_buildrequires} BuildRequires: python%{python3_pkgversion}-setuptools %endif %if %{with tests} BuildRequires: glibc-langpack-en BuildRequires: python%{python3_pkgversion}-hypothesis BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest-cov BuildRequires: python%{python3_pkgversion}-pytest-xdist %endif %description -n python%{python3_pkgversion}-%{srcname} %_description %prep %autosetup -n %{pkgname}-%{version} %if %{with auto_buildrequires} %generate_buildrequires %pyproject_buildrequires %endif %build %if %{with poetry_compatible} %pyproject_wheel %else %py3_build %endif %install %if %{with poetry_compatible} %pyproject_install %pyproject_save_files %{pkgname} %else %py3_install pushd %{buildroot} find "./%{python3_sitelib}/%{pkgname}"* -type d | while read d; do echo "%dir ${d#./}" done > %{pyproject_files} find "./%{python3_sitelib}/%{pkgname}"* -type f | while read f; do echo "${f#./}" done >> %{pyproject_files} popd %endif for script in update-rawdb update-totals sqlite2csv split-totals-db; do install -m0755 "scripts/countme-${script}.sh" "%{buildroot}%{_bindir}/" done install -m0755 "scripts/countme-rezip" "%{buildroot}%{_bindir}/" %check %if %{with tests} PYTHONPATH="%{buildroot}%{python3_sitelib}" %{python3} -m pytest -v -n auto %endif %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %license LICENSE.md %doc README.md %{_bindir}/countme-delete-totals %{_bindir}/countme-parse-access-log %{_bindir}/countme-totals %{_bindir}/countme-trim-raw %{_bindir}/countme-update-rawdb.sh %{_bindir}/countme-update-totals.sh %{_bindir}/countme-sqlite2csv.sh %{_bindir}/countme-split-totals-db.sh %{_bindir}/countme-rezip %changelog ## START: Generated by rpmautospec * Thu Jul 25 2024 Miroslav Suchý - 0.1.4-4 - convert GPLv3+ license to SPDX * Fri Jul 19 2024 Fedora Release Engineering - 0.1.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Fri Jun 07 2024 Python Maint - 0.1.4-2 - Rebuilt for Python 3.13 * Mon May 13 2024 Nils Philippsen - 0.1.4-1 - Version 0.1.4 * Mon May 06 2024 Nils Philippsen - 0.1.3-1 - Version 0.1.3 * Fri Jan 26 2024 Fedora Release Engineering - 0.1.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 0.1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Aug 28 2023 Nils Philippsen - 0.1.2-1 - Version 0.1.2 - Drop dependency on Poetry (#2223835) * Fri Jul 21 2023 Fedora Release Engineering - 0.1.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Fri Jul 07 2023 Nils Philippsen - 0.1.1-1 - Version 0.1.1 - Fix using up to date Python macros where available * Fri Jul 07 2023 Nils Philippsen - 0.1.0-1 - Version 0.1.0 - Update upstream locations - Python package name uses underscore as a separator now - Add new testing dependencies and run tests in parallel - Update Python RPM macros used - Cope better with differences between OS versions, e.g. using Python 3.11 on EL8, 9 * Tue Jun 13 2023 Python Maint - 0.0.7-6 - Rebuilt for Python 3.12 * Fri Jan 20 2023 Fedora Release Engineering - 0.0.7-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jul 22 2022 Fedora Release Engineering - 0.0.7-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Mon Jun 13 2022 Python Maint - 0.0.7-3 - Rebuilt for Python 3.11 * Fri Jan 21 2022 Fedora Release Engineering - 0.0.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Sep 24 2021 Nils Philippsen - 0.0.7-1 - Version 0.0.7 * Wed Aug 25 2021 Nils Philippsen 0.0.6-1 - Version 0.0.6 * Fri Aug 20 2021 Adam Saleh - 0.0.5-1 - Initial import ## END: Generated by rpmautospec