Name: mozjpeg Version: 4.1.1 Release: 1%{?dist} Summary: Mozilla JPEG encoder with improved compression License: BSD-3-Clause AND IJG AND Zlib URL: https://github.com/mozilla/mozjpeg Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: gcc BuildRequires: make BuildRequires: nasm BuildRequires: libpng-devel BuildRequires: zlib-devel %description MozJPEG improves JPEG compression efficiency achieving higher visual quality and smaller file sizes at the same time. It is based on libjpeg-turbo and is backward compatible with the libjpeg API. This package provides optimized encoding tools: cjpeg, djpeg, jpegtran. Files are installed to /opt/mozjpeg to avoid conflicts with system libjpeg. %prep %autosetup # Fix cmake_minimum_required for newer cmake that requires >= 3.5 sed -i 's/cmake_minimum_required(VERSION 2.8.12)/cmake_minimum_required(VERSION 3.10)/' CMakeLists.txt %build %cmake \ -DCMAKE_INSTALL_PREFIX=/opt/mozjpeg \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_STATIC=OFF \ -DPNG_SUPPORTED=ON %cmake_build %install %cmake_install # Create symlinks in /usr/bin with moz prefix mkdir -p %{buildroot}%{_bindir} for tool in cjpeg djpeg jpegtran; do ln -sf /opt/mozjpeg/bin/$tool %{buildroot}%{_bindir}/moz$tool done %check %{_vpath_builddir}/cjpeg -version || true %files %license LICENSE.md %doc README.md BUILDING.md /opt/mozjpeg/ %{_bindir}/mozcjpeg %{_bindir}/mozdjpeg %{_bindir}/mozjpegtran %changelog * Thu Jul 16 2026 Yonghang Wang - 4.1.1-1 - Initial build for al23x-devel COPR - Installed to /opt/mozjpeg to avoid conflicts with system libjpeg-turbo