Name: uke-camera-lens-shading Version: 1.0.0 Release: 1%{?dist} Summary: Generate fitted Uke front-camera lens shading for libcamera License: MIT URL: https://github.com/MCC45TR/uke-linux-hardware-support Source0: %{name}-%{version}.tar.xz BuildRequires: gcc-c++ BuildRequires: binutils %description Generate a libcamera SoftISP lens-shading profile from the validated module section supplied on standard input. The helper does not access the camera, write EEPROM, or change libcamera configuration. Profiles remain local to the fitted tablet. %prep %autosetup %build %{__cxx} -std=c++20 %{optflags} %{build_ldflags} -Wall -Wextra -Werror \ generate-lsc-tuning.cpp -o generate-lsc-tuning %install install -Dm755 generate-lsc-tuning \ "%{buildroot}%{_libexecdir}/%{name}/generate-lsc-tuning" %check generator="%{buildroot}%{_libexecdir}/%{name}/generate-lsc-tuning" if [ "%{_arch}" = aarch64 ]; then readelf -h "$generator" | grep -E 'Machine:[[:space:]]+AArch64' fi LC_ALL=C awk 'BEGIN { for (i = 0; i < 1870; i++) { byte = 0 if (i == 96) byte = 1 if (i >= 101 && i < 1869 && i %% 2) byte = 4 if (i == 1869) byte = sum %% 255 + 1 if (i > 96 && i < 1869) sum += byte printf "%%c", byte } }' > synthetic.bin test "$(stat -c '%%s' synthetic.bin)" = 1870 "$generator" < synthetic.bin > tuning.yaml grep -Fx ' - ct: 5000' tuning.yaml test "$(grep -Fo '1.000000' tuning.yaml | wc -l)" = 867 head -c 1869 synthetic.bin > truncated.bin cp synthetic.bin corrupted.bin printf '\000' | dd of=corrupted.bin bs=1 seek=1869 conv=notrunc status=none (cat synthetic.bin; printf '\000') > oversized.bin for input in truncated.bin corrupted.bin oversized.bin; do code=0 "$generator" < "$input" > rejected.yaml || code=$? test "$code" = 65 test ! -s rejected.yaml done %files %license LICENSE %dir %{_libexecdir}/%{name} %{_libexecdir}/%{name}/generate-lsc-tuning %changelog * Mon Nov 30 2026 Uke Linux Maintainers - 1.0.0-1 - Package the fitted front lens-shading helper for stock libcamera.