Name: littlesnitch-pre # This will be overwritten by your CI script to match PKGBUILD (e.g., 1.1.0pre3) Version: 1.1.0pre6 Release: 100.1.1%{?dist} Summary: Little Snitch for Linux (Prerelease) monitors and controls outgoing network connections using eBPF License: GPL-2.0-only AND LicenseRef-proprietary URL: https://obdev.at/products/littlesnitch-linux/download-prerelease.html ExclusiveArch: x86_64 aarch64 ppc64le riscv64 # We intentionally leave the Source array empty. # Because this COPR project has network access enabled, we bypass COPR's strict URL fetcher # and dynamically scrape the download page inside %prep (just like the PKGBUILD). BuildRequires: rpm BuildRequires: cpio BuildRequires: curl BuildRequires: grep BuildRequires: systemd-rpm-macros %{?systemd_requires} Provides: littlesnitch = %{version}-%{release} Conflicts: littlesnitch Conflicts: littlesnitch-bin %description Little Snitch for Linux monitors and controls outgoing network connections using eBPF. This package repackages the official upstream prerelease RPM package for Fedora-based systems. Little Snitch for Linux requires Linux kernel 6.12 or newer with BTF support. %prep rm -rf extracted mkdir -p extracted cd extracted echo "Finding the latest RPM URL for %{_target_cpu}..." # Scrape the exact filename for the rpm directly from the download page. # This completely prevents 404 errors if upstream changes their naming convention. href=$(curl -sL "https://www.obdev.at/products/littlesnitch-linux/download-prerelease.html" | grep -oP 'href="\K[^"]*littlesnitch-[^"]+\.%{_target_cpu}\.rpm' | head -n1) if [[ -z "$href" ]]; then echo "Error: Could not determine the upstream download URL for %{_target_cpu}." exit 1 fi if [[ "$href" == http* ]]; then dl_url="$href" elif [[ "$href" == /* ]]; then dl_url="https://obdev.at${href}" else dl_url="https://www.obdev.at/products/littlesnitch-linux/${href}" fi echo "Downloading $dl_url..." curl -fL "$dl_url" -o package.rpm # Extract the payload rpm2cpio package.rpm | cpio -idmv %build # Upstream binary RPM package. %install cd extracted if [ -d usr ]; then install -dm755 %{buildroot}%{_prefix} cp -a usr/. %{buildroot}%{_prefix}/ fi if [ -d etc ]; then install -dm755 %{buildroot}%{_sysconfdir} cp -a etc/. %{buildroot}%{_sysconfdir}/ fi if [ -d lib ]; then install -dm755 %{buildroot}/lib cp -a lib/. %{buildroot}/lib/ fi # Build an RPM file list without owning top-level system directories filelist="$PWD/../%{name}.files" rm -f "$filelist" for topdir in %{_prefix} %{_sysconfdir} /lib; do if [ -d "%{buildroot}${topdir}" ]; then find "%{buildroot}${topdir}" \ -mindepth 1 \ \( -type f -o -type l \) \ -print \ | sed "s|^%{buildroot}||" \ >> "$filelist" fi done # Mark /etc files as config files. sed -i 's|^/etc/|%config(noreplace) /etc/|' "$filelist" sort -u -o "$filelist" "$filelist" echo "Packaged files:" cat "$filelist" %post %systemd_post littlesnitch.service echo "=================================================================" echo " Little Snitch daemon installed successfully! " echo " " echo " To activate the network monitor, run the following command: " echo " sudo systemctl enable --now littlesnitch.service " echo "=================================================================" %preun %systemd_preun littlesnitch.service %postun %systemd_postun_with_restart littlesnitch.service %files -f %{name}.files %changelog * Sun Jul 05 2026 Sl (Shahaf Levi) - 1.1.0pre3-1 - Implement dynamic HTML scraping to bypass unpredictable upstream URL changes - Migrate to standard Fedora systemd macros