From 934d940e0d49dcff066008709471a862d56932f7 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Thu, 13 Feb 2025 16:54:45 -0500 Subject: [PATCH 1/5] Convert to %autorelease and %autochangelog [skip changelog] --- changelog | 17 +++++++++++++++++ libsixel.spec | 20 ++------------------ 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..e86e6b9 --- /dev/null +++ b/changelog @@ -0,0 +1,17 @@ +* Thu Jul 18 2024 Fedora Release Engineering - 1.10.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 1.10.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 1.10.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Aug 30 2023 ErrorNoInternet - 1.10.3-3 +- Enabled tests + +* Wed Aug 30 2023 ErrorNoInternet - 1.10.3-2 +- Fix a few package review issues + +* Sat Jul 29 2023 ErrorNoInternet - 1.10.3-1 +- Initial packaging diff --git a/libsixel.spec b/libsixel.spec index eb7d3b2..31c61ae 100644 --- a/libsixel.spec +++ b/libsixel.spec @@ -1,6 +1,6 @@ Name: libsixel Version: 1.10.3 -Release: 6%{?dist} +Release: %autorelease Summary: SIXEL encoding and decoding License: MIT @@ -68,20 +68,4 @@ rm %{buildroot}/%{_libdir}/libsixel.a %{zsh_completions_dir}/_img2sixel %changelog -* Thu Jul 18 2024 Fedora Release Engineering - 1.10.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Thu Jan 25 2024 Fedora Release Engineering - 1.10.3-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sun Jan 21 2024 Fedora Release Engineering - 1.10.3-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Wed Aug 30 2023 ErrorNoInternet - 1.10.3-3 -- Enabled tests - -* Wed Aug 30 2023 ErrorNoInternet - 1.10.3-2 -- Fix a few package review issues - -* Sat Jul 29 2023 ErrorNoInternet - 1.10.3-1 -- Initial packaging +%autochangelog From 6366b8c4cc82eba2ea149d1aa65d9171da6d2b96 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Thu, 13 Feb 2025 16:57:58 -0500 Subject: [PATCH 2/5] Add spaces for readability --- libsixel.spec | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/libsixel.spec b/libsixel.spec index 31c61ae..ed8eaa2 100644 --- a/libsixel.spec +++ b/libsixel.spec @@ -1,32 +1,32 @@ -Name: libsixel -Version: 1.10.3 -Release: %autorelease -Summary: SIXEL encoding and decoding +Name: libsixel +Version: 1.10.3 +Release: %autorelease +Summary: SIXEL encoding and decoding -License: MIT -URL: https://github.com/libsixel/libsixel -Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch0: meson.patch +License: MIT +URL: https://github.com/libsixel/libsixel +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Patch0: meson.patch -BuildRequires: gcc -BuildRequires: meson -BuildRequires: pkgconfig(gdlib) -BuildRequires: pkgconfig(libjpeg) -BuildRequires: pkgconfig(libpng) +BuildRequires: gcc +BuildRequires: meson +BuildRequires: pkgconfig(gdlib) +BuildRequires: pkgconfig(libjpeg) +BuildRequires: pkgconfig(libpng) %description An encoder/decoder implementation for DEC SIXEL graphics. %package devel -Summary: Development files for %{name} -Requires: %{name}%{?_isa} = %{version}-%{release} +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary}. %package utils -Summary: SIXEL encoder and decoder utilities -Requires: %{name}%{?_isa} = %{version}-%{release} +Summary: SIXEL encoder and decoder utilities +Requires: %{name}%{?_isa} = %{version}-%{release} %description utils %{summary}. From 7be3057eb2f36afd0f47511bbce5f4d8d35393ea Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Thu, 13 Feb 2025 16:58:15 -0500 Subject: [PATCH 3/5] Update to 1.10.5 --- .gitignore | 2 +- libsixel.spec | 8 +++----- meson.patch | 25 ------------------------- sources | 2 +- 4 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 meson.patch diff --git a/.gitignore b/.gitignore index ca1893c..e6e375d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/libsixel-1.10.3.tar.gz +/libsixel-*.tar.gz diff --git a/libsixel.spec b/libsixel.spec index ed8eaa2..e7155aa 100644 --- a/libsixel.spec +++ b/libsixel.spec @@ -1,12 +1,11 @@ Name: libsixel -Version: 1.10.3 +Version: 1.10.5 Release: %autorelease Summary: SIXEL encoding and decoding License: MIT URL: https://github.com/libsixel/libsixel -Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch0: meson.patch +Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: meson @@ -32,7 +31,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %{summary}. %prep -%autosetup -n %{name}-%{version} -p1 +%autosetup -p1 %build %meson -Dtests=enabled @@ -40,7 +39,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %install %meson_install -rm %{buildroot}/%{_libdir}/libsixel.a %check %meson_test diff --git a/meson.patch b/meson.patch deleted file mode 100644 index c961379..0000000 --- a/meson.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/meson.build -+++ b/meson.build -@@ -101,17 +101,17 @@ - python2_installation = pymod.find_installation('python2', required: get_option('python2')) - - if get_option('libcurl').enabled() and curl_found.found() -- conf_data.set('HAVE_LIBCURL', true) -+ conf_data.set('HAVE_LIBCURL', 1) - libsixel_deps += [curl_found] - endif - --if get_option('jpeg').enabled() and jpeg_found -- conf_data.set('HAVE_JPEG', true) -+if get_option('jpeg').enabled() and jpeg_found.found() -+ conf_data.set('HAVE_JPEG', 1) - libsixel_deps += [jpeg_found] - endif - --if get_option('png').enabled() and png_found -- conf_data.set('HAVE_PNG', true) -+if get_option('png').enabled() and png_found.found() -+ conf_data.set('HAVE_PNG', 1) - libsixel_deps += [png_found] - endif - diff --git a/sources b/sources index 9819c65..a5729d4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libsixel-1.10.3.tar.gz) = ef16f9ccecec8289728ec84ce9f24145648f8a38184c1ec3df8ead3499c6cf7d3e0a0c738f8bfcb1093e16ee8ae7ce5e46d3890707c8104752ce4ab7eb3bc7ac +SHA512 (libsixel-1.10.5.tar.gz) = 94fc972ee304885936d5d8fbc3dadc5feadebf1ab262bb49c9ae9b1eed19c528ed823f4d31c17326340f06a5b7ee28a1817be15ae55c3e9d0c4437cd36b3e49d From b2c084fef86022c843c035f25f10a0fe4e6ae9b4 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Mon, 5 May 2025 19:02:13 -0400 Subject: [PATCH 4/5] Add patch for fixing bash completions --- libsixel-fix-bash-completions.patch | 38 +++++++++++++++++++++++++++++ libsixel.spec | 4 +++ 2 files changed, 42 insertions(+) create mode 100644 libsixel-fix-bash-completions.patch diff --git a/libsixel-fix-bash-completions.patch b/libsixel-fix-bash-completions.patch new file mode 100644 index 0000000..cd1179b --- /dev/null +++ b/libsixel-fix-bash-completions.patch @@ -0,0 +1,38 @@ +From 0614b54ffb3d1c66965f05d5865db80c44dd6b97 Mon Sep 17 00:00:00 2001 +From: Yao Zi +Date: Mon, 27 Jan 2025 17:17:11 +0000 +Subject: [PATCH] Make completion file compatible with newer bash-completion + +Function _have was renamed as _comp_have_command in bash-completion +commit 6381fd1f ("refactor: `_have => _comp_have_command`") in 2022. +Since it's relatively recent, let's provide a wrapper to handle the +API change. + +This fixes error message like "bash: have: command not found" when +completing img2sixel command with bash-completion 2.16.0. + +Signed-off-by: Yao Zi +--- + converters/shell-completion/bash/img2sixel | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/converters/shell-completion/bash/img2sixel b/converters/shell-completion/bash/img2sixel +index 028651bd..306cf895 100644 +--- a/converters/shell-completion/bash/img2sixel ++++ b/converters/shell-completion/bash/img2sixel +@@ -1,6 +1,14 @@ + # bash completion for img2sixel + +-have img2sixel && ++_libsixel_command_exist() { ++ if declare -F _comp_have_command > /dev/null; then ++ _comp_have_command "$1" ++ else ++ have "$1" ++ fi ++} ++ ++_libsixel_command_exist img2sixel && + _img2sixel() + { + local cur prev diff --git a/libsixel.spec b/libsixel.spec index e7155aa..3a0a97c 100644 --- a/libsixel.spec +++ b/libsixel.spec @@ -7,6 +7,10 @@ License: MIT URL: https://github.com/libsixel/libsixel Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +# https://github.com/libsixel/libsixel/issues/81 +# Taken from https://github.com/libsixel/libsixel/pull/89 +Patch: libsixel-fix-bash-completions.patch + BuildRequires: gcc BuildRequires: meson BuildRequires: pkgconfig(gdlib) From 6031215ee18e2009ba1ee19870ff4ee6fb2d2456 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Tue, 26 Aug 2025 23:35:19 +0800 Subject: [PATCH 5/5] Apply fix for CVE-2025-9300 --- libsixel-fix-cve-2025-9300.patch | 30 ++++++++++++++++++++++++++++++ libsixel.spec | 3 +++ 2 files changed, 33 insertions(+) create mode 100644 libsixel-fix-cve-2025-9300.patch diff --git a/libsixel-fix-cve-2025-9300.patch b/libsixel-fix-cve-2025-9300.patch new file mode 100644 index 0000000..39b1c37 --- /dev/null +++ b/libsixel-fix-cve-2025-9300.patch @@ -0,0 +1,30 @@ +From a384e96ac83a141c3e752026123325436eb5b8e8 Mon Sep 17 00:00:00 2001 +From: ErrorNoInternet +Date: Tue, 26 Aug 2025 23:24:14 +0800 +Subject: [PATCH] Fix CVE-2025-9300 + +Modified version of +https://github.com/saitoha/libsixel/commit/316c086e79d66b62c0c4bc66229ee894e4fdb7d1. +--- + src/encoder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/encoder.c b/src/encoder.c +index 4a6a038..45061a1 100644 +--- a/src/encoder.c ++++ b/src/encoder.c +@@ -700,9 +700,9 @@ sixel_debug_print_palette( + fprintf(stderr, "palette:\n"); + for (i = 0; i < sixel_dither_get_num_of_palette_colors(dither); ++i) { + fprintf(stderr, "%d: #%02x%02x%02x\n", i, ++ palette[i * 3 + 0], + palette[i * 3 + 1], +- palette[i * 3 + 2], +- palette[i * 3 + 3]); ++ palette[i * 3 + 2]); + } + } + +-- +2.49.0 + diff --git a/libsixel.spec b/libsixel.spec index 3a0a97c..f0409c5 100644 --- a/libsixel.spec +++ b/libsixel.spec @@ -11,6 +11,9 @@ Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Taken from https://github.com/libsixel/libsixel/pull/89 Patch: libsixel-fix-bash-completions.patch +# https://github.com/saitoha/libsixel/issues/200 +Patch: libsixel-fix-cve-2025-9300.patch + BuildRequires: gcc BuildRequires: meson BuildRequires: pkgconfig(gdlib)