14
0

- Add no-store-btime-gzip.patch to fix bsc#1227999 by not storing

build time in gzip headers so as to make building documentation
  reproducible
- Add rpmlintrc

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinxcontrib-devhelp?expand=0&rev=14
This commit is contained in:
2024-07-19 17:57:15 +00:00
committed by Git OBS Bridge
parent fccee47896
commit f31a81f598
4 changed files with 47 additions and 6 deletions

25
no-store-btime-gzip.patch Normal file
View File

@@ -0,0 +1,25 @@
From 2e0fc9b9da0227b146258aa3831a416c7b023234 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Wed, 17 Jul 2024 07:50:46 +0200
Subject: [PATCH] Avoid storing build time in gzip headers
This allows to create bit-reproducible Python3.12/Python.devhelp.gz output.
See https://reproducible-builds.org/ for why this is good.
---
sphinxcontrib/devhelp/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sphinxcontrib/devhelp/__init__.py b/sphinxcontrib/devhelp/__init__.py
index bc99016..fc441d0 100644
--- a/sphinxcontrib/devhelp/__init__.py
+++ b/sphinxcontrib/devhelp/__init__.py
@@ -124,7 +124,7 @@ def write_index(title: str, refs: list[Any], subitems: Any) -> None:
# Dump the XML file
xmlfile = path.join(outdir, outname + '.devhelp.gz')
- with gzip.open(xmlfile, 'w') as f:
+ with gzip.GzipFile(filename=xmlfile, mode='w', mtime=0) as f:
tree.write(f, 'utf-8') # type: ignore

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Jul 19 17:56:18 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Add no-store-btime-gzip.patch to fix bsc#1227999 by not storing
build time in gzip headers so as to make building documentation
reproducible
- Add rpmlintrc
-------------------------------------------------------------------
Sun Jan 14 10:42:57 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -0,0 +1,2 @@
addFilter("hidden-file-or-dir /usr/lib/python.*/sphinxcontrib/devhelp/locales/.tx")
addFilter("file-not-in-%lang /usr/lib/python.*/site-packages/sphinxcontrib/devhelp/locales/.*\.mo")

View File

@@ -1,5 +1,5 @@
#
# spec file
# spec file for package python-sphinxcontrib-devhelp
#
# Copyright (c) 2024 SUSE LLC
#
@@ -32,7 +32,11 @@ Summary: Sphinx extension which outputs Devhelp documents
License: BSD-2-Clause
Group: Development/Languages/Python
URL: https://github.com/sphinx-doc/sphinxcontrib-devhelp
Source: https://files.pythonhosted.org/packages/source/s/sphinxcontrib-devhelp/sphinxcontrib_devhelp-%{version}.tar.gz
Source0: https://files.pythonhosted.org/packages/source/s/sphinxcontrib-devhelp/sphinxcontrib_devhelp-%{version}.tar.gz
Source99: python-sphinxcontrib-devhelp.rpmlintrc
# PATCH-FIX-UPSTREAM no-store-btime-gzip.patch bsc#1227999 mcepl@suse.com
# don't store build time in gzip headers to make building documentation reproducible
Patch0: no-store-btime-gzip.patch
%if %{with test}
BuildRequires: %{python_module Sphinx >= 5.0}
BuildRequires: %{python_module pytest}
@@ -50,13 +54,13 @@ BuildArch: noarch
sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document.
%prep
%setup -q -n sphinxcontrib_devhelp-%{version}
%autosetup -p1 -n sphinxcontrib_devhelp-%{version}
%build
%pyproject_wheel
%install
%if !%{with test}
%if %{without test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
@@ -66,11 +70,13 @@ sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document.
%pytest
%endif
%if !%{with test}
%if %{without test}
%files %{python_files}
%doc README.rst CHANGES
%license LICENSE
%{python_sitelib}/*
%dir %{python_sitelib}/sphinxcontrib
%{python_sitelib}/sphinxcontrib/devhelp
%{python_sitelib}/sphinxcontrib_devhelp-%{version}*-info
%endif
%changelog